emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [bug, ox-latex] footnotes with math in narrowed buffer
@ 2015-04-24 16:04 Rasmus
  2015-04-24 16:28 ` Rasmus
  2015-04-24 19:09 ` Nicolas Goaziou
  0 siblings, 2 replies; 10+ messages in thread
From: Rasmus @ 2015-04-24 16:04 UTC (permalink / raw)
  To: emacs-orgmode

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

Hi,

Consider the following example:

* h1
foo[fn:1]

* Footnotes
[fn:1] if \alpha $\beta$ \(\gamma\)

Narrow it to h1 and export the buffer.  Something like this is exported:

   foo\footnote{if \alpha \beta \gamma}

Somehow org-export-get-footnote-definition "knows about" math-blocks for
footnotes that are within the buffer view, but not outside.  The patch
fixes the above example, but I doubt it's the Right Wayᵀᴹ to fix this
(i.e. there could be a more fundamental bug).

—Rasmus

-- 
Bang bang

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0002-ox-latex-Fix-footnote-bug-when-narrowed-buffer.patch --]
[-- Type: text/x-diff, Size: 1042 bytes --]

From ce22e0e6d92b79cfec41c1a2295f8e0a21cc3775 Mon Sep 17 00:00:00 2001
From: Rasmus <rasmus@gmx.us>
Date: Fri, 24 Apr 2015 18:00:30 +0200
Subject: [PATCH 2/2] ox-latex: Fix footnote bug when narrowed buffer

* ox-latex.el (org-latex-footnote-reference): Support math in outside
  footnotes when narrowed.
---
 lisp/ox-latex.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index 2d7ffe5..3b71bfb 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -1554,7 +1554,8 @@ CONTENTS is nil.  INFO is a plist holding contextual information."
      "\\footnotemark")
     ;; Otherwise, define it with \footnote command.
     (t
-     (let ((def (org-export-get-footnote-definition footnote-reference info)))
+     (let ((def (org-latex--wrap-latex-math-block
+		 (org-export-get-footnote-definition footnote-reference info) info)))
        (concat
 	(format "\\footnote{%s}" (org-trim (org-export-data def info)))
 	;; Retrieve all footnote references within the footnote and
-- 
2.3.6


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-04-25 10:42 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-24 16:04 [bug, ox-latex] footnotes with math in narrowed buffer Rasmus
2015-04-24 16:28 ` Rasmus
2015-04-24 16:33   ` Rasmus
2015-04-24 19:28     ` Nicolas Goaziou
2015-04-24 19:36   ` Nicolas Goaziou
2015-04-24 20:41     ` Rasmus
2015-04-25 10:22       ` Nicolas Goaziou
2015-04-25 10:42         ` Rasmus
2015-04-24 19:09 ` Nicolas Goaziou
2015-04-24 20:37   ` Rasmus

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).