README.md 1.68 KB
Newer Older
Paul Jung's avatar
Paul Jung committed
1
# LaTeX-CI Template for Collaborative LaTeX Projects
Paul Jung's avatar
Paul Jung committed
2

Paul Jung's avatar
Paul Jung committed
3
[![Download PDF](https://img.shields.io/badge/Download-PDF-green)](/../-/jobs/artifacts/master/browse?job=build_latex)
Paul Jung's avatar
Paul Jung committed
4
[![Build Status](/../../../badges/master/pipeline.svg)](/../../../pipelines/latest)
Paul Jung's avatar
Paul Jung committed
5

Paul Jung's avatar
Paul Jung committed
6
## Making a new project:
Paul Jung's avatar
Paul Jung committed
7

Paul Jung's avatar
Paul Jung committed
8
1. Make sure the main tex document is present at the top level of the project and latexmk knows about it.
Paul Jung's avatar
Paul Jung committed
9
2. Make sure all of the plots and other files are included in the project.
Paul Jung's avatar
Paul Jung committed
10
11
3. Optionally, fine tune the build process with the CI variables in `.gitlab-ci.yml`
4. Optionally, add additional download buttons to the project as described below.
Paul Jung's avatar
Paul Jung committed
12
13
14
15
16
17

# Advanced.

## CI Variables:

This is a description of the variables in `.gitlab-ci.yml` and what they do.
Paul Jung's avatar
Paul Jung committed
18
19
- `LATEXMK_FLAGS` pass any command line arguments to latexmk for building.
- `MAIN_TEX_FILE` only necessary if latexmk cannot determine what the main file is. 
Paul Jung's avatar
Paul Jung committed
20
21


Paul Jung's avatar
Paul Jung committed
22
## Adding a Download PDF Button
Paul Jung's avatar
Paul Jung committed
23

Paul Jung's avatar
Paul Jung committed
24
To add a direct link to the PDF on the repository page you can create a new "Badge" in the following menu: Settings -> General -> Badges.
Paul Jung's avatar
Paul Jung committed
25
26
27
Link:
`https://gitlab.triumf.ca/%{project-path}/-/jobs/artifacts/master/download?job=build-latex`
Badge image URL:
Paul Jung's avatar
Paul Jung committed
28
29
`https://img.shields.io/badge/Download-PDF-green`

Paul Jung's avatar
Paul Jung committed
30
31
32
33
34
Similarly, in the README
```[![Download PDF](https://img.shields.io/badge/Download-PDF-green)](/../-/jobs/artifacts/master/raw/<your-document-name>.pdf?job=build_latex)```

This needs to be manually configured for each new project.

Paul Jung's avatar
Paul Jung committed
35
36
37
## Additional Build Steps

For more advanced documents, additional stages may be included to automatically produce the figures directly from data files. This way all of the data as well as plotting scripts are included in the same repository.