From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: [bug, ox-latex] footnotes with math in narrowed buffer Date: Fri, 24 Apr 2015 18:04:04 +0200 Message-ID: <87y4lhzf63.fsf@gmx.us> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48730) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ylg5W-00084t-UA for emacs-orgmode@gnu.org; Fri, 24 Apr 2015 12:04:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ylg5P-00063Z-Jf for emacs-orgmode@gnu.org; Fri, 24 Apr 2015 12:04:22 -0400 Received: from plane.gmane.org ([80.91.229.3]:46374) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ylg5P-00063J-Co for emacs-orgmode@gnu.org; Fri, 24 Apr 2015 12:04:15 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Ylg5M-0004Li-OT for emacs-orgmode@gnu.org; Fri, 24 Apr 2015 18:04:12 +0200 Received: from tsn109-201-152-241.dyn.nltelcom.net ([109.201.152.241]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 24 Apr 2015 18:04:12 +0200 Received: from rasmus by tsn109-201-152-241.dyn.nltelcom.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 24 Apr 2015 18:04:12 +0200 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: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit 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 --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0002-ox-latex-Fix-footnote-bug-when-narrowed-buffer.patch >From ce22e0e6d92b79cfec41c1a2295f8e0a21cc3775 Mon Sep 17 00:00:00 2001 From: Rasmus 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 --=-=-=--