3

There is already a similar question but the answer didn't solve my problem.

I would like to put in some text from an other .tex file (called munich.tex). This .tex file is in a subfolder called "01 - germany".

If I use

\input{01 - germany/munich}

it does not work because of the spaces in the name of the "01 - germany" folder. How can I solve this problem (without rename the "01 - germany" folder)?

Edit: I just realized, there must be a problem using the package [ngerman]{babel}:

\documentclass{article}
\usepackage[ngerman]{babel}

\begin{document}
\input{"01 - germany/munich.tex"}
\end{document}

It works without this package.

\documentclass{article}
%\usepackage[ngerman]{babel}

\begin{document}
\input{"01 - germany/munich.tex"}
\end{document}

Is someone formiliar with this problem?

  • 5
    It depends on your OS, your file system and your tex system. You can try quotes (around the folder or around the whole argument), but imho it is much less trouble if you simply rename the folder. – Ulrike Fischer Jan 4 '18 at 13:26
  • If you don't want to rename the folder, creating a link without spaces in its name might help. Just renaming the folder is certainly much easier. – user36296 Jan 4 '18 at 13:42
  • I just tried the quote-solution (using ") with Win10 and it worked. – knut Jan 4 '18 at 14:04
3
\documentclass{article}
\usepackage[ngerman]{babel}

\begin{document}
\shorthandoff{"}
\input{"01 - germany/munich.tex"}
\shorthandon{"}
\end{document}
0

There is an other solution.

\documentclass{article}

\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\makeatletter
\def\input@path{{"01 - germany/"}}
\makeatother

\begin{document}
\input{munich.tex}
\end{document}
  • Maybe you should add that you have to redefine this before using any other material stored in another folder. – TeXnician Jan 5 '18 at 12:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.