Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No PNG images with new TeXLive: Use version-stable TinyTeX #152

Closed
riccardoporreca opened this issue Nov 1, 2019 · 3 comments
Closed

No PNG images with new TeXLive: Use version-stable TinyTeX #152

riccardoporreca opened this issue Nov 1, 2019 · 3 comments
Assignees
Labels

Comments

@riccardoporreca
Copy link
Member

riccardoporreca commented Nov 1, 2019

There is an issue when running SmaRP from the Docker container as the usual test in the release process: The PNG images of the Swiss pension system and Tax benefits in the PDF report are not shown.

Originally posted by @riccardoporreca in #151 (comment)

After some investigation, the root cause is a problem recently introduced in the graphicx LaTeX package (see jgm/pandoc#5848), preventing images to be included with the xelatex engine we currently use for the PDF report.

There is a fundamental issue with the way we use TeXLive (via TinyTeX, see #91), which is meant to always install the latest version of TeXLive and LaTeX packages. This is unfortunately a source of issue since in any new build of SmaRP as new versions will kick-in in a possibly uncontrolled way. This is sort of against the version-stable approach behind the version-stable Rocker images we leverage on. Note that the version-stable Rocker images use the same approach to the TinyTeX installation we use in SmaRP and hence are subject to similar problems => see corresponding issue rocker-org/rocker-versioned#169

There is however good news: A tlnet archive is now available with TeXLive snaphots of CTAN (similar to the MRAN), see also https://www.tug.org/texlive/pkginstall.html. TinyTex in fact supports specifying a custom CTAN repo via the environment variable CTAN_REPO:
https://github.com/yihui/tinytex/blob/9efbce0c77179eac2f6800f08b768aefa1917085/tools/install-base.sh#L5
so we could set it to make our TinyTeX install version-stable.

@riccardoporreca riccardoporreca self-assigned this Nov 1, 2019
@riccardoporreca riccardoporreca added this to the Autumn release 1.3.0 milestone Nov 1, 2019
@riccardoporreca riccardoporreca changed the title Missing PNG images in report with new TexLive Missing PNG images in report with new TeXLive Nov 1, 2019
@riccardoporreca riccardoporreca changed the title Missing PNG images in report with new TeXLive No PNG images with new TeXLive: Use version-stable TinyTex Nov 1, 2019
@riccardoporreca riccardoporreca changed the title No PNG images with new TeXLive: Use version-stable TinyTex No PNG images with new TeXLive: Use version-stable TinyTeX Nov 1, 2019
@riccardoporreca
Copy link
Member Author

Usage of version-stable TinyTeX implemented with 0a69df4 in a feature branch, where we use as date 2019/02/27, which is the latest snapshot available before the MRAN build date of the rocker/r-ver:3.5.3 we are currently using and corresponds to the frozen 2018 TeXLive snapshot.

Successfully tested in the feature branch via

git checkout feature/152-version-stable-tinytex
docker build --pull -f Dockerfile -t mirai/smarp:152-version-stable-tinytex .
docker run -p 80:80 mirai/smarp:152-version-stable-tinytex

@riccardoporreca
Copy link
Member Author

Note that, in general, we shall reconsider if we want to keep using xelatex as engine, as well as whether PDF version (vector graphics) of the figures can be created and used instead of PNG.

This can be addressed as part of #130.

@riccardoporreca
Copy link
Member Author

After some more thoughts, one option to pick the TeXLive snapshot is to bind it to the version of TeXLive normally shipped as texlive-* packages in the Debian image each rocker/r-ver is created FROM. This would basically mean using the TinyTeX install in the rocker/verse as a tiny, container-friendly replacement for the TeXLive install one would get via apt-get for the specific Debian release.
The information can be found at https://www.tug.org/texlive/debian.html.

Originally posted by @riccardoporreca in rocker-org/rocker-versioned#169 (comment)

It then makes sense to use the TeXLive 2016 release from the tlnet archive, i.e. http://www.texlive.info/tlnet-archive/2017/04/13/tlnet as CTAN_REPO. Note the http instead of https, this is required since back in TeXLive 2016 install-tl only supported http and ftp for the -repository command-line argument.

This is even more relevant for SmaRP, where we are doing a first release where we switch from the debian texlive-* packages to TinyTeX, and this approach would minimize the difference in the PDF report due to the version of TeXLive and LaTeX packages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant