AutoLaTeX: how to automatize LaTeX compilation

This documentation is extracted from the README file and the pod/man manuals. Please refer to these documents for more details.

Preamble

AutoLaTeX is basically a command line tool. But a GTK-perl interface is also provided for configuration conveniance:


$> autolatex --version
$> autolatex-gtk
User configurationSelection of enabled image convertersAutoLaTeX launchers

Targets

AutoLaTeX provides a fixed set of targets, the argumentto the make command, for all projects. The default target is view whose ultimate goal is to provide an on-screen preview of the formatted document. For additional information on the make program, please refer to the documentation for your copy of make.

The targets provided by AutoLaTeX are:

all

Same as view.

clean

Cleans the current working directory by removing all LaTeX output and other output files created during processing of the project.

cleanall

Same as clean. In addition, emacsfiles and other backup files are removed. The generated figures are also removed.

gen_doc

Performs all processing required to produce the .pdf/.dvi/.ps file for the project.

view

Same as gen_doc. In addition launch the document viewer.

bibtex

Performs all processing that permits to generate the bibliography (bibtex).

makeindex

Performs all processing that permits to generate the index (makeindex).

images

Performs the automatic generation of the figures.

commit

Commit the changes into a SCM system (CVS or SVN).

update

Update the local copy with the changes from a SCM system (CVS or SVN).

showimages

Display the filenames of the figures.

showpath

Show the value of the environment variable PATH

showvars

Show several important variable values (usefull for debugging)

Options

--[no]auto

Enable or disable the auto generation of the figures.

--createconfig[=type]

Do not the compilation the LaTeX project, but create a coniguration file. The created configuration file depends on the type value. If the type is equal to project, AutoLaTeX will create the configuration file dedicated to a project. Otherwhise it will create the configuration file of a user. The project configuration file is path/to/project/.autolatex_project.cfg on Unix platforms, and path\to\project\autolatex_project.cfg on other platforms. The default user configuration file is $HOME/.autolatex on Unix platforms, C:\Documents and Settings\User\Local Settings\Application Data\autolatex.conf on Windows platforms, and $HOME/autolatex.conf on other plateforms.

--createist

Create a default MakeIndex style file into the project directory. The created file will be named 'default.ist'. If a file with this name already is existing, it will be overwritten.

--createmakefile

Do not the compilation the LaTeX project, but create a Makefile in the project's directory that will permits to compile it.

--defaultist

Allow AutoLaTeX to use MakeIndex with the default style (ist file). The default style is provided by AutoLaTeX.

The options --index and --noindex also permit to change the behavior of AutoLaTeX against MakeIndex

--dvi

Do the compilation to produce a DVI document.

--exclude=name

Avoid AutoLaTeX to load the translator called name. See bellow for the available translators.

The option --include permits to include a translator; and the option
I permits to specify where to find translator scripts.

-f=file
--file=file

Specify the main LaTeX file to compile. If this option is not specified, AutoLaTeX will search for Main.tex.

--fixconfig[=file]

Fix the syntax of a configuration file. If the file is not specified on the command line, AutoLaTeX will try to fix the project configuration, or the user configuration if no project configuration file was found.

-?
--help

Display this manual.

-I=paths

Notify AutoLaTeX that it could find translator scripts inside the specified directories. The specified path could be a list of paths separated by the operating system's path separator (':' on Unix, ';' for Windows for example).

The option --exclude permits to exclude a translator; and the option
--include permits to exclude a translator.

--imgdirectory=path

Force AutoLaTeX to restrict te auto-generation of the pictures which are located in the given directory (or in one of its children).

--include=name

Force AutoLaTeX to load the translator called name. See bellow for the available translators.

The option --exclude permits to exclude a translator; and the option
I permits to specify where to find translator scripts.

--index[=style_file]

Allow AutoLaTeX to use MakeIndex.

If this option was specified with a value, the file value will be assumed to be an .ist file to pass to MakeIndex.

