Hot answers tagged

55

Evince and Okular will auto-reload when the file being viewed changes. So does another option: Zathura. That said, my recommendation would still be MuPDF instead, though it'll take some more work to set up. The reason is that MuPDF in general is a much faster program, and will reload faster. It doesn't auto reload like these do, but this can be solved with ...


41

At Hans-Peter E. Kristiansen’s request, I provide another answer, extending the one given by kay102. Add the following lines to some latexmk initialization file (e.g., on Linux systems, ~/.latexmkrc): add_cus_dep('glo', 'gls', 0, 'run_makeglossaries'); add_cus_dep('acn', 'acr', 0, 'run_makeglossaries'); sub run_makeglossaries { if ( $silent ) { ...


40

Unfortunately, rubber does not seem to be really maintained anymore; the latest stable version 1.1 was released in 2006, and the more recent "development version" is unusable. That's the main reason why I tried to switch from rubber to latexmk. However, it seems that the rubber has the following features that are not (yet?) offered by latexmk: Rubber ...


34

You need to write a configuration file that tells latexmk which files are interesting for the glossary and how to handle them. Fortunately, the author provides some sample rc files. Putting add_cus_dep('glo', 'gls', 0, 'makeglo2gls'); sub makeglo2gls { system("makeindex -s '$_[0]'.ist -t '$_[0]'.glg -o '$_[0]'.gls '$_[0]'.glo"); } in ~/.latexmkrc (...


33

You can use Lua(La)TeX with latexmk by setting the -pdflatex parameter: -pdflatex=<program> - set program used for pdflatex. (replace '<program>' by the program name) So latexmk should call lualatex instead of pdflatex if you invoke it like this: latexmk -pdflatex=lualatex -pdf <texfile> or with newer ...


24

As of May 17, 2012, the external lib comes with support for both checksum checks and diff-based checks (CVS version at the time of this writing). With this version, the picture's content is compared against the state of the most recent successfull image externalization. Changes in the picture's content will automatically cause a remake for both mode=list ...


22

One important advantage of latexmk over rubber is that latexmk detects dependent files much more reliably. As best as I have been able to work out, rubber determines the dependent files by parsing the tex file, by looking for \input, \include and \includegraphics macros. But if these macros are buried inside another macro, rubber doesn't detect the ...


19

Latexmk also brings an auto-preview feature, which recompiles (smartly) the pdf as soon as the tex is saved. There are also more advanced features, like tight integration with makefiles for example.


18

I've made a new version of latexmk, which supports -aux-directory and -output-directory. It's v. 4.27a and can be found at http://www.phys.psu.edu/~collins/latexmk/versions.html This version will be submitted to CTAN fairly soon, but some feedback would be useful, since I have not tested the new features extensively, especially as I don't have current ...


16

"precompile" is probably a slightly confusing phrase to use as TeX is not a compiler but (mostly) a macro expansion language, but anyway... In general you can dump most macro definitions and register assignments into a format. What you can't do is ship out pages. So in practice you can dump most LaTeX preambles. Rather than having to edit the file so that ...


15

The most commonly used are Evince and Okular (whether you are respectively using GNOME/XFCE or KDE).


15

By default, latexmk treats .bbl files as non-regeneratable. This is because the .bib from which they are made is not always available. See the documentation for a fuller explanation, especially the explanation of the $bibtex_use variable. To get latexmk -C to delete .bbl files, put the following in an initialization file: $bibtex_use = 2;


15

(As the author of latexmk, I am naturally partial to my own program, but here's my 2-cents' worth anyway.) The fundamental problem that latexmk solves is that the number of runs of (pdf)latex needed is highly dynamically dependent on the document and the class file used. If you make a small change to a document, often only one recompilation by (pdf)latex ...


14

If you look carefully at the output from the run, you'll see that on the first run, pdflatex detects a first missing file. Since nonstopmode is being used, that causes a fatal error, and pdflatex goes no further. Then latexmk sees a message about a single missing file, makes it, and repeats the run. Then an error comes up about the second missing file, ...


14

The reason latexmk keeps re-running is because the generated a-pics.pdf file keeps changing on every run. There are lines in the PDF file with creation dates, modification dates and IDs that keep changing. There are two possible solutions. Tell latexmk to ignore a-pics.pdf completely from its dependency database. I do not know how to do this. Tell latexmk ...


14

Yes, you can use latexmk -C (or -c) just to clean up auxiliary files. By default, -c cleans up the following files types: @generated_exts = ( 'aux', 'bcf', 'fls', 'idx', 'ind', 'lof', 'lot', 'out', 'toc' ); (latexmk.pl, l. 1088f) -C also cleans up the actual output, i.e pdf, dvi, or what have you. If you want to add more file extensions ...


14

A simpler solution is latexmk -pvc -pdf -xelatex -interaction=nonstopmode foo.tex


14

You need $pdf_mode = 1; to enable pdf mode. The manual says it is the same as the option: ... Equivalent to the -pdf-, -pdf, -pdfdvi, -pdfps options. A sensible place to store the configuration file is $HOME/.latexmkrc Here is my complete .latexmkrc file: $recorder = 1; $pdf_mode = 1; $bibtex_use = 2; $pdflatex = "pdflatex --shell-escape %O %S"...


13

As this is still very high on google: LatexMk (since 4.31) supports the -xelatex option and auto-detects biber. Therefore, in the fabulous world of 2015: $ latexmk -xelatex biberedtexfile.tex works fine.


12

Here's a little perl script that might get you started. You can use it as perl removelatexcode.pl myfile.tex myfile1.tex and can call it with as many files as you like (or you could pipe into it too). It does the following: copies your input file, myfile.tex to myfile.tex.bak just in case something goes wrong loops through each line in the file, and ...


11

You can use pplatex to filter errors, warnings and badboxes: http://www.stefant.org/web/projects/software/pplatex.html (the compilation of http://dl.dropbox.com/u/12697903/pplatex/pplatex-1.0-rc1-src.tar.gz needs an additional #include in src/outputfilter.cpp) If you then have ppdflatex in the path, you can create a ~/.latexmkrc file like the following to ...


11

You can use latexmk's -jobname option like this: latexmk -pdf -jobname=/path/to/new/output/newfilename currentfile and all of the output files will be routed to the directory specified and given the basename 'newfilename'. E.g., all the files associated with processing currentfile.tex will now be in output/ and be called newfilename.pdf, newfilename.bbl, ...


11

What you forgot is that a custom dependency is intended to have input and output files that differ only in their extensions, e.g., to convert foo.ltx to foo.fmt. But they don't work to convert, for example, fmt/preamble.tex to main.fmt. A second, but less severe, problem is that when pdfLaTeX doesn't find the .fmt file, it dies with an error message to the ...


10

As announced at Use MiKTeX option through latexmk, I've made a new version of latexmk, which supports -output-directory. It's v. 4.27a and can be found at http://www.phys.psu.edu/~collins/latexmk/versions.html (It'll be on CTAN soon.) Just use the following settings in your latexmkrc file $pdflatex="pdflatex -interaction=nonstopmode %O %S"; $out_dir = '...


10

The problem is not specific for latexmk, but related to Skim, the way pdflatex works and how file notifications are implemented in OSX (and its Mach kernel under the hood). The problem is that pdflatex does not change the PDF file in an atomic manner, but during the compilation process more or less continuously updates bits and bytes inside it. The file ...


10

Here's an improved way of using latexmk from within arara (my thanks to Paulo for helping sort out my initial catastrophic mess). First, install aRaRa (you'll never look back) Second, cut-and-paste this into a file in your arara rules directory called xelatexmk.yaml: !config # LaTeXmk with XeTeX rule for arara # author: Brent Longborough # last edited by: ...


10

Update below: The error occurs of two reasons The argument of latexmk doesn't like spaces. (This can be solved) You can't pass options to latexmk. I guess the perl interpreter can handle this. The author of arara mentioned that expansion is being done correctly by arara, the tricky part relies on the replacement code that is submitted to the Perl ...


10

I don't see any way of configuring the current version of latexmk to prevent it doing the extra runs. Not only is makeindex run a second time by latexmk, but so is latex, so the run time is doubled, which is a bad penalty on a large document. To correct this needs changes in latexmk itself. There is enough information in the .log file for latexmk to ...


10

Let my try to solve your issue using arara If you hear arara the first time here a small abstract: arara allows the specification of the compilation steps from the main document This small sentence isn't able to describe the whole power of the tool. Therefor you can have a look at the documentation or the short intro at the homepage: Homepage arara The ...


9

First, look at TeX-command-list to ensure that it has an entry for latexmk. If not, you need to add a line to this variable to allow the executable to be invoked by Auctex; unfortunately this variable is not well-documented (see the manual); I explain a little later. Second, the default program is specified by the variable TeX-command-default. Change this ...



Only top voted, non community-wiki answers of a minimum length are eligible