You can easily add new templates for ReLaTeX to use. The basic process is:
See the example templates in templates/pnas, templates/plos, and templates/generic. You can see them in action in Basic ReLaTeX Tutorial. Note that Jinja2 variables are inserted using {{ }} markers, and control structures are inserted using {% %} markers.
ReLaTeX provides the following variables for insertion anywhere within your template:
any keyword parameter(s) passed by the --param command line option.
title: inserts the document title
section: is a dictionary of the named sections in the paper, whose keys are section names, and whose associated values are the latex content of that section. It also provides the following attribute:
Note that if your input latex file uses the \begin{abstract}...\end{abstract} construct, its content will be added to this dictionary as the section named Abstract.
figures: if --extract-figures was specified, a list of figure objects, each with the following attributes. Otherwise it’s an empty list.
tables: if --extract-figures was specified, a list of table objects, each with the following attributes. Otherwise it’s an empty list.
authors: a list of author objects, each with the following attributes:
name: the Author Name as provided in the input latex file’s \author{} list.
get_affiliations(fmt=None, key=None, linker=’,’): returns a string providing a formatted list of affiliations for this author.
fmt, if provided, will be used as a Python format string which can contain any of the following fields: %(id)s: inserts the number of the affiliation (starting from 1); %(key)s: inserts the key character of the affiliation, obtained from the optional key character string key argument. %(label)s: inserts the affiliation string from the affiliations.txt file for this affiliation. %(labelOnce)s: same as %(label)s, except that it will insert an empty string on subsequent re-usages of the same affiliation (required by some journal formats).
key, if provided is a string of characters to use for each affiliation (i.e. the first character is used for the first affiliation, etc.).
linker is the string used for joining the list of affiliations.
get_marker(role, label): returns the string specified by label if the author has the specified role, otherwise an empty string.
emailAddress: inserts the corresponding author’s email address, provided by the --email option.
affiliations: a list of affiliation objects, each with the following attributes:
macroDefs: inserts macros defined by the input latex file, which must be marked BY starting with the line %BEGINMACROS and ending the line %ENDMACROS, e.g.:
%BEGINMACROS
\newcommand{\ip}{\ensuremath{\text{IP}_0}\xspace}
\newcommand{\zdx}{\ensuremath{\text{ZD}_{\chi}}\xspace}
\newcommand{\zdr}{\ensuremath{\text{ZDR}}\xspace}
\newcommand{\zdt}{\ensuremath{\text{ZD}_t}\xspace}
\newcommand{\mars}{\ensuremath{\text{MaRS}^{*}}\xspace}
%ENDMACROS