If this option was specified without a value, AutoLaTeX will use MakeIndex and tries to detect a MakeIndex style file (.ist file) inside the project directory. If no project's .ist file was found, AutoLaTeX will not pass a style to MakeIndex.

The options --defaultist and --noindex also permit to change the behavior of AutoLaTeX against MakeIndex

--noindex

Avoid AutoLaTeX to use MakeIndex.

The options --index and --defaultist also permit to change the behavior of AutoLaTeX against MakeIndex

-o=directory
--output=directory

Specify where the generated Makefile should be created instead of the project's directory.

--pdf

Do the compilation to produce a PDF document. The compilation is based on pdflatex instead of using the old compilation process: latex, dvips, ps2pdf.

--ps

Do the compilation to produce a Postscript document. The compilation is based on the old compilation process: latex, dvips.

--pspdf

Do the compilation to produce a PDF document. The compilation is based on old compilation process: latex, dvips, ps2pdf; instead of using pdflatex.

--set name=value

Set the internal value of AutoLaTeX named name with the specified value. Internal values are limited and corresponds to the «set» directives from the configuration file syntax.

-v

Each time this option was specified, AutoLaTeX is more verbose.

--version

Display the version of AutoLaTeX.

--view[=file]
--noview

Enable or disable the document viewer at the end of the compilation. The path of the document viewer could be specify with file. If not specified, AutoLaTeX will check for the tools acroread, kpdf, evince, gv, and xpdf.

Auto Generation of Figures

A translator is used to convert a source figure into a target figure whichis supported by LaTeX. This converter is an external program (eg. epstopdf) or an internal script (eg. gnuplot2eps).

Each supporter translation is stored inside a .mk file. This file contains the definition of the variables for the shell command line to launch, and make rules to automatocally call the converter on each figures of the LaTeX project.

The supported formats for calls of translator are:

a binfile [flags] [inputflags] inputfile [outputflags] outputfile [postflags]
b binfile [flags] [outputflags] outputfile [inputflags] inputfile [postflags]
c binfile [flags] inputflags=inputfile outputflags=outputfile [postflags]
d binfile [flags] outputflags=outputfile inputflags=inputfile [postflags]
e binfile [flags] [inputflags] inputfile outputflags=outputfile [postflags]
f binfile [flags] outputflags=outputfile [inputflags] inputfile [postflags]
g binfile [flags] inputflags=inputfile [outputflags] outputfile [postflags]
h binfile [flags] [outputflags] outputfile inputflags=inputfile [postflags]
i binfile [flags] [inputflags] inputfile [postflags] > outputfile
j binfile [flags] inputflags=inputfile [postflags] > outputfile

The supported translations are:

Encapsuled PostScript (eps) to Portable Document Format (pdf)

based on epstopdf tool. The input filename extension is '.eps'. This translator is automatically included by AutoLaTeX even if you exclude it from the the command line.

Name:eps2pdf
Use external converter:epstopdf
Use internal converter:
Input format:.eps
Output format:.pdf
Provide generation rules:no
Provide generation macros:$(EPS2PDF_SHELL_CMD)
Command line pattern:f

XFig document (fig) to Portable Document Format (pdf)

based on fig2dev and epstopdf tools. The input filename extension is '.fig'.

Name:fig2pdf
Use external converter:fig2dev
Use internal converter:eps2pdf
Input format:.fig
Output format:.pdf
Provide generation rules:yes
Provide generation macros:$(FIG2EPS_SHELL_CMD)
Command line pattern:a

XFig document (fig) to TeX embeded in Portable Document Format (pdf+tex)

based on fig2dev and epstopdf tools. The input filename extension is '.ltx.fig' and the output filename extensions are '.pdf' and '.tex'.

PDF part:

Name:fig2pdf+tex
Use external converter:fig2dev
Use internal converter:eps2pdf
Input format:.ltx.fig
Output format:.pdf
Provide generation rules:yes
Provide generation macros:$(FIG2PSTEX_SHELL_CMD)
Command line pattern:a

TeX part:

