Tobias Westmeier

Astrophysicist & Radio Astronomer

Schematic overview of markup languages

The following document provides a schematic overview of a selection of frequently used elements of the markup languages HTML and LATEX. This overview is not intended to be complete or serve as an introduction to these languages.

Font and character settings

Element HTML 4 CSS 2 LATEX 2ε
Bold <b>...</b> font-weight:bold; \textbf{...}
Italic <i>...</i> font-style:italic; \textit{...}
Slanted   font-style:oblique; \textsl{...}
Teletype <tt>...</tt> font-family:monospace; \texttt{...}
Small capitals   font-variant:small-caps; \textsc{...}
Sans-serif   font-family:sans-serif; \textsf{...}
Emphasis <em>...</em>   \emph{...}
Superscript <sup>...</sup>   ^{...} (in math mode)
Subscript <sub>...</sub>   _{...} (in math mode)

Note that in HTML 5 the <b> and <i> elements have a different meaning and the <tt> element is no longer supported.

Document structure

Element HTML 4 / 5 LATEX 2ε
Heading <h1>...</h1>
<h2>...</h2>
<h3>...</h3>
<h4>...</h4>
<h5>...</h5>
<h6>...</h6>
\begin{chapter}...\end{chapter} (books only)
\begin{section}...\end{section}
\begin{subsection}...\end{subsection}
\begin{subsubsection}...\end{subsubsection}
Paragraph <p>...</p> Separated by two line breaks in the source file
Line break <br /> \\
Unordered list <ul>
<li>...</li>
</ul>
\begin{itemize}
\item ...
\end{itemize}
Ordered list <ol>
<li>...</li>
</ol>
\begin{enumerate}
\item ...
\end{enumerate}
Definition list <dl>
<dt>...</dt>
<dd>...</dd>
</dl>
\begin{description}
\item[...] ...
\end{description}
Footnote   \footnote{...}
Internal references Anchor:
id="..."

Reference:
<a href="#...">...</a>
Anchor:
\label{...}

Reference:
\ref{...}

Alternatively:
\autoref{...} (Requires package hyperref)
External references <a href="...">...</a> \hyperref[link]{text} (Requires package hyperref)

Note that in HTML 5 the <h1> to <h6> elements have a slightly different semantic meaning compared to HTML 4.

Tables, figures, and equations

Element HTML 5 LATEX 2ε
Table with content <table>
<caption>...</caption>
<thead>
<tr>
<th>...</th>
</tr>
</thead>
<tbody>
<tr>
<td>...</td>
</tr>
</tbody>
<tfoot>
<tr>
<td>...</td>
</tr>
</tfoot>
</table>
\begin{table}[...]
\caption{...}
\begin{tabular}{...}
... & ... & ... \\
\end{tabular}
\end{table}
Image / figure <figure>
<img src="..." width="..." height="..." alt="..." />
<figcaption>...</figcaption>
</figure>
\begin{figure}[...]
\includegraphics[width=,heigh=]{...}
\caption{...}
\end{figure}


(Requires package graphicx)
Equation <math>...</math>

(Requires MathML; implicitly embedded in HTML 5)
As a separate paragraph:
\begin{equation}...\end{equation}

Inline (within the running text):
$...$

Note that in HTML 4 the <figure> and <figcaption> elements are not supported, and the <math> element requires MathML to be explicitly embedded.