emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <n.goaziou@gmail.com>
To: Bastien <bzg@altern.org>
Cc: emacs-orgmode@gnu.org, Konstantin Kliakhandler <kosta@slumpy.org>
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	[thread overview]
Message-ID: <87ob0ymk0a.fsf@gmail.com> (raw)
In-Reply-To: <87a9cio06v.fsf@bzg.ath.cx> (Bastien's message of "Sat, 22 Mar 2014 14:03:04 +0100")

[-- Attachment #1: Type: text/plain, Size: 291 bytes --]

Bastien <bzg@altern.org> 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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-ox-latex-Fix-underline-in-sections.patch --]
[-- Type: text/x-diff, Size: 1959 bytes --]

From 7a6bcad9dea5dd8a7c8b15f942191046f63f262f Mon Sep 17 00:00:00 2001
From: Nicolas Goaziou <n.goaziou@gmail.com>
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


  reply	other threads:[~2014-03-22 13:37 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-21 16:30 Bug: \uline produced inside \section in latex export [8.2.5h (8.2.5h-30-gdd810b-elpa @ /home/user/.emacs.d/elpa/org-20140303/)] Konstantin Kliakhandler
2014-03-21 23:32 ` Bastien
2014-03-22  8:01   ` Konstantin Kliakhandler
2014-03-22  8:02   ` Nicolas Goaziou
2014-03-22  8:27     ` Bastien
2014-03-22 11:19       ` Nicolas Goaziou
2014-03-22 11:38         ` Rasmus
2014-03-22 11:45         ` Konstantin Kliakhandler
2014-03-22 12:38           ` Nicolas Goaziou
2014-03-22 13:03             ` Bastien
2014-03-22 13:37               ` Nicolas Goaziou [this message]
2014-03-22 14:09                 ` Bastien
2014-03-22 14:18                   ` Nicolas Goaziou
2014-03-22 17:06             ` Nicolas Richard
2014-03-22 20:06               ` Rasmus
2014-03-22 21:04               ` Konstantin Kliakhandler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ob0ymk0a.fsf@gmail.com \
    --to=n.goaziou@gmail.com \
    --cc=bzg@altern.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=kosta@slumpy.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).