emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [babel] bug in ob-latex - :exports argument is not honored when it is set as a header property
@ 2011-09-23 18:30 William Henney
  0 siblings, 0 replies; only message in thread
From: William Henney @ 2011-09-23 18:30 UTC (permalink / raw)
  To: emacs-org

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

Dear list

I believe I have found a bug in the export of latex source blocks (to
HTML, ascii, etc) when ob-latex.el has been loaded.

In summary, setting the :exports argument as a header property fails
to override the default value in org-babel-default-header-args:latex

Please see the attached org file for a demonstration.

Cheers

Will


-- 

  Dr William Henney, Centro de Radioastronomía y Astrofísica,
  Universidad Nacional Autónoma de México, Campus Morelia

[-- Attachment #2: test-export-latex-src-block.org --]
[-- Type: application/octet-stream, Size: 2048 bytes --]


* Bug in export of LaTeX source blocks when =ob-latex= is loaded

+ Quote from http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-LaTeX.html:

#+begin_quote
Note: The default value of the =:exports= header argument alters the expected behavior of Org-mode export to HTML and LaTeX. LaTeX code blocks will require an explicit =:exports= code header argument to export as described in the Org-mode manual.
#+end_quote

+ However, if you specify the =:exports code= argument as a header property then it doesn't work. The value of =org-babel-default-header-args:latex= is still in force. 
+ It only works if you use a code block specific argument. 

** Evaluate this first
#+begin_src emacs-lisp
  (require 'ob-latex)
#+end_src

#+results:
: ob-latex

** LaTeX export fails with =exports= set as a header property
   :PROPERTIES:
   :exports:  code
   :END:

#+begin_src latex
  This is never exported after \texttt{ob-latex} has been loaded
#+end_src

** LaTeX export works with =exports= set as a code block specific argument 
#+begin_src latex :exports code
  This is exported correctly
#+end_src

** A workaround is to explicitly redefine =org-babel-default-header-args:latex=

After evaluating the following, both source blocks will export successfully. 

#+begin_src emacs-lisp
  (setq org-babel-default-header-args:latex '((:results . "latex") (:exports . "code")))
#+end_src

#+results:
| (:results . latex) | (:exports . code) |

** Tested with the following setup
   :PROPERTIES:
   :exports:  both
   :END:
*** Org version
#+begin_src emacs-lisp
  (org-version) 
#+end_src

#+results:
: Org-mode version 7.7

*** Emacs version
#+begin_src emacs-lisp
  (emacs-version)
#+end_src

#+results:
: GNU Emacs 24.0.50.3 (i386-apple-darwin9.8.0, NS apple-appkit-949.54)
:  of 2011-09-23 on braeburn.aquamacs.org - Aquamacs Distribution 3.xdev

*** Operating system
#+begin_src sh
  uname -a
#+end_src

#+results:
: Darwin slavoj 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun  7 16:32:41 PDT 2011; root:xnu-1504.15.3~1/RELEASE_X86_64 x86_64


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-09-23 18:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-23 18:30 [babel] bug in ob-latex - :exports argument is not honored when it is set as a header property William Henney

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