[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[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:
#+HEADER: :file example.pdf
#+HEADER: :inputs '("./input/preamble.tex")
#+BEGIN_src latex
\begin{tikzpicture}
\draw[->,custom-style] (-3,0) -- (-2,0)
arc[radius=0.5cm,start angle=-180,endangle=0] (-1,0) -- (1,0)
arc[radius=0.5cm,start angle=180,end angle=0] (2,0) -- (3,0);
\filldraw (-1.5,0) circle[radius=1mm];
\filldraw (1.5,0)circle[radius=1mm];
\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,endangle=0] (-1,0) -- (1,0)
arc[radius=0.5cm,start angle=180,end angle=0] (2,0) -- (3,0);
\filldraw (-1.5,0) circle[radius=1mm];
\filldraw (1.5,0)circle[radius=1mm];
\end{tikzpicture}
\end{document}
Kind regards,
Bob
0001-lisp-ob-latex.el-Added-latex-inputs.patch
Description: Binary data
- [PATCH] ob-latex: Added support for including files with a relative path,
emacs <=