Difference between revisions of "Extended description"

From Wiki
Jump to navigation Jump to search
(Change epigram into epigraph as this is the proper name)
Line 1: Line 1:
 
< [[Modules]]
 
< [[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.
+
The '''xdesc''' module by Giuseppe Bilotta (Oblomov) provides a means to treat special descriptions such as epigraphs. 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 ==
+
== Example setup for epigraphs ==
An epigram is a concise and witty saying or a short witty poem. An example would be
+
An epigraph (sometimes also wrongly called 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!
 
: We haven't got the money, so we've got to think!
Line 13: Line 13:
 
<texcode>
 
<texcode>
 
\usemodule[xdesc]
 
\usemodule[xdesc]
\defineextendeddescription[epigram][epigrams]%
+
\defineextendeddescription[epigraph][epigraphs]%
 
                           [author,years,source,note,whois]
 
                           [author,years,source,note,whois]
 
</texcode>
 
</texcode>
  
We now define the commands to typeset the epigrams, one short version which is useful for production
+
We now define the commands to typeset the epigraphs, one short version which is useful for production
  
 
<texcode>
 
<texcode>
\starttemplate[epigram][short]
+
\starttemplate[epigraph][short]
 
\startframedtext[right][frame=off,offset=none,background=none,
 
\startframedtext[right][frame=off,offset=none,background=none,
 
                         width=0.65\textwidth,top=,bottom=]
 
                         width=0.65\textwidth,top=,bottom=]
Line 34: Line 34:
  
 
<texcode>
 
<texcode>
\starttemplate[epigram][medium]
+
\starttemplate[epigraph][medium]
 
\startframedtext[right][frame=off,offset=none,background=none]
 
\startframedtext[right][frame=off,offset=none,background=none]
 
{\it \getslot{content}}\par
 
{\it \getslot{content}}\par
Line 48: Line 48:
  
 
<texcode>
 
<texcode>
\selecttemplate[epigram][short] % medium,short
+
\selecttemplate[epigraph][short] % medium,short
 
</texcode>
 
</texcode>
  
Line 54: Line 54:
  
 
<texcode>
 
<texcode>
\startepigram[epg:Rutherford]
+
\startepigraph[epg:Rutherford]
 
   [author={Ernest Rutherford},
 
   [author={Ernest Rutherford},
 
     years={1871--1937},
 
     years={1871--1937},
Line 60: Line 60:
 
     source={in {\it Bulletin of the Institute of Physics} (1962) vol. 13}]
 
     source={in {\it Bulletin of the Institute of Physics} (1962) vol. 13}]
 
   We haven't got the money, so we've got to think!
 
   We haven't got the money, so we've got to think!
\stopepigram
+
\stopepigraph
 
</texcode>
 
</texcode>
  
To typeset the epigram, simply call:
+
To typeset the epigraph, simply call:
  
 
<texcode>
 
<texcode>
\getepigram[epg:Rutherford]
+
\getepigraph[epg:Rutherford]
 
</texcode>
 
</texcode>

Revision as of 09:15, 4 April 2007

< Modules

The xdesc module by Giuseppe Bilotta (Oblomov) provides a means to treat special descriptions such as epigraphs. 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 epigraphs

An epigraph (sometimes also wrongly called 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[epigraph][epigraphs]%
                          [author,years,source,note,whois]

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

\starttemplate[epigraph][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[epigraph][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[epigraph][short] % medium,short

It is now time to get type in a quote

\startepigraph[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!
\stopepigraph

To typeset the epigraph, simply call:

\getepigraph[epg:Rutherford]