Timestamp-based compilation

40 views
Skip to first unread message

Joshua Spence

unread,
Jun 23, 2012, 8:16:21 PM6/23/12
to latex-makef...@googlegroups.com
Is it possible to have the latex-makefile only recompile the LaTeX document if the source files have changed (based on timestamps) in the same manner that make itself supports?

Does LaTeX even support this? I have a document with multiple .tex source files that are included into the main document. One particular source file takes a while to compile (as it is doing some manipulation of large data sets) and I don't really want to have to compile this each time.

At the very least it would be nice to have the latex-makefile be aware of changes in the whole document (if not each source file), such that running the command "make && make" would only compile the document once.

I believe latexmk has some of these features. Unfortunately though, the output of latexmk is very ugly and littered with meaningless errors and warnings from early invocations of the latex command.

Chris Monson

unread,
Jun 25, 2012, 3:32:23 AM6/25/12
to jo...@joshuaspence.com, latex-makef...@googlegroups.com

This should already be working, though we found some bugs in it.  If you could try out version 2.2.1-alpha9 and let me know if that fixes your problem, that would be great.

--
-- You received this message because you are subscribed to the Google Groups latex-makefile-discuss group. To post to this group, send email to latex-makef...@googlegroups.com. To unsubscribe from this group, send email to latex-makefile-di...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/latex-makefile-discuss?hl=en-US

Joshua Spence

unread,
Jun 25, 2012, 5:40:56 AM6/25/12
to latex-makef...@googlegroups.com, jo...@joshuaspence.com
No luck. Here is the output of running make with verbose and shell_debug turned on.

