From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Nested smart quotes Date: Thu, 05 Oct 2017 15:13:21 -0400 Message-ID: <87wp49tnla.fsf@alphaville.usersys.redhat.com> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56325) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0BaZ-00072j-4b for emacs-orgmode@gnu.org; Thu, 05 Oct 2017 15:13:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0BaV-0004oX-SM for emacs-orgmode@gnu.org; Thu, 05 Oct 2017 15:13:43 -0400 Received: from [195.159.176.226] (port=34232 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0BaV-0004kQ-Lf for emacs-orgmode@gnu.org; Thu, 05 Oct 2017 15:13:39 -0400 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1e0BaF-00056x-Uz for emacs-orgmode@gnu.org; Thu, 05 Oct 2017 21:13:23 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org Martin Alsinet writes: > ... > I have found that the smart-quotes option of org-mode does not export properly the quotes when they are nested (single quotes inside double quotes), but only when they coincide at the > start or the end of the quote. > > Maybe the problem will be clearer with an example: > > #+TITLE: Smart quotes example > #+OPTIONS: toc:nil ':t > #+LANGUAGE: en > #+LATEX_CLASS: book > She said to me: "Rick screamed, 'let's go together'" > This example has the additional problem of the apostrophe in "let's", which basically causes more mayhem. Let's simplify the example a bit by considering She said to me: "Rick screamed, 'let us go together'" which when export to TeX becomes: She said to me: ``Rick screamed, `let us go together''' and TeX misinterprets the three closing single quotes as (closing double quote, closing single quote) instead of (closing single quote, closing double quote). Modifying the TeX output to this: She said to me: ``Rick screamed, `let us go together'\,'' makes TeX interpret things correctly and it is also visually pleasant (IMO of course). > This gets exported to TeX as: > > She said to me: ``Rick screamed, `let's go together''' > > Which gets rendered as PDF as: > > The orde > > The order of the closing quotes gets reversed, it first closes the outside double quotes and then the nested single quote. > > I have tried leaving a space between them, but that is arguably worse > > Org: > > She said to me: "Rick screamed, 'let's go together' " > > TeX: > > She said to me: ``Rick screamed, `let's go together' " I do not get this with the space. I get this in the TeX output: She said to me: ``Rick screamed, `let us go together' '' which has a larger space between the single and the double quote at the end than with \, but is otherwise OK. > > Internal > > In this case, the internal single quotes are rendered correctly, but the closing quote is not converted into its "smart" version. > > If the nested quotes are in such a way that there are other characters between the quotes, that is they are not together at the start or the end of the quote, they get rendered correctly. I'm not sure whether smart quotes can be made smarter, perhaps by detecting the problem and inserting the small space \, to resolve the ambiguity; but the manual space solution should have worked: what version of org are you using? FWIW, mine is latest master: Org mode version 9.1.2 (release_9.1.2-84-geeaf9a @ /home/nick/src/emacs/org/org-mode/lisp/) Going back to the original string with the apostrophe, I don't see any way that org or TeX can deal with it except by really understanding what is being said: having the apostrophe be denoted by the same symbol as the closing quote is bound to introduce ambiguities. In these days of Unicode, I think the only solution is to use xelatex or another Unicode-cognizant TeX system and to use a proper apostrophe. -- Nick