Tag Info

Hot answers tagged

45

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 ...


34

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 ...


27

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 ...


27

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 ...


26

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 ) { ...


20

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 ...


18

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

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 ...


17

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 ...


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 most commonly used are Evince and Okular (whether you are respectively using GNOME/XFCE or KDE).


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 ...


13

"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 ...


13

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;


12

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 ...


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 ...


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

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

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

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, ...


9

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 = ...


9

LaTeXmk has been removed in r865 of TeXworks. But it should be no big deal to add a new entry to the processing tools.


9

You can also let latexmk call makeglossaries directly by adding the following to your latexmkrc file (in my case I had to add it to $HOME/.latexmkrc): add_cus_dep('glo', 'gls', 0, 'makeglossaries'); add_cus_dep('acn', 'acr', 0, 'makeglossaries'); sub makeglossaries { system "makeglossaries $_[0]"; if ( -z "$_[0].glo" ) { open GLS, ...


9

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 ...


9

The "latexmk -pdflatex='pdflatex -file-line-error' -pdf %s" instruction should contain all options we want to pass to pdflatex at execution time, so "latexmk -pdflatex='pdflatex -file-line-error -synctex=1' -pdf %s" should work. The part within single quotes is the command latexmk will issue for compiling the document.


9

Pandoc accepts many different input formats including LaTeX and can produce a variety of outputs including plain text. To try Pandoc online, visit the Try pandoc! site. As stated on the Pandoc website: If you need to convert files from one markup format into another, pandoc is your swiss-army knife. Pandoc can convert documents in markdown, ...


9

I don't know latexmk, but if you just want to trigger a new ConTeXt run if you modify the source file you can use inotify (assuming you use Linux). This mechanism is not ConTeXt related. Here's a simple example watching the file somefile.tex. file='somefile.tex' while inotifywait --event modify "$file"; do context --batchmode "$file" done You can also ...


9

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


9

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 ...


9

To allow convenient use of latexmk for making/building the project, put a file latexmkrc in the same directory is its primary source file main.tex. For the project described in the question, appropriate contents of latexmkrc are $pdf_mode = 1; $dvi_mode = $postscript_mode = 0; $pdflatex = 'lualatex %O %S'; @default_files = ( 'main.tex' ); The first two ...



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