+ which tput
+ /usr/bin/tput setaf 0
+ /usr/bin/tput setaf 1
+ /usr/bin/tput setaf 2
+ /usr/bin/tput setaf 3
+ /usr/bin/tput setaf 4
+ /usr/bin/tput setaf 5
+ /usr/bin/tput setaf 6
+ /usr/bin/tput setaf 7
+ /usr/bin/tput bold
+ /usr/bin/tput smul
+ /usr/bin/tput sgr0
+ kpsewhich nomencl.ist
+ kpsewhich nomencl.ist
echo "= thesis.tex --> thesis.d thesis.pdf.1st.make (0-1) ="
+ echo = thesis.tex --> thesis.d thesis.pdf.1st.make (0-1) =
= thesis.tex --> thesis.d thesis.pdf.1st.make (0-1) =
\
export run_reason="need to build .d and .pdf.1st.make"; \
pdflatex -jobname='thesis' -interaction=batchmode -file-line-error  -recorder thesis > /dev/null;  : || :; \
cp -f 'thesis.log' 'thesis.0-1.log'; \
if egrep -s '/import.sty\)' 'thesis.log'; then echo "import.sty is not supported - included files must"; echo "be in the same directory as the primary document"; exit 1; fi; \
if egrep -q ' LaTeX Error: File .*\.dot_t.* not found' thesis.log; then echo "Missing dot_t file(s)"; echo "Please run"; echo "  make all-dot2tex"; echo "before proceeding."; exit 1; fi; \
if [ ! -e 'thesis.aux' ]; then sed -e '${' -e '  /^$/!{' -e '    H' -e '    s/.*//' -e '  }' -e '}' -e '/^$/!{' -e '  H' -e '  d' -e '}' -e '/^$/{' -e '  x' -e '  s/^\(\n\)\(.*\)/\2\1/' -e '}' -e '/^::P\(P\{1,\}\)::/{' -e '  s//::\1::/' -e '  G' -e '  h' -e '  d' -e '}' -e '/^::P::/{' -e '  s//::0::/' -e '  G' -e '}' -e 'b start' -e ':needonemore' -e 's/^/::P::/' -e 'G' -e 'h' -e 'd' -e ':needtwomore' -e 's/^/::PP::/' -e 'G' -e 'h' -e 'd' -e ':needthreemore' -e 's/^/::PPP::/' -e 'G' -e 'h' -e 'd' -e ':start' -e '/^! LaTeX Error: File /{' -e '  s/\n//g' -e '  b needtwomore' -e '}' -e 's/^[^[:cntrl:]:]*:[[:digit:]]\{1,\}:/!!! &/' -e 's/^\(.*\n\)\([^[:cntrl:]:]*:[[:digit:]]\{1,\}: .*\)/\1!!! \2/' -e '/^!!! .*[[:space:][:cntrl:]]LaTeX[[:space:][:cntrl:]]Error:[[:space:][:cntrl:]]*File /{' -e '  s/\n//g' -e '  b needonemore' -e '}' -e '/^::0::! LaTeX Error: File .*/{' -e '  /\n\n$/{' -e '    s/^::0:://' -e '    b needonemore' -e '  }' -e '  s/^::0::! //' -e '  s/^\(.*not found.\).*Enter file name:.*\n\(.*[[:digit:]]\{1,\}\): Emergency stop.*/\2: \1/' -e '  b error' -e '}' -e '/^::0::!!! .*LaTeX Error: File .*/{' -e '  /\n\n$/{' -e '    s/^::0:://' -e '    b needonemore' -e '  }' -e '  s/::0::!!! //' -e '  /File .*\.e\{0,1\}ps'"'"' not found/b skip' -e '  /could not locate.*any of these extensions:/{' -e '    b skip' -e '  }' -e '  s/\(not found\.\).*/\1/' -e '  s/^/!!! /' -e '  b error' -e '}' -e '/^\(.* LaTeX Error: Missing .begin.document.\.\).*/{' -e '  s//\1 --- Are you trying to build an include file?/' -e '  b error' -e '}' -e '/.*\(!!! .*Undefined control sequence\)[^[:cntrl:]]*\(.*\)/{' -e '  s//\1: \2/' -e '  s/\nl\.[[:digit:]][^[:cntrl:]]*\(\\[^\\[:cntrl:]]*\).*/\1/' -e '  b error' -e '}' -e '/^\(!pdfTeX error:.*\)s*/{' -e '  b error' -e '}' -e '/.*\(!!! .*\)/{' -e '  s//\1/' -e '  s/[[:cntrl:]]//' -e '  s/[[:cntrl:]]$//' -e '  /Cannot determine size of graphic .*(no BoundingBox)/b skip' -e '  b error' -e '}' -e ':skip' -e 'd' -e ':error' -e 's/^!\(!! \)\{0,1\}\(.*\)/\2/' -e 'p' -e 'd' 'thesis.log' | sed -e 's/\\\\/\\\\\\\\/g'; echo "Error: failed to create thesis.aux"; exit 1; fi; \
sed -e '/\\@input{\(.*\)}/{' -e '  s//\1/' -e '  s![.:]!\\&!g' -e '  h' -e '  s!.*!\\:\\\\@input{&}:{!' -e '  p' -e '  x' -e '  s/\\././g' -e '  s/.*/r &/p' -e '  s/.*/d/p' -e '  s/.*/}/p' -e '  d' -e '}' -e 'd' 'thesis.aux' > "thesis.aux.$$.sed.make"; sed -f "thesis.aux.$$.sed.make" 'thesis.aux' > "thesis.aux.$$.make"; sed -e '/^\\relax/d' -e '/^\\bibcite/d' -e 's/^\(\\newlabel{[^}]\{1,\}}\).*/\1/' "thesis.aux.$$.make" | sort > 'thesis.aux.make'; rm -f thesis.aux.$$.make thesis.aux.$$.sed.make; \
echo "# vim: ft=make" > thesis.d; \
echo ".PHONY: thesis._graphics" >> thesis.d; \
sed -e '/^INPUT/!d' -e 's!^INPUT \(\./\)\{0,1\}!!' -e 's/[[:space:]]/\\ /g' -e 's/\(.*\)\.aux$/\1.tex/' -e '/\.tex$/b addtargets' -e '/\.cls$/b addtargets' -e '/\.sty$/b addtargets' -e '/\.pstex_t$/b addtargets' -e '/\.dot_t$/b addtargets' -e 'd' -e ':addtargets' -e 's!.*!thesis.aux thesis.aux.make thesis.d thesis.pdf: $(call path-norm,&)!' 'thesis.fls' | sort | uniq >> thesis.d; \
sed -e '1!d' -e '/^%&\([[:alnum:]]\{1,\}\)\( .*\)*$/{' -e '  s!!\1!' -e '  h' -e '  s/.*/# MISSING format "&.fmt" (comment forces rebuild of target file)/' -e '  p' -e '  g' -e '  s!.*!thesis.fls thesis.aux thesis.aux.make thesis.d thesis.pdf thesis.pdf.1st.make: $(call path-norm,&.fmt)!' -e '  p' -e '}' -e 'd' 'thesis.tex' >> thesis.d; \
sed -e '${' -e '  /^$/!{' -e '    H' -e '    s/.*//' -e '  }' -e '}' -e '/^$/!{' -e '  H' -e '  d' -e '}' -e '/^$/{' -e '  x' -e '  s/^\(\n\)\(.*\)/\2\1/' -e '}' -e '/^::P\(P\{1,\}\)::/{' -e '  s//::\1::/' -e '  G' -e '  h' -e '  d' -e '}' -e '/^::P::/{' -e '  s//::0::/' -e '  G' -e '}' -e 'b start' -e ':needonemore' -e 's/^/::P::/' -e 'G' -e 'h' -e 'd' -e ':needtwomore' -e 's/^/::PP::/' -e 'G' -e 'h' -e 'd' -e ':needthreemore' -e 's/^/::PPP::/' -e 'G' -e 'h' -e 'd' -e ':start' -e '/^! LaTeX Error: File `/{' -e '  b needtwomore' -e '}' -e '/^::0::\(.*\)/{' -e '  s//\1/' -e '  /Default extension: /!d' -e '  s/.*File `\([^'"'"']*\)'"'"' not found.*/\1/' -e '  s/[[:cntrl:]]//' -e '  /\.tex/!s/$/.tex/' -e '  s/[[:space:]]/\\ /g' -e '  h' -e '  s/.*/# MISSING input "&" - (presence of comment affects build)/' -e '  p' -e '  s/.*//' -e '  x' -e '  s!^.*!thesis.aux thesis.aux.make thesis.d thesis.pdf: $(call path-norm,&)!' -e '  p' -e '}' -e 'd' 'thesis.log' | sort | uniq >> thesis.d; \
echo ".SECONDEXPANSION:" >> thesis.d; \
sed -e '/^File: \(.*\) Graphic file (type [^)]*)/{' -e '  s//\1/' -e '  s/\.e\{0,1\}ps$//' -e '  b addtargets' -e '}' -e '${' -e '  /^$/!{' -e '    H' -e '    s/.*//' -e '  }' -e '}' -e '/^$/!{' -e '  H' -e '  d' -e '}' -e '/^$/{' -e '  x' -e '  s/^\(\n\)\(.*\)/\2\1/' -e '}' -e '/^::P\(P\{1,\}\)::/{' -e '  s//::\1::/' -e '  G' -e '  h' -e '  d' -e '}' -e '/^::P::/{' -e '  s//::0::/' -e '  G' -e '}' -e 'b start' -e ':needonemore' -e 's/^/::P::/' -e 'G' -e 'h' -e 'd' -e ':needtwomore' -e 's/^/::PP::/' -e 'G' -e 'h' -e 'd' -e ':needthreemore' -e 's/^/::PPP::/' -e 'G' -e 'h' -e 'd' -e ':start' -e '/^[^[:cntrl:]:]*:[[:digit:]]\{1,\}:[[:space:][:cntrl:]]*LaTeX[[:space:][:cntrl:]]*Error:[[:space:][:cntrl:]]*File `/{' -e '  s/\n//g' -e '  b needonemore' -e '}' -e '/^::0::.*: LaTeX Error: File `/{' -e '  /\n\n$/{' -e '    s/^::0:://' -e '    b needonemore' -e '  }' -e '  s/\n\{1,\}/ /g' -e '  s/[[:space:]]\{1,\}/ /g' -e '  s/^.*File `//' -e '  /extensions: /{' -e '    s/'"'"' not found\..*extensions: \([^[:space:]]*\).*/::::\1/' -e '    b fileparsed' -e '  }' -e '  s/'"'"' not found\..*/::::/' -e '  :fileparsed' -e '  s/\.e\{0,1\}ps::::$/::::/' -e '  h' -e '  s/\(.*\)::::\(.*\)/# MISSING stem "\1" - allowed extensions are "\2" - leave comment here - it affects the build/' -e '  p' -e '  g' -e '  s/::::.*//' -e '  b addtargets' -e '}' -e 'd' -e ':addtargets' -e 's/[[:space:]]/\\\\\\&/g' -e 'h' -e 's/.*/-include &.gpi.d/' -e 'p' -e 'g' -e 's!.*!thesis.d: $$(call graphics-source,&)!' -e 'p' -e 's/.*//' -e 'x' -e 's!.*!thesis.pdf thesis._graphics: $$(call graphics-target,&)!' -e 'p' -e 'd' thesis.log >> thesis.d; \
sed -e 's/^No file \(.*\.ind\)\.$/TARGETS=\1/' -e 's/^No file \(.*\.[gn]ls\)\.$/TARGETS=\1/' -e 's/[[:space:]]/\\&/g' -e '/^TARGETS=/{' -e '  h' -e '  s!^TARGETS=!thesis.aux thesis.aux.make: !p' -e '  g' -e '  s!^TARGETS=\(.*\)!\1: thesis.tex!p' -e '}' -e 'd' 'thesis.log' | sort | uniq >> thesis.d; \
sed -e '/^\\bibdata/!d' -e 's/\\bibdata{\([^}]*\)}/\1,/' -e 's/,\{2,\}/,/g' -e 's/[[:space:]]/\\&/g' -e 's/,/.bib /g' -e 's/ \{1,\}$//' 'thesis.aux.make' | xargs kpsewhich '#######' | sed -e 's!.*!thesis.bbl thesis.aux thesis.aux.make: $(call path-norm,&)!' | sort | uniq >> thesis.d; \
egrep -q "# MISSING stem" thesis.d && sleep 1 && rm -f thesis.pdf; \
egrep -q "# MISSING format" thesis.d && rm -f thesis.pdf; \
[ -e 'thesis.pdf' ] && mv -f 'thesis.pdf' 'thesis.pdf.1st.make'; \
for s in toc out lot lof lol nav; do \
if [ -e "thesis.$s" ]; then \
if ! diff -q thesis.$s thesis.$s.make >/dev/null 2>&1; then \
touch thesis.run.cookie; \
fi; \
cp -f thesis.$s thesis.$s.make; \
fi; \
done
+ export run_reason=need to build .d and .pdf.1st.make
+ pdflatex -jobname=thesis -interaction=batchmode -file-line-error -recorder thesis
+ :
+ cp -f thesis.log thesis.0-1.log
+ egrep -s /import.sty\) thesis.log
+ egrep -q  LaTeX Error: File .*\.dot_t.* not found thesis.log
+ [ ! -e thesis.aux ]
+ sed -e /\\@input{\(.*\)}/{ -e   s//\1/ -e   s![.:]!\\&!g -e   h -e   s!.*!\\:\\\\@input{&}:{! -e   p -e   x -e   s/\\././g -e   s/.*/r &/p -e   s/.*/d/p -e   s/.*/}/p -e   d -e } -e d thesis.aux
+ sed -f thesis.aux.14639.sed.make thesis.aux
+ sed -e /^\\relax/d -e /^\\bibcite/d -e s/^\(\\newlabel{[^}]\{1,\}}\).*/\1/ thesis.aux.14639.make
+ sort
+ rm -f thesis.aux.14639.make thesis.aux.14639.sed.make
+ echo # vim: ft=make
+ echo .PHONY: thesis._graphics
+ sed -e /^INPUT/!d -e s!^INPUT \(\./\)\{0,1\}!! -e s/[[:space:]]/\\ /g -e s/\(.*\)\.aux$/\1.tex/ -e /\.tex$/b addtargets -e /\.cls$/b addtargets -e /\.sty$/b addtargets -e /\.pstex_t$/b addtargets -e /\.dot_t$/b addtargets -e d -e :addtargets -e s!.*!thesis.aux thesis.aux.make thesis.d thesis.pdf: $(call path-norm,&)! thesis.fls
+ uniq
+ sed -e 1!d -e /^%&\([[:alnum:]]\{1,\}\)\( .*\)*$/{ -e   s!!\1! -e   h -e   s/.*/# MISSING format "&.fmt" (comment forces rebuild of target file)/ -e   p -e   g -e   s!.*!thesis.fls thesis.aux thesis.aux.make thesis.d thesis.pdf thesis.pdf.1st.make: $(call path-norm,&.fmt)! -e   p -e } -e d thesis.tex
+ sort
+ sed -e ${ -e   /^$/!{ -e     H -e     s/.*// -e   } -e } -e /^$/!{ -e   H -e   d -e } -e /^$/{ -e   x -e   s/^\(\n\)\(.*\)/\2\1/ -e } -e /^::P\(P\{1,\}\)::/{ -e   s//::\1::/ -e   G -e   h -e   d -e } -e /^::P::/{ -e   s//::0::/ -e   G -e } -e b start -e :needonemore -e s/^/::P::/ -e G -e h -e d -e :needtwomore -e s/^/::PP::/ -e G -e h -e d -e :needthreemore -e s/^/::PPP::/ -e G -e h -e d -e :start -e /^! LaTeX Error: File `/{ -e   b needtwomore -e } -e /^::0::\(.*\)/{ -e   s//\1/ -e   /Default extension: /!d -e   s/.*File `\([^']*\)' not found.*/\1/ -e   s/[[:cntrl:]]// -e   /\.tex/!s/$/.tex/ -e   s/[[:space:]]/\\ /g -e   h -e   s/.*/# MISSING input "&" - (presence of comment affects build)/ -e   p -e   s/.*// -e   x -e   s!^.*!thesis.aux thesis.aux.make thesis.d thesis.pdf: $(call path-norm,&)! -e   p -e } -e d thesis.log
+ uniq
+ echo .SECONDEXPANSION:
+ sed -e /^File: \(.*\) Graphic file (type [^)]*)/{ -e   s//\1/ -e   s/\.e\{0,1\}ps$// -e   b addtargets -e } -e ${ -e   /^$/!{ -e     H -e     s/.*// -e   } -e } -e /^$/!{ -e   H -e   d -e } -e /^$/{ -e   x -e   s/^\(\n\)\(.*\)/\2\1/ -e } -e /^::P\(P\{1,\}\)::/{ -e   s//::\1::/ -e   G -e   h -e   d -e } -e /^::P::/{ -e   s//::0::/ -e   G -e } -e b start -e :needonemore -e s/^/::P::/ -e G -e h -e d -e :needtwomore -e s/^/::PP::/ -e G -e h -e d -e :needthreemore -e s/^/::PPP::/ -e G -e h -e d -e :start -e /^[^[:cntrl:]:]*:[[:digit:]]\{1,\}:[[:space:][:cntrl:]]*LaTeX[[:space:][:cntrl:]]*Error:[[:space:][:cntrl:]]*File `/{ -e   s/\n//g -e   b needonemore -e } -e /^::0::.*: LaTeX Error: File `/{ -e   /\n\n$/{ -e     s/^::0::// -e     b needonemore -e   } -e   s/\n\{1,\}/ /g -e   s/[[:space:]]\{1,\}/ /g -e   s/^.*File `// -e   /extensions: /{ -e     s/' not found\..*extensions: \([^[:space:]]*\).*/::::\1/ -e     b fileparsed -e   } -e   s/' not found\..*/::::/ -e   :fileparsed -e   s/\.e\{0,1\}ps::::$/::::/ -e   h -e   s/\(.*\)::::\(.*\)/# MISSING stem "\1" - allowed extensions are "\2" - leave comment here - it affects the build/ -e   p -e   g -e   s/::::.*// -e   b addtargets -e } -e d -e :addtargets -e s/[[:space:]]/\\\\\\&/g -e h -e s/.*/-include &.gpi.d/ -e p -e g -e s!.*!thesis.d: $$(call graphics-source,&)! -e p -e s/.*// -e x -e s!.*!thesis.pdf thesis._graphics: $$(call graphics-target,&)! -e p -e d thesis.log
+ sort
+ uniq
+ sed -e s/^No file \(.*\.ind\)\.$/TARGETS=\1/ -e s/^No file \(.*\.[gn]ls\)\.$/TARGETS=\1/ -e s/[[:space:]]/\\&/g -e /^TARGETS=/{ -e   h -e   s!^TARGETS=!thesis.aux thesis.aux.make: !p -e   g -e   s!^TARGETS=\(.*\)!\1: thesis.tex!p -e } -e d thesis.log
+ xargs kpsewhich #######
+ sed -e s!.*!thesis.bbl thesis.aux thesis.aux.make: $(call path-norm,&)!
+ uniq
+ sort
+ sed -e /^\\bibdata/!d -e s/\\bibdata{\([^}]*\)}/\1,/ -e s/,\{2,\}/,/g -e s/[[:space:]]/\\&/g -e s/,/.bib /g -e s/ \{1,\}$// thesis.aux.make
+ egrep -q # MISSING stem thesis.d
+ egrep -q # MISSING format thesis.d
+ [ -e thesis.pdf ]
+ mv -f thesis.pdf thesis.pdf.1st.make
+ [ -e thesis.toc ]
+ diff -q thesis.toc thesis.toc.make
+ cp -f thesis.toc thesis.toc.make
+ [ -e thesis.out ]
+ diff -q thesis.out thesis.out.make
+ cp -f thesis.out thesis.out.make
+ [ -e thesis.lot ]
+ diff -q thesis.lot thesis.lot.make
+ cp -f thesis.lot thesis.lot.make
+ [ -e thesis.lof ]
+ diff -q thesis.lof thesis.lof.make
+ cp -f thesis.lof thesis.lof.make
+ [ -e thesis.lol ]
+ [ -e thesis.nav ]
\
sed -e '/^\\newlabel/d' thesis.aux.make > thesis.auxbbl.make.temp; \
! diff -q 'thesis.auxbbl.make.temp' 'thesis.auxbbl.make' >/dev/null 2>&1 && mv -f 'thesis.auxbbl.make.temp' 'thesis.auxbbl.make' || :
+ sed -e /^\\newlabel/d thesis.aux.make
+ diff -q thesis.auxbbl.make.temp thesis.auxbbl.make
+ mv -f thesis.auxbbl.make.temp thesis.auxbbl.make
\
echo "= thesis-blx.bib thesis.aux --> thesis.bbl ="; export run_reason="dependencies of thesis.bbl changed"; bibtex thesis | sed -e 's/^Warning--.*/&/' -e 't' -e '/---/,/^.[^:]/{' -e '  H' -e '  /^.[^:]/{' -e '    x' -e '    s/\n\(.*\)/\1/' -e '    p' -e '    s/.*//' -e '    h' -e '    d' -e '  }' -e '  d' -e '}' -e '/(.*error.*)/s//&/' -e 'd';  :; touch thesis.bbl.cookie;  \
if egrep -q 'bibstyle.(apacite|apacann|chcagoa|[^}]*annot)' 'thesis.aux'; then \
echo "= ** annotated extra latex ** --> output ignored (0-1) ="; \
pdflatex -jobname='thesis' -interaction=batchmode -file-line-error   thesis > /dev/null;  :; \
cp -f 'thesis.log' 'thesis.0-annotated.log'; \
echo "= ** annotated extra bibtex ** thesis-blx.bib thesis.aux --> thesis.bbl ="; bibtex thesis | sed -e 's/^Warning--.*/&/' -e 't' -e '/---/,/^.[^:]/{' -e '  H' -e '  /^.[^:]/{' -e '    x' -e '    s/\n\(.*\)/\1/' -e '    p' -e '    s/.*//' -e '    h' -e '    d' -e '  }' -e '  d' -e '}' -e '/(.*error.*)/s//&/' -e 'd';  :; touch thesis.bbl.cookie;  \
echo "= ** annotated extra latex ** --> output ignored (0-2) ="; \
pdflatex -jobname='thesis' -interaction=batchmode -file-line-error   thesis > /dev/null;  :; \
fi
+ echo = thesis-blx.bib thesis.aux --> thesis.bbl =
= thesis-blx.bib thesis.aux --> thesis.bbl =
+ export run_reason=dependencies of thesis.bbl changed
+ bibtex thesis
+ sed -e s/^Warning--.*/&/ -e t -e /---/,/^.[^:]/{ -e   H -e   /^.[^:]/{ -e     x -e     s/\n\(.*\)/\1/ -e     p -e     s/.*// -e     h -e     d -e   } -e   d -e } -e /(.*error.*)/s//&/ -e d
+ :
+ touch thesis.bbl.cookie
+ egrep -q bibstyle.(apacite|apacann|chcagoa|[^}]*annot) thesis.aux
\
fatal=`sed -e '${' -e '  /^$/!{' -e '    H' -e '    s/.*//' -e '  }' -e '}' -e '/^$/!{' -e '  H' -e '  d' -e '}' -e '/^$/{' -e '  x' -e '  s/^\(\n\)\(.*\)/\2\1/' -e '}' -e '/^::P\(P\{1,\}\)::/{' -e '  s//::\1::/' -e '  G' -e '  h' -e '  d' -e '}' -e '/^::P::/{' -e '  s//::0::/' -e '  G' -e '}' -e 'b start' -e ':needonemore' -e 's/^/::P::/' -e 'G' -e 'h' -e 'd' -e ':needtwomore' -e 's/^/::PP::/' -e 'G' -e 'h' -e 'd' -e ':needthreemore' -e 's/^/::PPP::/' -e 'G' -e 'h' -e 'd' -e ':start' -e '/^! LaTeX Error: File /{' -e '  s/\n//g' -e '  b needtwomore' -e '}' -e 's/^[^[:cntrl:]:]*:[[:digit:]]\{1,\}:/!!! &/' -e 's/^\(.*\n\)\([^[:cntrl:]:]*:[[:digit:]]\{1,\}: .*\)/\1!!! \2/' -e '/^!!! .*[[:space:][:cntrl:]]LaTeX[[:space:][:cntrl:]]Error:[[:space:][:cntrl:]]*File /{' -e '  s/\n//g' -e '  b needonemore' -e '}' -e '/^::0::! LaTeX Error: File .*/{' -e '  /\n\n$/{' -e '    s/^::0:://' -e '    b needonemore' -e '  }' -e '  s/^::0::! //' -e '  s/^\(.*not found.\).*Enter file name:.*\n\(.*[[:digit:]]\{1,\}\): Emergency stop.*/\2: \1/' -e '  b error' -e '}' -e '/^::0::!!! .*LaTeX Error: File .*/{' -e '  /\n\n$/{' -e '    s/^::0:://' -e '    b needonemore' -e '  }' -e '  s/::0::!!! //' -e '  /File .*\.e\{0,1\}ps'"'"' not found/b skip' -e '  /could not locate.*any of these extensions:/{' -e '    b skip' -e '  }' -e '  s/\(not found\.\).*/\1/' -e '  s/^/!!! /' -e '  b error' -e '}' -e '/^\(.* LaTeX Error: Missing .begin.document.\.\).*/{' -e '  s//\1 --- Are you trying to build an include file?/' -e '  b error' -e '}' -e '/.*\(!!! .*Undefined control sequence\)[^[:cntrl:]]*\(.*\)/{' -e '  s//\1: \2/' -e '  s/\nl\.[[:digit:]][^[:cntrl:]]*\(\\[^\\[:cntrl:]]*\).*/\1/' -e '  b error' -e '}' -e '/^\(!pdfTeX error:.*\)s*/{' -e '  b error' -e '}' -e '/.*\(!!! .*\)/{' -e '  s//\1/' -e '  s/[[:cntrl:]]//' -e '  s/[[:cntrl:]]$//' -e '  /Cannot determine size of graphic .*(no BoundingBox)/b skip' -e '  b error' -e '}' -e ':skip' -e 'd' -e ':error' -e 's/^!\(!! \)\{0,1\}\(.*\)/\2/' -e 'p' -e 'd' 'thesis.log' | sed -e 's/\\\\/\\\\\\\\/g'`; \
if [ x"$fatal" != x"" ]; then \
echo "$fatal"; \
exit 1; \
fi; \
sed -e '/^\\newlabel/!d' thesis.aux.make > thesis.auxtarget.cookie; \
run=0; \
for i in 1; do \
if [ -e 'thesis.bbl.cookie' ]; then \
export run_reason="thesis.bbl.cookie is present"; \
run=1; \
break; \
fi; \
if [ -e 'thesis.run.cookie' ]; then \
export run_reason="thesis.run.cookie is present"; \
run=1; \
    break; \
fi; \
if [ -e 'thesis.auxtarget.make' ] && ! diff -q 'thesis.auxtarget.cookie' 'thesis.auxtarget.make' >/dev/null 2>&1;\
then \
export run_reason="thesis.auxtarget.cookie differs from thesis.auxtarget.make"; \
run=1; \
break; \
fi; \
if sed -e '/^No file thesis\.aux\./d' thesis.log | egrep '^(.*Rerun .*|No file thesis\.[^.]+\.|No file .+\.tex\.|LaTeX Warning: File.*)$' | egrep -q -v '^(Package: rerunfilecheck.*Rerun checks for auxiliary files.*)$'; then \
export run_reason="thesis.log indicated that this is necessary"; \
run=1; \
break; \
fi; \
if [ ! -e 'thesis.pdf.1st.make' ]; then \
export run_reason="thesis.pdf.1st.make does not exist"; \
run=1; \
break; \
fi; \
done; \
rm -f thesis.bbl.cookie thesis.run.cookie; \
mv -f thesis.auxtarget.cookie thesis.auxtarget.make; \
if [ x"$run" = x"1" ]; then \
:; \
for i in 2 3 4 5; do \
echo "= thesis.tex --> thesis.pdf (0-$i) =" ; \
pdflatex -jobname='thesis' -interaction=batchmode -file-line-error   thesis > /dev/null;  :; \
cp -f 'thesis.log' 'thesis.'0-$i'.log'; \
if egrep '^(.*Rerun .*|No file thesis\.[^.]+\.)$' thesis.log | egrep -q -v '^(Package: rerunfilecheck.*Rerun checks for auxiliary files.*)$'; then \
export run_reason="rerun requested by thesis.log"; \
else \
break; \
fi; \
done; \
else \
mv -f 'thesis.pdf.1st.make' 'thesis.pdf'; \
fi; \
if [ -d '_out_/' ]; then if cp -f 'thesis.pdf' '_out_/'; then echo "Copied 'thesis.pdf' to '_out_/'"; else echo "Failed to copy 'thesis.pdf' to '_out_/'"; fi; fi; \
sed -e '${' -e '  /^$/!{' -e '    H' -e '    s/.*//' -e '  }' -e '}' -e '/^$/!{' -e '  H' -e '  d' -e '}' -e '/^$/{' -e '  x' -e '  s/^\n//' -e '  /Output written on /{' -e '    s/.*Output written on \([^(]*\) (\([^)]\{1,\}\)).*/Success!  Wrote \2 to \1/' -e '    s/[[:digit:]]\{1,\}/&/g' -e '    s/Success!/&/g' -e '    s/to \(.*\)$/to \1/' -e '    b end' -e '  }' -e '  / *LaTeX Error:.*/{' -e '    s/.*\( *LaTeX Error:.*\)/\1/' -e '    b error' -e '  }' -e '  /^[^[:cntrl:]:]*:[[:digit:]]\{1,\}:/b error' -e '  /.*Warning:.*/{' -e '    s//&/' -e '    b end' -e '  }' -e '  /Underfull.*/{' -e '    s/.*\(Underfull.*\)/\1/' -e '    b end' -e '  }' -e '  /Overfull.*/{' -e '    s/.*\(Overfull.*\)/\1/' -e '    b end' -e '  }' -e '  d' -e '  :error' -e '  s/.*/&/' -e '  b end' -e '  :end' -e '  G' -e '}' thesis.log
+ sed -e s/\\/\\\\/g
+ sed -e ${ -e   /^$/!{ -e     H -e     s/.*// -e   } -e } -e /^$/!{ -e   H -e   d -e } -e /^$/{ -e   x -e   s/^\(\n\)\(.*\)/\2\1/ -e } -e /^::P\(P\{1,\}\)::/{ -e   s//::\1::/ -e   G -e   h -e   d -e } -e /^::P::/{ -e   s//::0::/ -e   G -e } -e b start -e :needonemore -e s/^/::P::/ -e G -e h -e d -e :needtwomore -e s/^/::PP::/ -e G -e h -e d -e :needthreemore -e s/^/::PPP::/ -e G -e h -e d -e :start -e /^! LaTeX Error: File /{ -e   s/\n//g -e   b needtwomore -e } -e s/^[^[:cntrl:]:]*:[[:digit:]]\{1,\}:/!!! &/ -e s/^\(.*\n\)\([^[:cntrl:]:]*:[[:digit:]]\{1,\}: .*\)/\1!!! \2/ -e /^!!! .*[[:space:][:cntrl:]]LaTeX[[:space:][:cntrl:]]Error:[[:space:][:cntrl:]]*File /{ -e   s/\n//g -e   b needonemore -e } -e /^::0::! LaTeX Error: File .*/{ -e   /\n\n$/{ -e     s/^::0::// -e     b needonemore -e   } -e   s/^::0::! // -e   s/^\(.*not found.\).*Enter file name:.*\n\(.*[[:digit:]]\{1,\}\): Emergency stop.*/\2: \1/ -e   b error -e } -e /^::0::!!! .*LaTeX Error: File .*/{ -e   /\n\n$/{ -e     s/^::0::// -e     b needonemore -e   } -e   s/::0::!!! // -e   /File .*\.e\{0,1\}ps' not found/b skip -e   /could not locate.*any of these extensions:/{ -e     b skip -e   } -e   s/\(not found\.\).*/\1/ -e   s/^/!!! / -e   b error -e } -e /^\(.* LaTeX Error: Missing .begin.document.\.\).*/{ -e   s//\1 --- Are you trying to build an include file?/ -e   b error -e } -e /.*\(!!! .*Undefined control sequence\)[^[:cntrl:]]*\(.*\)/{ -e   s//\1: \2/ -e   s/\nl\.[[:digit:]][^[:cntrl:]]*\(\[^\[:cntrl:]]*\).*/\1/ -e   b error -e } -e /^\(!pdfTeX error:.*\)s*/{ -e   b error -e } -e /.*\(!!! .*\)/{ -e   s//\1/ -e   s/[[:cntrl:]]// -e   s/[[:cntrl:]]$// -e   /Cannot determine size of graphic .*(no BoundingBox)/b skip -e   b error -e } -e :skip -e d -e :error -e s/^!\(!! \)\{0,1\}\(.*\)/\2/ -e p -e d thesis.log
+ fatal=
+ [ x != x ]
+ sed -e /^\\newlabel/!d thesis.aux.make
+ run=0
+ [ -e thesis.bbl.cookie ]
+ export run_reason=thesis.bbl.cookie is present
+ run=1
+ break
+ rm -f thesis.bbl.cookie thesis.run.cookie
+ mv -f thesis.auxtarget.cookie thesis.auxtarget.make
+ [ x1 = x1 ]
+ :
+ echo = thesis.tex --> thesis.pdf (0-2) =
= thesis.tex --> thesis.pdf (0-2) =
+ pdflatex -jobname=thesis -interaction=batchmode -file-line-error thesis
+ :
+ cp -f thesis.log thesis.0-2.log
+ egrep ^(.*Rerun .*|No file thesis\.[^.]+\.)$ thesis.log
+ egrep -q -v ^(Package: rerunfilecheck.*Rerun checks for auxiliary files.*)$
+ break
+ [ -d _out_/ ]
+ sed -e ${ -e   /^$/!{ -e     H -e     s/.*// -e   } -e } -e /^$/!{ -e   H -e   d -e } -e /^$/{ -e   x -e   s/^\n// -e   /Output written on /{ -e     s/.*Output written on \([^(]*\) (\([^)]\{1,\}\)).*/Success!  Wrote \2 to \1/ -e     s/[[:digit:]]\{1,\}/&/g -e     s/Success!/&/g -e     s/to \(.*\)$/to \1/ -e     b end -e   } -e   / *LaTeX Error:.*/{ -e     s/.*\( *LaTeX Error:.*\)/\1/ -e     b error -e   } -e   /^[^[:cntrl:]:]*:[[:digit:]]\{1,\}:/b error -e   /.*Warning:.*/{ -e     s//&/ -e     b end -e   } -e   /Underfull.*/{ -e     s/.*\(Underfull.*\)/\1/ -e     b end -e   } -e   /Overfull.*/{ -e     s/.*\(Overfull.*\)/\1/ -e     b end -e   } -e   d -e   :error -e   s/.*/&/ -e   b end -e   :end -e   G -e } thesis.log
Overfull \hbox (2.26009pt too wide) in paragraph at lines 88--92
\OT1/cmr/m/n/10 in-stead of the Lapla-cian [[]24[]]. The nor-mal-ized Lapla-cia
n is given by $\OML/cmm/m/it/10 D[]LD[]$
 []

Overfull \hbox (4.56125pt too wide) in paragraph at lines 29--36
\OT1/cmr/m/n/10 which takes $\OML/cmm/m/it/10 O\OT1/cmr/m/n/10 (\OML/cmm/m/it/1
0 n[]\OT1/cmr/m/n/10 )$ time and thus is not prac-ti-cal for large graphs [ci-t
a-tion needed].
 []

Overfull \hbox (3.38025pt too wide) in paragraph at lines 188--190
[]\OT1/cmr/m/n/10 There are, how-ever, some lim-i-ta-tions of the afore-men-tio
ned al-go-rithm. Specif-
 []

Overfull \hbox (15.96695pt too wide) in paragraph at lines 211--211
[]\OT1/cmr/m/n/10 Sukanta Pati. \OT1/cmr/m/it/10 Lapla-cian ma-trix of a graph\
OT1/cmr/m/n/10 . []$\OT1/cmtt/m/n/10 http : / / www . lix . polytechnique .
 []

Overfull \hbox (0.37747pt too wide) in paragraph at lines 211--211
\OT1/cmr/m/n/10 Feed Han-dler''. In: \OT1/cmr/m/it/10 IEEE In-ter-na-tional Sym
-po-sium on Field-Programmable
 []

Overfull \hbox (5.08969pt too wide) in paragraph at lines 211--211
\OT1/cmr/m/it/10 Math-e-mati-cians 2010\OT1/cmr/m/n/10 . 2010, pp. 2698{2722. \
OT1/cmr/m/sc/10 doi\OT1/cmr/m/n/10 : []$\OT1/cmtt/m/n/10 10 . 1142 / 9789814324
359 .
 []

Overfull \hbox (11.37726pt too wide) in paragraph at lines 211--211
[]\OT1/cmr/m/n/10 Timothy de Vries, San-jay Chawla, and Michael E. Houle. ``Den
sity-preserving
 []

Success!  Wrote 48 pages, 608390 bytes to thesis.pdf

On Monday, June 25, 2012 5:32:23 PM UTC+10, Chris Monson wrote:

This should already be working, though we found some bugs in it.  If you could try out version 2.2.1-alpha9 and let me know if that fixes your problem, that would be great.

On Jun 24, 2012 2:16 AM, "Joshua Spence" <jo...@joshuaspence.com> wrote:
Is it possible to have the latex-makefile only recompile the LaTeX document if the source files have changed (based on timestamps) in the same manner that make itself supports?

Does LaTeX even support this? I have a document with multiple .tex source files that are included into the main document. One particular source file takes a while to compile (as it is doing some manipulation of large data sets) and I don't really want to have to compile this each time.

At the very least it would be nice to have the latex-makefile be aware of changes in the whole document (if not each source file), such that running the command "make && make" would only compile the document once.

I believe latexmk has some of these features. Unfortunately though, the output of latexmk is very ugly and littered with meaningless errors and warnings from early invocations of the latex command.

--
-- You received this message because you are subscribed to the Google Groups latex-makefile-discuss group. To post to this group, send email to latex-makefile-discuss@googlegroups.com. To unsubscribe from this group, send email to latex-makefile-discuss+unsub...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/latex-makefile-discuss?hl=en-US

Chris Monson

unread,
Jun 25, 2012, 5:42:39 AM6/25/12
to jo...@joshuaspence.com, latex-makef...@googlegroups.com
Actually, what you might find more useful for debugging is to run the make program with -d and see *why* it thinks it needs to rebuild your targets.

Unfortunately, I haven't had much time to work on the makefile for a while, nor am I likely to in the near future (unless this turns out to be super easy, or someone else figures out what is going on).  :-(

-- You received this message because you are subscribed to the Google Groups latex-makefile-discuss group. To post to this group, send email to latex-makef...@googlegroups.com. To unsubscribe from this group, send email to latex-makefile-di...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/latex-makefile-discuss?hl=en-US

Joshua Spence

unread,
Jun 26, 2012, 2:41:41 AM6/26/12
to latex-makef...@googlegroups.com, jo...@joshuaspence.com
Hi Chris,

I might try to have a look myself in a couple of days time. But I have managed to replicate the issue with a smaller example. I think perhaps the issue is caused by biblatex?

Josh
-- You received this message because you are subscribed to the Google Groups latex-makefile-discuss group. To post to this group, send email to latex-makefile-discuss@googlegroups.com. To unsubscribe from this group, send email to latex-makefile-discuss+unsubscri...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/latex-makefile-discuss?hl=en-US
latex.tar.gz

Chris Monson

unread,
Jun 26, 2012, 5:00:38 AM6/26/12
to jo...@joshuaspence.com, latex-makef...@googlegroups.com
Ah, biblatex.  I believe there is an open issue about that already.  Have you tried using plain old bibtex instead?  If that fixes the problem, then you are having the same issue that has already been reported.  :-)

--
-- You received this message because you are subscribed to the Google Groups latex-makefile-discuss group. To post to this group, send email to latex-makef...@googlegroups.com. To unsubscribe from this group, send email to latex-makefile-di...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/latex-makefile-discuss?hl=en-US

Joshua Spence

unread,
Jun 26, 2012, 6:33:45 AM6/26/12
to latex-makef...@googlegroups.com, jo...@joshuaspence.com
I think I may have a fix...

It seems that the source of the problem is that a dependency is generated in test.d to a temporary file produced by biblatex named test-blx.bib. This dependency arises because the test.aux file generated by pdflatex for the document contains a line "\bibdata{test-blx,test}".

A simple fix is to ensure that -blx.bib files are not parsed as dependencies by modifying the sed expression in the get-bibs function. My modified get-bibs function is shown below:

define get-bibs
$(SED) \
-e '/^\\bibdata/!d' \
-e 's/\\bibdata{\([^}]*\)}/\1,/' \
-e 's/,\{2,\}/,/g' \
-e 's/[[:space:]]/\\&/g' \
-e 's/[^,]\+-blx,//' \
-e 's/,/.bib /g' \
-e 's/ \{1,\}$$//' \
'$1' | $(XARGS) $(KPSEWHICH) '#######' | \
$(SED) \
-e 's!.*!$2: $$(call path-norm,&)!' | \
$(SORT) | $(UNIQ)
endef

Chris Monson

unread,
Jun 26, 2012, 1:46:09 PM6/26/12
to jo...@joshuaspence.com, latex-makef...@googlegroups.com
Oh, nice.  So that I understand correctly, this means that the blx file is regenerated, but that should not trigger a rebuild under any circumstances?  Or are there some circumstances in which the regeneration of this file should trigger a rebuild?

-- You received this message because you are subscribed to the Google Groups latex-makefile-discuss group. To post to this group, send email to latex-makef...@googlegroups.com. To unsubscribe from this group, send email to latex-makefile-di...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/latex-makefile-discuss?hl=en-US
 
 

Joshua Spence

unread,
Jun 26, 2012, 8:00:41 PM6/26/12
to latex-makef...@googlegroups.com, jo...@joshuaspence.com
Ok, I've done a bit of digging.

The contents of the -blx.bib file is the "control" options for biblatex. These comes from arguments specified when importing the biblatex package. (eg. "\usepackage[sortcase=false]{biblatex}"). So if any of these control options change then the contents of the -blx.bib file will change.

So possibly a better option is to either have the makefile parse the options used for importing biblatex, in order to determine if the -blx.bib file should change, or to explicitly copy the -blx.bib file (to, say, -blx-bib.old) and then compare the new and old -blx.bib files... if the file is different, then a rebuild is required.

What are your thoughts on this?

Joshua Spence

unread,
Jun 26, 2012, 11:24:18 PM6/26/12
to latex-makef...@googlegroups.com, jo...@joshuaspence.com
To further complicate things, the suffix of the file can be changed with the \blxauxsuffix macro.

I think that perhaps this file doesn't change often enough to warrant handling in the makefile. A make clean would fix it. Unless there is an easy fix of course.

Chris Monson

unread,
Jun 27, 2012, 5:24:19 AM6/27/12
to jo...@joshuaspence.com, latex-makef...@googlegroups.com
I think I'm inclined to just accept your patch, with some slight modifications for collapsing commas and making it work with non-GNU sed.  :-)

diff -r 74fed3f4dd3c get-bibs.sed
--- a/get-bibs.sed Mon May 09 16:40:01 2011 -0400
+++ b/get-bibs.sed Wed Jun 27 11:23:09 2012 +0200
@@ -6,6 +6,9 @@
 # Remove the \bibdata{} from around the pertinent information
 s/\\bibdata{\([^}]*\)}/\1,/
 
+# Ignore -blx files - they change frequently without affecting the build.
+s/[^,]\{1,\}-blx//
+
 # Collapse comma sequences
 s/,\{2,\}/,/g

I've attached a rebuilt Makefile to this message - feel free to give it a spin.  If it works, I'll release a new alpha with the fix.

--
-- You received this message because you are subscribed to the Google Groups latex-makefile-discuss group. To post to this group, send email to latex-makef...@googlegroups.com. To unsubscribe from this group, send email to latex-makefile-di...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/latex-makefile-discuss?hl=en-US
 
 

Makefile

Joshua Spence

unread,
Jun 29, 2012, 11:30:07 PM6/29/12
to latex-makef...@googlegroups.com, jo...@joshuaspence.com
Hi Chris,

This patch works fine.

On another note, I found this patch on the internet to suppress some of the annoying warnings about the *.d file not existing on a clean make.

--- Makefile.orig 2012-06-30 13:15:46.640317497 +1000
+++ Makefile 2012-06-30 13:19:05.796322042 +1000
@@ -2771,11 +2771,13 @@
 endif
 
 # Include only the dependencies used
+# Modified to suppress error about missing *.d files
 ifneq "" "$(source_includes)"
-include $(source_includes)$(call include-message,$(source_includes))
+-include $(source_includes)$(call include-message,$(source_includes))
 endif
 ifneq "" "$(graphic_includes)"
-include $(graphic_includes)$(call include-message,$(graphic_includes))
+-include $(graphic_includes)$(call include-message,$(graphic_includes))
 endif
 
 #

Chris Monson

unread,
Jun 30, 2012, 6:16:23 AM6/30/12
to jo...@joshuaspence.com, latex-makef...@googlegroups.com
Yes, that patch is wrong.  It misses some important cases, and allows those includes to just be missing.  That is never correct, hence the annoying message.  On the balance, it's still a lot less spammy than latex's usual output.

So, apply this patch at your own risk: your builds won't always be right if you do.

-- You received this message because you are subscribed to the Google Groups latex-makefile-discuss group. To post to this group, send email to latex-makef...@googlegroups.com. To unsubscribe from this group, send email to latex-makefile-di...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/latex-makefile-discuss?hl=en-US

Reply all
Reply to author
Forward
0 new messages