From a14506a1ce38a51c290f0d1f065ee47f82631e54 Mon Sep 17 00:00:00 2001
From: Bela <felix.hilsky@mailbox.tu-dresden.de>
Date: Mon, 20 Apr 2020 12:52:13 +0200
Subject: [PATCH] install and explain ci

---
 .gitlab-ci.yml | 11 +++++++++++
 .latexmkrc     |  4 ++++
 README         |  8 ++++++++
 tex/.latexmkrc |  1 +
 4 files changed, 24 insertions(+)
 create mode 100644 .gitlab-ci.yml
 create mode 100644 .latexmkrc
 create mode 120000 tex/.latexmkrc

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..f652d32
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,11 @@
+image: mirisbowring/texlive_ctan_full:2019
+
+compiling:
+  script:
+      # use settings from .latexmkrc
+    - latexmk
+    - mv out/main.pdf Felix-Hilsky-FANA-HA-SoSe2020.pdf
+  artifacts:
+    paths:
+    - "Felix-Hilsky-FANA-HA-SoSe2020.pdf"
+    expire_in: 40 weeks
diff --git a/.latexmkrc b/.latexmkrc
new file mode 100644
index 0000000..1e5733f
--- /dev/null
+++ b/.latexmkrc
@@ -0,0 +1,4 @@
+# 4 = lualatex, do not know why this magic number, see CTAN repository with latexmkrc examples
+$pdf_mode= 4 ;
+@default_files = ('.maindir/tex/main.tex');
+$out_dir = '.maindir/out';
diff --git a/README b/README
index 82da55b..6d81e60 100644
--- a/README
+++ b/README
@@ -7,3 +7,11 @@ Man kann jede Datei im Ordner /tex einzeln kompilieren. Dafür sind einige Hürd
 • \docStart und \docEnd hätten eigentlich ein environment sein sollen. Dabei gab es aber den Fehler, dass dieses Environment angeblich nicht beendet wurde bevor das Dokument mit \end{document} beendet wurde. Interessanterweise konnte ich den Fehler aber nicht zuverlässig reproduzieren, sondern nur bei Dateien, die keine weiteren eingefügt haben oder irgendeine andere irrelevante Eigenschaft haben.
 
 • Die Datei tex/_TEMPLATE.tex beinhaltet die Dinge, die in jede (Unter-)datei, die auch alleine kompilieren soll, rein muss. Beim erstellen eines neuen Kapitels kopiert man also _TEMPLATE.tex.
+
+• In order to have a clean repo without all the cluttering temporary latex files there exists the .latexmkrc file in the main directory and a symlink to it in the /tex directory. It specifies to put these files into /out, no matter where you are (thanks to .maindir) and to use lualatex.
+
+• If you work with gitlab you can use the CI. For this there is the .gitlab-ci.yml file that tells gitlab to compile the main file and make it avaiable as an artifact. Then it is avaiable under the api link
+https://your.gitlab.instance.de/api/v4/projects/your-project-id/jobs/artifacts/master/raw/main.pdf?job=compiling
+You get the project id visible on the main page of your project. master is the branch you want to use for that continous compiling and compiling is the name of the job, specified in the .gitlab-ci.yml. main.pdf is the name of the file generated, specified via the main tex-file name and the .latexmkrc.
+For example this gives:
+https://gitlab.mn.tu-dresden.de/api/v4/projects/44/jobs/artifacts/master/raw/out/skript-numerik-sander.pdf?job=compiling
diff --git a/tex/.latexmkrc b/tex/.latexmkrc
new file mode 120000
index 0000000..20f02ed
--- /dev/null
+++ b/tex/.latexmkrc
@@ -0,0 +1 @@
+../.latexmkrc
\ No newline at end of file
-- 
GitLab