Giter Site home page Giter Site logo

latexrun's People

Contributors

aclements avatar apuignav avatar janwirth avatar keithw avatar tchajed avatar temporaer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

latexrun's Issues

biblatex with biber only generated correctly on first run

I am using biblatex with the biber backend. The first generation of a document perfectly if passing --bibtex-cmd biber in the command line. However, all subsequent generations of the document seem to skip important aspects resulting in missing dependencies until the output folder is deleted completely.

Invalid escape sequences in Regexes cause SyntaxWarnings in Python >=3.12

When using latexrun with Python 3.12 and up, this gets printed every run:

/usr/bin/latexrun:1214: SyntaxWarning: invalid escape sequence '\w'
  if lookingatre('(Package |Class |LaTeX |pdfTeX )?(\w+ )?warning: ', re.I):
/usr/bin/latexrun:1353: SyntaxWarning: invalid escape sequence '\.'
  m2 = self.__lookingatre('l\.[0-9]+ ')
/usr/bin/latexrun:1849: SyntaxWarning: invalid escape sequence '\d'
  m2 = re.match("BibTeX subsystem: (.*?), line (\d+), (.*)$", m.group(1))

This is caused by invalid escape sequences in regexes. The solution is to use raw strings for these regexes as well.

Does `latexrun` work with XeLaTeX?

I was able to get rubber work with XeLaTeX, but latexrun does seem to be cleaner and modern, so is it possible to use latexrun to compile with XeLaTeX?

Thanks.

Fails on finding the logfile when using synctex with lualatex

When running
latexrun --latex-cmd lualatex --latex-args '-shell-escape -interaction=nonstopmode -synctex=1' --bibtex-cmd biber main.tex
latexrun is not able to find the log file and outputs
failed to extract job name from latex log.
It is probably due to the fact, that lualatex outputs
SyncTeX written on main.synctex.gz.Transcript written on main.log.
instead of the usual line when synctex is enabled.

Using
latexrun --latex-cmd lualatex --latex-args '-shell-escape -interaction=nonstopmode' --bibtex-cmd biber main.tex
works correctly.

fails on readline latex cmds

For example, the following asks for user input.

\typein [\files]{Enter file names to process, (chap1,chap2 ...), or `all' to process all files:}
\def\all{all}
\ifx\files\all \typeout{Including all files.} \else \typeout{Including only \files.} \includeonly{\files} \fi

support makeglossaries

Is it possible or even intended to automatically run makeglossaries or biblatex with latexrun?

Missing \include file should be fatal (or at least warn)

With this test input:

\documentclass{article}
\begin{document}
\include{nonexistent}
Hello.
\end{document}

pdflatex successfully completes but includes this in its output: No file nonexistent.tex.

latexrun successfully completes and doesn't print anything at all.

I think it may be better to make this fatal, or at least include as a warning in the latexrun output.

Latexrun+biber works incorrectly with \nocite{*}

Here goes minimal example.

blah.tex:

\documentclass{article}
\usepackage[backend=biber]{biblatex}
\addbibresource{refs.bib}

\begin{document}

Hello world.

\nocite{*}
\printbibliography

\end{document}

refs.bib:

@inproceedings{ref01,
  author={M. Pie},
  title={A Bug in Latexrun},
  booktitle={Github},
  year={2018}
}

I do latexrun --bibtex-cmd biber blah and I get a pdf file with no references section. This is wrong.

If I do pdflatex blah; biber blah; pdflatex blah, the references section is there. This is how it's supposed to be.

Doesn't run enough times when adding a new label

  1. I ran latexrun to create my document.
  2. I added a new tex file and corresponding label
  3. I added a forward reference to the new label
  4. I ran latex run
  5. I opened the resulting PDF and saw "Section??" (below)

:(

image

Support for multibib?

Hi,
I am working with multibib lib and using different bib files to generate different kinds of publications. However I can't get all the publications items right in the xxx.aux in latex.out. Is it because latexrun doesn't support multibib currently?

Example of latex compiling process with multibib (here)

Piping into latexrun?

With pdflatex, lualatex etc. I am able to do something like echo "test.tex" | pdflatex. This doesn't work with latexrun:

usage: latexrun [-h] [-o FILE] [--latex-cmd CMD] [--latex-args ARGS]
                [--bibtex-cmd CMD] [--bibtex-args ARGS] [--max-iterations N]
                [-W no-CLASS] [-O DIR] [--color {auto,always,never}]
                [--verbose-cmds] [--debug] [--clean-all]
                [file]
latexrun: error: at least one action is required

Any way to make this work? Thanks :)

Line breaks are not parsed correctly when using

The two regular expressions don't seem to work, when the whole path is multiline

r'^Transcript written on "?(.* )\.log"?\.$'
and
r'^Output written on "?(.*\. [^ ."]+)"? \([0-9]+ page'

Files were located in a path, where the the output for transcript and output would not fit into a single line. The script immediately broke, even though the regular expression should support multilines.

Unbalanced "{" caused by unicode-math line breaks

I do not know if this is a special case for unicode math, but it bugs me that I cannot get rid of these warnings.

\documentclass{article}
\usepackage{unicode-math}

\begin{document}
Test
\end{document}


% latexrun --latex-cmd=lualatex test.tex
test.tex: warning: extra `}' in log; file names may be wrong 
test.tex: warning: extra `}' in log; file names may be wrong 
test.tex: warning: extra `}' in log; file names may be wrong

