0

Suppose I have two tex files, document.tex and content.tex

document.tex:

\documentclass{article}

\begin{document}

This is some content.

\input{content.tex}

\end{document}

content.tex:

This is some more content.

Compiling with pdflatex document.tex produces the expected document as pdf. However, I'd like to create a new standalone tex file, that would look like this:

\documentclass{article}

\begin{document}

This is some content.

This is some more content.

\end{document}

I'm almost sure there must be a standard tool to do this, but I wasn't able to find anything.

karpfen
  • 101
  • I'd say the standard tool is a text editor equipped with copy/paste. You might want to explain why you are trying to do this from within TeX. – campa Feb 01 '21 at 09:37
  • Sure, that would work. But it's tedious and error prone if you have documents with dozens of externals. As to why, I needed to do this for a submission some time ago and did it manually then. And given that there's a bunch of little known (at least to me) command line tools for all kinds of jobs I thought chances are there is one for this task, too. – karpfen Feb 01 '21 at 09:53
  • Yes, latexpand does exactly what I was looking for. Thank you! – karpfen Feb 01 '21 at 10:17

0 Answers0