Difference between revisions of "Extended description"
Jump to navigation
Jump to search
TobiasBurnus (talk | contribs) (Create) |
m |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
< [[Modules]] | < [[Modules]] | ||
− | The '''xdesc''' module by Giuseppe Bilotta (Oblomov) provides a means to treat special descriptions such as | + | 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 | + | == 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! | ||
− | : — '' | + | : — ''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 | ||
Line 13: | Line 13: | ||
<texcode> | <texcode> | ||
\usemodule[xdesc] | \usemodule[xdesc] | ||
− | \defineextendeddescription[ | + | \defineextendeddescription[epigraph][epigraphs]% |
[author,years,source,note,whois] | [author,years,source,note,whois] | ||
</texcode> | </texcode> | ||
− | We now define the commands to typeset the | + | We now define the commands to typeset the epigraphs, one short version which is useful for production |
<texcode> | <texcode> | ||
− | \starttemplate[ | + | \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=] | ||
\small{\it \getslot{content}} | \small{\it \getslot{content}} | ||
\unskip\nobreak\hfil\penalty50\hskip1em\hbox{}\nobreak\hfil | \unskip\nobreak\hfil\penalty50\hskip1em\hbox{}\nobreak\hfil | ||
− | \hbox{\small{--- \getslot{author}, \getslot{years}}} | + | \hbox{\small{--- \getslot{author}% |
+ | \doifelse{\getslot{years}}{}{}{, \getslot{years}}}} | ||
\parfillskip=0pt \finalhyphendemerits=0 | \parfillskip=0pt \finalhyphendemerits=0 | ||
\stopframedtext | \stopframedtext | ||
Line 34: | Line 35: | ||
<texcode> | <texcode> | ||
− | \starttemplate[ | + | \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 49: | ||
<texcode> | <texcode> | ||
− | \selecttemplate[ | + | \selecttemplate[epigraph][short] % medium,short |
</texcode> | </texcode> | ||
Line 54: | Line 55: | ||
<texcode> | <texcode> | ||
− | \ | + | \startepigraph[epg:Rutherford] |
[author={Ernest Rutherford}, | [author={Ernest Rutherford}, | ||
years={1871--1937}, | years={1871--1937}, | ||
Line 60: | Line 61: | ||
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! | ||
− | \ | + | \stopepigraph |
</texcode> | </texcode> | ||
− | To typeset the | + | To typeset the epigraph, simply call: |
<texcode> | <texcode> | ||
− | \ | + | \getepigraph[epg:Rutherford] |
</texcode> | </texcode> | ||
+ | |||
+ | [[Category:Tools]] |
Latest revision as of 14:17, 8 June 2020
< 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}% \doifelse{\getslot{years}}{}{}{, \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]