Allowed LaTeX syntax for page writing
In the scientific community, it is very common to have texts, equations, and full documents already written in LaTeX. This implies that one needs to translate such content to the Quarto Markdown syntax explained in the previous guide. However, this template allows for the use of some simple LaTeX syntax (in combination with native syntax), which is converted on the fly to the correct Quarto Markdown format. This document serves as both a guide and a test file for the translation rules. It is written using the supported LaTeX commands to explain exactly how the transformation works.
The compatibility is implemented as a simple text replacer and not a full LaTeX compiler. This means that any LaTeX environment or command that is not explicitly demonstrated on this page is not supported and will not be automatically replaced. For those unsupported elements, native Quarto Markdown syntax must be used.
Sections and Subsections
When structuring a document using standard LaTeX sectioning, the script will translate those commands into Markdown headers. For example, typing \section{Sections and Subsections} generates a main section header. Similarly, using the \subsection{This is a subsection} command produces a secondary heading, and \subsubsection{This is a sub-subsection} creates a tertiary heading.
This is a subsection
This is a sub-subsection
Because the script converts this directly into native Markdown, the system automatically generates a reference identifier for it based on the heading’s name (lowercase, using hyphens instead of spaces). This allows you to easily link back to the translated section using standard Markdown linking, such as typing [this section](#sections-and-subsections) to navigate back to this section.
Mathematical Equations
The native Quarto Markdown syntax for inline and unnumbered formulas (using single and double $ symbols) is the exact same as in LaTeX, so no translation is needed. For numbered equations produced by the equation environment, the script finds the block, extracts the math, and converts it into the native Quarto syntax. To ensure the script correctly translates the reference into Quarto’s rigid cross-referencing system, the label must begin with either the standard LaTeX eq: or Quarto’s eq- prefix:
\begin{equation}
x=\frac{-b\pm \sqrt{b^2-4ac}}{2a} \,,
\label{eq:secondorder_latex}
\end{equation}Once processed, the equation is displayed and numbered automatically:
\[ x=\frac{-b\pm \sqrt{b^2-4ac}}{2a} \,, \tag{1}\]
Thanks to this automated translation, the equation can now be referenced anywhere using the standard LaTeX \ref{eq:secondorder_latex} to output just the number, or \eqref{eq:secondorder_latex} to automatically wrap the number in parentheses, like it has been done for Eq. (1).
Beyond the standard equation environment, the translation script also supports automatic translation of align, gather, and split environments. For example,
\begin{align}
A &= B + C \label{eq:systems_latex_1} \\
X &= Y - Z \label{eq:systems_latex_2}
\end{align}will automatically render as an aligned block:
\[ \begin{aligned} A &= B + C \\ X &= Y - Z \end{aligned} \tag{2}\]
However, to ensure compatibility with Quarto’s cross-referencing engine, these environments are translated into Quarto’s inner environments (aligned, gathered, and split) wrapped inside a single display math block with a single label ($$...$$ {#eq-ref}). This means that the whole block can only have a single shared label (the first one), which can then be used for referencing, such as in Eq. (2).
Text Formatting
Standard LaTeX text formatting commands are fully supported. If text is wrapped in the \textit{italic} command, it will be rendered as italic. Likewise, using the \textbf{bold} command ensures the text is rendered as bold. Behind the scenes, the script simply replaces these LaTeX tags with the single (*) and double (**) asterisks used in Markdown. Similarly, one can use the \textcolor{red}{colored text} command to produce colored text.
Links and Citations
Hyperlinks created with the standard href command are easily converted. When the script sees a command like \href{https://github.com/MKReyesH/ScientificWiki}{GitHub Repository}, it rearranges the URL and the text into the correct Markdown format, rendering a clickable link (e.g. GitHub Repository).
For bibliography management, the standard citation commands continue to function perfectly. A command like \cite{ReyesHung:2023udr} is directly converted, producing a formatted citation like [@ReyesHung:2023udr] in the text (e.g. [1]). If multiple papers are cited inside the exact same command, such as \cite{ReyesHung:2023udr, AnotherCitation}, the script will properly separate them and display a combined citation.
Lists, Figures, Tables, Footnotes and Everything Else
Inserting footnotes, lists, figures, and tables in LaTeX usually requires the use of much more complicated syntax than doing it directly in Markdown. Translating these elements using a simple script is incredibly fragile due to decoupled structures, nested elements, and the possible mixing of different environments.
Therefore, these elements (and in general, any other LaTeX syntax not explicitly mentioned on this page) are not supported for automatic translation. If the script encounters them, they will likely be broken or removed from the final webpage. If any of these elements are needed for your document, please use the much easier, native Quarto Markdown syntax, as shown in the Quarto Markdown Guide.