User:Solis/From LaTeX to ConTeXt
Jump to navigation
Jump to search
Example Document
If you're in a hurry, here's a document you can use as a quick reference:
\setuphead[title][align=middle] \setupbodyfont[ebgaramond, 12pt] \setupwhitespace[big] \starttext %---------------------------------------- \title{From \LaTeX{} to \ConTeXt{}} \section{Introduction} \LaTeX and \ConTeXt{} are \bold{overall} \italic{pretty} \color[darkgreen]{similar}.\footnote{Except when they're not!} \placefigure{This is my figure}{ \externalfigure[cow.pdf][width=0.2\textwidth] } \section{Math mode} Inline math-mode can be done the same way: $e^{i \pi} + 1 = 0$. But for display math, we use a different command: \startformula f(a) = \frac{1}{2 \pi i} \oint_\gamma \frac{f(z)}{z - a} \dd{z} \stopformula \startitemize[packed] \item A \item B \item C \stopitemize \startitemize[a, packed] \item One \item Two \item Three \stopitemize \stoptext

Basics
- There's no need to specify a document class.
- There's very little need for external "packages" in ConTeXt. You may load one with \usemodule, if you wish to.
- Instead of
\begin{document}and\end{document}, use \starttext and \stoptext text. - More generally, instead of
\begin{environment}and\end{environment}, use\startenvironmentand\stopenvironment - In a
\command[...]{...}, the different brackets don't denote optional and mandatory arguments, but rather: code inside{...}is what actually gets typeset, and in[...]are the rest: options and configurations. - To configure some aspect of your document, you can likely use
\setupaspect(e.g., \setuppapersize, \setupformula). Browse this wiki for more information.
Math mode
- You can use
$...$for inline math, but also \m[...]{...} for more options. - You must use \startformula for display math.
- To number an equation, put it inside \placeformula{...}
Defining new macros
- To create your own version of a ConTeXt macro, use the
\defineprefix: \defineitemgroup, \definealignment, \defineformula. - To define a command from scratch, use the \define command, or regular TeX macros: \def, \edef, \let
TODO
- References, links, hyperref
- Address amsmath environments
- TOC, bibliography
- Images
- Tables
- Fonts
- Text formatting
- Document layout: paper, margin, whitespace, headers and footers