I have headerfiles that I input with an \input{general.teh}
statement. If have several headerfiles.
And yes, I use the extension .teh
for TeX header files.
This is what a small document would look like:
\documentclass[paper=a4, 11pt]{scrartcl}
\usepackage{lipsum}
\input{general.teh}
\title{title}
\begin{document}
\section{Lorem Ipsum}
\lipsum[1]
\end{document}
.teh
files cannot be compiled on their own, and go after the \documentclass
statement. Some header files react differently on the document class at hand:
%% --- page settings ---
\makeatletter
\@ifclassloaded{g-brief}{%
}{%
\@ifclassloaded{g-brief2}{%
}{%
\@ifclassloaded{beamer}{%
}{%
\usepackage[a4paper, left=2.5cm, right=2.5cm, top=2cm, bottom=3cm]{geometry}
}}}
\@ifclassloaded{beamer}{%
\usetheme{Darmstadt}
\usecolortheme{albatross}
\setbeamercovered{transparent}
\beamertemplatenavigationsymbolsempty
}{%
\pagestyle{plain}
\pagenumbering{arabic}
}
\makeatother
I use version control for some .tex
files, but more often than not, I just use rsync
on my TeX root to archive them over to an external hard drive. There, they get .tar.xz
'd, for backup reasons. All TeX documents are stored under a common root (~/Documents/latex/
) and in there are folders for various documents.
Now, when the document is quite large, like applications for work, including CV, etc. I use Makefiles to facilitate quick creation of PDFs. Those files also contain functions to "clean" the directory:
all: mappe.pdf
mappe.pdf: bewerbung.pdf lebenslauf.pdf
%.pdf: %.tex
-xelatex -interaction nonstopmode $<
-rm -f *.log *.aux
.PHONY: clean
clean:
-rm -f *.pdf *.log *.aux
All I have to do to recreate the PDFs, is run make
in the directory. When make
fails, I can use the output of the console for debugging, just as I'd do with anything else, where a build process fails, such as compiling programs.
Using makefiles, is only advised, when the document is maturing, and all you do, is basically fill it with content and not tweaking with its fundamental structure, whatever that may be. You can still see the errors without problems when you change the documents, but when beginning a new document from scratch, I would advise against writing the Makefile first...
As Stefan Kottwitz pointed out, you could use arlatex
, which works quite ok, with a compressor:
arlatex --document=xetest.tex gemeral.teh | xz > bundle-xetest.tex
But the functionality spectrum isn't really what I'm looking for right now. I tend to archive all files, just like that.