0

Trivial yet true: an error-free TeX document compilation requires for a matching system environment configuration.

Specifically for citing there seem to be some compatibility problems and for newbies even understanding problems how to reference sources. As I have troubles with it myself, I focus on it in this question, but I would use same approach for further configuration.

Justification. From the system engineering point of view, it is good to have a machine readable spec for an environment installation required to "compile" your code. My favourite tool for that and also quite popular is Docker so I use it to demonstrate what I am trying to achieve.

Hypothesis: it should be possible to take an OOB TeX environment captured in Docker and run it against a reference document, to get a PDF just through one call. Maybe some tweaks will be needed like installing additional packages but with Docker it is quite easy.

To explore the above hypothesis, here is a setup of 4 experiments. None of them works in terms of achieving a PDF document with quotes instead of ? signs. I cannot estimate which of these (or another one) would represent most up-to-date state of the art setup of packages to go on with tweaking/troubleshooting. But I wish to find out!

Sidenote. It is great that community shares both sophisticated codes and sophisticated environments, but sometimes some DevOps work is needed to close the gap between both.

Community-provided reference OOB environments of my choice:

Community-provided test documents to produce a PDF document with bibliography:

To reproduce the below experiments, you need the Docker daemon in your Mac or Linux environment; Windows 10 supports Docker as well but there are still some problems with shared volumes.

Experiment A-01 (miktex-mweb)

Call:

docker run -ti   -v miktex:/miktex/.miktex  \
-v `pwd`:/miktex/work   miktex/miktex  \
pdflatex mweb-biblatex.tex

Result:

(/root/.miktex/texmfs/install/tex/latex/biblatex/lbx/english.lbx)
No file mweb-biblatex.aux.
No file mweb-biblatex.bbl.

LaTeX Warning: Citation 'key' on page 1 undefined on input line 17.


LaTeX Warning: Empty bibliography on input line 19.

[1{/root/.miktex/texmfs/data/pdftex/config/pdftex.map}] (mweb-biblatex.aux)

LaTeX Warning: There were undefined references.


Package biblatex Warning: Please (re)run Biber on the file:
(biblatex)                mweb-biblatex
(biblatex)                and rerun LaTeX afterwards.

Here it seems there is a gap between the example assuming biber to be used and the OOB MikTex distro assuming biber wouldn't be used. Could I just pass some tweaked argument to the above call? Something like maybe (of course possible to put proper order of calls in a bash script)?

docker run -ti   -v miktex:/miktex/.miktex   -v `pwd`:/miktex/work --user root   miktex/miktex bash -c "apt -y update && apt-get -y install biber && pdflatex mweb-biblatex.tex && biber mweb-biblatex.tex"

UPD we know now that biber can't be installed via MPM in Linux, and an apt-get would deliver an incompatible version.

Experiment A-02 (MikTeX-ACM)

Call:

    docker run -ti --user=root -v miktex:/miktex/.miktex -v `pwd`:/miktex/work miktex/miktex pdflatex sample-sigconf.tex

Result:

Sorry, but miktex-makepk did not succeed for the following reason:

  GSF2PK failed on rtxr.pfb.

Here some new missing package/configuration is coming up. So OOB MikTeX is not working with a reference ACM as a newbie might expect.

Experiment B-01 [SOLVED] (TexLive-mweb)

Call:

docker run --rm --volume $PWD:/workdir --workdir /workdir makisyu/texlive-2017 pdflatex mweb-biblatex.tex

Result: missing biber as well.

No file mweb-biblatex.bbl.
LaTeX Warning: Citation 'key' on page 1 undefined on input line 17.
LaTeX Warning: Empty bibliography on input line 19.

UPD Solution: biber is already present in the texlive distribution. To produce a PDF with references, use the following instructions.

pdflatex mweb-biblatex
biber mweb-biblatex
pdflatex mweb-biblatex
pdflatex mweb-biblatex

Experiment B-02 [SOLVED] (Texlive-acm) GitHub issue

Call:

docker run --rm --volume $PWD:/workdir --workdir /workdir makisyu/texlive-2017 pdflatex sample-sigconf.tex

Result: here is no biber related error, but natbib is not working in a similar way.

Package natbib Warning: Citation `Amsthm15' on page 3 undefined on input line 2
95.

UPD - working solution is in this case:

pdflatex sample-sigconf
bibtex sample-sigconf
pdflatex sample-sigconf
pdflatex sample-sigconf

Conclusion. Sure there will be many more ways of getting any of these 4 setups done but I consider that minimal working examples as well as prominent working templates should be accompanied by accordingly confgured environments.

An acceptable answer I expect for this question will contain solutions or at least references to such which I will then test.

  • 1
    I'm not familiar with docker, but as far as I can see, all you commands only run pdflatex mweb-biblatex.tex once. To succesfuly build a document you would need to run pdflatex mweb-biblatex; pdflatex mweb-biblatex; biber mweb-biblatex; pdflatex mweb-biblatex. If you don;t want to do this manually try for example latexmk mweb-biblatex which will automatically run all the required steps. – user36296 Feb 24 '18 at 15:08
  • @samcarter OK I try to add an apt-get install biber and run it like you told. Thank you so far! Should this work both with MikTex and TexLive in the same way? – J. Doe Feb 24 '18 at 15:14
  • @samcarter does not work... Command: docker run -ti --user root \ -v miktex:/miktex/.miktex \ -v pwd:/miktex/work \ miktex/miktex \ bash -c "apt -y update && apt-get -y install biber && pdflatex mweb-biblatex && pdflatex mweb-biblatex && biber mweb-biblatex && pdflatex mweb-biblatex" Result: LaTeX Warning: Overwriting file `./mweb-biblatex.bib'. (/root/.miktex/texmfs/install/tex/latex/biblatex/lbx/english.lbx) (mweb-biblatex.aux) No file mweb-biblatex.bbl. LaTeX Warning: Citation 'key' on page 1 undefined on input line 17. – J. Doe Feb 24 '18 at 15:20
  • 2
    Do you see the console output of running biber mweb-biblatex? If yes, can you please post it? – user36296 Feb 24 '18 at 15:39
  • @samcarter here is it: please find it from line #3058 github.com/1605200517/tex-mwe-citing/blob/master/miktex-mweb/… – J. Doe Feb 24 '18 at 21:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.