emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: William Henney <whenney@gmail.com>
To: emacs-org <emacs-orgmode@gnu.org>
Subject: [babel] bug in ob-latex - :exports argument is not honored when it is set as a header property
Date: Fri, 23 Sep 2011 13:30:58 -0500	[thread overview]
Message-ID: <CAKchnZNv2bufdb7uXBu+Sz6-hFP7eZVVVzC8GAmuoSQKniXQQA@mail.gmail.com> (raw)

[-- 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


                 reply	other threads:[~2011-09-23 18:32 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=CAKchnZNv2bufdb7uXBu+Sz6-hFP7eZVVVzC8GAmuoSQKniXQQA@mail.gmail.com \
    --to=whenney@gmail.com \
    --cc=emacs-orgmode@gnu.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).