Compile multiple LaTeX files using GitLab CI

Problem

I am recording university lectures at LaTeX (which is very convenient for this purpose), and I want the files to be texautomatically compiled into pdf.

I have a couple of files .texin my repository, for example:

.
β”œβ”€β”€ .gitlab-ci.yml
└── lectures
    β”œβ”€β”€ math
    |   β”œβ”€β”€ differentiation
    |   |   β”œβ”€β”€ lecture_math_diff.tex
    |   |   β”œβ”€β”€ chapter_1.tex
    |   |   └── chapter_2.tex
    |   └── integration
    |       β”œβ”€β”€ lecture_math_int.tex
    |       β”œβ”€β”€ chapter_1.tex
    |       └── chapter_2.tex
    └── physics
        └── mechanics
            β”œβ”€β”€ lecture_physics_mech.tex
            β”œβ”€β”€ chapter_1.tex
            └── chapter_2.tex

So, the main file, for example lecture_math_diff.tex, using

\include{chapter_1}
\include{chapter_2}

to form a whole lecture.

And as a result, I want my pdf assembly artifacts to look like this:

β”œβ”€β”€ math
|   β”œβ”€β”€ lecture_math_diff.pdf
|   └── lecture_math_int.pdf
└── physics
    └── lecture_physics_mech.pdf

What can be done here? Do I need to write any shscript to collect all files texor use gitlab runners?

+4

Source: https://habr.com/ru/post/1653595/


All Articles