1

I want to include snippets (with their images in a dir with the same name as the tex file) from a shared repository in the content directory. I have defined a command for that:

\newcommand*{\includecontent}[1]{\graphicspath{{./content/#1/}}%
\input{./content/#1}}

My problem: This resets the graphicspath defined in the processed file. Is there

  • either a way to add a path to graphicspath without disturbing the existing ones
  • or (preferred) to save the current graphicspath before and restore it after the snippet was included
2
  • 4
    I normally use something like \begingroup\graphicspath{...} \input... \endgroup jo just add begin/endgroup inside your macro definition
    – daleif
    Jul 29, 2019 at 20:01
  • Wonderful, that saves me a lot of clutter, thank you :-)
    – hoeni
    Aug 4, 2019 at 10:20

0

You must log in to answer this question.

Browse other questions tagged .