Skip to content

Markdown and LaTeX guidelines

Bill Ticehurst edited this page Apr 26, 2024 · 6 revisions

Overview

This project uses Markdown and LaTeX extensively, such as for the katas and the Q# standard library documentation.

There are various 'flavors' of these syntaxes, as well as different libraries used in different environments in which content is rendered. For example, VS Code's rendering libraries are different to https://quantum.microsoft.com/. In order to ensure consistency a common subset and some content guidelines should be adhered to, which is the goal of this document.

Libraries

The markdown package marked and the LaTeX package MathJax are two of the most popular libraries. However, VS Code uses the markdown-it package for Markdown, and the KaTeX package for LaTeX (via its markdown-it plugin @vscode/markdown-it-katex. These are known for being fast, lightweight, and adhering closely to the documented standards.

Flavors

The syntax supported by the CommonMark markdown spec can be seen at https://spec.commonmark.org/0.31.2/ The GitHub flavored Markdown spec (which extends CommonMark) can be seen at https://github.github.com/gfm/ The list of LaTeX functions that KaTeX supports can be seen at https://katex.org/docs/supported.

As CommonMark is a subset set of GitHub Flavored Markdown, and KaTeX supports a smaller set of functions that MathJax, stick to those subsets for maximum compatibility.

Validation

To verify content will render correctly in those libraries, the below online tools can be used:

Alternatively, author and build your content, then view it locally in the Q# Playground. (See the README for more details.

Guidance

TODO: Provide a bunch of examples of what to do, and what not to do, in authored content.