LaTeX macros
I have made the following LaTeX macro files which I use when
writing articles. You can choose to use individual macros, just cut
and paste from the files, or the whole setup I'm using. Files can be
downloaded individually, or as a zipped file
containing all the files.
- LaTeX template for articles (mal.tex)
- Defines my default setup for articles including the inclusion of
setup.tex and meta.tex. Suggested solution: Rather than modify
setup.tex for each new article, keep one copy in a
shared directory; make your own setup file including
(using \input)
the shared setup.tex for each new article and redefine macros you
wish to modify.
- LaTeX setup for articles (setup.tex)
- Defines various macros and parameters: define paths (home
directory, bibliography), \addsection for
adding sections with
automatic labeling, multi-column table of contents, \DRAFT macro
for marking label and citation definitions in the margin.
- LaTeX metafile for articles (meta.tex)
- Standardized file for defining meta-information on article:
title, author, etc. Macro \includesections is
defined here adding
all the sections and appendices using \addsection.
My typical LaTeX article setup consists of the following documents
per article:
- Main document
- This follows the template (mal.tex). The
files macro.tex and meta.tex are included using \input.
- macro.tex
- This contains macro definitions specific to the article. It
includes setup.tex at the start using \input
the general setup file which is in a shared catalogue; including
that here rather than in the main document ensures that macros
originally defined in setup.tex can be
redefined here if you wish to modify their behaviour.
- meta.tex
- This is a copy of the meta file adapted to the specific
document. It contains information such as title, author, etc. It
also contains a list of all the sections (chapters) in the definition of
\includesections where all the sections are
included using the
macro \addsection.
- one file per section (chapter)
- I use one file per section (chapter). These are included by
adding them to the definition of \includesections made in the meta
file. This way, the sections are automatically labeled as chap:xxx
or app:xxx where xxx is
the section name. The filename is on the
form {\texfileprefix}xxx.tex where \texfileprefix should be
(re)defined in the meta file.