Name:fig2pdf+tex
Use external converter:fig2dev
Use internal converter:fig2pstex_t
Input format:.ltx.fig
Output format:.tex
Provide generation rules:yes
Provide generation macros:$(FIG2PSTEX_T_SHELL_CMD)
Command line pattern:a

GNU plot (plot) to Portable Document Format (pdf)

based on gnuplot and epstopdf tools. The input filename extension is '.plot'.

Name:plot2pdf
Use external converter:gnuplot
Use internal converter:eps2pdf
Input format:.plot
Output format:.pdf
Provide generation rules:yes
Provide generation macros:$(PLOT2PDF_SHELL_CMD)
Command line pattern:i

GNU plot (plot) to TeX embeded in Portable Document Format (pdf+tex)

based on gnuplot and epstopdf tools. The input filename extension is '.ltx.plot' and the output filename extensions are '.pdf' and '.tex'.

PDF part:

Name:plot2pdf+tex
Use external converter:gnuplot
Use internal converter:eps2pdf
Input format:.ltx.plot
Output format:.pdf
Provide generation rules:yes
Provide generation macros:$(PLOT2PSTEX_SHELL_CMD)
Command line pattern:a

TeX part:

Name:plot2pdf+tex
Use external converter:gnuplot
Use internal converter:gnuplot2pstex
Input format:.ltx.plot
Output format:.tex
Provide generation rules:yes
Provide generation macros:$(PLOT2PSTEX_T_SHELL_CMD)
Command line pattern:a

Scalable Vector Graphic (svg) to Portable Document Format (pdf)

based on inkscape and epstopdf tools. The input filename extension is '.svg'.

Name:svg2pdf
Use external converter:inkscape
Use internal converter:eps2pdf
Input format:.svg
Output format:.pdf
Provide generation rules:yes
Provide generation macros:$(SVG2PDF_SHELL_CMD)
Command line pattern:e

Scalable Vector Graphic (svg) to Portable Network Graphic (png)

based on inkscape tool. The input filename extension is '.svg'.

Name:svg2png
Use external converter:inkscape
Use internal converter:
Input format:.svg
Output format:.png
Provide generation rules:yes
Provide generation macros:$(SVG2PNG_SHELL_CMD)
Command line pattern:e

UML Metadata Interchange (xmi) to Portable Document Format (pdf): Umbrello variante

based on umbrello and epstopdf tools. The input filename extension is '.xmi'.

Name:xmi2pdf_umbrello
Use external converter:umbrello
Use internal converter:xmi2eps_umbrello, eps2pdf
Input format:.xmi
Output format:.pdf
Provide generation rules:yes
Provide generation macros:$(XMI2EPS_SHELL_CMD)
Command line pattern:a

UML Metadata Interchange (xmi) to Portable Document Format (pdf): xmi2svg variante

based on xmi2svg and on the translator svg2pdf. The input filename extension is '.xmi'.

Name:xmi2pdf_xmi2svg
Use external converter:xmi2svg
Use internal converter:svg2pdf
Input format:.xmi
Output format:.pdf
Provide generation rules:yes
Provide generation macros:$(XMI2SVG_SHELL_CMD)
Command line pattern:i

UML Metadata Interchange (xmi) to Portable Document Format (pdf): uml2svg variante

based on uml2svg and on the translator svg2pdf. The input filename extension is '.xmi'.

Name:xmi2pdf_uml2svg
Use external converter:uml2svg
Use internal converter:svg2pdf
Input format:.xmi
Output format:.pdf
Provide generation rules:yes
Provide generation macros:$(XMI2SVG_SHELL_CMD)
Command line pattern:i

Compressed Bitmap to Uncompressed Bitmap

based on zcat tool. This translator assumes that bitmaps are compressed. The input filename extensions is '.<fmt>.gz' where <fmt> is one of 'png', 'jpg', 'jpeg', 'gif', 'bmp', or 'pdf'. This translator permits to store in the project compressed figures as raw material for the LaTeX compiler. The bitmaps are uncompressed in a file with the same name as the source, except that the '.gz' was removed from the name.

