Difference between revisions of "Extended description"

From Wiki
Jump to navigation Jump to search
(Create)
 
Line 7: Line 7:
  
 
: We haven't got the money, so we've got to think!
 
: We haven't got the money, so we've got to think!
: — ''Rutherford, Ernest Rutherford, 1871–1937''
+
: — ''Ernest Rutherford, 1871–1937''
  
 
We first load now the module and setup a new description
 
We first load now the module and setup a new description

Revision as of 09:18, 15 May 2006

< Modules

The xdesc module by Giuseppe Bilotta (Oblomov) provides a means to treat special descriptions such as epigrams. In this case the object has several attributes, which can be typeset in several ways. The module can be downloaded from the modules:xdesc site.

Example setup for epigrams

An epigram is a concise and witty saying or a short witty poem. An example would be

We haven't got the money, so we've got to think!
Ernest Rutherford, 1871–1937

We first load now the module and setup a new description

\usemodule[xdesc]
\defineextendeddescription[epigram][epigrams]%
                          [author,years,source,note,whois]

We now define the commands to typeset the epigrams, one short version which is useful for production

\starttemplate[epigram][short]
\startframedtext[right][frame=off,offset=none,background=none,
                        width=0.65\textwidth,top=,bottom=]
  \small{\it \getslot{content}}
  \unskip\nobreak\hfil\penalty50\hskip1em\hbox{}\nobreak\hfil
  \hbox{\small{--- \getslot{author}, \getslot{years}}}
  \parfillskip=0pt \finalhyphendemerits=0
\stopframedtext
\stoptemplate

and a medium long version. which is a bit lengthier,

\starttemplate[epigram][medium]
\startframedtext[right][frame=off,offset=none,background=none]
{\it \getslot{content}}\par
\rightaligned{--- \getslot{author}, \getslot{years}}\par
\startalignment[left]
\small \getslot{source}
\stopalignment
\stopframedtext
\stoptemplate

The version we want to use can be set via

\selecttemplate[epigram][short] % medium,short

It is now time to get type in a quote

\startepigram[epg:Rutherford]
   [author={Ernest Rutherford},
     years={1871--1937},
     whois={New Zealand physicist},
    source={in {\it Bulletin of the Institute of Physics} (1962) vol. 13}]
  We haven't got the money, so we've got to think!
\stopepigram

To typeset the epigram, simply call:

\getepigram[epg:Rutherford]