diff --git a/dockerfiles/latex-builder/Dockerfile b/dockerfiles/latex-builder/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..6d0e7bca869eb1bde9066f05e6b590a371498f94 --- /dev/null +++ b/dockerfiles/latex-builder/Dockerfile @@ -0,0 +1,24 @@ +# We use CI_COMMIT_REF_SLUG as a tag here (and not CI_AWE_IMAGE_TAG) +# because the latter refers to what the projects that include the +# CI templates shoud use. That variable usually points to `v5` or similar +# and the associated tag is not always available in the Docker registry +# at the time of building this image. +# CI_COMMIT_REF_SLUG however should be available at build time because +# that's what used in this project's .gitlab-ci.yml. The only time that +# tag is not available is when building this image for a MR pipeline +# where conda-builder is not changed and thus not built. +FROM ${CI_AWE_IMAGE_BASE}/conda-builder:${CI_COMMIT_REF_SLUG} + +LABEL version="1.2" +LABEL description="Image for building LaTeX documentation through tectonic" + +ARG CONDA_PREFIX=/opt/conda + +# Compiling the example will let tectonic pull most common LaTeX packages, +# thereby increasing continuous integration speed. +COPY example.tex /root/example.tex + +RUN ${CONDA_PREFIX}/bin/conda install -c conda-forge "tectonic==0.1.15" texlive-core "malramsay::biber==2.11" \ + && ${CONDA_PREFIX}/bin/tectonic /root/example.tex \ + && curl -o /usr/local/bin/git-latexdiff https://gitlab.com/git-latexdiff/git-latexdiff/-/raw/1.6.0/git-latexdiff \ + && chmod +x /usr/local/bin/git-latexdiff diff --git a/dockerfiles/latex-builder/README.rst b/dockerfiles/latex-builder/README.rst new file mode 100644 index 0000000000000000000000000000000000000000..5d84d855946f4d665b3a93c86070ed061d376e1b --- /dev/null +++ b/dockerfiles/latex-builder/README.rst @@ -0,0 +1,36 @@ +============= +latex-builder +============= + +Minimal Docker image for building LaTeX documentation. + +Tectonic is used to compile the LaTeX files because tectonic will automatically +fetch any required packages. A large set of packages is prefetched. + +Contains +======== + +* tectonic for the LaTeX compilation, +* texlive-core for latexdiff, +* git-latexdiff, and +* biber for biblatex support. + +History +======= + +V1.2, 2020/09/14 +---------------- + +* Add biber 2.11. Version hardcoded because the latest (2.12) is not compatible with the latest tectonic (0.1.15). +* Therefore hardcode tectonic to 0.1.15. + +V1.1, 2020/05/19 +---------------- + +* Add git-latexdiff. + +V1.0, 2020/15/21 +---------------- + +* Add tectonic. +* Initial version. diff --git a/dockerfiles/latex-builder/example.tex b/dockerfiles/latex-builder/example.tex new file mode 100644 index 0000000000000000000000000000000000000000..44cfd52bd5a34453b945057bfab893d0c3d4c33c --- /dev/null +++ b/dockerfiles/latex-builder/example.tex @@ -0,0 +1,172 @@ +\documentclass[a4paper,twoside,11pt]{article} + +\usepackage{pdfpages} +\usepackage{color} +\usepackage{amsmath} +\usepackage{listings} +\lstloadlanguages{csh, python} + +\usepackage{url} +\usepackage{upgreek} +\usepackage{rotating} +\usepackage[ + pagebackref=false, + pdfpagelabels=true, + plainpages=false, + colorlinks=true]{hyperref} + +\usepackage{chngcntr} + +\usepackage[english]{babel} +\usepackage{lastpage} +\usepackage{multirow} +\usepackage{longtable} +\usepackage{supertabular} +\usepackage{fancyhdr} +\usepackage{graphicx} +\usepackage{mathptmx} +\usepackage{verbatim} +\usepackage{titlesec} +\usepackage{epsfig} +\usepackage{fontspec} + +\usepackage{acronym} +\usepackage{suffix} +\usepackage{xstring} +\usepackage{csquotes} +\usepackage{etoolbox} +\usepackage{biblatex} +\usepackage{pdftexcmds} +\usepackage{ifluatex} +\usepackage{kvsetkeys} +\usepackage{etexcmds} +\usepackage{logreq} + +\setlongtables + +\begin{document} + +\lstset{basicstyle=\ttfamily, + columns=flexible, + frame=single, + backgroundcolor=\color{listingbg}, + captionpos=b, + showspaces=false} + +\setcounter{tocdepth}{2} +\tableofcontents +\cleardoublepage + +Example document that imports many packages for tectonic to cache. + +\section{Section}{}\label{sec:mysec} +Section~\ref{sec:mysec} contains $x < 3$. + +$r_\textrm{H}=10 to 80$ + +\begin{sidewaysfigure}[ht] + \centering + \caption{\textbf{Bold}: normal.} + \label{fig:myfig} +\end{sidewaysfigure} + +\normalsize + +\textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font +{\fontencoding{OT1}\fontfamily{ptm}\selectfont \textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font} +{\fontencoding{OT1}\fontfamily{ptm}\selectfont ABCDEFGHIJKLMNOPQRSTUVWXYZ \fontname\font} +{\fontencoding{T1}\fontfamily{ptm}\selectfont \textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font} + +{\fontencoding{OT1}\fontfamily{lmtt}\selectfont \textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font} +{\fontencoding{T1}\fontfamily{lmtt}\selectfont \textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font} + +{\fontencoding{OT1}\fontfamily{rsfs}\selectfont \textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font} +{\fontencoding{T1}\fontfamily{rsfs}\selectfont \textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font} +{\fontencoding{OT1}\fontfamily{cmsy}\selectfont \textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font} +{\fontencoding{T1}\fontfamily{cmsy}\selectfont \textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font} + +\large + +\textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font +{\fontencoding{OT1}\fontfamily{ptm}\selectfont \textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font} +{\fontencoding{OT1}\fontfamily{ptm}\selectfont ABCDEFGHIJKLMNOPQRSTUVWXYZ \fontname\font} +{\fontencoding{T1}\fontfamily{ptm}\selectfont \textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font} +{\fontencoding{OT1}\fontfamily{lmtt}\selectfont \textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font} +{\fontencoding{T1}\fontfamily{lmtt}\selectfont \textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font} +{\fontencoding{OT1}\fontfamily{rsfs}\selectfont \textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font} +{\fontencoding{T1}\fontfamily{rsfs}\selectfont \textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font} +{\fontencoding{OT1}\fontfamily{cmsy}\selectfont \textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font} +{\fontencoding{T1}\fontfamily{cmsy}\selectfont \textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font} + +\Large + +\textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font +{\fontencoding{OT1}\fontfamily{ptm}\selectfont \textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font} +{\fontencoding{OT1}\fontfamily{ptm}\selectfont ABCDEFGHIJKLMNOPQRSTUVWXYZ \fontname\font} +{\fontencoding{T1}\fontfamily{ptm}\selectfont \textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font} +{\fontencoding{OT1}\fontfamily{lmtt}\selectfont \textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font} +{\fontencoding{T1}\fontfamily{lmtt}\selectfont \textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font} +{\fontencoding{OT1}\fontfamily{rsfs}\selectfont \textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font} +{\fontencoding{T1}\fontfamily{rsfs}\selectfont \textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font} +{\fontencoding{OT1}\fontfamily{cmsy}\selectfont \textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font} +{\fontencoding{T1}\fontfamily{cmsy}\selectfont \textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font} + +\huge +\textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font +{\fontencoding{OT1}\fontfamily{ptm}\selectfont \textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font} +{\fontencoding{OT1}\fontfamily{ptm}\selectfont ABCDEFGHIJKLMNOPQRSTUVWXYZ \fontname\font} +{\fontencoding{T1}\fontfamily{ptm}\selectfont \textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font} +{\fontencoding{OT1}\fontfamily{lmtt}\selectfont \textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font} +{\fontencoding{T1}\fontfamily{lmtt}\selectfont \textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font} +{\fontencoding{OT1}\fontfamily{rsfs}\selectfont \textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font} +{\fontencoding{T1}\fontfamily{rsfs}\selectfont \textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font} +{\fontencoding{OT1}\fontfamily{cmsy}\selectfont \textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font} +{\fontencoding{T1}\fontfamily{cmsy}\selectfont \textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font} + +\Huge + +\textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font +{\fontencoding{OT1}\fontfamily{ptm}\selectfont \textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font} +{\fontencoding{OT1}\fontfamily{ptm}\selectfont ABCDEFGHIJKLMNOPQRSTUVWXYZ \fontname\font} +{\fontencoding{T1}\fontfamily{ptm}\selectfont \textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font} +{\fontencoding{OT1}\fontfamily{lmtt}\selectfont \textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font} +{\fontencoding{T1}\fontfamily{lmtt}\selectfont \textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font} +{\fontencoding{OT1}\fontfamily{rsfs}\selectfont \textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font} +{\fontencoding{T1}\fontfamily{rsfs}\selectfont \textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font} +{\fontencoding{OT1}\fontfamily{cmsy}\selectfont \textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font} +{\fontencoding{T1}\fontfamily{cmsy}\selectfont \textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font} + +\small + +\textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font +{\fontencoding{OT1}\fontfamily{ptm}\selectfont \textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font} +{\fontencoding{OT1}\fontfamily{ptm}\selectfont ABCDEFGHIJKLMNOPQRSTUVWXYZ \fontname\font} +{\fontencoding{T1}\fontfamily{ptm}\selectfont \textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font} +{\fontencoding{OT1}\fontfamily{lmtt}\selectfont \textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font} +{\fontencoding{T1}\fontfamily{lmtt}\selectfont \textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font} +{\fontencoding{OT1}\fontfamily{rsfs}\selectfont \textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font} +{\fontencoding{T1}\fontfamily{rsfs}\selectfont \textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font} +{\fontencoding{OT1}\fontfamily{cmsy}\selectfont \textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font} +{\fontencoding{T1}\fontfamily{cmsy}\selectfont \textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font} + +\tiny + +\textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font +{\fontencoding{OT1}\fontfamily{ptm}\selectfont \textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font} +{\fontencoding{OT1}\fontfamily{ptm}\selectfont ABCDEFGHIJKLMNOPQRSTUVWXYZ \fontname\font} +{\fontencoding{T1}\fontfamily{ptm}\selectfont \textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font} +{\fontencoding{OT1}\fontfamily{lmtt}\selectfont \textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font} +{\fontencoding{T1}\fontfamily{lmtt}\selectfont \textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font} +{\fontencoding{OT1}\fontfamily{rsfs}\selectfont \textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font} +{\fontencoding{T1}\fontfamily{rsfs}\selectfont \textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font} +{\fontencoding{OT1}\fontfamily{cmsy}\selectfont \textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font} +{\fontencoding{T1}\fontfamily{cmsy}\selectfont \textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font} + + +\itshape + +{\fontencoding{OT1}\fontfamily{ptm}\selectfont \textbf{ab}cd\textit{ef}ghijklmnopqrstuvwxyzfifl \fontname\font} +ABCDEFGHIJKLMNOPQRSTUVWXYZ\fontname\font +{\fontencoding{OT1}\fontfamily{ptm}\selectfont ABCDEFGHIJKLMNOPQRSTUVWXYZ \fontname\font} + +\end{document} diff --git a/templates/latex.yml b/templates/latex.yml index d661038b6dc53b79d31d25ca9ec6585c0ee7a7ab..ac04bc327de9b1324453b898803b1b6dd8eef3dd 100644 --- a/templates/latex.yml +++ b/templates/latex.yml @@ -2,8 +2,7 @@ include: - local: '/templates/shared/all.yml' .abstract_pdf_job: - # Image from https://github.com/omegacen/docker-latex-builder - image: omegacen/latex-builder:latest + image: ${CI_AWE_IMAGE_BASE}/latex-builder:${CI_AWE_IMAGE_TAG} before_script: # Determine the main LaTeX file. Can be specified manually in FILENAME_TEX. # 1) Use git grep to find all tex files with a documentclass.