Name:imggz2img
Use external converter:zcat
Use internal converter:
Input format:.png.gz .jpeg.gz .jpg.gz .gif.gz .pdf.gz .bmp.gz
Output format:.png .jpeg .jpg .gif .pdf .bmp
Provide generation rules:yes
Provide generation macros:$(IMGGZ2IMG_SHELL_CMD)
Command line pattern:i

Dot Graphviz (dot) to Portable Document Format (pdf)

based on graphviz tool. The input filename extension is '.dot'.

Name:dot2pdf
Use external converter:dot
Use internal converter:dot2pdf
Input format:.dot
Output format:.pdf
Provide generation rules:yes
Provide generation macros:$(DOT2PDF_SHELL_CMD)
Command line pattern:a

Dot Graphviz (dot) to Portable Network Graphic (png)

based on graphviz tool. The input filename extension is '.dot'.

Name:dot2png
Use external converter:dot
Use internal converter:dot2png
Input format:.dot
Output format:.png
Provide generation rules:yes
Provide generation macros:$(DOT2PNG_SHELL_CMD)
Command line pattern:a

Diagram Editor (dia) to Portable Document Format (pdf)

based on dia and epstopdf tools. The input filename extension is '.dia'.

Name:dia2pdf
Use external converter:dia
Use internal converter:eps2pdf
Input format:.dia
Output format:.pdf
Provide generation rules:yes
Provide generation macros:$(DIA2EPS_SHELL_CMD)
Command line pattern:f

Graph eXtended Language (gxl) to Portable Document Format (pdf)

based on graphviz tool. The input filename extension is '.gxl'.

Name:gxl2pdf
Use external converter:gxl2dot
Use internal converter:dot2pdf
Input format:.gxl
Output format:.pdf
Provide generation rules:yes
Provide generation macros:$(GXL2DOT_SHELL_CMD)
Command line pattern:h

Graph eXtended Language (gxl) to Portable Network Graphic (png)

based on graphviz tool. The input filename extension is '.gxl'.

Name:gxl2pdf
Use external converter:gxl2dot
Use internal converter:dot2png
Input format:.gxl
Output format:.png
Provide generation rules:yes
Provide generation macros:$(GXL2DOT_SHELL_CMD)
Command line pattern:h

LaTeX Style Package

AutoLaTeX provides a LaTeX style called autolatex.sty. It provides the following functions:

\includefigurewtex{width}{filename}

include a figure from a .pstex_t file

Configuration File

Location of the Configuration Files

The configuration files used by AutoLaTex could be a several places:

  • System Configuration (for all users): inside the directory where AutoLaTeX was installed (usually /usr/lib/autolatex on Unix systems).
  • User Configuration: two cases: the configuration directory named $$HOME/.autolatex on Unix, or C:\DocumentsandSettings\<user>\LocalSettings\ApplicationData\autolatex on Windows exists; or not.
    In the first case, the configuration file is stored inside the directory and is named autolatex.conf.
    In the second case, the configuration file is inside the user directory and is named $HOME/.autolatex on Unix, and C:\DocumentsandSettings\<user>\LocalSettings\ApplicationData\autolatex.conf on Windows.
  • Project Configuration: the configuration file in the same directory as the main TeX file of the project. It is named .autolatex_project.cfg on Unix and autolatex_project.cfg on Windows.

Syntax of the Configuration Files

The configuration files respect a syntax similar to the Windows .ini files. A comment starts with the characters '#' or ';' and it finishes at the end of the line. Each configuration directive must be inside a configuration section. A configuration section is declared by its name between brackets.
Example:

[mysection]
Each directive must be declared as:
directive name = value
Several section names are reserved by AutoLaTeX, the others are assumed to be the configuration for the translators.

[Viewer] section

This section permits to configure the viewer used by AutoLaTeX. The recognized directives are:

view
Indicates if AutoLaTeX must launch a viewer after LaTeX compilation. Accepted values: yes or no.
viewer
Is the path or the command line of the viewer to launch. Accepted value: any command line.

[Generation] section

This section permits to configure the generation process used by AutoLaTeX. The recognized directives are:

