Warning, /acts/docs/white_papers/how_to_add.md is written in an unsupported language. File is not indexed.
0001 # How to add a white paper
0002
0003 The white paper collection is managed through a configuration file that
0004 contains information on registered white papers. This configuration can be
0005 automatically updated from GitHub by a script that will pull some meta
0006 information like the title, authors, and abstract. It will also grab the
0007 latest compiled PDF from the source repository that was created by a
0008 CI job.
0009
0010 To get started, head over to the white paper template
0011 [repository](https://github.com/acts-project/whitepaper-template). There
0012 should be a button toward the top right that says *Use this template*,
0013 which will allow you to create a copy of the template
0014 repository into a repository of your own.
0015
0016 :::{tip}
0017 You can get started by creating a whitepaper repository using the template
0018 under your own account. However, when the document finalizes, consider
0019 moving it into the ACTS organization (`acts-project`), which helps
0020 management of documents.
0021 :::
0022
0023 The project will immediately start building the basic default note with
0024 dummy content using GitHub Actions. You can now clone and start making
0025 changes to the document and compile locally.
0026
0027 :::{tip}
0028 :name: latexmk-tip
0029 The easiest way to compile the document locally is `latexmk`. Simply running `latexmk`
0030 in the root directory will automatically compile the source code the right
0031 number of times. It will also run `biber` that generates the references from the
0032 example `references.bib` file. You don't have to use `latexmk`, but it's very
0033 convenient! The output file when using `latexmk` will be in a subfolder `build`
0034 of the root directory.
0035 :::
0036
0037 :::{tip}
0038 The note template requires LuaLatex, which should be found in any default
0039 LaTeX installations. `latexmk` is configured to use LuaLatex by default.
0040 :::
0041
0042 ## Integrate with Overleaf
0043
0044 [Overleaf](https://www.overleaf.com) is a convenient web-based LaTeX authoring tool. It has GitHub integration 🎉!
0045
0046 :::{image} figures/overleaf_import_github.png
0047 :align: center
0048 :::
0049
0050 You can then go to the *Menu* on the top right, and click on *GitHub* in the drawer menu to pull changes from GitHub, and to push changes that you made on Overleaf!
0051
0052 :::{danger}
0053 Overleaf is not particularly good at handling merge conflicts, so try not to make changes on both GitHub and Overleaf.
0054 :::
0055
0056 For the document to compile without errors on Overleaf, you will have to change the compiler to LuaLatex, by going to *Menu* in the top right, and changing the *Compiler* setting:
0057
0058 :::{image} figures/overleaf_compiler.png
0059 :align: center
0060 :::
0061
0062 ## Template repository structure
0063
0064 The content of the template repository will look something like this:
0065
0066 ```console
0067 whitepaper-template
0068 ├── main.tex
0069 ├── metadata.tex
0070 ├── abstract.tex
0071 ├── references.bib
0072 ├── latexmkrc
0073 └── theme
0074 ├── acts.sty
0075 └── logo_acts.pdf
0076 ```
0077
0078 - `main.tex` is the root source file for the document, and you can edit it to
0079 changed the content of the document.
0080
0081 - `metadata.tex` and `abstract.tex` contain the document title, authors and
0082 abstract. Their content is consumed by the workflow described in
0083 [](#whitepaper_index_update).
0084
0085 `metadata.tex` contains the two standard LaTeX commands:
0086
0087 ```tex
0088 \title{A whitepaper about a topic}
0089 \author{First Author \and Second Author}
0090 ```
0091
0092 Note how the `\author` directive is given multiple authors separated by `\and`.
0093 The workflow below uses the literal `\and` to separate out different authors.
0094
0095 `abstract.tex` contains the **content** of the abstract only, and is loaded
0096 into the abstract in the `main.tex` document like:
0097
0098 ```tex
0099 \begin{abstract}
0100 \input{abstract.tex}
0101 \end{abstract}
0102 ```
0103
0104 :::{warning}
0105 While LaTeX supports arbitrary content in the abstract, the index that lives in
0106 the documentation only supports basic math markup.
0107 :::
0108
0109 - `references.bib` contains an example reference in standard *bibtex* format, and
0110 is a good place to add any additional references that you want to cite in
0111 your document.
0112
0113 - `latexmkrc` configures `latexmk` (see [here](#latexmk-tip))
0114
0115 - `theme` contains the overall theme of the document. You do not typically need
0116 to change anything in this folder.
0117
0118 (whitepaper_index_update)=
0119 ## Update the white paper overview
0120
0121 The white paper overview in this documentation [here](#white-paper-index) is
0122 automatically generated using a registry file and a script, both of which are
0123 located in the main ACTS repository under `docs`.
0124
0125 The registration file `docs/white_papers.toml` contains a list of all
0126 known white papers, and also stores metadata information on the white paper. It looks something like:
0127
0128 ```toml
0129 [[white_papers]]
0130 repository = "https://github.com/acts-project/whitepaper-template"
0131
0132 [white_papers.metadata]
0133 authors = [ "First Author", "Second Author",]
0134 title = "A whitepaper about a topic"
0135 description = "This is a whitepaper example. It contains a number of example\npatterns, layouts etc.\nSimple math like $a + b = c$ or even $\\sqrt{s} = 14$ TeV is supported!\n\nQuisque ullamcorper placerat ipsum. Cras nibh. Morbi vel justo vitae lacus\ntincidunt ultrices. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. In hac\nhabitasse platea dictumst. Integer tempus convallis augue. Etiam facilisis. Nunc\nelementum fermentum wisi. Aenean placerat. Ut imperdiet, enim sed gravida\nsollicitudin, felis odio placerat quam, ac pulvinar elit purus eget enim. Nunc vitae\ntortor. Proin tempus nibh sit amet nisl. Vivamus quis tortor vitae risus porta\nvehicula."
0136 ```
0137
0138 `[[white_papers]]` indicates a white paper entry, while `[white_papers.metadata]` is a dictionary containing the metadata for that white paper.
0139
0140 :::{note}
0141 `[white_papers.metadata]` is auto-generated!
0142 :::
0143
0144 To add a new white paper, simply add a new section at the bottom of the file:
0145
0146 ```toml
0147 [[white_papers]]
0148 repository = "https://github.com/acts-project/another-whitepaper"
0149 slug = "another-whitepaper"
0150 ```
0151
0152 Note that `slug` should be lower case, not contain spaces, and be unique.
0153
0154 The script `docs/white_papers.py` is used to complete the metadata information
0155 for the white papers. To run it, you need to install the dependencies in
0156 `docs/requirements.txt` using `pip`.
0157
0158 :::{tip}
0159 It is **strongly recommended** to use a [virtual
0160 environment](https://realpython.com/python-virtual-environments-a-primer/) for
0161 this purpose! For example, run
0162
0163 ```console
0164 $ python -m venv venv
0165 $ source venv/bin/activate
0166 ```
0167
0168 to create a local virtual environment, and then run the `pip` command above.
0169 :::
0170
0171 You also need the `convert` executable from
0172 [ImageMagick](https://imagemagick.org/) available on your `$PATH`. You can
0173 then run
0174
0175 ```console
0176 $ white_papers.py pull --github-token $GITHUB_TOKEN
0177 ```
0178
0179 which will for each white_paper listed in `white_papers.toml`
0180
0181 1. Download the most recent PDF of the document built by that repository's CI
0182 2. Make a PNG of the first page of that PDF to be displayed in the documentation
0183 3. Download `metadata.tex` and `abstract.tex` from the repository, and parse
0184 them to extract the title, authors and abstract content.
0185
0186 :::{important}
0187 Make sure to create a tag on GitHub before running this command! This is good
0188 for organizational purposes, but also allows directly linking to the PDF that
0189 is generated by the CI for that tag.
0190 :::
0191
0192 Afterwards, the `white_papers.toml` should now contain updated information from
0193 all listed white papers. The `white_papers.toml` file is used to automatically
0194 generate a white paper index, that is then used by the regular documentation
0195 build, which you can read more about [here](#build_docs).