emacs-orgmode
[Top][All Lists]

[PATCH] ob-latex: Added support for including files with a relative path

 From: emacs Subject: [PATCH] ob-latex: Added support for including files with a relative path Date: Mon, 4 Jul 2022 21:15:55 +0200 (CEST)

Dear list,

in the attachment you find a proposed patch to support including external files
when exporting a latex source block. Currently this was only possible by using a
:header argument. The problem with this approach is that, files needed to be
included with their absolute path.

My proposed change adds support for a :inputs header argument, which expands te
provided file paths to an absolute path before including them.

Example:
#+BEGIN_src latex
\begin{tikzpicture}
\draw[->,custom-style] (-3,0) -- (-2,0)
arc[radius=0.5cm,start angle=180,end angle=0] (2,0) -- (3,0);
\end{tikzpicture}
#+END_src

Expands to

\documentclass[article]
...
\input{absolute/path/to/input/preamble.tex}
\begin{document}
\begin{tikzpicture}
\draw[->,custom-style] (-3,0) -- (-2,0)
arc[radius=0.5cm,start angle=180,end angle=0] (2,0) -- (3,0);