Tag Info

Hot answers tagged

41

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


31

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


26

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>


25

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


21

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


17

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


17

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


16

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

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


12

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


12

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

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


12

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


11

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


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

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

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

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


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

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


8

Yes, I have changed the bundled version of latexmk to a symbolic link to TexLive's version. This works well, but is slightly difficult to instruct how to do as there are many potential locations for your LaTeX.tmbundle. Personally, I recommend grabbing the latest version from GitHub and placing it in ~/Library/Application Support/TextMate/Bundles/ ...


8

I just remembered that rubber has log filtering. It turns out there is a program in the rubber package called rubber-info which is solely for parsing the log file. Because latexmk acts as tee (writing the to the logfile and printing to stdout and stderr, we can run rubber-info after latexmk is finished. So I put this in a shell script: #! /bin/bash ...


8

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


8

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


7

There's \batchmode, which will disable terminal output and pretend you just pressed enter on every error message, but it won't save you from infinite loops. (There's also \nonstopmode, which I believe does the same with terminal output.) There are usually corresponding command line switches, --interaction=batchmode or --batchmode


7

exists $generated_log{"$bbl_base.bcf"} does a test if the list of files %generated_log includes an entry for "$bbl_base.bcf". From my point of view such an entry is missing in the list %generated_log, the reason why the call fails. If you test it with -e which does in general the same, it works in fact of the now missing check of %generated_log. You should ...



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