Difference between revisions of "From LaTeX to ConTeXt"

From Wiki
Jump to navigation Jump to search
(→‎Command syntax: Brackets are used different in ConTeXt and LaTeX:)
Line 26: Line 26:
 
=== Command syntax ===
 
=== Command syntax ===
  
''Looks similar, but...''
+
Brackets are used different in ConTeXt and LaTeX
  
'''LaTeX''':
+
{| border="1" cellspacing="0" cellpadding="2"
"Command arguments are enclosed in curly braces { and },
+
|-
except for optional arguments, which are enclosed in square
+
|  || {..} || [..]
brackets [ and ]."
+
|-
 
+
| LaTeX || command arguments  || optional arguments
'''ConTeXt''':
+
|-
"A command is often followed by setups or by text. Setups
+
| ConTeXt || typeset material; scope or range of the command (the text acted upon) is placed between curly brackets || setups instructions and metadata (options)
are placed between brackets ([]). The scope or range of
+
|-
the command, the text acted upon, is placed between
+
|}
curly brackets ({})."
 
 
 
In other words,
 
 
 
* arguments in {} pairs are typeset material
 
* arguments in [] are setup instructions and metadata
 
  
 
=== Programming ===
 
=== Programming ===

Revision as of 00:53, 9 January 2011

< 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.

Document and Page Layout

Text Formatting

Command syntax

Brackets are used different in ConTeXt and LaTeX

{..} [..]
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)

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