|
From: | Max Nikulin |
Subject: | Re: Export LaTeX command inside figure environment |
Date: | Sun, 8 May 2022 12:08:42 +0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 |
On 08/05/2022 07:30, Juan Manuel Macías wrote:
Thomas S. Dye writes:Is there a way to add an arbitrary LaTeX command between \begin{figure} ... \end{figure} during LaTeX export? I want to end up with the following snippet, but can't figure out how to slip in \setfloatalignment{b}. \begin{figure}[htb] \centering \includegraphics[width=.9\linewidth]{hilbertcurves.pdf} \caption[Hilbert curves]{\label{fig:orgparagraph1} Hilbert curves of various degrees \emph{n}.} \setfloatalignment{b} \end{figure}I think the :caption attribute could do the trick (of course everything must be on one line): #+ATTR_LaTeX: :caption \caption[Hilbert curves]{\label{fig:orgparagraph1} Hilbert curves of various degrees \emph{n}.}\setfloatalignment{b}
Would it work if \setfloatalignment{b} is added before \includegraphics? From my point of view, it is still a hack due to abusing the :placement attribute, but it is backend agnostic, so reuses caption for HTML and relieves requirement of single long line:
#+caption[Hilbert curves]: Hilbert curves of various degrees \(n\) #+name: orgparagraph1 #+attr_latex: :placement [b]\setfloatalignment{b} [[file:hilbertcurves.pdf]] # Local Variables: # org-latex-prefer-user-labels: t # End:P.S. Math and absence of period are intentional. I never used tufte, so unsure if something besides b is meaningful with \setfloatalignment{b}. I dropped "ht" to make inconsistency apparent and expecting that when figures are moved to the end of document, "ht" should be used instead with removing of \setfloatalignment.
[Prev in Thread] | Current Thread | [Next in Thread] |