Code Monkey home page Code Monkey logo

docker-texlive's Introduction

Docker image for texlive License: MIT

This docker image supports full TeX Live with following additions:

  • Gnuplot
  • GraphViz
  • Inkscape
  • latexmk - an automator for latex building
  • Pandoc - to convert from and to .tex
  • Python
    • pygments. This enables the usage of the minted package for source code highlighting.
    • pip. This enables manual Python package installation.
  • Java headless - required for Pandoc

It builds on the full texlive image by "Island of TeX" with additions concidered important.

Usage

Using docker

docker run --rm -it -v $(pwd):/workdir danteev/texlive latexmk -pdf document.tex

Create a file .github/workflows/build.yml with following content:

name: Build
on: [push]
jobs:
  build_latex:
    runs-on: ubuntu-latest
    steps:
      - name: Set up Git repository
        uses: actions/checkout@v2
      - name: Compile document.tex
        uses: dante-ev/latex-action@edge
        with:
          root_file: document.tex

See dante-ev/latex-action for documentation on the different with options available.

You can also use it with multiple files as outlined here:

❯ tree
.
├── motivation_letter.pdf
├── master_degree.pdf
├── README.md
├── master_degree
│   ├── master_degree.sty
│   └── master_degree.tex
└── motivation_letter
    ├── motivation_letter.bib
    └── motivation_letter.tex

Following custom compilation script compiles all PDFs:

name: Build
on:
  push:
    paths-ignore:
      - '*.pdf'
jobs:
  build_latex:
    runs-on: ubuntu-latest
    container:
      image: danteev/texlive:latest
    steps:
    - name: Checkout
      uses: actions/checkout@v2
    - name: Build LaTeX
      run: |
        for project in $(ls); do
          if [ -d "$project" ]; then
            cd ${project}
            latexmk -synctex=1 -interaction=nonstopmode -file-line-error -pdf -outdir=$PWD/../ $PWD/${project}
            cd ..
          fi
        done