Incorrectly parsing overfull hbox as error under certain conditions

I have a file that latexrun is detecting errors in, but when I compile manually and inspect the log, there are no errors (although plenty of warnings particularly overfull hboxes).

I believe this is caused by the following warning in the log:

Overfull \hbox (83.6969pt too wide) in paragraph at lines 582--583
[]\T1/LinuxLibertineT-TLF/m/n/10 (-20) We want to show that $\OML/nxlmi/m/it/10
 embed[]\LMS/ntxsy/m/n/10 <B9>\OML/nxlmi/m/it/10 C\LMS/ntxsy/m/n/10 <BA> ` [][]\OML/n
xlmi/m/it/10 i \OT1/LinuxLibertineT-TLF/m/n/10 (-20) : \LMS/ntxsy/m/n/10 <B9>[][] 
\OML/nxlmi/m/it/10 ^K[]\LMS/ntxsy/m/n/10 <BA>[]<B9>[] \OML/nxlmi/m/it/10 ^K\LMS/ntxsy/m
/n/10 <BA>[][]\U/ntxmia/m/it/10 ^^@[][]\OML/nxlmi/m/it/10 ^^^[] \LMS/ntxsy/m/n/10 
! <B9>[][] <B9><BA> \OML/nxlmi/m/it/10 ^K[]\LMS/ntxsy/m/n/10 <BA>[]<B9>[] \OML/nxlmi/m/it/10 ^K\
LMS/ntxsy/m/n/10 <BA>[][]\U/ntxmia/m/it/10 ^^@\OML/nxlmi/m/it/10 ; \LMS/ntxsy/m/n/
10 <B9>[][] <B9><BA> \OML/nxlmi/m/it/10 ^K[]\LMS/ntxsy/m/n/10 <BA>[]\OML/nxlmi/m/it/10 ^^^[]
$\T1/LinuxLibertineT-TLF/m/n/10 (-20) . 

Notably, the warning message contains an ! at the beginning of a new line, due to line wrapping. However, it's a false positive, as that is part of warning, not an error.

PDF file when using XeLaTeX and bibtex is missing references.

Problem

The content of the PDF file in the root directory is incorrect, it is missing references.

Skärmavbild 2020-02-20 kl  20 11 16

The PDF file in latex.out is correct.

Skärmavbild 2020-02-20 kl  20 11 10

Minimum working example

Compile with ./latexrun --latex-cmd xelatex --bibtex-cmd bibtex --debug mwe.tex.

\documentclass{article}

\begin{filecontents}{\jobname.bib}
    @article{einstein,
        author = {Albert Einstein},
        title = {the true about tree},
        journaltitle = {Annalen der Physik},
        year = {1905},
        volume = {322},
        number = {10},
        pages = {891--921}
    }
\end{filecontents}
\bibliographystyle{plain}

\begin{document}

Lorem ipsum~\cite{einstein}.

\bibliography{mwe}
\end{document}

Log output

creating new database
task latex::mwe.tex: unstable (changed: never run)
task latex::mwe.tex: running
running ['xelatex', '-interaction', 'nonstopmode', '-recorder', '-output-directory', 'latex.out', 'mwe.tex']
hashing /usr/local/texlive/2019/texmf-dist/tex/latex/base/article.cls
hashing /usr/local/texlive/2019/texmf-dist/web2c/texmf.cnf
hashing /usr/local/texlive/2019/texmf.cnf
hashing /usr/local/texlive/2019/texmf-dist/tex/latex/base/ts1cmr.fd
hashing /usr/local/texlive/2019/texmf-dist/tex/latex/base/size10.clo
hashing mwe.tex
hashing /usr/local/texlive/2019/texmf-var/web2c/xetex/xelatex.fmt
hashing /usr/local/texlive/2019/texmf-dist/tex/latex/l3backend/l3backend-xdvipdfmx.def
hashing latex.out/mwe.log
hashing latex.out/mwe.bib
hashing latex.out/mwe.fls
hashing latex.out/mwe.aux
committing database
task latex_commit::mwe.tex: unstable (changed: never run)
task latex_commit::mwe.tex: running
commiting latex.out/mwe.pdf to mwe.pdf
hashing latex.out/mwe.pdf
hashing mwe.pdf
committing database
scanning for bib commands in latex.out/mwe.aux
task bibtex::mwe.tex: unstable (changed: never run)
task bibtex::mwe.tex: running
running ['bibtex', 'mwe.aux'] in latex.out
hashing filtered aux file latex.out/mwe.aux
hashing /usr/local/texlive/2019/texmf-dist/bibtex/bst/base/plain.bst
hashing latex.out/mwe.bbl
hashing latex.out/mwe.blg
committing database
task latex::mwe.tex: unstable (changed: file('latex.out/mwe.aux',))
task latex::mwe.tex: pre-hashing latex.out/mwe.log
task latex::mwe.tex: pre-hashing latex.out/mwe.bib
task latex::mwe.tex: pre-hashing latex.out/mwe.fls
task latex::mwe.tex: pre-hashing latex.out/mwe.aux
task latex::mwe.tex: running
running ['xelatex', '-interaction', 'nonstopmode', '-recorder', '-output-directory', 'latex.out', 'mwe.tex']
hashing latex.out/mwe.log
hashing latex.out/mwe.fls
hashing latex.out/mwe.aux
committing database
task latex_commit::mwe.tex: stable
scanning for bib commands in latex.out/mwe.aux
hashing filtered aux file latex.out/mwe.aux
task bibtex::mwe.tex: stable
task latex::mwe.tex: unstable (changed: file('latex.out/mwe.aux',))
task latex::mwe.tex: pre-hashing latex.out/mwe.log
task latex::mwe.tex: pre-hashing latex.out/mwe.fls
task latex::mwe.tex: pre-hashing latex.out/mwe.aux
task latex::mwe.tex: running
running ['xelatex', '-interaction', 'nonstopmode', '-recorder', '-output-directory', 'latex.out', 'mwe.tex']
hashing latex.out/mwe.log
hashing latex.out/mwe.fls
hashing latex.out/mwe.aux
committing database
task latex_commit::mwe.tex: stable
scanning for bib commands in latex.out/mwe.aux
hashing filtered aux file latex.out/mwe.aux
task bibtex::mwe.tex: stable
task latex::mwe.tex: stable
fixed-point reached
mwe.tex: warning: File `mwe.bib' already exists on the system
latex.out/./mwe.bib:5: warning: empty journal in einstein

