ajshort / vscode-latex-preview

Compilation and embedded preview of LaTeX documents for Visual Studio Code
MIT License
33 stars 11 forks source link

Export outputdir as environment var during build #15

Closed phyrog closed 7 years ago

phyrog commented 7 years ago

This should be a workaround for #8 and similar issues, where the output directory path is needed in the source code during compilation.

You can now use minted like this using the catchfile package:

\documentclass{article}

\usepackage{catchfile}
\CatchFileEdef{\OUTPUTDIR}{"|kpsewhich --var-value OUTPUTDIR"}{}

\usepackage[outputdir=\OUTPUTDIR]{minted}

\begin{document}

\begin{minted}{lisp}
(defun foo-bar (bar faz)
  (if faz
      bar
      (mapcar #'foobar bar)))
\end{minted}
\end{document}
phyrog commented 7 years ago

Oh one more thing: The plugin did not compile on my computer using the newest typescript version, so I had to locally lock it to 2.0.3.

ajshort commented 7 years ago

Thanks for the contribution! Sorry it took so long for me to look at.

ajshort commented 7 years ago

576a3411e7d46b57e0944cdd9584c100d4e6e331