Difference between revisions of "Article Abstracts"

From Wiki
Jump to navigation Jump to search
(Added proper LaTeX example.)
(Added a simple ConTeXt solution.)
Line 18: Line 18:
 
== ConTeXt: A simple solution ==
 
== ConTeXt: A simple solution ==
  
The simplest way of producing an abstract in a ConTeXt document is to specify the formatting directly.  The following version is a close approximation of the version produced by the <code>\abstract</code> command in LaTeX's startard article class.
+
The simplest way of producing an abstract in a ConTeXt document is to specify the formatting directly.  The code from LaTeX's <code>classes.dtx</code> is nearly trivial, and is quite easy to replicate in ConTeXt idioms.
  
 
<texcode>
 
<texcode>
% Again, this is filler from the Document Titles page.
+
\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[big]
  
 +
This is the main text of the document.  Like the abstract, it contains enough text
 +
for two lines, to show the margins.
 +
\stoptext
 +
</texcode>
 +
 +
<context>
 
\starttext
 
\starttext
\startalignment[center]
+
\midaligned{\bf Abstract}
  \blank[2*big]
+
\startnarrower[2*middle]
    {\tfd How to do this in Context}
+
This is the document's abstract.  It contains enough text for two lines, but no more.
  \blank[3*medium]
+
\stopnarrower
    {\tfa The author}
+
\blank[big]
  \blank[2*medium]
 
    {\tfa July 26, 2005}
 
  \blank[3*medium]
 
\stopalignment
 
  
Then, the actual text of the document starts hereWe'll put in enough text to
+
This is the main text of the document.  Like the abstract, it contains enough text
fill out the line and start to make a paragraph.
+
for two lines, to show the margins.
 
\stoptext
 
\stoptext
</texcode>
+
</context>
  
{{todo|Find the code in LaTeX's <tt>classes.dtx</tt> for setting abstracts, translate into ConTeXt, and put in the above example.}}
+
In the two-column document classes, LaTeX's <code>abstract</code> environment does nothing beyond putting a <code>\section*{Abstract}</code> in front of the abstract's text. This can be easily replicated in ConTeXt with <code>\subject{Abstract}</code>.  (See [[Unnumbered Sections]].)
  
 
== ConTeXt: A more reusable solution ==
 
== ConTeXt: A more reusable solution ==
  
 
{{todo|Write this whole section, along the lines of the parallel section in [[Document Titles]].}}
 
{{todo|Write this whole section, along the lines of the parallel section in [[Document Titles]].}}

Revision as of 02:03, 5 September 2005

< 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! (See: To-Do List)


LaTeX

Much as with Document Titles, the standard LaTeX article and report classes define an abstract environment to typeset an abstract in a way that distinguishes it from the rest of the text. In a single-column article, it is set somewhat narrower than the main text, with the word "Abstract" centered above it.

\documentclass{article}
\begin{document}
  \begin{abstract}
    This is the abstract of the paper.
  \end{abstract}
\end{document}

ConTeXt: A simple solution

The simplest way of producing an abstract in a ConTeXt document is to specify the formatting directly. The code from LaTeX's classes.dtx is nearly trivial, and is quite easy to replicate in ConTeXt idioms.

\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[big]

This is the main text of the document.  Like the abstract, it contains enough text
for two lines, to show the margins.
\stoptext

In the two-column document classes, LaTeX's abstract environment does nothing beyond putting a \section*{Abstract} in front of the abstract's text. This can be easily replicated in ConTeXt with \subject{Abstract}. (See Unnumbered Sections.)

ConTeXt: A more reusable solution


TODO: Write this whole section, along the lines of the parallel section in Document Titles. (See: To-Do List)