GithubHelp home page GithubHelp logo

Comments (2)

joel-coffman avatar joel-coffman commented on August 19, 2024

A minimal working example to reproduce this issue would be nice, but yes, Makefile.tex runs pdflatex in draft mode twice before attempting to produce a PDF (i.e., a total of three runs of pdflatex). The multiple runs essentially assume that all documents have some sort of cross-references that should be resolved.

It might make sense to have a draft phony target that compiles once without attempting to resolve any cross references (or handle references, glossaries, indexes, etc.). That is, one could execute make draft to compile a document. Would that be useful?

from latex-incubator.

joel-coffman avatar joel-coffman commented on August 19, 2024

Minimal Working Example

Makefile:

mwe.pdf: mwe.tex
mwe.tex:
	cat > $@ <<< '\documentclass{article}\begin{document}MWE\end{document}'

include $(shell git rev-parse --show-toplevel)/texmf/Makefile.tex

Executing make (technically make --dry-run):

rm -f mwe.sta
TEXINPUTS=.::../texmf//: pdflatex -shell-escape -draftmode mwe.tex
if grep -E '^\\@istfilename' mwe.aux; then makeglossaries -d . mwe && TEXINPUTS=.::../texmf//: pdflatex -shell-escape -draftmode mwe.tex; fi
files=$(sed -n 's/\\@input{\(.*\)}/\1/p' mwe.aux); if grep --quiet -E '\\(citation)' mwe.aux $files; then BIBINPUTS=.::../texmf//: bibtex mwe; fi
TEXINPUTS=.::../texmf//: pdflatex -shell-escape -draftmode mwe.tex
if [ -f mwe.idx ]; then makeindex $(if [[ mwe.tex == *.dtx ]]; then echo -s gind.ist; fi) -o mwe.ind mwe.idx; fi
if [ -f mwe.glo ]; then makeindex -s $(if [[ mwe.tex == *.dtx ]]; then echo gglo; else echo mwe; fi).ist -o mwe.gls mwe.glo; fi
TEXINPUTS=.::../texmf//: pdflatex -shell-escape mwe.tex
while ( grep -q '^LaTeX Warning: Label(s) may have changed' mwe.log ) do TEXINPUTS=.::../texmf//: pdflatex -shell-escape mwe.tex; done

Using -draftmode prevents pdflatex from producing an output PDF. Using draft mode doesn't do much else (see pdflatex -draftmode much slower compared to draft option passed to graphicx and What is the correct way to use draft mode with arara?) and could be omitted, but the later invocations of pdflatex would need to be conditional, using various heuristics to determine if additional runs are needed.

from latex-incubator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.