MyST

# Scientific PDFs

You can render your MyST documents as print-ready scientific papers, by converting to $\LaTeX$ and render to over 400 journal templates already available. Alternatively, you can also render your documents as Beamer presentations or as to share with other collaborators.

## #Exporting to PDF

To create a new pdf export type for your MyST document, in your document frontmatter, add an exports list:

---
title: My PDF
exports:
- format: pdf
template: arxiv_two_column
output: exports/my-document.pdf
---

To build the exports, use the myst build command, which will work with your project structure if it exists and create a document in the output path that you specify.

myst build my-document.md

Based on the output field in the export list in the , the PDF and a log file will be written to exports/my-document.pdf and any associated log files. If the output file is a folder, the document name will be used with a .pdf or .tex extension, as appropriate. Any necessary auxilary files (e.g. for example *.png or *.bib) will be added to the base folder (exports/ above).

## #Rendering PDFs with $\LaTeX$

The rendering process for scientific PDFs uses $\LaTeX$ and makes use of the jtex templating library, to convert to $\LaTeX$ the myst-to-tex packages is used. The libraries work together with mystjs for sharing information about (e.g. title, keywords, authors, and affiliations).

To include the $\LaTeX$ source code as well as the included images, change the format to:

tex
create a folder containing the $\LaTeX$ source code, referenced images, citation files, and any class files required by the template.
tex+pdf
create a folder containing all the same outputs as tex as well as run the build process for the pdf.
pdf
Run the above processes in a temporary folder, and only copy in the PDF export and any log files if there are problems.

### #Install $\LaTeX$

See the official documentation for installation instructions for $\LaTeX$ at:

## #Choosing a Template

There are currently 422 journals supported and it is straghtforward to add new personal templates, or contribute them back to the community.

To list all of the public tempaltes, use the myst templates command:

myst templates --format pdf --tag two-column

> arXiv (Two Column)       arxiv_two_column
> Description: A two column arXiv compatible template
> Tags: paper, two-column, preprint, arxiv, bioarxiv, eartharxiv
>
> ...

Once you have found a template, you can list detailed information about the parts and options that the template exposes using:

myst templates arxiv_two_column

> ID: public/arxiv_two_column
> Version: 1.0.0
> Author: Brenhin Keller
> Description: A two column arXiv compatible template
> Tags: paper, two-column, preprint, arxiv, bioarxiv, eartharxiv
>
> Parts
> abstract (required) - Keep it short — abstracts longer than 1920 characters will not be accepted ...
>
> Options
> line_numbers (boolean) - Turn line numbers on in the PDF

There are two ways to provide information to a template, through parts and options.

## #Template parts

The parts of a template are things like abstract, acknowledgments or data_availability, they are usually written pieces of a document, but are placed specifically in a template. For example, an abstract usually has a place in templates, with a box or other typographic choices applied. These parts can be marked as required, and will raise error in the PDF export process, however, myst will always try to complete the build.

A part of a template is defined using metadata on a MyST :

+++ { "part": "abstract" }

MyST (Markedly Structured Text) is designed to create publication-quality documents
written entirely in Markdown. The markup and publishing build system is fantastic,
MyST seamlessly exports to any PDF template, while collecting metadata to make your
writing process as easy as possible.

+++

# Introduction

### #Template options

Template authors should choose to use properties where possible, however, all templates can also expose custom options through their . Include options for the build in the exports list. For example, to turn on line_numbers in the template, add the option to the dictionary.

1
2
3
4
5
6
7
8
---
title: My PDF
exports:
- format: pdf
template: arxiv_two_column
output: exports/my-document.pdf
line_numbers: true
---

Any unrecognized, or malformed entries will be logged as errors as well as required options that are not provided.

## #Creating a Template

The export list can also point to local templates, for $\LaTeX$ these are built using jtex, and you can learn more about how to create a template for: and .

To make use of the template locally, validate it using jtex check and then point to the template folder in your export:

Please consider to the growing list of templates so that other people can benefit and improve your work!