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.

J. Doe
  • 113
  • 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. – samcarter_is_at_topanswers.xyz 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? – samcarter_is_at_topanswers.xyz Feb 24 '18 at 15:39
  • @samcarter here is it: please find it from line #3058 https://github.com/1605200517/tex-mwe-citing/blob/master/miktex-mweb/exec.log – J. Doe Feb 24 '18 at 21:59
  • You seems to have an rather outdated biber (This is Biber 2.4, current is 2.10, your version seems to be not the miktex biber but an ubuntu version) and it gives a perl error. This won't work. biber must match the biblatex version, so with miktex you must ensure that you use the miktex biber. – Ulrike Fischer Feb 24 '18 at 23:17
  • Please tell me you aren't really running any of this as root. This is sand-boxed, right, and root is not really the root account? – cfr Feb 24 '18 at 23:36
  • I guess it is 'loosely isolated' by the container stuff, though I'm not sure I'd entirely trust that. And root is 1000:1000 which seems weirdly confusing, but I suppose this is just because I don't understand the concept adequately. Note that MikTeX, unlike TeX Live, doesn't typically involve a full installation. Often, it is configured with on-the-fly package installation, so that stuff gets installed if and when needed. I'd think TeX Live would be a better option for something self-sufficient. (But I don't actually get the point, so I might be wrong about this.) – cfr Feb 24 '18 at 23:59
  • @J.Doe Instead of apt-get -y install biber try to use the miktex package manager to install a biber version which is compatible with your biblatex version. – samcarter_is_at_topanswers.xyz Feb 25 '18 at 00:10
  • @samcarter here you go, mpm installation of biber does not work unfortunately. https://tex.stackexchange.com/questions/417134/mpmcli-error-on-installing-biber-in-miktex – J. Doe Feb 25 '18 at 09:08
  • @cfr I'd like not to use root but there is a related Miktex issue https://github.com/MiKTeX/docker-miktex/issues/2 – J. Doe Feb 25 '18 at 09:09
  • To be honest, i have no idea what the real question here is. – Johannes_B Feb 25 '18 at 11:48
  • @Johannes_B generate 4 PDF documents: ACM template and a minimum working quotation example from this site once in TexLive and once in MikTex environment. – J. Doe Feb 25 '18 at 11:55

0 Answers0