Changes

Jump to navigation Jump to search
1,325 bytes added ,  02:10, 5 September 2005
Added the "more reusable" solution.
== 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. Thus, we can define an <code>abstract</code> environment using the following commands: <texcode>\def\startabstract{% \midaligned{todo|Write this whole section\bf Abstract} \startnarrower[2*middle]}\def\stopabstract{% \stopnarrower}</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>\starttext\startabstractThis is the document's abstract. It contains enough text for two lines, along but no more.\stopabstract This is the main text of the document. Like the abstract, it contains enough textfor two lines , to show the margins.\stoptext</texcode> This, of course, produces exactly the same result as the parallel section in previous illustration. <context>\starttext\midaligned{\bf Abstract}\startnarrower[2*middle]This is the document's abstract. It contains enough text for two lines, but no more.\stopnarrower\blank[Document Titles]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