emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [question] lisp code in :results header arg.?


From: Berry, Charles
Subject: Re: [question] lisp code in :results header arg.?
Date: Tue, 16 Feb 2021 17:58:03 +0000


> On Feb 16, 2021, at 8:30 AM, Juan Manuel Macías <maciaschain@posteo.net> 
> wrote:
> 
> Hi,
> 
> I'm exploring some ways to include a complex LaTeX preamble using source
> blocks. Consider this (code at the end of this message), that works fine.
> 
> My question is: In order to do it all in a single block, would there be
> any way to pass the output of the first block as an argument to a
> function, and put that function as a header arg (results)...?


[rest deleted]

I think you might do better to use noweb chunks, viz.

#+name: pre-amble
#+begin_src latex :exports none
  \usepackage{luacode}
  \usepackage{fontspec}
  \directlua
  {
  [...]
  }
  }
  \setmainfont{Linux Libertine O}
  [RawFeature={+ktest}]
#+end_src


#+begin_src latex :noweb yes :results drawer
,#+LaTeX_HEADER: <<pre-amble>>
#+end_src


Evaluating the latter chunk (assuming `org-babel-load-languages' has (latex . 
t)) gives what I suspect you want.

Note that using a drawer allows replacement of the result.

HTH,
Chuck



reply via email to

[Prev in Thread] Current Thread [Next in Thread]