From mboxrd@z Thu Jan 1 00:00:00 1970 From: Grant Rettke Subject: Re: Exporting Source Blocks with Symbols Date: Tue, 19 Jan 2016 20:26:50 -0600 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35031) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLiU0-0004PV-Md for emacs-orgmode@gnu.org; Tue, 19 Jan 2016 21:26:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aLiTz-0001Oz-I3 for emacs-orgmode@gnu.org; Tue, 19 Jan 2016 21:26:52 -0500 Received: from mail-wm0-x22d.google.com ([2a00:1450:400c:c09::22d]:35946) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLiTz-0001Os-A3 for emacs-orgmode@gnu.org; Tue, 19 Jan 2016 21:26:51 -0500 Received: by mail-wm0-x22d.google.com with SMTP id l65so161609356wmf.1 for ; Tue, 19 Jan 2016 18:26:50 -0800 (PST) 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: Michael Gauland Cc: "emacs-orgmode@gnu.org" Thank you for sharing your solution. My current solution: avoid the issue entirely and don't use Unicode in your source code, use pretty-mode instead: https://github.com/akatov/pretty-mode A future option: switch from PDFLaTeX to XeLaTeX of LuaLaTeX. Both are great. The latter is ideal, and does the "right thing" for just about every language out there and if it doesn't, it is added quickly. Sincerely, Grant Rettke On Sun, Jan 17, 2016 at 2:10 PM, Michael Gauland wrot= e: > Just following up with my solution, in case anyone else is interested > (thanks to John Kitchin for pointing me in the right direction). First, I > should note that '=C2=B5' exported correctly because I was using the unic= ode > element 'MICRO SYMBOL' instead of 'GREEK SMALL LETTER MU' (which looks th= e > same, but doesn't export). > > The 'listings' package can only handle 8-bit characters, but you can tell= it > to escape to LaTeX. The code block below adds a hook to escape the > characters I'm interested in, and adds the listing option to identify the > escape character (a symbol I've never used for anything else). > > This code could certainly be improved, but it serves my needs, and may be > useful as a starting point for anyone trying to do something similar. > --Michael Gauland > > #+BEGIN_SRC emacs-lisp :session :results value silent :exports none > ;; Set up a filter to preserve greek symbols in code blocks > (setq org-export-filter-src-block-functions > (list > (lambda (text backend info) > (replace-regexp-in-string "\\([=CF=83=CE=B2]\\)" "=C2=A7$\\1$= =C2=A7" text)))) > > (setq org-latex-listings-options '(("escapechar" "=C2=A7"))) > #+END_SRC >