From LaTeX to ConTeXt
< Main Page >
General hints for converting from LaTeX to Context can be found in
This page offers specific advice on a number of special things that you may be doing with LaTeX, but are not so obvious to do with ConTeXt.
Contents
Document and Page Layout
- Document Titles: Title blocks, as in the standard LaTeX article.
- \thanks{} adds footnoted information, usually to author blocks.
- Article Abstracts: Abstracts from the standard LaTeX article or report.
- KOMA-scrartcl Type Area: An interesting automated type-area setup.
- Unnumbered Sections: Section and subsection headings without numbers.
- Flush bottom
- Vertically Centered Boxes: Centering parboxes and tables in a line of text.
Text Formatting
- Bold small caps
- Bold typewriter: Bold versions of the cmtt family of monospaced fonts.
- Verbatim with line breaks
- ISO-8859-15: Using the ISO Latin-9 (Western European) character encoding for input.
- Description
- The microtype package has its analogue in Protrusion
- So-called (by plain TeX and LaTeX) French spacing
Idiomatic Differences Between ConTeXt and LaTeX
Brackets and Braces
{..} | [..] | |
LaTeX | command arguments | optional arguments |
ConTeXt | typeset material; scope or range of the command (the text acted upon) is placed between curly brackets | setups instructions and metadata (options) |
Optional Arguments and Setups
In ConTeXt, arguments may be either comma separated lists or assignments, but not both. The following example demonstrates that LaTeX allows either syntax in optional arguments:
\documentclass[BCOR=12mm,DIV=calc,twoside]{scrartcl}
(From the KOMA-Script manual.) ConTeXt, however, distinguishes strictly between both types for processing them internally relies on two different mechanisms. Therefore, setups like \itemize usually allow two sets of optional arguments [1], the comma list preceding the assignment:
\starttext \startitemize [R,2*broad][ start=11, before=\startlinecorrection, after=\stoplinecorrection, ] \item Foo, \item bar, \item baz. \stopitemize \stoptext
The ConTeXt interface definitions (collected by Wolfgang in the macro reference) use a special notation to indicate whether an argument expects assignment or list syntax:
\defineframedtext [...] [...] [..,.=.,..]
where [...]
stands for the list type and
[..,.=.,..]
denotates an assignment.
Programming
Document Metadata
Math
Copy-Paste text between LaTeX and ConTeXt
It is sometimes useful to have the same source for a latex document and context presentation (or context document and latex presentation). However, the commands used by both are very different. Can someone describe some definations in context that implement the core functionality of latex commands like \section et al, \textbf et al, \bfseries et al and \begin \end pairs?
The author of this entry is looking for a solution for the described problem. | (See: How to?) |
\section
works the same way as in LaTeX, for mathematics take a look into LaTeX Math in ConTeXt, use \bf
instead of \textbf
for both LaTeX and ConTeXt (or \def\textbf#1{{\bf #1}}
) and as a general rule: use as many plain TeX macros as possible instead of LaTeX-specific macros. \begin ... \end
only works for math as far as I know. See also other documents listed above or ask on the mailing list.
A Vietnamese version of LaTeX in proper ConTeXt is available at VnOSS.
Functionality of Latex Packages in Context
code> code>\textbf /pre> (From the KOMA-Script manual.) ConTeXt, however, distinguishes sharply between both for processing them internally relies on two different mechanisms. Therefore, setups like ConTeXt/Basic Latex|Basic Latex]]
- [[LaTeX