From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: [PATCH] double-O-LaTeX: retain meta-information during LaTeX Export Date: Fri, 02 Jul 2010 13:56:07 -0700 Message-ID: <87hbkhwqkj.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from [140.186.70.92] (port=45172 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OUnHl-0005rh-JX for emacs-orgmode@gnu.org; Fri, 02 Jul 2010 16:56:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OUnHk-0002Ba-9F for emacs-orgmode@gnu.org; Fri, 02 Jul 2010 16:56:33 -0400 Received: from mail-pw0-f41.google.com ([209.85.160.41]:43182) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OUnHk-0002BM-2J for emacs-orgmode@gnu.org; Fri, 02 Jul 2010 16:56:32 -0400 Received: by pwi9 with SMTP id 9so3254747pwi.0 for ; Fri, 02 Jul 2010 13:56:30 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Org Mode --=-=-= Revoking org-latex's license to kill. Hi, I've noticed a sneaky bug when exporting to LaTeX. Org-babel uses top-level #+BABEL: or #+PARAMETERS: lines to set global values for header arguments. When exporting to latex, the latex exporter removes *all* meta-information header lines when exporting the body [1]. Some Babel blocks rely on these lines and the header values they define to control their behavior on export. Does anyone know why these lines are being removed? I've experimented with the attached patch [2] in which the LaTeX exporter *does not* remove these lines. It fixes the babel issues, and I haven't noticed any problems caused by leaving these lines in (I think the lines are now being removed later in the export process). Thanks -- Eric Footnotes: [1] see `org-export-latex-first-lines' and `org-export-kill-licensed-text' [2] --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=revoke-org-latex-liscence-to-kill.patch diff --git a/lisp/org-latex.el b/lisp/org-latex.el index d725fc8..73a71b3 100644 --- a/lisp/org-latex.el +++ b/lisp/org-latex.el @@ -1202,22 +1202,17 @@ If END is non-nil, it is the end of the region." (end (if (re-search-forward "^\\*+ " end t) (goto-char (match-beginning 0)) (goto-char (or end (point-max)))))) - (prog1 - (org-export-latex-content - (org-export-preprocess-string - (buffer-substring pt end) - :for-LaTeX t - :emph-multiline t - :add-text nil - :comments nil - :skip-before-1st-heading nil - :LaTeX-fragments nil - :timestamps (plist-get opt-plist :timestamps) - :footnotes (plist-get opt-plist :footnotes))) - (org-unmodified - (let ((inhibit-read-only t)) - (add-text-properties pt (max pt (1- end)) - '(:org-license-to-kill t)))))))) + (org-export-latex-content + (org-export-preprocess-string + (buffer-substring pt end) + :for-LaTeX t + :emph-multiline t + :add-text nil + :comments nil + :skip-before-1st-heading nil + :LaTeX-fragments nil + :timestamps (plist-get opt-plist :timestamps) + :footnotes (plist-get opt-plist :footnotes)))))) (defvar org-export-latex-header-defs nil "The header definitions that might be used in the LaTeX body.") --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --=-=-=--