I seem to remember it was in when back in the days I seriously started using L A T E X and I learned then that one had to run the following sequence of commands:. A rather tedious process. What's more, the output PDF quality could under some circumstances be underwhelming, to say the least. When playing with font encodings, character rendering felt it was subject to some low resolution.
|Published (Last):||16 November 2008|
|PDF File Size:||8.21 Mb|
|ePub File Size:||1.8 Mb|
|Price:||Free* [*Free Regsitration Required]|
Essentially, it is like a specialized relative of the general make utility, but one which determines dependencies automatically and has some other very useful features. In its basic mode of operation latexmk is given the name of the primary source file for a document, and it issues the appropriate sequence of commands to generate a.
By default latexmk will run the commands necessary to generate a. Latexmk can also be set to run continuously with a suitable previewer. In that case the LaTeX program, etc, are rerun whenever one of the source files is modified, and the previewer automatically updates the on-screen view of the compiled document.
Latexmk determines which are the source files by examining the log file. Optionally, it also examines the list of input and output files generated by the -recorder option of modern versions of latex and pdflatex.
See the documentation for the -recorder option of latexmk below. When latexmk is run, it examines properties of the source files, and if any have been changed since the last document generation, latexmk will run the various LaTeX processing programs as necessary.
In particular, it will repeat the run of LaTeX or pdflatex often enough to resolve all cross references; depending on the macro packages used. With some macro packages and document classes, four, or even more, runs may be needed.
In addition, latexmk can be configured to generate other necessary files. For example, from an updated figure file it can automatically generate a file in encapsulated postscript or another suitable format for reading by LaTeX. Latexmk has two different previewing options. In the simple -pv option, a dvi, postscript or pdf previewer is automatically run after generating the dvi, postscript or pdf version of the document.
The type of file to view is selected according to configuration settings and command line options. The second previewing option is the powerful -pvc option mnemonic: "preview continuously". In this case, latexmk runs continuously, regularly monitoring all the source files to see if any have changed.
Every time a change is detected, latexmk runs all the programs necessary to generate a new version of the document. A good previewer like gv will then automatically update its display. Thus the user can simply edit a file and, when the changes are written to disk, latexmk completely automates the cycle of updating the.
For other previewers, the user may have to manually make the previewer update its display, which can be some versions of xdvi and gsview as simple as forcing a redraw of its display. Latexmk has the ability to print a banner in gray diagonally across each page when making the postscript file.
It can also, if needed, call an external program to do other postprocessing on the generated files. Latexmk is highly configurable, both from the command line and in configuration files, so that it can accommodate a wide variety of user needs and system configurations. A very annoying complication handled very reliably by Latexmk , is that LaTeX is a multiple pass system.
On each run, LaTeX reads in information generated on a previous run, for things like cross referencing and indexing. In the simplest cases, a second run of LaTeX suffices, and often the log file contains a message about the need for another pass.
However, there is a wide variety of add-on macro packages to LaTeX, with a variety of behaviors. The result is to break simple-minded determinations of how many runs are needed and of which programs. In its new version, latexmk has a highly general and efficient solution to these issues. The solution involves retaining between runs information on the source files, and a symptom is that latexmk generates an extra file with extension.
If no files are specified, latexmk will, by default, run on all files in the current working directory with a ". If a file is specified without an extension, then the ". Thus, if you specify: latexmk foo then latexmk will operate on the file "foo. A common use for this option is when a document comes from an external source, complete with its bbl file s , and the user does not have the corresponding bib files available.
In this situation use of the -bibtex- option will prevent latexmk from trying to run bibtex or biber , which would result in overwriting of the bbl files. Thus when the bib files are not available, bibtex or biber is not run, thereby avoiding overwriting of the bbl file s. This is the default setting.
Note that it is possible for latexmk to decide that the bib file does not exist, even though the bib file does exist and bibtex or biber finds it. The problem is that the bib file may not be in the current directory but in some search path; the places latexmk and bibtex or biber cause to be searched need not be identical.
On modern installations of TeX and related programs this problem should not arise, since latexmk uses the kpsewhich program to do the search, and kpsewhich should use the same search path as bibtex and biber. If this problem arises, use the -bibtex option when invoking latexmk. The message must be a single argument on the command line so be careful with quoting spaces and such. Note that if the -bm option is specified, the -ps option is assumed.
A decimal number between 0 and 1. The default is 0. Experimentation is necessary to get the right scale for your message, as a rule of thumb the scale should be about equal to divided by the number of characters in the message. The default is This cleanup is instead of a regular make. See the -gg option if you want to do a cleanup then a make. Otherwise these files are not deleted. See the -gg option if you want to do a cleanup than a make.
Now equivalent to the -C option. See that option for details. Size and intensity can be modified with the -bs and -bi options.
The -bm option will override this option as this is really just a short way of specifying: latexmk -bm DRAFT Note that if the -d option is specified, the -ps option is assumed. This is in the form of a dependency list of the form used by the make program, and it is therefore suitable for use in a Makefile. It gives an overall view of the files without listing intermediate files, as well as latexmk can determine them.
By default the list of dependent files is sent to stdout i. Users familiar with GNU automake and gcc will find that the -deps option is very similar in its purpose and results to the -M option to gcc.
This is the default. Use of this option also turns on the output of the list of dependent files after processing. The argument to this option is a filter which will generate a filtered dvi file with the extension ". All extra processing e. Example usage: To use dviselect to select only the even pages of the dvi file: latexmk -dF 'dviselect even' foo. This may help for debugging problems or to understand latexmk 's behavior in difficult situations. This may get overridden, if some other file is made e.
The code is typically a sequence of assignment statements separated by semicolons. The code is executed when the -e option is encountered during latexmk 's parsing of its command line. See the -r option for a way of executing initialization code from a file. An error results in latexmk stopping. Multiple instances of the -r and -e options can be used, and they are executed in the order they appear on the command line.
Some care is needed to deal with proper quoting of special characters in the code on the command line. This avoids the complications of getting a quote character inside an already quoted string in a way that is independent of both the shell and the operating-system.
Normally, when latexmk detects that LaTeX or another program has found an error which will not be resolved by further processing, no further processing is carried out. This could be used to override a setting in a configuration file. This option is useful, for example, if you change some options and wish to reprocess the files.
This option is not normally needed nowadays, since current previewers normally determine this information automatically. By default, latexmk will, in continuous-preview mode, test for a previously running previewer for the same file and not start a new one if a previous previewer is running. However, its test sometimes fails notably if there is an already- running previewer that is viewing a file of the same name as the current file, but in a different directory.
This option turns off the default behavior. It puts latexmk in its normal behavior that in preview-continuous mode it checks for an already-running previewer. In this situation use of the -nobibtex option will prevent latexmk from trying to run bibtex or biber , which would result in overwriting of the bbl files.
By default it is the generated postscript file that is printed. In general, the correct behavior for printing very much depends on your system's software.
In particular, under MS-Windows you must have suitable program s available, and you must have configured the print commands used by latexmk. This can be non-trivial. This option is incompatible with the -pv and -pvc options, so it turns them off. This can be used to override a setting in a configuration file. It may get overridden if some other option requires the generation of a pdf file. This option also ensures that the requisite file is made, and turns on printing. The default is to print a postscript file.
It may get overridden by some other option that requires a postscript file, for example a request for printing. The argument to this option is a filter which will generate a filtered postscript file with the extension ". Example of usage: Use psnup to print two pages on the one page: latexmk -ps -pF 'psnup -2' foo. If the -view option is used, this will select the kind of file to be previewed dvi, ps or pdf. Otherwise the viewer views the "highest" kind of file selected, by the -dvi , -ps , -pdf , -pdfps options, in the order dvi, ps, pdf low to high.
If no file type has been selected, the dvi previewer will be used.
latexmk (1) - Linux Man Pages
If you use cross-references, you often have to run LaTeX more than once, if you use BibTeX for your bibliography or if you want to have a glossary you even need to run external programs in-between. To avoid all this hassle, you should simply use Latexmk! Latexmk is a Perl script which you just have to run once and it does everything else for you … completely automagically. And the nice thing is: you probably have it already installed on your computer, because it is part of MacTeX and MikTeX and it is bundled with many Linux Distributions.
Subscribe to RSS
Essentially, it is like a specialized relative of the general make utility, but one which determines dependencies automatically and has some other very useful features. In its basic mode of operation latexmk is given the name of the primary source file for a document, and it issues the appropriate sequence of commands to generate a. By default latexmk will run the commands necessary to generate a. Latexmk can also be set to run continuously with a suitable previewer. In that case the LaTeX program, etc, are rerun whenever one of the source files is modified, and the previewer automatically updates the on-screen view of the compiled document. Latexmk determines which are the source files by examining the log file.