From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sebastien Vauban Subject: [PATCH] Protect active characters such as `~' when exporting to LaTeX Date: Fri, 16 Jan 2015 15:58:33 +0100 Message-ID: <86vbk63h7q.fsf@example.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: 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-mXXj517/zsQ@public.gmane.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org --=-=-= Content-Type: text/plain Hello, When ~code~ is converted to LaTeX, it becomes \verb~code~; i.e., it uses a potentially "dangerous" character, in this case `~' which is active. In most cases, it is unnoticeable, but in some environments, it breaks. The solution is to protect the command, what the attached patch does. PS- Nicolas, can you apply this one without problem? Best regards, Seb -- Sebastien Vauban --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0002-Protect-active-characters-such-as.patch >From e5a6525898a41a4e4381c46575f7c54e8a367700 Mon Sep 17 00:00:00 2001 From: Sebastien Vauban Date: Fri, 16 Jan 2015 15:53:40 +0100 Subject: [PATCH] Protect active characters such as `~' --- lisp/ox-latex.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index 66cc6c2..cb6d75c 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -1,6 +1,6 @@ ;;; ox-latex.el --- LaTeX Back-End for Org Export Engine -;; Copyright (C) 2011-2014 Free Software Foundation, Inc. +;; Copyright (C) 2011-2015 Free Software Foundation, Inc. ;; Author: Nicolas Goaziou ;; Keywords: outlines, hypermedia, calendar, wp @@ -1122,7 +1122,7 @@ INFO is a plist used as a communication channel. See ;; and use "\\verb" command. ((eq 'verb fmt) (let ((separator (org-latex--find-verb-separator text))) - (concat "\\verb" separator + (concat "\\protect\\verb" separator (replace-regexp-in-string "\n" " " text) separator))) ;; Handle the `protectedtexttt' special case: Protect some -- 2.1.1 --=-=-=--