One can push the results using following example:

    - name: Publish LaTeX
      run : |
        git config --global user.email "[email protected]"
        git config --global user.name "BOT_WORKFLOW"
        git add -f $PWD/*.pdf
        git commit -m "WORKFLOW_COMMIT - Update PDFs [skip ci]"
        git push

Alternatively, you can use the GitHub push action to push something.

Usage in CircleCI 2.0

Create file .circle/config.yml with following content:

version: 2
jobs:
   build:
     docker:
       - image: danteev/texlive
     steps:
       - checkout
       - run: latexmk -pdf document.tex

Usage in Travis CI

Create file .travis.yml with following content:

dist: bionic
language: generic
services: docker

script:
- docker run --rm -it -v $(pwd):/workdir danteev/texlive latexmk -pdf document.tex

Usage in GitLab CI

Create file .gitlab-ci.yml with following content:

build:
  image: danteev/texlive
  stage: build
  script:
    - latexmk -pdf document.tex
  artifacts:
    paths:
      - document.pdf

Available tags

  • edge - the edge build. Usually created on the first and fifteenth of a month.
  • latest - the latest released version.
  • YYYY-MM-DD - a build of that date. Usually created on the first and fifteenth of a month.

Browse all available tags at https://hub.docker.com/repository/docker/danteev/texlive/tags?page=1&ordering=last_updated.

Other versions

  • 2021-A - first image release in year 2021
  • 2020-A - latest TeXLive 2020 build
  • TL2017 - TeXLive 2017 build
  • For all other versions see CHANGELOG.md.

Usage example

docker run --rm -it -v $(pwd):/workdir danteev/texlive latexmk document.tex

In case you want to use an explicit tag, you can do it as follows:

You can run the build of 2021-05-15 by using the tag 2021-05-15:

docker run --rm -it -v $(pwd):/workdir danteev/texlive:2021-05-15 latexmk document.tex

Background

We decided to base on the official TeXLive image, because this ensures recent TeXLive packages and a working basic build. We extended the image with tools required for our use cases.

Development hints

  • At a release, we point to a specific tag of the "upstream" Docker image. To find out the lasest tag there, follow the instructions at https://gitlab.com/islandoftex/images/texlive/-/issues/9. Search for build:latest: [2021, no, no] in the build jobs. no, no means: no documentation and no source files.

Alternatives

In case this all-in-one image is too large for you, you might be interested in following images:

License

docker-texlive's People

Contributors

koppor avatar linusdietz avatar schoeps avatar shiipou avatar skyfrk avatar splitt3r avatar stain 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

Watchers

 avatar  avatar  avatar

docker-texlive's Issues

CI is broken

https://github.com/dante-ev/docker-texlive/runs/769502469?check_suite_focus=true#step:4:2232

Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 inkscape : Depends: libgomp1 (>= 4.9) but it is not going to be installed
            Depends: libmagick++-6.q16-8 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

I guess /etc/apt/sources.list has to be updated?

https://github.com/dante-ev/docker-texlive/blob/master/Dockerfile#L18

consider including bibtool?

I'd like to call bibtool inside my build scripts to generate a clean bibliography file before compiling.
Now, it seems that this is not part of texlive (I thought it was), so it requires an extra installation.
On Debian, apt install bibtool does the trick, but although this docker image is based on debian, this command seems to fail:

.gitlab-ci.yml:

default:
  image: danteev/texlive
  before_script:
    - apt install bibtool

build:
  script:
    - cd src
    - bibtool -r bib/bibtoolrc content/references.bib > content/references-clean.bib                         
    - latexmk -f -outdir=.. -pdf main.tex
  artifacts:
    paths:
      - "main.pdf"

log:

Skipping Git submodules setup
$ apt install bibtool

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package bibtool
ERROR: Job failed: exit code 1

"latexindent" is available but it seems that it is not working

Hi,

I was looking for linters and I discovered that the following are available:

  • lacheck
  • chktex
  • latexindent

The two first are working fine, however, latexindent doesn't seems to work.

Here's the log:

$ docker-compose run texlive latexindent src/analysis/index.tex
Creating continuouslatex_texlive_run ... done
Can't locate Log/Dispatch/File.pm in @INC (you may need to install the Log::Dispatch::File module) (@INC contains: /usr/share/texlive/texmf-dist/scripts/latexindent /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.32.0 /usr/local/share/perl/5.32.0 /usr/lib/x86_64-linux-gnu/perl5/5.32 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl-base /usr/lib/x86_64-linux-gnu/perl/5.32 /usr/share/perl/5.32 /usr/local/lib/site_perl) at /usr/share/texlive/texmf-dist/scripts/latexindent/LatexIndent/LogFile.pm line 24.
BEGIN failed--compilation aborted at /usr/share/texlive/texmf-dist/scripts/latexindent/LatexIndent/LogFile.pm line 24.
Compilation failed in require at /usr/share/texlive/texmf-dist/scripts/latexindent/LatexIndent/Document.pm line 25.
BEGIN failed--compilation aborted at /usr/share/texlive/texmf-dist/scripts/latexindent/LatexIndent/Document.pm line 25.
Compilation failed in require at /usr/bin/latexindent line 30.
BEGIN failed--compilation aborted at /usr/bin/latexindent line 30.

Create luaotfload database

Avoid this message:

luaotfload | db : Font names database not found, generating new one.
luaotfload | db : This can take several minutes; please be patient.

"latest" tag points to 2019

First, thanks for providing the image!

As of today, the "latest" tag points to a texlive 2019 based image:

# podman run --rm -ti docker.io/danteev/texlive:latest latex --version
pdfTeX 3.14159265-2.6-1.40.20 (TeX Live 2019)
kpathsea version 6.3.1
Copyright 2019 Han The Thanh (pdfTeX) et al.
There is NO warranty.  Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Han The Thanh (pdfTeX) et al.
Compiled with libpng 1.6.36; using libpng 1.6.36
Compiled with zlib 1.2.11; using zlib 1.2.11
Compiled with xpdf version 4.01
# podman images | grep texlive
docker.io/danteev/texlive        latest           4eab049c4b6b  3 days ago     8.64 GB

is this on purpose? And if so, what would be the correct label to get the "real" latest version?

State of python

The CHANGELOG.md states for version 2021-A

Remove Python, because it is not required in a default setup

however python is advertised both here in the Readme, and on the docker page. Is is also available locally in the container, but pip (or python -m pip) fails even though listed on the docker page. Is this intended behaviour, and if so could you please direct people in the readme on how to make pip available?
I use this container for a build process that also creates figures, and python including pip is necessary. Tonight the build process failed with No module named pip. It would be great to get it to work again, the container is of great help!
Cheers

plantuml.jar is overwritten if a docker volume is mounted on /home

The plantuml.jar is overwritten if a docker volume is mounted on /home. If you then try to compile a document which uses the plantuml CTAN package plantuml.jar is not available.

A quick workaround: docker run --rm -it -v /path/to/project:/home/work danteev/texlive bash -c 'cd work && latexmk -synctex=1 -interaction=nonstopmode -file-line-error -shell-escape -pdf -pdflatex=lualatex document.tex'

To fix this issue I'd suggest to either mount the plantuml.jar in another place or add a note to the readme.

Pygments

Minted requires Pygments for syntax highlighting. Could you consider including it? The package should not noticeably increase the image size but would be very helpful as it allows the image to be use in more contexts out of the box.

Access to files in parent directories

Suppose the following structure:

parent-directory
├── current-directory
│   └── current-file.tex % Contains: \documentclass{article}\begin{document}\input{../parent-file}\end{document}
└── parent-file.tex      % Contains: Hey, I'm the content of the parent file!

With a non Docker installation of the TeX Live and a texmf.cnf file that contains openout_any = r, the compilation of current-file.tex is possible.

With the docker image you provide, all my attempts failed. So far I tried by adding a local texmf.cnf file containing openout_any = r in each of these directories and running:

$ cd /home/bitouze/parent-directory/current-directory
$ docker run --rm -it -v $(pwd):/workdir danteev/texlive pdflatex current-file

or:

$ cd /home/bitouze/parent-directory/current-directory
$ docker run --rm -it -v $(pwd)/..:/workdir danteev/texlive pdflatex current-directory/current-file

but in each case, that returns:

! LaTeX Error: File `../parent-file.tex' not found.

With the docker image you provide, is it possible to compile files which input files in parent directories?

tlmgr does NOT update any package during build

In the Dockerfile, texlive-full in installed and later updated with tlmgr update --all.
However, when the latter is issued no package is updated, as tlmgr will see no packages as installed.

PS C:\> docker run -it danteev/texlive:latest                                                                           root@5fd1f6d862d6:/home# tlmgr info --only-installed
(running on Debian, switching to user mode!)
root@5fd1f6d862d6:/home# tlmgr update --all
(running on Debian, switching to user mode!)
tlmgr: package repository http://mirrors.ibiblio.org/pub/mirrors/CTAN/systems/texlive/tlnet (verified)
tlmgr: no updates available

Thus, the resulting packages will always be those included in the texlive-full Debian package, many of which are currently outdated.

Texdoc doesn't work

The image doesn't seem to contain documentation for any of the installed packages, even for texdoc itself.
Examples:

root@8ae96bb31d97:/workspaces/rapport# texdoc texdoc
Sorry, no documentation found for "texdoc".
If you are unsure about the name, try full-text searching on CTAN.
Search form: <https://www.ctan.org/search/>
root@8ae96bb31d97:/workspaces/rapport# texdoc csquotes
Sorry, no documentation found for "csquotes".
If you are unsure about the name, try full-text searching on CTAN.
Search form: <https://www.ctan.org/search/>
root@8ae96bb31d97:/workspaces/rapport# texdoc babel
Sorry, no documentation found for "babel".
If you are unsure about the name, try full-text searching on CTAN.
Search form: <https://www.ctan.org/search/>

In fact, I can't find a single package known to texdoc. Am I doing something wrong? Is this normal behaviour? If so, do you have any clues for how I could fix it?

GH Action taking doubled the time

I have an action based on this image, and 4 days ago my action started taking double the time. From 3:30 minutes to 7-8 minutes.
Is there a way i can use a previous version of the docker image?

Actually the action that i'm using is this one: https://github.com/Jatus93/Latex-multicompiler on release 1.
The dockerfile of this action look like this

FROM danteev/texlive

COPY entrypoint.sh /entrypoint.sh

RUN chmod +x /entrypoint.sh

ENTRYPOINT ["/bin/bash", "/entrypoint.sh"]

Debian stretch got archived by Debian

The debian image used by docker-texlive is no longer maintained and has been archived. As a result, adding a packet to the container is no longer possible. An "apt-get update" performed in the container fails. Is an update of the debian image used planned?

latexmk with lualatex cannot stabilize

With this simple document (lualatex-simple.tex):

\documentclass{article}
\usepackage{fontspec}
\setmainfont{QTGraphLite}
\begin{document}
Essai
\end{document}

the following command:

docker run --rm -it -v $(pwd):/workdir danteev/texlive latexmk -pdflua lualatex-simple.tex

reruns lualatex at each run !

As /usr/local/texlive is writeable, the following files are (re)created at each run:

Rule 'lualatex':  Reasons for rerun
Changed files or newly in use/created:
  /usr/local/texlive/2023/texmf-var/luatex-cache/generic/names/luaotfload-lookup-cache.luc
Rule 'lualatex':  Reasons for rerun
Changed files or newly in use/created:
  /usr/local/texlive/2023/texmf-var/luatex-cache/generic/fonts/otl/lmroman10-bold.lua
  /usr/local/texlive/2023/texmf-var/luatex-cache/generic/fonts/otl/lmroman10-regular.lua
  /usr/local/texlive/2023/texmf-var/luatex-cache/generic/fonts/otl/qtgraphlite.lua
  /usr/local/texlive/2023/texmf-var/luatex-cache/generic/names/luaotfload-lookup-cache.luc

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.