A paper describing CarboKitten
The source files for the paper should be placed in md/, that is md/paper.md figures in md/fig, and references in md/ref.bib. The paper is written in Markdown, that is then compiled down to LaTeX and PDF using Pandoc. Any source files for the LaTeX (cls files for the Journal template mostly) should be placed in latex/, while Pandoc filters are placed in pandoc/.
Figures should be located in md/fig so that the Markdown renders reasonably well on Github.
Figures and example code should be evaluated by Julia, so there should be a Project.toml, Manifest.toml and src/jl/*.jl for scripts.
Code fragments in the paper should be evaluating to the given output. Something that should be enforced by using Entangled.
All figures should have source files available. If they were created in``` Inkscape, the SVG file is considered 'source' and placed in src/svg.
When the paper is published, a release of the package should be made and artifacts uploaded to Zenodo.
All actions should be available from a Makefile, even if we use brei to build figures from Entangled sources, and latexmk to build the eventual LaTeX. All generated output should appear in build/.
Julia dependencies:
CarboKittenwhat else to talk aboutCairoMakiefor high quality plottingGraphvizDotLangfor drawing graphs
Use Pandoc ≥ 3.1, compiled with Lua support. On Fedora:
dnf install pandocUse TeXLive ≥ 2023, building with LuaTeX and latexmk. On Fedora:
dnf install texlive-scheme-medium latexmk texlive-selnolig texlive-svgpip install entangled-cliOr use the attached pyproject.toml with uv:
uv syncwhich allows you to run entangled and brei through uv, for example:
uv run entangled tangleUsed to combine everything.
Since we're using Pandoc, we can keep our Markdown clean. Any particular items can be given a CSS class or ID and then translated to LaTeX using a Pandoc filter.
A div (being a custom content block) can be marked as follows:
:::abstract
...
:::In this example, we speak of an abstract-div, that is then translated to
\begin{abstract}
...
\end{abstract}A similar thing can be done with spans.
[[email protected]]{.author-email}See the Pandoc documentation.
Citations follow a syntax like @Bosscher1992, where Bosscher1992 is an entry in the md/ref.bib. There are other forms for citation translating to \citet or \citep in LaTeX, see Pandoc documentation.
-
hide.luahides blocks that are marked with:::hide. This is used to hide code blocks. -
fignos.luaandfigref.luanumber the figures and enable referencing those figures in the text. The label should be given at the end of the caption, which should be given as a paragraph following the image, starting withFigure:. Example: -
eqnos.luamakes equations numbered and allows cross referencing them. -
plain_tables.luaconverts tables to\begin{table}...\end{table}environment in LaTeX. This is needed because the default behaviour is to create alongtablewhich doesn't work in 2-column mode. -
wide_figures.luayou can tag a figure with the{.wide}class, so that it will translate to a LaTeXfigure*and a set width of\textwidth.
An example of this profile is shown in Figure @fig:wave-transport-magnitude.
{.wide}
Figure: Depth profile of velocity and shear. The velocity profile was taylored to have a maximum of $10 \textrm{m}/\textrm{yr}$ at a depth of $20 \textrm{m}$. Where the shear is non-zero, there is a net accumulation of sediment. {#fig:wave-transport-magnitude}We use a modified version of the standard Pandoc template for LaTeX output. The copernicus document class and citation styles are shipped in the latex/copernicus directory. The template in latex/template.tex is configured to use the Geoscientific Model Development (gmd) format. To create a (single column) manuscript version, run make manuscript.
To debug the conversion from Markdown to LaTeX it is sometimes useful to look at Pandoc's abstract syntax tree directly. Pandoc can show this when using -t native. This can also run with make debug.