From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Szmulewicz Subject: Re: utf8x and org-mode 8 (Sebastien Vauban) Date: Tue, 26 Aug 2014 03:03:06 +0300 Message-ID: References: Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36505) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XM4EG-00086J-7i for emacs-orgmode@gnu.org; Mon, 25 Aug 2014 20:03:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XM4EB-0003QS-QI for emacs-orgmode@gnu.org; Mon, 25 Aug 2014 20:03:16 -0400 Received: from mail-wg0-x230.google.com ([2a00:1450:400c:c00::230]:42673) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XM4EB-0003QO-Ii for emacs-orgmode@gnu.org; Mon, 25 Aug 2014 20:03:11 -0400 Received: by mail-wg0-f48.google.com with SMTP id x13so13862716wgg.7 for ; Mon, 25 Aug 2014 17:03:10 -0700 (PDT) Received: from [192.168.1.106] ([5.22.135.171]) by mx.google.com with ESMTPSA id lz1sm5653030wic.24.2014.08.25.17.03.09 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 25 Aug 2014 17:03:09 -0700 (PDT) In-Reply-To: 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Awesome. Thank you, Sebastien.=20 I prefer the second solution, because it allows me to account for = different kinds of spaces: espace fine, espace ins=E9cable, espace = moyenne, etc.=20 Just for curiosity: I=92m not sure what to make of the regexp. The =91?=92= is normally a postfix operator used in conjunction with other = characters, isn=92t it? As it is, it seems to target question marks = instead of blank spaces. What am I missing? > ------------------------------ >=20 > Message: 17 > Date: Mon, 25 Aug 2014 09:55:20 +0200 > From: Sebastien Vauban > To: emacs-orgmode@gnu.org > Subject: Re: [O] utf8x and org-mode 8 > Message-ID: <86wq9xj95j.fsf@somewhere.org> > Content-Type: text/plain; charset=3Dutf-8 >=20 > Daniel Szmulewicz wrote: >> I understand that org-latex derives the encoding from the buffer.=20 >> In the ".tex? file produced by the exporter, I see this line: >> \usepackage[utf8]{inputenc} >>=20 >> However, I would like to set it to: >> \usepackage[utf8x]{inputenc} >>=20 >> I need to account for special French spacing characters: ?espaces = ins?cables."=20 >>=20 >> Old tricks to achieve this with previous org-mode versions don?t seem = to work.=20 >> What is the best way to export an org buffer and have it set to utf8x = with the latest org-mode version? >=20 > AFAICT, when using the `utf8' option to `inputenc' (and not `utf8x' > which should be avoided, as it uses `ucs' which is no longer > maintained), we have 2 solutions to support the UTF-8 non-breaking > space: >=20 > - Convert it in Org mode, when exporting (via a filter) >=20 > #+begin_src emacs-lisp > ;; filter for non-breaking spaces > (defun leuven--latex-filter-nbsp (text backend info) > "Convert non-breaking spaces when exporting to LaTeX/Beamer." > (when (memq backend '(latex beamer)) > (replace-regexp-in-string "?" "~" text))) >=20 > (add-to-list 'org-export-filter-plain-text-functions > 'leuven--latex-filter-nbsp) > #+end_src >=20 > - or Convert it in LaTeX: >=20 > #+begin_src emacs-lisp :tangle no > ;; convert `nbsp' to its LaTeX equivalent > (add-to-list 'org-latex-packages-alist > (concat "\\ifdefined\\DeclareUnicodeCharacter{" > "\\DeclareUnicodeCharacter{00A0}{~}" > "}\\fi") t) > #+end_src >=20 > I think that the first one is "better", though its problem is that, > being done by a filter (hence, on the user-side), sharing an Org file = is > not easy anymore (without sharing the filter to be added to the > personal .emacs file). >=20 > Best regards, > Seb >=20 > --=20 > Sebastien Vauban >=20 >=20 >=20 -- Daniel Szmulewicz daniel.szmulewicz@gmail.com