main file
Specifies the basename of the main TeX file to compile. This option is available only inside the project's configuration file.
generate images
Indicates if AutoLaTeX automatically generates the figures. Accepted values: yes or no
generation type
Indicates the type of generation. Accepted values:
  • pdf - use pdflatex
  • dvi - use latex
  • ps - use latex and dvips
  • pspdf - use latex, dvips and ps2pdf
makeindex style
Specifies the style that must be used by makeindex. This is a list of values separated by comas. The values should be:
  • <filename> - if a filename was specified, AutoLaTeX assumes that it is the .ist file;
  • @system - AutoLaTeX uses the system default .ist file (in AutoLaTeX distribution);
  • @detect - AutoLaTeX will tries to find a .ist file in the project's directory. If none was found, AutoLaTeX will not pass a style to makeindex;
  • @none - AutoLaTeX assumes that no .ist file must be passed to MakeIndex;
  • <empty> - AutoLaTeX assumes that no .ist file must be passed to MakeIndex.
If the list contains more than one value, AutoLaTeX will do the corresponding behaviors in turn.
translator include path
Specifies additional directories from which translator scripts could be loaded. This is a list of paths separated by comas or the path separator of your operating system (':' on Unix, ';' on Windows). If a path contains a coma character, you must enclose it in quotes.
set make
Specifies the GNU make tool command line. Accepted value: any command line.
set latex
Specifies the LaTeX tool command line. Accepted value: any command line.
set bibtex
Specifies the BibTeX tool command line. Accepted value: any command line.
set dvips
Specifies the dvips tool command line. Accepted value: any command line.
set ps2pdf
Specifies the ps2pdf tool command line. Accepted value: any command line.
set latex_flags
Specifies the options to pass to the LaTeX tool. Accepted value: any command line.
set latex_draft_flags
Specifies the options to pass to the LaTeX tool only in draft mode. Accepted value: any command line.
set bibtex_flags
Specifies the options to pass to the BibTeX tool. Accepted value: any command line.
set dvips_flags
Specifies the options to pass to the dvips tool. Accepted value: any command line.
set ps2pdf_flags
Specifies the options to pass to the ps2pdf tool. Accepted value: any command line.
set touch
Specifies the command line for a «touch» Unix-like command. Accepted value: any command line.
set echo
Specifies the command line for a «echo» Unix-like command. Accepted value: any command line.
set echo_err
Specifies the command line for a «echo >&2» Unix-like command. Accepted value: any command line.

[Clean] section

This section permits to configure the cleaning features of AutoLaTeX (targets clean and cleanall). The recognized directives are:

files to clean
Is a list of files to remove when the target 'clean' is invoked. Shell wildcards are allowed.
files to desintegrate
Is a list of files to remove when the target 'cleanall' is invoked. Shell wildcards are allowed.

[Scm] section

This section permits to configure the SCM support of AutoLaTeX (CVS, SVN or others). The recognized directives are:

scm commit
Specifies the command line to use when commit the changes.
scm update
Specified the command line to use when update the local copy.

⟨Translator⟩ section

A translator section has the same name as the translator it configures. The recognized directives are:

include module
Indicates if the translator should be loaded by default. Accepted values: yes or no.

Variables Defined by AutoLaTeX

The variables used by AutoLaTeX can be categorized roughly into two groups. The first set of variables are typically used to configure the whole behavior of AutoLaTeX. These variables can be overridden on the command line for maximum flexibility. The second set of variables are set by in the variable translation scripts.

General Variables

