Difference between revisions of "Document Titles"

From Wiki
Jump to navigation Jump to search
(Elaborated on the "In LaTeX" description.)
(Added a simple solution, to start with.)
Line 17: Line 17:
 
The title, author, and date defined by these commands is also used to create the PDF authoring information, if appropriate packages are used.  (I'm not sure of the details of this; will look them up later. --Brooks)
 
The title, author, and date defined by these commands is also used to create the PDF authoring information, if appropriate packages are used.  (I'm not sure of the details of this; will look them up later. --Brooks)
  
== In ConTeXt ==
+
== In ConTeXt: A simple solution ==
 +
 
 +
The ConTeXt philosophy is for the author to specify the formatting, rather than selecting from existing formats.  A simple solution is thus to write the title block directly; the following version is a close duplicate of the version produced by the <code>\maketitle</code> command in LaTeX's startard article class.
 +
 
 +
<texcode>
 +
\starttext
 +
\startalignment[center]
 +
  \blank[2*big]
 +
    {\tfd How to do this in Context}
 +
  \blank[3*medium]
 +
    {\tfa The author}
 +
  \blank[2*medium]
 +
    {\tfa July 26, 2005}
 +
  \blank[3*medium]
 +
\stopalignment
 +
 
 +
Then, the actual text of the document starts here.  We'll put in enough text to
 +
fill out the line and start to make a paragraph.
 +
\stoptext
 +
</texcode>
 +
 
 +
<context>
 +
\starttext
 +
\startalignment[center]
 +
  \blank[2*big]
 +
    {\tfd How to do this in Context}
 +
  \blank[3*medium]
 +
    {\tfa The author}
 +
  \blank[2*medium]
 +
    {\tfa July 26, 2005}
 +
  \blank[3*medium]
 +
\stopalignment
 +
 
 +
Then, the actual text of the document starts here.  We'll put in enough text to
 +
fill out the line and start to make a paragraph.
 +
\stoptext
 +
</context>
 +
 
 +
== In ConTeXt: A more flexible solution ==
  
 
{{howto}}
 
{{howto}}

Revision as of 23:01, 3 September 2005

< From LaTeX to ConTeXt >

In LaTeX

The standard LaTeX document classes define a \maketitle command, along with \title, \author, and \date commands, which can be used to produce a relatively automatic title block.

\documentclass{article}
  \title{How to do this in Context}
  \author{The author}
  \date{July 26, 2005}
\begin{document}
  \maketitle
\end{document}

The title, author, and date defined by these commands is also used to create the PDF authoring information, if appropriate packages are used. (I'm not sure of the details of this; will look them up later. --Brooks)

In ConTeXt: A simple solution

The ConTeXt philosophy is for the author to specify the formatting, rather than selecting from existing formats. A simple solution is thus to write the title block directly; the following version is a close duplicate of the version produced by the \maketitle command in LaTeX's startard article class.

\starttext
\startalignment[center]
  \blank[2*big]
    {\tfd How to do this in Context}
  \blank[3*medium]
    {\tfa The author}
  \blank[2*medium]
    {\tfa July 26, 2005}
  \blank[3*medium]
\stopalignment

Then, the actual text of the document starts here.  We'll put in enough text to
fill out the line and start to make a paragraph.
\stoptext

In ConTeXt: A more flexible solution


The author of this entry is looking for a solution for the described problem. (See: How to?)