[Top][All Lists]

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

Re: Export LaTeX command inside figure environment

From: Juan Manuel Macías
Subject: Re: Export LaTeX command inside figure environment
Date: Sun, 08 May 2022 16:12:38 +0000

Thomas S. Dye writes:

> It would be better to have a LaTeX attribute, say :commands, that
> places commands within \begin{figure} ... \end{figure}.

This is a possible solution from the LaTeX side, which would avoid
having to modify the Org code and can also be used to introduce more
complex arbitrary code into the figure environment. It consists of
defining a variable (for arbitrary code) and redefining the figure
environment to include that variable. Something like this:

#+NAME: preamble
#+begin_src latex :exports none




#+begin_src latex :noweb yes :results raw
,#+LaTeX_HEADER: <<preamble>>

Here I use the dummy images from the graphicx package. Of course, then
it is necessary to apply a zero value to the variable again, or enclose
all in a \begingroup...\endgroup. It's a bit tricky and I haven't tried
it too much:


#+caption: This is a caption
#+ATTR_LaTeX: :placement [h] :width .5\linewidth


#+caption: This is a caption
#+ATTR_LaTeX: :placement [h] :width .5\linewidth

A screenshot:


Best regards,

Juan Manuel 

reply via email to

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