"failed to extract output name from latex log" with long filenames

When a filename is long enough for TeX to wrap its message:

Output written on "latex.out/L04 Intel 64 Architektur und C-Toolchain.pdf" (1 p
age, 74341 bytes).
Transcript written on "latex.out/L04 Intel 64 Architektur und C-Toolchain.log".

This causes latexrun to abort with:

failed to extract output name from latex log
There were errors; output not updated

This is on Archlinux with latexrun on 38ff6ec and pdfTeX 3.14159265-2.6-1.40.21 (TeX Live 2020/Arch Linux).

Bugs in .tex file cause latexrun to fail

I have an unclosed environment in my .tex file that should be an error:

\begin{figure}
\begin{subfigure}
\subfigure
   ....
\end{subfigure}
\end{figure}

This should throw a latex exception that latexrun catches and prints. Instead latexrun outputs:

latexrun main.tex --clean-all
Traceback (most recent call last):
  File "/usr/local/bin/latexrun", line 1478, in <module>
    main()
  File "/usr/local/bin/latexrun", line 108, in main
    stable = run_tasks(tasks, args.max_iterations)
  File "/usr/local/bin/latexrun", line 362, in run_tasks
    task.run()
  File "/usr/local/bin/latexrun", line 456, in run
    result = self._execute()
  File "/usr/local/bin/latexrun", line 607, in _execute
    self._input('file', path)
  File "/usr/local/bin/latexrun", line 433, in _input
    val = method(*args)
  File "/usr/local/bin/latexrun", line 518, in _input_file
    return hash_cache.get(path)
  File "/usr/local/bin/latexrun", line 226, in get
    with open(filename, 'rb') as fp:
