diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 427cb8114254954bcb3926147853b7f02eee9862..1a9ec6ff11a07333487d77daff360fd2eee0766e 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,26 +1,18 @@
-# This file is a template, and might need editing before it works on your project.
-# To contribute improvements to CI/CD templates, please follow the Development guide at:
-# https://docs.gitlab.com/ee/development/cicd/templates.html
-# This specific template is located at:
-# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/LaTeX.gitlab-ci.yml
-
----
-variables:
-  # Feel free to choose the image that suits you best.
-  # blang/latex:latest ... Former image used in this template. No longer maintained by author.
-  # listx/texlive:2020 ... The default, referring to TexLive 2020. Current at least to 2021-02-02.
-
-  # Additional alternatives with high Docker pull counts:
-  # thomasweise/docker-texlive-full
-  # thomasweise/texlive
-  # adnrv/texlive
-  LATEX_IMAGE: listx/texlive:2020
+compile_pdf:
+  stage: build
+  image: timnn/texlive  # use a Docker image for LaTeX from https://hub.docker.com/
+  script: pdflatex main.tex  # build the pdf just as you would on your computer
+  artifacts:
+    paths: 
+      - main.pdf  # instruct GitLab to keep the main.pdf file
 
-build:
-  image: $LATEX_IMAGE
+pages:
+  stage: deploy
   script:
-    - latexmk -pdf
-
+    - mkdir public  # create a folder called public
+    - cp main.pdf public  # copy the pdf file into the public folder
   artifacts:
-    paths:
-      - "*.pdf"
+    paths: 
+      - public  # instruct GitLab to keep the public folder
+  only: 
+    - main  # deploy the pdf only for commits made to the main branch