From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <emacs-orgmode-bounces+larch=yhetil.org@gnu.org>
Received: from mp1 ([2001:41d0:2:4a6f::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by ms0.migadu.com with LMTPS
	id aBrtJtSzsmCYZAEAgWs5BA
	(envelope-from <emacs-orgmode-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Sat, 29 May 2021 23:36:20 +0200
Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by mp1 with LMTPS
	id eI4TItSzsmAiYgAAbx9fmQ
	(envelope-from <emacs-orgmode-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Sat, 29 May 2021 21:36:20 +0000
Received: from lists.gnu.org (lists.gnu.org [209.51.188.17])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by aspmx1.migadu.com (Postfix) with ESMTPS id C437C1EF9A
	for <larch@yhetil.org>; Sat, 29 May 2021 23:36:19 +0200 (CEST)
Received: from localhost ([::1]:39320 helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <emacs-orgmode-bounces+larch=yhetil.org@gnu.org>)
	id 1ln6d0-0002T4-Lt
	for larch@yhetil.org; Sat, 29 May 2021 17:36:18 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:32792)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <agoesele@sju.edu>) id 1ln6cC-0002Sw-B0
 for emacs-orgmode@gnu.org; Sat, 29 May 2021 17:35:28 -0400
Received: from mail-qk1-x730.google.com ([2607:f8b0:4864:20::730]:46603)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <agoesele@sju.edu>) id 1ln6c9-0003gQ-Tr
 for emacs-orgmode@gnu.org; Sat, 29 May 2021 17:35:28 -0400
Received: by mail-qk1-x730.google.com with SMTP id 76so7701061qkn.13
 for <emacs-orgmode@gnu.org>; Sat, 29 May 2021 14:35:25 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=sju-edu.20150623.gappssmtp.com; s=20150623;
 h=from:to:subject:organization:references:date:in-reply-to:message-id
 :user-agent:mime-version:content-transfer-encoding;
 bh=bRBd9i+rmZ66kSN+Txa1Z4yoEtEa1XpZYw69WADZp8c=;
 b=0WtIElectAok6NNTPtG7qVDiegZHW1ET2cwn1Y2yEF4uqoDM3cOJi0BwIyeBLetkr5
 RNst9rq1rJXz5HqZIGZOtW1U3jIGkmz74cyFvgP13RVmPDXwb91ShpUE1+9wgddCkS9G
 iOO9Z6xW5GoPIkAvRphEbL3Oc/BaSGzAfV3aTjYQv0ztrroigY/q0UW6DBhxEGr7E4JN
 rpF/ibf7NxEnr/acN3uJRRSmOaeeZSeazFPEEBtWT3I0m0y7nqZbY6GSS9awf/atyCV3
 e4Ppkoea7z/yeK3/2a73YCcLn3yj+OqSwcabMiCTuwO8QeguvoKKQ9qUP8WAVcn2fnw9
 hBNA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:subject:organization:references:date
 :in-reply-to:message-id:user-agent:mime-version
 :content-transfer-encoding;
 bh=bRBd9i+rmZ66kSN+Txa1Z4yoEtEa1XpZYw69WADZp8c=;
 b=A4kRmCqRK1YOEfEIVRuDLkS8e7DUXL1VwATEcB+sfDIPqSR7EU66FiEBlIEZNg+QXu
 i3MCFRYWHIZeXIuDgSXD1t12ZINrn2rC3MDsKxWZEgfZsn5bZdj9EhoebHSqShtU6t3M
 zZhj6Jvg+MSNpvx3iA3ZAGZ9TeB2YFYR5aLadajOTDbB2eFGdfscai7HRuF2KqwJeE/6
 n0J1Ly14hCfCQJJgf6Qvq1DatLucc9+OCgZA+gd88bG0hFaL4FEYjosMx2aUwvv6Xbdc
 OwxxumX2WQeAk9OCcGmAyyTpWtjwNO2vGdsYPJpPxuMdfkhria8JPeBeD2aAGgdVzbYH
 hSWg==
X-Gm-Message-State: AOAM533VvFvcDYFmS7/ecuuW0o63cjJBl86VQoA2D9W3BP6bNKjiLPYu
 VrCBZ2aBZxhSvumBR7/qZJUjdM/5rsYXlA==
X-Google-Smtp-Source: ABdhPJxJ+zGST1X8IKeBR7vI2dOr3pR5nJBpcQn8SP6SvITQU302/fwuzggoBMzJTXulBynvii7xRw==
X-Received: by 2002:a37:7145:: with SMTP id m66mr9837708qkc.379.1622324124606; 
 Sat, 29 May 2021 14:35:24 -0700 (PDT)
Received: from ag ([2603:301d:801:b400:ad9c:c76e:a230:2353])
 by smtp.gmail.com with ESMTPSA id h3sm6111758qkk.82.2021.05.29.14.35.24
 for <emacs-orgmode@gnu.org>
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 29 May 2021 14:35:24 -0700 (PDT)
From: Andreas =?utf-8?Q?G=C3=B6sele?= <agoesele@sju.edu>
To: emacs-orgmode@gnu.org
Subject: Re: Smart quotes not working correctly with single quotes
Organization: Saint Joseph's University
References: <87bl8vr2j2.fsf@hfph.mwn.de> <87wnrjf9sg.fsf@posteo.net>
 <871r9qrhj3.fsf@sju.edu> <87mtsespym.fsf@zeitkraut.de>
 <87lf7ypmh4.fsf@sju.edu>
Date: Sat, 29 May 2021 17:35:23 -0400
In-Reply-To: <87lf7ypmh4.fsf@sju.edu> ("Andreas =?utf-8?Q?G=C3=B6sele=22's?=
 message of "Fri, 28 May 2021 17:39:03 -0400")
Message-ID: <87a6odp6jo.fsf@sju.edu>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Received-SPF: pass client-ip=2607:f8b0:4864:20::730;
 envelope-from=agoesele@sju.edu; helo=mail-qk1-x730.google.com
X-Spam_score_int: -18
X-Spam_score: -1.9
X-Spam_bar: -
X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-BeenThere: emacs-orgmode@gnu.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "General discussions about Org-mode." <emacs-orgmode.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/emacs-orgmode>,
 <mailto:emacs-orgmode-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/emacs-orgmode>
List-Post: <mailto:emacs-orgmode@gnu.org>
List-Help: <mailto:emacs-orgmode-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/emacs-orgmode>,
 <mailto:emacs-orgmode-request@gnu.org?subject=subscribe>
Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org
Sender: "Emacs-orgmode" <emacs-orgmode-bounces+larch=yhetil.org@gnu.org>
X-Migadu-Flow: FLOW_IN
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org;
	s=key1; t=1622324180;
	h=from:from:sender:sender:reply-to:subject:subject:date:date:
	 message-id:message-id:to:to:cc:mime-version:mime-version:
	 content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references:list-id:list-help:
	 list-unsubscribe:list-subscribe:list-post:dkim-signature;
	bh=bRBd9i+rmZ66kSN+Txa1Z4yoEtEa1XpZYw69WADZp8c=;
	b=Jw+3HxZaN6NLDnMhloOwSp+SzQ0yoaAxuxHiB/Jq0eCcFd743ynSCwPgSCZarmv6OvSEjC
	WnRm6sl7vy82dXc5SC3EC1fyFPVvGOBGG46khD9Kq/I1YOtrr40YfqoimixxPC9xr19zvw
	vhJSXFyDOB5th0lwCBAm02nafqMYZ+RvFlg5Z93axyRSRpe/AfCcGgzZCaU8AuvblGQa89
	5yobqZ5JTbiNrSwDWfSp5iYVgK9Q9CkEifXP2qjBzQ4FbPXmvePAla1PK2J75wfI7eTsAx
	2MRiZ0HkqHP/NNtBrmh9R6kzlMM23UN5ajuPRGXBgpJTZAL2hlRO3Z7kTFpi7A==
ARC-Seal: i=1; s=key1; d=yhetil.org; t=1622324180; a=rsa-sha256; cv=none;
	b=IUgSHBkaoZVen6ybylqApk+N2HWkrw4KIZEU17udknWZL23L7uXJJuzqTXzQXn6O0hvMWT
	FaL0Rn2K+g6qpeppNE1Kqv33tQlpTCK7b3B0HnVuv1F6wcXC3aXVhtAxHBh2IevLghoO7h
	gYsxvd7NelqnvropAiFRCUcQHa+yOFgEBCiUl6dbnLIEKzdGHgKqomGygQrRRM6GXuCo1B
	0Y/dsaxp4Cwphc72kePp2dya601Xv1NxYTuUJwE3Ub4pIF6jWn0jFR3E/m09P2QNqkTuzB
	00be8PfqwUmbSPhJ1q0BVq6hixosW6cq/cg2v58d/0OO77wlU/Syg9KhSkqLZQ==
ARC-Authentication-Results: i=1;
	aspmx1.migadu.com;
	dkim=pass header.d=sju-edu.20150623.gappssmtp.com header.s=20150623 header.b=0WtIElec;
	dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=sju.edu (policy=none);
	spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org
X-Migadu-Spam-Score: -2.53
Authentication-Results: aspmx1.migadu.com;
	dkim=pass header.d=sju-edu.20150623.gappssmtp.com header.s=20150623 header.b=0WtIElec;
	dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=sju.edu (policy=none);
	spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org
X-Migadu-Queue-Id: C437C1EF9A
X-Spam-Score: -2.53
X-Migadu-Scanner: scn0.migadu.com
X-TUID: hx5aIZezySqc

Hi,

thanks to Albert for pointing me to pandoc-quotes.lua.

It doesn't take care of apostrophes so I wrote my own very simple pandoc
lua filter:

 text =3D require 'text'
 function Str (s)
   s.text =3D pandoc.pipe("sed", {"-e","s/'/=E2=80=99/"}, s.text)
   return s
 end

Together with pandoc-quotes.lua and "-M lang=3Dde" this gives the desired
result for odt and html.

For latex there was no problem with the apostrophes, but for some reason
(I don't understand) pandoc-quotes.lua with lang=3Dde translates closing
quotes into "``" and "`" instead of "=E2=80=9C" and "=E2=80=98". (The openi=
ng quotes are
correct and in pandoc-quotes.lua the "de" entry correctly has "=E2=80=9C" a=
nd
"=E2=80=98".) This can lead to something like "```" if inner quotes are
immediately followed by outer quotes which LaTeX translates to "=E2=80=9C=
=E2=80=98"
instead of "=E2=80=98=E2=80=9C".

To solve this I created a meta file with:

---
quot-marks:
    - =E2=80=9E
    - =E2=80=8B=E2=80=9C
    - =E2=80=9A
    - =E2=80=98
...

(The important thing being that there is a unicode "ZERO WIDTH SPACE"
(U+200B) in front of the second entry.)

I also put \DeclareUnicodeCharacter{200B}{{\hskip 0pt}} into
default.latex.

Using the meta-file with pandoc-quotes.lua and "-V lang=3Dde" leads to
correctly nested quotes also for latex.

Thanks again to everybody!

Andreas

Andreas G=C3=B6sele <agoesele@sju.edu> writes:

> Albert Krewinkel <albert+org-mode@zeitkraut.de> writes:
>
>> Andreas G=C3=B6sele <agoesele@sju.edu> writes:
>>
>>> [...] I tried to convert the LaTeX document with pandoc, tex4h and
>>> latex2html to odt and html but none of them produces the correct
>>> output.
>>>
>>> So I'm wondering whether there is any way to make org export to
>>> recognize single quotes also outside from double quote. It should be
>>> possible as inner quotes is not the only use of simple quotes.
>>
>> I apologize for the non-Emacs solution, but you can use pandoc in
>> combination with the following Lua filter to get the desired result:
>> https://github.com/pandoc/lua-filters/tree/master/pandoc-quotes.lua
>> For LaTeX output, you can also pass -Vcsquotes as a parameter to force
>> pandoc to make use of the csquotes package. Both should give you the
>> desired results.
>
> Thanks for the suggestion. I would be happy to use pandoc.
>
> I tried it and it works well for quotes (double and single). But the
> apostrophe only is correctly treated if I convert to LaTeX/PDF. (That's
> because LaTeX transforms the "typewriter apostrophe" into the correct
> typographic apostrophe.)
>
> From:
>
>  #+LANGUAGE: de
>  #+OPTIONS: ':t
>
>  #+OPTIONS: toc:nil
>  It's a 'test'.
>
> I get for html/odt:
>
>  It's a =E2=80=9Atest=E2=80=98.
>
> But I should get:
>
>  It=E2=80=99s a =E2=80=9Atest=E2=80=98.
>
> Directly using the org export I get:
>
>  It=E2=80=99s a =E2=80=99test=E2=80=99.
>
> So with pandoc and the Lua filter the single quotes are correct, with
> the direct export from org the apostrophe is correct.
>
> Is there a way with pandoc to get correct quotes and apostrophes?
>
> Thanks again!
>
> Andreas