Changes

Jump to navigation Jump to search
311 bytes removed ,  13:24, 9 August 2020
m
Text replacement - "<cmd>" to "{{cmd|"
< [[From LaTeX to ConTeXt]] | [[Document Titles]] >
 
{{todo|This is sort of a stub article which I sketched out to remind myself what I wanted to write later. If anyone else wants to work on it, feel free!}}
== LaTeX ==
== ConTeXt: A more reusable solution ==
As with [[Document Titles]], to replicate the spirit of the LaTeX environment, we might want to separate the document formatting commands from the actual text of the abstract. ThusThe low-level Context command {{cmd|definestartstop}} defines a pair of {{cmd|start}} - {{cmd|stop}} commands, so we can define an <code>abstract</code> environment using the following commands:
<texcode>
\def\startabstract{%definestartstop [abstract] [before={\midaligned{\bf Abstract} \startnarrower[2*middle]}, after={\def\stopabstract{%stopnarrower \stopnarrowerblank[big]}]
</texcode>
This code can be placed in the document header, or can be placed in a module file to be loaded in a number of documents. It could also be enhanced by <{{cmd>|if</cmd> }} statements to distinguish between the one-column and two-column cases, as LaTeX does. In any case, once these commands are defined, they can be used in the obvious manner.
<texcode>
This, of course, produces exactly the same result as the previous illustration.
<context>\starttext\midaligned{\bf Abstract}\startnarrower[2*middle[Category:From LaTeX]This is the document's abstract. It contains enough text for two lines, but no more.\stopnarrower\blank[bigThis is the main text of the document. Like the abstract, it contains enough textfor two lines, to show the margins.\stoptext</context>

Navigation menu