I have a bunch of tex files in different folders on my system. The goal is to create new tex files (using a template, that has the title page, packages, new commands,...) that combines all the definitions/theorems of the other tex files at a specific place in this template file.
I'm pretty new to linux, so I was wondering which command/set of commands would be the best to use here. So far I used:
$ sed -n '/begin{definition}/,/end{definition}/p' <infile >outfile
which succeeds in extracting the definitions from one file into another.
Someone any suggestions?
def_extractor this.tex foo.tex bar.tex | cat pre_defs.tex - post_defs.tex > final.tex
, where thedef_extractor
is something like thesed
oneliner above. Oh, the power of Unix. – vonbrand Mar 01 '13 at 18:40cat
) – Joseph R. Mar 01 '13 at 22:30