Skip to content
Snippets Groups Projects
Commit 692fe552 authored by Marius Meyer's avatar Marius Meyer
Browse files

Initial commit

parents
No related branches found
No related tags found
No related merge requests found
stages:
- build
- upload
- release
default:
tags:
- imt-no-sla
variables:
# Package version can only contain numbers (0-9), and dots (.).
# Must be in the format of X.Y.Z, i.e. should match /\A\d+\.\d+\.\d+\z/ regular expresion.
# See https://docs.gitlab.com/ee/user/packages/generic_packages/#publish-a-package-file
PACKAGE_VERSION: "0.1"
PDF_FILE: "quarto-overview-${PACKAGE_VERSION}.pdf"
PACKAGE_REGISTRY_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/quarto-overview/${PACKAGE_VERSION}"
build_pdf:
stage: build
image: texlive/texlive:latest
cache:
- key:
files:
- julia-folder.lock
paths:
- /root/.julia
script:
- apt-get update && apt-get install -y --no-install-recommends make pandoc curl gdebi-core librsvg2-bin && rm -rf /var/lib/apt/lists/*
- curl -fsSL https://install.julialang.org | sh -s -- -y --default-channel release
- source /root/.bashrc
- julia -e "using Pkg; Pkg.add(\"IJulia\"); Pkg.add(\"Conda\")"
- julia -e "using IJulia; IJulia.installkernel(\"julia\")"
- julia -e "using Conda; Conda.add(\"jupyter\"); Conda.add(\"jupyter-cache\")"
- curl -LO https://quarto.org/download/latest/quarto-linux-amd64.deb
- gdebi --non-interactive quarto-linux-amd64.deb
- quarto check
- quarto render README.qmd --to pdf
artifacts:
paths:
- README.pdf
upload:
stage: upload
image: curlimages/curl:latest
rules:
- if: $CI_COMMIT_TAG
script:
- |
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file README.pdf "${PACKAGE_REGISTRY_URL}/${PDF_FILE}"
release:
# Caution, as of 2021-02-02 these assets links require a login, see:
# https://gitlab.com/gitlab-org/gitlab/-/issues/299384
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
rules:
- if: $CI_COMMIT_TAG
script:
- echo "Create a release!"
release:
name: "Release $CI_COMMIT_TAG"
description: "Created using the release-cli"
tag_name: "$CI_COMMIT_TAG"
ref: "$CI_COMMIT_TAG"
assets:
links:
- name: "$PDF_FILE"
url: "${PACKAGE_REGISTRY_URL}/${PDF_FILE}"
build_pages:
stage: build
image: julia:latest
cache:
- key:
files:
- julia-folder.lock
paths:
- /root/.julia
script:
- apt-get update && apt-get install -y --no-install-recommends make pandoc curl gdebi-core && rm -rf /var/lib/apt/lists/*
- julia -e "using Pkg; Pkg.add(\"IJulia\"); Pkg.add(\"Conda\")"
- julia -e "using IJulia; IJulia.installkernel(\"julia\")"
- julia -e "using Conda; Conda.add(\"jupyter\"); Conda.add(\"jupyter-cache\")"
- curl -LO https://quarto.org/download/latest/quarto-linux-amd64.deb
- gdebi --non-interactive quarto-linux-amd64.deb
- quarto check
- make install_deps
- make html
artifacts:
paths:
- README_files
- README.html
pages:
stage: release
script:
- mkdir .public
- cp -r figures .public
- cp -r README_files .public
- cp README.html .public/index.html
- mv .public public
artifacts:
paths:
- public
dependencies:
- build_pages
only:
- main
[deps]
IJulia = "7073ff75-c697-5162-941a-fcdaad2a7d2a"
---
title: Quarto for Scientific Publications
author: Marius Meyer
jupyter: julia-1.9
---
# Using Quarto for Scientific Publications
[Quarto](https://quarto.org) describes itself as *an open-source scientific and technical publication system*.
It makes use of [Pandoc](https://pandoc.org) to convert Pandoc-compatible markdown into books, articles, presentations, websites or other formats.
In addition, Quarto includes easy use of equations, citations, and references as we are all used to from LaTex.
Even this readme can be converted into a PDF with Quarto:
```
quarto render README.qmd --to pdf
```
# VS Code Setup
Several helpful plugins exist for VS Code covering most important steps when creating a Document.
My setup makes use of the following Plugins:
- [General Quarto Support](https://marketplace.visualstudio.com/items?itemName=quarto.quarto)
- [Draw.io (Creating SVGs)](https://marketplace.visualstudio.com/items?itemName=hediet.vscode-drawio)
- [Julia (Plotting, data processing)](https://marketplace.visualstudio.com/items?itemName=julialang.language-julia)
- Instead of Julia, Quarto also supports other languages (Python, R)
# Data Processing and Plotting using Julia
Quarto supports the generation of Jupyter notebooks from markdown files as an itermediate step when generating a document.
These notebooks can contain executable cells and these cells as well as their output *can* be part of the final document.
With that, we can create our plots directly in the document source from the most recent data.
Please refer to the official documentation for [setup instructions](https://quarto.org/docs/computations/julia.html#installation).
It is recommended to also install the `jupyter-cache` package to speed up document generation.
# Installing the ACM Template
We assume Quarto is already installed on the system.
Execute the following line to create a new project with the ACM template:
```
quarto use template quarto-journals/acm
```
You will have to provide a name for the document. We will use `example` in the following.
The command above will create a new directory `example` with several files and folder in there. The most important file for us is the `example.qmd`, which is the source code for our document.
We can render the template into a PDF with the following command:
```
quarto render example/example.qmd
```
How about creating a website from the same document?
```
quarto render example/example.qmd --to acm-html
```
Take a look at the provided template `example/example.qmd` to get an idea of cross-references, citations, and more.
An IEEE template is also available:
```
quarto use template gael-close/ieeetran
```
Note, that all templates are available on GitHub and can easily be forked and modified to your personal needs!
You can find a (incomplete) list of journal template here: [https://github.com/quarto-journals](https://github.com/quarto-journals)
# CI/CD
An example `.gitlab-ci.yml` file can be found in this repository.
It contains rules to build a website and PDF from source using the IMT GitLab runner and deploy it on our GitLab instance.
The generated generated website can be found here.
# Julia Code in Document
This is a small example how to execute Julia code within a document.
Note, that the code itself and the output are visible. Set `echo: false` in the julia code cell to hide the code.
Take a look into the [official documentation](https://quarto.org/docs/computations/julia.html) to find out more!
```{julia}
#| echo: true
println("Hello World!")
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment