Sign inSign up

kpituke/latex

By kpituke

•Updated about 1 year ago

LaTeX Docker image

Image
0

2.4K

kpituke/latex repository overview

⁠LaTeX Docker image for final theses

⁠Running Locally

You can use this docker image locally to compile your LaTeX documents. Just map the directory with your files to the /thesis volume inside container and optionally set user ID to match you local user.

For user TUKE theses there is prepared Makefile with all needed settings and additional tools. Running it can be automated with the following script:

#!/usr/bin/env bash

docker container run --rm -it --user $(id -u):$(id -g) --volume .:/thesis kpituke/latex make "$@"

Save it as mkthesis.sh and make it executable with chmod +x mkthesis.sh. Then you can use it to compile printable version of your thesis with ./mkthesis.sh pdf, or watch and recompule ebook version with ./mkthesis.sh watch.

List of available targets can be displayed with ./mkthesis.sh help.

You can also use the image to compile your thesis with latexmk or other commands directly.

⁠What Image Contains?

The image is based on Fedora because it allows to select individual TeXLive packages. It contains three base collections:

  • latexrecommended — recommended set of LaTeX packages
  • fontsrecommended — recommended set of LaTeX fonts
  • langczechslovak — support for Slovak language

It also includes following additional packages:

  • adjustbox — some utilities to adjust boxed content
  • biblatex-iso690 — ISO690 styles for formatting BibLaTeX citations
  • dirtree – drawing directory trees
  • glossaries — creating glossaries and lists of acronyms
  • minted — colorful code syntax highlighting using Python Pygments library
  • multirow — creating tabular cells spanning multiple rows
  • pgfplots — creating normal/logarithmic plots in two and three dimensions
  • soul — letterspacing, underlining, highlighting
  • stmaryrd — some additional mathematical symbols
  • tcolorbox — colored and framed text boxes
  • totalcount — typesetting total values of counters
  • ulem – underlining (for git-latexdiff)

There are also some tools:

  • latexmk — fully automated LaTeX document generation
  • make — build automation
  • texcount — counting words in LaTeX documents
  • chktex — checking LaTeX documents for common mistakes
  • git-latexdiff – visualizing differences between two document versions from Git history
  • latexpand – expanding \input and \include in LaTeX files (for git-latexdiff)

⁠Additional Packages

If you need additional packages, you can list them in the packages file in the root of your project. Each package name should be on a separate line. The packages will be installed with dnf before the compilation.

texlive-multirow
texlive-beamer

Instead of RPM package names, you can specify name of LaTeX package (.sty) or class (.cls) file (apostrophes are required):

tex(multirow.sty)
tex(beamer.cls)

⁠Using in GitLab-CI

You can use this image to run CI jobs that would build PDF of your LaTeX document, so you can download it from the project page, but don't need to store it in the repository itself.

⁠How to Use?

Use the following .gitlab-ci.yml file. You need to set name of your main TeX file in the MAIN_TEX_FILE variable. In some cases you may need to modify parameters passed to latexmk, for example, add -shell-escape if you use minted.

variables:
  MAIN_TEX_FILE: name-of-main-tex-file-without-extension

pdf:
  stage: build
  image: git.kpi.fei.tuke.sk:4567/kpi/latex
  before_script:
      - /entrypoint.bash  # Install packages specified in `packages` file
  script:
    - latexmk -pdf -interaction=nonstopmode $MAIN_TEX_FILE
  artifacts:
    paths:
      - $MAIN_TEX_FILE.pdf
    expire_in: 2 weeks
⁠„Download PDF“ Project Badge

You can have a nice badge at the top of your Gitlab project page to access latest PDF of your document.

download PDF

Go to the Settings → General → Badges and add badge with the following parameters:

  • Name: download PDF
  • Link: https://git.kpi.fei.tuke.sk/%{project_path}/-/jobs/artifacts/%{default_branch}/raw/name-of-main-tex-file.pdf?job=pdf
  • Badge image URL: https://img.shields.io/badge/download-PDF-blue?logo=adobe-acrobat-reader

Don't forget to change the name-of-main-tex-file in the link URL.

Tag summary

Content type

Image

Digest

sha256:d8de00aa3…

Size

373.3 MB

Last updated

about 1 year ago

docker pull kpituke/latex