IsADirectoryError: [Errno 21] Is a directory: 'latex.out'

Doh!

latexrun fails with a warning about 'NoneType' not having a 'startswith' attribute

The error, with the --debug flag, is

loading database
hashing /usr/share/texmf-dist/tex/latex/amsmath/amsgen.sty
hashing /usr/share/texmf-dist/tex/latex/oberdiek/auxhook.sty
hashing /usr/share/texmf-dist/fonts/map/fontname/texfonts.map
hashing /usr/share/texmf-dist/fonts/tfm/public/amsfonts/cmextra/cmex8.tfm
hashing /usr/share/texmf-dist/fonts/tfm/public/cm/cmr12.tfm
hashing /usr/share/texmf-dist/tex/latex/hyperref/hpdftex.def
hashing /usr/share/texmf-dist/tex/latex/base/article.cls
hashing /usr/share/texmf-dist/web2c/texmf.cnf
hashing /usr/share/texmf-dist/fonts/tfm/public/cm/cmr8.tfm
hashing /usr/share/texmf-dist/fonts/tfm/public/cm/cmmi8.tfm
hashing /usr/share/texmf-dist/tex/generic/oberdiek/gettitlestring.sty
hashing /usr/share/texmf-dist/fonts/type1/public/amsfonts/cm/cmmi10.pfb
hashing /usr/share/texmf-dist/fonts/type1/public/amsfonts/cm/cmsy10.pfb
hashing /usr/share/texmf-dist/fonts/tfm/public/amsfonts/symbols/msbm10.tfm
hashing /usr/share/texmf-dist/fonts/tfm/public/cm/cmmi12.tfm
hashing /usr/share/texmf-dist/tex/latex/url/url.sty
hashing /usr/share/texmf-dist/tex/latex/amsmath/amsopn.sty
hashing /usr/share/texmf-dist/tex/latex/amsmath/amsmath.sty
hashing /usr/share/texmf-dist/tex/latex/booktabs/booktabs.sty
hashing /usr/share/texmf-dist/tex/latex/hyperref/nameref.sty
hashing /usr/share/texmf-dist/fonts/tfm/public/amsfonts/cmextra/cmex7.tfm
hashing /usr/share/texmf-dist/fonts/tfm/public/amsfonts/symbols/msam10.tfm
hashing /usr/share/texmf-dist/fonts/tfm/public/cm/cmex10.tfm
hashing /usr/share/texmf-dist/fonts/tfm/public/amsfonts/symbols/msam7.tfm
hashing /usr/share/texmf-dist/tex/latex/hyperref/pd1enc.def
hashing /usr/share/texmf-dist/fonts/tfm/public/cm/cmbx10.tfm
hashing memetic.tex
hashing /usr/share/texmf-dist/fonts/type1/public/amsfonts/cm/cmti10.pfb
hashing /usr/share/texmf-dist/fonts/tfm/public/cm/cmsy10.tfm
hashing /usr/share/texmf-dist/fonts/type1/public/amsfonts/cm/cmbx12.pfb
hashing /usr/share/texmf-dist/tex/latex/amsfonts/umsb.fd
hashing /usr/share/texmf-dist/tex/latex/ntgclass/a4.sty
hashing /usr/share/texmf-dist/fonts/tfm/public/cm/cmr6.tfm
hashing /usr/share/texmf-dist/fonts/type1/public/amsfonts/cm/cmr12.pfb
hashing /usr/share/texmf-dist/tex/latex/amsfonts/amssymb.sty
hashing /usr/share/texmf-dist/tex/latex/amscls/amsthm.sty
hashing /usr/share/texmf-dist/fonts/tfm/public/cm/cmbx12.tfm
hashing /usr/share/texmf-dist/fonts/tfm/public/cm/cmsy6.tfm
hashing /usr/share/texmf-dist/tex/generic/oberdiek/hobsub-generic.sty
hashing /usr/share/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb
hashing /var/lib/texmf/web2c/pdftex/pdflatex.fmt
hashing /usr/share/texmf-dist/tex/generic/oberdiek/hobsub-hyperref.sty
hashing latex.out/memetic.aux
task latex::memetic.tex: unstable (changed: file('latex.out/memetic.aux',))
task latex::memetic.tex: pre-hashing latex.out/memetic.log
hashing latex.out/memetic.log
task latex::memetic.tex: pre-hashing latex.out/memetic.aux
task latex::memetic.tex: pre-hashing latex.out/memetic.out
hashing latex.out/memetic.out
task latex::memetic.tex: pre-hashing latex.out/memetic.pdf
hashing latex.out/memetic.pdf
task latex::memetic.tex: pre-hashing latex.out/memetic.fls
hashing latex.out/memetic.fls
task latex::memetic.tex: running
running ['pdflatex', '-interaction', 'nonstopmode', '-recorder', '-output-directory', 'latex.out', 'memetic.tex']
hashing /usr/share/texmf-dist/tex/latex/base/omscmr.fd
hashing /usr/share/texmf-dist/tex/latex/oberdiek/kvoptions.sty
hashing /usr/share/texmf-dist/tex/latex/hyperref/hyperref.sty
hashing /usr/share/texmf-dist/fonts/tfm/public/cm/cmmi6.tfm
hashing /usr/share/texmf-dist/fonts/tfm/public/cm/cmti10.tfm
hashing /usr/share/texmf-dist/fonts/tfm/public/cm/cmr17.tfm
hashing /usr/share/texmf-dist/tex/latex/graphics/keyval.sty
hashing /usr/share/texmf-dist/tex/latex/amsmath/amstext.sty
hashing /usr/share/texmf-dist/tex/latex/base/size10.clo
hashing /usr/share/texmf-dist/tex/latex/oberdiek/rerunfilecheck.sty
hashing /usr/share/texmf-dist/tex/latex/amsmath/amsbsy.sty
hashing /usr/share/texmf-dist/tex/latex/amsfonts/amsfonts.sty
hashing /usr/share/texmf-dist/tex/latex/amsfonts/umsa.fd
hashing /usr/share/texmf-dist/fonts/type1/public/amsfonts/cm/cmbx10.pfb
hashing /usr/share/texmf-dist/fonts/tfm/public/amsfonts/symbols/msbm5.tfm
hashing /usr/share/texmf-dist/tex/latex/a4wide/a4wide.sty
hashing /var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map
hashing /usr/share/texmf-dist/fonts/tfm/public/amsfonts/symbols/msam5.tfm
hashing /usr/share/texmf-dist/tex/latex/latexconfig/hyperref.cfg
hashing /usr/share/texmf-dist/fonts/tfm/public/amsfonts/symbols/msbm7.tfm
hashing /usr/share/texmf-dist/fonts/type1/public/amsfonts/cm/cmr17.pfb
hashing latex.out/memetic.bbl
hashing /usr/share/texmf-dist/tex/generic/ifxetex/ifxetex.sty
hashing /usr/share/texmf-dist/fonts/tfm/public/cm/cmsy8.tfm
hashing latex.out/memetic.pdf
hashing latex.out/memetic.log
hashing latex.out/memetic.fls
hashing latex.out/memetic.out
hashing latex.out/memetic.aux
committing database
task latex_commit::memetic.tex: unstable (changed: latex())
task latex_commit::memetic.tex: pre-hashing memetic.pdf
hashing memetic.pdf
task latex_commit::memetic.tex: running
commiting latex.out/memetic.pdf to memetic.pdf
hashing memetic.pdf
committing database
scanning for bib commands in latex.out/memetic.aux
task bibtex::memetic.tex: unstable (changed: never run)
task bibtex::memetic.tex: running
running ['bibtex', 'memetic.aux'] in latex.out
Traceback (most recent call last):
  File "/usr/bin/latexrun", line 1936, in <module>
    main()
  File "/usr/bin/latexrun", line 169, in main
    stable = run_tasks(tasks, args.max_iterations)
  File "/usr/bin/latexrun", line 524, in run_tasks
    task.run()
  File "/usr/bin/latexrun", line 621, in run
    result = self._execute()
  File "/usr/bin/latexrun", line 1614, in _execute
    inputs, auxnames, outbase = self.__parse_inputs(stdout, cwd, env)
  File "/usr/bin/latexrun", line 1686, in __parse_inputs
    if filename.startswith('/'):
