Generating a single LaTeX file by merging different LaTeX files
This solution should work.
perl latexpand main.tex > newarticle.tex
Related videos on Youtube
Kevin Bowen
I route the packets that make the Internet sing. Contributor to Xfce Desktop Environment(DE) documentation: https://docs.xfce.org I have been a casual Linux user since Slackware 3.0 (Hello Walnut Creek!) and an Ubuntu user since around version 6.06 or 6.10. My primary professional skill set has been focused on the design, implementation, operation, and daily management of enterprise networks. This includes the configuration and operation of network hardware as well as the care and feeding involved in the network monitoring systems supporting them. The hardware includes routers, switches, firewalls, wan-optimizers, and occasionally load balancers (mostly Cisco, Riverbed, and f5 systems). Launchpad twitter
Updated on September 18, 2022Comments
-
Kevin Bowen almost 2 years
I have a main LaTeX file which \input{} (aka imports) many other LaTeX files.
For example:
\documentclass{article} \begin{document} \input{input1.tex} \input{./Input_folder_1/input2.tex} \input{input3.tex} \input{./Input_folder_2/Input_folder_3/input4.tex} \end{document}
Let's call the above file say
main.tex
. I want a single LaTeX file, which imports contents frominput1.tex
,input2.tex
,input3.tex
andinput4.tex
, so that I have only one single LaTeX file instead of the above four LaTeX files.How do I go about writing a bash-script which does this job for me?
PS: I need to submit an article to a journal and I thought it would be good to have a single
.tex
file.The issue is the following: I have different files in sub-directories in a recursive manner and hence I cannot upload these individual files since the directory structure in the input command is on the local folder on my computer.
I could of course put these manually but I thought if there would be a way out similar to the .bbl file for the bibliography.
-
geethujoseph about 11 yearsYou have many tools that seem to do what you want listed here: tex.stackexchange.com/questions/21838/…
-
-
MERose over 3 yearsThe answer isn't complete, I believe, because an installation (or sth.) is missing. I get
Can't open perl script "latexpand": No such file or directory
-
grantbow over 3 yearsYou can install from ctan.org/pkg/latexpand.