FILE
The name of the LaTeX document to compile without the trailing '.tex'. Default value = Main.
OPEN_PDF
Boolean value (yes or no) that indicates if the PDF viewer should be launched. Default value = yes.
AUTO_GENERATE_IMAGES
Boolean value (yes or no) that indicates if the figures included in the LaTeX document should be automatically generated from picture sources. Default value = yes.
PDF_VIEWER
Path of the PDF viewer to use. If not set, AutoLaTeX will check for acroread, kpdf, evince and xpdf (in this order). No default value.
SCM_UPDATE_CMD
Shell command of the SCM command to use to update the local copy. No default value.
SCM_COMMIT_CMD
Shell command of the SCM command to use to commit the local copy. No default value.
LATEX_CMD
Shell command for generating the PDF document. Default value = pdflatex.
LATEX_DRAFT_FLAGS
Command line options to pass to the LaTeX compiler when it will be launched in draft mode. Default value = --draftmode.
LATEX_FLAGS
Command line options to pass to the LaTeX compiler. No default value.
BIBTEX_CMD
Shell command for generating the bibliography entries. Default value = bibtex.
BIBTEX_FLAGS
Parameters that must be passed to the bibtex command. No default value.
MAKEINDEX_CMD
Shell command for generating the index entries. Default value = makeindex.
MAKEINDEX_FLAGS
Parameters that must be passed to the makeindex command. No default value.
MAKEINDEX_STYLEFILE
Name of the style file (.ist) that makeindex must use. If a value was set, the option «-s file.ist» will be passed to makeindex. No default value.
DVIPS_CMD
Shell command for generating the Postcript document. Default value = dvips.
DVIPS_FLAGS
Parameters that must be passed to the dvips command. No default value.
PSPDF_CMD
Shell command for generating the PDF document from Postcript document. Default value = ps2pdf.
PSPDF_FLAGS
Parameters that must be passed to the ps2pdf command. No default value.
TOUCH_CMD
Shell command for the Unix-like command touch. Default value = autolatex_touch.

Translator Variables

(Replace xxx_ by the name of the translator in upper case)

xxx_BIN
Command to launch.
xxx_FLAGS
Command line options to pass to the converter.
xxx_INPUT_FLAGS
Options which must appear just before then input filename.
xxx_OUTPUT_FLAGS
Options which must appear just before then input filename.
xxx_POST_FLAGS
Options which must appear just after all the rest on the command line.
xxx_OUTPUT_INPUT
Switch the order of the output options and the input option. If set to yes, the output options will appear before the input options. If set to no, the input options will appear before the output options.
xxx_OUTPUT_STDOUT
If set to yes, the output options will be ignored and the command's standard output will be sent to the target file.

Graphic User Interface

A graphical user interface is available since version 5.0 to configure and launch AutoLaTeX process.

The available user interfaces are:

  • autolatex-gtk: a GTK-based user interface.

System Requirements

To configure and install AutoLaTeX, you will need a Unix-like operating system or shell with a compatible GNU make.

You need to install the package Compress::Zlib to compile and install AutoLaTeX. This package is not required for the execution of AutoLaTeX. In addition, to compile AutoLaTeX, you need to install the 'msgfmt' command which is a part of 'gettext'.

To use AutoLaTeX, you will require:

  • LaTeX.
    The development of AutoLaTeX was done using Thomas Esser’s TeX distribution, teTeX, version 1.0.7. More information on teTeX can be found at http://www.tug.org/tetex/. But AutoLaTeX is working fine with TeX Live distribution.
  • Either GNU make version 3.80 or higher.
    For information on GNU make, see http://www.gnu.org/software/make/. The GNU make version requirement is firm. AutoLaTeX will not work with versions of GNU make prior to 3.80. It is highly unlikely that AutoLaTeX will be ported to older GNU make versions due to the lack of some important features in older versions.
  • Either Perl version 5.004 or higher.
  • The Perl package Config::Simple.
  • The Perl package Locale::gettext

Installation

Installation of AutoLaTeX consists of launching the Makefile.PL script to generate a Makefile that permits to compile and install AutoLaTeX. The basic commands are:

$> cd path_to_autoloader_sources/
$> perl ./Makefile.PL --prefix=/usr
$> make
$> make install
$> make clean

No-screenshot

Project Spotlight

TeX-UPmethodology

A LaTeX style which permits to create Unified Process methodology (UP or RUP) based documents (document version, history, authors, validators, specification, task management, helping tools...).

No-screenshot

Project Spotlight

tinyMAS

A very small platform which permits to implement and run agent-based systems.