AttributeError: 'NoneType' object has no attribute 'startswith'

This appears to be triggered by use of BibTeX - this didn't happen to me when I didn't need to use it.

Latexrun fails on long file names

When compiling a file with long name (>48 characters, perhaps?), latexrun fails with error

failed to extract job name from latex log

For example, create a latex file with name

thisisanabsurdlylonglatexfilenamewhichgoesonandonforever.tex

with code

\documentclass{article}
\begin{document}
test
\end{document}

Latexrun fails with error log in terminal

his is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013)
 restricted \write18 enabled.
entering extended mode
(./thisisanabsurdlylonglatexfilenamewhichgoesonandonforever.tex
LaTeX2e <2011/06/27>
Babel <3.9f> and hyphenation patterns for 78 languages loaded.
(/usr/local/texlive/2013/texmf-dist/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(/usr/local/texlive/2013/texmf-dist/tex/latex/base/size10.clo))
(latex.out/thisisanabsurdlylonglatexfilenamewhichgoesonandonforever.aux)
[1{/usr/local/texlive/2013/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
(latex.out/thisisanabsurdlylonglatexfilenamewhichgoesonandonforever.aux) )</usr
/local/texlive/2013/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb>
Output written on latex.out/thisisanabsurdlylonglatexfilenamewhichgoesonandonfo
rever.pdf (1 page, 10603 bytes).
Transcript written on latex.out/thisisanabsurdlylonglatexfilenamewhichgoesonand
onforever.log.

failed to extract job name from latex log
There were errors; output not updated

db.temp not found when assigning labels

latexrun throws this error if i run it once after assigning a label / an autoref
error committing control database latex.out/.latexrun.db.tmp: [Errno 2] No such file or directory: 'latex.out/.latexrun.db.tmp' -> 'latex.out/.latexrun.db'

Everything works fine in the second run though.

Trouble with bibtex

I think there might be some bugs in the bibtex handling, depending on how the LaTeX file is set up.

(1) The logic at https://github.com/aclements/latexrun/blob/master/latexrun#L1127-L1131 seems to assume that the \bibliography{} will be found in the main TeX file (and therefore \bibstyle or \bibdata will appear in the jobname.aux file). But in the MIT thesis template, the main TeX file includes a biblio.tex which in turn has \bibliography, so the \bibstyle ends up in biblio.aux. So latexrun is not running bibtex at all in this case.

(2) latexrun doesn't seem to run bibtex in a way that lets it find the aux files for \included chapters. It runs bibtex latex.out/main.aux, which for me then spews a lot of I couldn't open auxiliary file cover.aux and I couldn't open auxiliary file contents.aux, etc.

I think latexrun might need to really chdir to the latex.out subdirectory before running bibtex, or else it's not going to find the other aux files (where the references may be found).

(3) It would be helpful if latexrun parsed the bibtex errors couldn't open auxiliary file or I'm skipping whatever remains of this command and gave an error.

Support for using latexrun only to parse the LaTeX log files

I've not really used latexrun much, yet, but I've heard positive things. One of these is that latexrun is able to parse the LaTeX log and print them in a much more readable (and parsable) manner.

I am thinking that this feature itself is interesting, e.g. in order to use latexrun only to actually parse the log files. I am the developer of vimtex, and I would be interested in adding an error parsing layer that relies on latexrun, if this feature were to be added.

Let me know if this request is unclear, and I'll try to explain it better.

--max-iterations N should not exit with error status

When I specify --max-iterations N, my sense is that, if the document compiles without error over the N iterations, then latexrun should exit with process exit code 0, regardless of whether the iterations have converged to stability. I.e. I have asked it to run N times, presumably because I was prepared to accept non-convergence, and it did so successfully, so that should be success. However, latexrun exits with an error status and an error message. I suggest this should be a warning message and success status.

$ cat z.tex 
\documentclass{article}
\begin{document}
hello
\end{document}

$  latexrun z.tex && echo $?
0

$ latexrun --max-iterations 1 z.tex ; echo $?
error: files are still changing after 1 iterations; giving up
1

Python package on PyPi

Thank you for your work, I have now switched from rubber to latexrun :)

It would be also very convenient to be able to install latexrun as a PyPi package.

@aclements, do you have plans to publish it at PyPi? The setup.py file could be very simple, like this:

import setuptools

setuptools.setup(
    name='latexrun',
    author='Austin Clements',
    author_email='<[email protected]',
    description='A 21st century LaTeX wrapper',
    keywords='latex',
    license='MIT',
    packages=setuptools.find_packages(),
    scripts=['latexrun'],
    version='0.1',
)

If you are not going to, I can do it with my own fork, but I think it's better not to produce extra entities and the best solution is if you could publish it as the developer, through your own PyPi account.

PS: You may also want to explicitly mention that latexrun uses Python 3 syntax and will not work under Python 2.7.

Thanks!

Not so useful Warnings when Filenames have spaces

When compiling the file
/Users/yann/Mathématiques 2016 2017/Enonces_TD_Maths.tex
I get errors like this :
/Users/yann/Mathématiques:354: warning: Overfull \hbox (13.46664pt too wide) (page 14)
and the text editor can't make a clickable link to the right file. Whereas the file
/Users/yann/Mathématiques_2016_2017/Enonces_TD_Maths.tex
results in the correct report:
/Users/yann/Mathématiques_2016_2017/Enonces_TD_Maths.tex:354: warning: Overfull \hbox (13.46664pt too wide) (page 14)

Add license to latexrun script

Currently, latexrun can't be copied to another repo on its own because that violates the license. Fix this and explicitly mention this in the README.

Add switch for deleting directory for intermediate files and control database on successful compilation

While the --clean-all switch is provided, it would be a great idea to offer the possibility of removing the latex.out (or whatever name) directory after a successful compilation, ie, with no errors.

Currently --clean-all also deletes the output file, so there is no way to actually only remove temporary files, AFAIK. I want to open this issue to discuss the topic, I can implement whatever we decide myself an open a PR.

Bibtex stability test is sometimes wrong

BibTeX.stable is wrong in some situations. Create a tex file with \bibliography, but no \citations. This will run latex and bibtex and bibtex will fail with "no \citation commands". Then remove \bibliography commands. This will run latex, decide that bibtex is stable, and then replay the error from the previous bibtex run. Stable means both that it will have no effect on system state AND that its results will be the same as the previous run. Maybe the tests that are currently in BibTeX.stable tests all need to go in BibTeX._execute?

warning with siunitx

MWE:

\documentclass{article}
\usepackage{siunitx}
\begin{document}
hello world
\end{document}

Output:

$ latexrun foo.tex
/usr/local/texlive/2016/texmf-dist/tex/latex/siunitx/siunitx.sty: warning: extra `}' in log; file names may be wrong
/usr/local/texlive/2016/texmf-dist/tex/latex/siunitx/siunitx.sty: warning: extra `}' in log; file names may be wrong
/usr/local/texlive/2016/texmf-dist/tex/latex/siunitx/siunitx.sty: warning: extra `}' in log; file names may be wrong

By the way it is not clear how to change warning filters; e.g. -Wno-all or -Wno-siunitx have no effect.

Doesn't show correct output for "Unused global option(s):"

When latex gives the warning "Unused global option(s):", latexrun doesn't show which options are unused. Compare the output of latexrun and pdflatex below:

Test file (foo.tex):

\documentclass[english]{article}

\begin{document}
Foo
\end{document}
$ latexrun foo.tex
foo.tex: warning: Unused global option(s):
$ pdflatex foo.text
...
LaTeX Warning: Unused global option(s):
    [english].
...

latexrun tries to generate incorrect bib file

The command pdflatex is able to successfully compile both \bibliography{name.bib} and \bibliography{name}.

latexrun however can only compile if it is \bibliography{name}.
If we have \bibliography{name.bib} in the tex file latexrun actually tries to look for the file name.bib.bib which is not ideal.

Incompatibility with minted

minted is a package to highlight code snippets. It shells out and calls the Python program pygments to write some intermediate file. This file is not picked up correctly by latexrun, hence the following example fails to compile with latexrun --latex-args="-shell-escape" test.tex:

\documentclass{minimal}
\usepackage{minted}

\begin{document}
  \begin{minted}{latex}
    \documentclass{minimal}
  \end{minted}
\end{document}

Compiling with latexrun --latex-args="-shell-escape" -O . test.tex is successful.

Add `.latexrun.db.lock` file

The issue with latexrun not finding the .latexrun.db file is because it is possible to run latexrun twice at the same time on the same file. I use latexrun in conjunction with a build system to watch changes and I have been running into issues. Not urgent imho but something to consider.

Using biber with latex.out

I use biber as the backend for my references, no matter how I try to send in the argument
--output_directory latex.out

latexrun just replies that I need to rerun biber on them, any ideas?

Numbers in brackets from preamble output are incorrectly parsed as page numbers

The semantic package outputs a date in the format [2018/11/1], which latexrun incorrectly parses as the page number 2018. This only affects the first page, since subsequent page numbers correct it, but it causes errors on the first page to be reported as being on page 2019.

A simple way to test this is \typeout{[2018/11/1]} in the preamble and then an error on the first page (eg, an overfull \hbox).

Perhaps one way this could be fixed is re-setting the page number after processing the preamble.

latexrun fails to compile pdf when pdflatex generates missing fonts

Reproduction steps:

  1. Take Linux with the following packages installed (or build docker image with this Dockerfile)
apt-get update && apt-get install -y \
    biber \
    cm-super \
    fontconfig \
    latex-xcolor \
    preview-latex-style \
    texlive-bibtex-extra \
    texlive-fonts-extra \
    texlive-generic-extra \
    texlive-lang-all \
    texlive-lang-swedish \
    texlive-latex-base \
    texlive-latex-extra \
    texlive-math-extra \
    texlive-science \
    texlive-xetex
  1. Try to compile this tex file.
$ curl https://github.com/aslushnikov/latex-online/blob/master/sample/sample.tex > main.tex
$ latexrun main.tex
  1. Observe latexrun error (below is truncated version, full error text is here):
failed to open file recorder output: [Errno 36] File name too long: 'larm1200.log.mktextfm: /root/.texmf-var/fonts/tfm/lh/lh-t2a/larm1200.tfm: successfully generated.)(/usr/share/texlive/texmf-dist/tex/latex/base/inputenc.sty(/usr/share/texlive/texmf-dist/tex/latex/base/

It turns out that function __parse_jobname fails to parse the
output. This happens because output contains a lot of intermediate steps of font generation.

Multi line warning not shown in full

I had a warning that was two lines long but only the first line was shown. Is that deliberate to not show long warnings (maybe for several lines?) or is this a "bug" that should be fixed?

As the moderncv class has a bug (xdanaux/moderncv#7) this can be reproduced with this tex file:

\documentclass{moderncv}
\moderncvstyle{classic}
\name{foo}{bar}
\begin{document}
foo
\end{document}

The warning if I run pdflatex mwe is

LaTeX Warning: You have requested package `moderncvbodyi',
               but the package provides `moderncvbodyi'.

but latexrun mwe produces this output:

/usr/share/texmf-dist/tex/latex/moderncv/moderncvheadi.sty: warning: You have requested package `moderncvheadi',

and I would prefer it to be

/usr/share/texmf-dist/tex/latex/moderncv/moderncvheadi.sty: warning: You have requested package `moderncvheadi', but the package provides `moderncvbodyi'.

Detect and depend on missing includes

Since the log parser has a special rule for missing includes, latexrun can add this missing file as a dependency and mostly solve its bug with lack of dependencies on missing files.

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.