emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Berry, Charles" via "General discussions about Org-mode." <emacs-orgmode@gnu.org>
To: "Juan Manuel Macías" <maciaschain@posteo.net>
Cc: orgmode <emacs-orgmode@gnu.org>
Subject: Re: [question] lisp code in :results header arg.?
Date: Tue, 16 Feb 2021 17:58:03 +0000	[thread overview]
Message-ID: <225A3D45-0F47-4FFE-8BBA-F023CB8C9A6C@health.ucsd.edu> (raw)
In-Reply-To: <87zh040ybv.fsf@posteo.net>



> 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	other threads:[~2021-02-16 17:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-16 16:30 Juan Manuel Macías
2021-02-16 17:58 ` Berry, Charles via General discussions about Org-mode. [this message]
2021-02-16 18:25   ` Juan Manuel Macías

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=225A3D45-0F47-4FFE-8BBA-F023CB8C9A6C@health.ucsd.edu \
    --to=emacs-orgmode@gnu.org \
    --cc=ccberry@health.ucsd.edu \
    --cc=maciaschain@posteo.net \
    --subject='Re: [question] lisp code in :results header arg.?' \
    /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

Code repositories for project(s) associated with this 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 NNTP newsgroup(s).