From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Bug: \uline produced inside \section in latex export [8.2.5h (8.2.5h-30-gdd810b-elpa @ /home/user/.emacs.d/elpa/org-20140303/)] Date: Sat, 22 Mar 2014 14:37:57 +0100 Message-ID: <87ob0ymk0a.fsf@gmail.com> References: <87ior7qzua.fsf@slumpy.org> <87fvmbktzz.fsf@bzg.ath.cx> <87k3bmoe3o.fsf@gmail.com> <87ppleiqo6.fsf@bzg.ath.cx> <874n2qo4zh.fsf@gmail.com> <87ob0ysbh8.fsf@slumpy.org> <87vbv6mmrt.fsf@gmail.com> <87a9cio06v.fsf@bzg.ath.cx> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43566) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WRM7D-0002AI-MY for emacs-orgmode@gnu.org; Sat, 22 Mar 2014 09:37:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WRM78-0002OM-OL for emacs-orgmode@gnu.org; Sat, 22 Mar 2014 09:37:35 -0400 Received: from mail-wi0-x236.google.com ([2a00:1450:400c:c05::236]:34562) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WRM78-0002OB-Gi for emacs-orgmode@gnu.org; Sat, 22 Mar 2014 09:37:30 -0400 Received: by mail-wi0-f182.google.com with SMTP id d1so1253747wiv.3 for ; Sat, 22 Mar 2014 06:37:29 -0700 (PDT) In-Reply-To: <87a9cio06v.fsf@bzg.ath.cx> (Bastien's message of "Sat, 22 Mar 2014 14:03:04 +0100") 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: Bastien Cc: emacs-orgmode@gnu.org, Konstantin Kliakhandler --=-=-= Content-Type: text/plain Bastien writes: > I don't know but it looks good to me, because the shortcomings of > \underline not being able to wrap are not a problem for sections. Here is the patch. b399ff0cba2382bf52d5bb6ef2b4a776fe0ac902 needs to be reverted first. Regards, -- Nicolas Goaziou --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-ox-latex-Fix-underline-in-sections.patch >From 7a6bcad9dea5dd8a7c8b15f942191046f63f262f Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Sat, 22 Mar 2014 14:23:23 +0100 Subject: [PATCH] ox-latex: Fix underline in sections * lisp/ox-latex.el (org-latex-headline): Hard-code "\underline" in sections because "\uline" ("ulem" package) returns an error and "\ul" ("soul" package) doesn't support chinese characters. See http://permalink.gmane.org/gmane.emacs.orgmode/83962 for the related thread. --- lisp/ox-latex.el | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index 3d51ce5..b49a157 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -1344,7 +1344,16 @@ holding contextual information." ((= (length sec) 4) (if numberedp (concat (car sec) "\n%s" (nth 1 sec)) (concat (nth 2 sec) "\n%s" (nth 3 sec))))))) - (text (org-export-data (org-element-property :title headline) info)) + ;; Create a temporary export back-end that hard-codes + ;; "\underline" within "\section" and alike. + (section-back-end + (org-export-create-backend + :parent 'latex + :transcoders + '((underline . (lambda (o c i) (format "\\underline{%s}" c)))))) + (text + (org-export-data-with-backend + (org-element-property :title headline) section-back-end info)) (todo (and (plist-get info :with-todo-keywords) (let ((todo (org-element-property :todo-keyword headline))) @@ -1397,8 +1406,9 @@ holding contextual information." (let ((opt-title (funcall org-latex-format-headline-function todo todo-type priority - (org-export-data - (org-export-get-alt-title headline info) info) + (org-export-data-with-backend + (org-export-get-alt-title headline info) + section-back-end info) (and (eq (plist-get info :with-tags) t) tags)))) (if (and numberedp opt-title (not (equal opt-title full-text)) -- 1.9.1 --=-=-=--