Difference between revisions of "A Very Simple Cover Page"

From Wiki
Jump to navigation Jump to search
m (Very simple cover moved to A Very Simple Cover Page)
m (A bit of mark-up cleaning)
Line 1: Line 1:
= A very simple cover page =
 
 
 
If you are looking for something fancy with graphics, bells, and whistles, this is not for you. ([[Simple Cover Page]] might be.) However, if you are looking for a very simple cover page with simple code, then read on.
 
If you are looking for something fancy with graphics, bells, and whistles, this is not for you. ([[Simple Cover Page]] might be.) However, if you are looking for a very simple cover page with simple code, then read on.
  
Line 56: Line 54:
 
</context>
 
</context>
  
== Analysis of the code ==
+
= Analysis of the code =
  
 
A strut is needed in the beginning to give the <tt>\blank</tt> something to start with. Then there is a 6-centimeter blank:
 
A strut is needed in the beginning to give the <tt>\blank</tt> something to start with. Then there is a 6-centimeter blank:

Revision as of 15:20, 24 January 2006

If you are looking for something fancy with graphics, bells, and whistles, this is not for you. (Simple Cover Page might be.) However, if you are looking for a very simple cover page with simple code, then read on.

Very often a white paper or some other document needs a cover page. The cover page needs to have a specific (and special) layout, so some layout commands are required. The textual content is limited, and in many cases there is no graphics whatsoever. The cover page below is really plain vanilla:

% --- Cover page

\strut
\blank[6cm]

\startalignment[center]
  \ssd Polar Bears of Antarctica \par
  \ssc A Suggestion
\stopalignment

\blank[10cm]

\startalignment[flushright]
\strut
\ssb
\bTABLE
  \setupTABLE[r][each][frame=off]
  \bTR \bTD Dr. I.M.Looney \eTD \eTR
  \bTR \bTD Institute of Bad Ecology \eTD \eTR
  \bTR \bTD February 30, 2006 \eTD \eTR
\eTABLE
\stopalignment
\page

Analysis of the code

A strut is needed in the beginning to give the \blank something to start with. Then there is a 6-centimeter blank:

\strut
\blank[6cm]

The title is centered. The actual layout may need some tweaking with e.g. \blank. This one looks reasonably fine on the paper (and bad in the Wiki).

\startalignment[center]
  \ssd Polar Bears of Antarctica \par
  \ssc A Suggestion
\stopalignment

Another waste of paper:

\blank[10cm]

And then the rest of the information is embedded in a natural TABLE. All the text in the TABLE is left-aligned, but the TABLE itself is right-aligned. So, the longest row dictates the position of the TABLE. The downside of this approach is that if you have a number of cover pages with different authors, the starting position jumps around.

\startalignment[flushright]
\strut
\ssb
\bTABLE
  \setupTABLE[r][each][frame=off]
  \bTR \bTD Dr. I.M.Looney \eTD \eTR
  \bTR \bTD Institute of Bad Ecology \eTD \eTR
  \bTR \bTD February 30, 2006 \eTD \eTR
\eTABLE
\stopalignment

N.B.: the \startalignment requires some text immediately afterwards, hence the \strut. If that is left out, the TABLE sits on the left!

And finally, let's finish the page:

\page

And that's it, a very simple cover page. It has several shortcomings. For example, the positions are not absolute, so a change in the title may move the information block in the lower right corner. Using the TABLE is just a show-off. If you do not need the "align-by-rightmost" alignment, \startnarrower[..][..] ... \stopnarrower provides much the same functionality with fewer commands and cleaner code.