0

GNU Emacs 25.1.50.2

Org-mode version 8.3.5

At some point in the past I could put down a block like this

#+begin_src latex :exports results :results {latex|html}
\begin{equation}
a = 1 + b
\end{eqation}
#+end_src

For either html or latex and make it export to the corresponding format. This functionality have for some reason disappeared and now it exports the src block as a code block instead of the results that exports to nice native latex or html math and rendered that way.

I find it convenient to be able to do this, for a number of reasons, so it would be nice if there was a way to make this work again.

  • 2
    This is how I did it: raw.githubusercontent.com/wvxvw/introduction-to-data-structures/… (see by-backend macro). The commented out version is the one I used with some older version of Org. – wvxvw Aug 21 '16 at 15:57
  • Thanks for your reply. For some reason this doesn't seem to do anything for me. Even starting from a fresh slate with -q doesn't yield and output from my code block with a header from your example and a macro defined. – Sparx Aug 21 '16 at 21:29
  • 1
    Sorry if this is obvious, just making sure: you evaluated the code with the macro (for example you C-c C-c on the code block with the macro). You then used #+HEADER: :results (by-backend (pdf "latex") (t "raw")) in your latex code block. The results were actually produced, but without change (rather than, for example, Org exporter dying silently, while leaving the results from the previous export). – wvxvw Aug 22 '16 at 4:53
  • Yeah, I did this but after further investigation it seems like my config is to blame. Haven't found the faulty code yet but I have to backpadle for blaming orgmode changes. Thanks for your answer @wvxvw. – Sparx Aug 22 '16 at 17:31
  • Turns out I carelessly set the variable (setq org-export-babel-evaluate nil) which according to the documentation disregards all header arguments. Looks like more than just this issue just got solved for me... Not sure if I should delete this question or rewrite it to be more relevant. – Sparx Aug 22 '16 at 18:39
2

Turns out I carelessly set the variable

(setq org-export-babel-evaluate nil)

which according to the documentation disregards all header arguments:

Switch controlling code evaluation during export. When set to nil no code will be evaluated as part of the export process and no header argumentss will be obeyed. When set to ‘inline-only’, only inline code blocks will be executed. Users who wish to avoid evaluating code on export should use the header argument ‘:eval never-export’.

After setting this to t I could export as expected.

  • Please accept your own answer to mark this question as solved. – Tobias Jul 5 at 16:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.