summaryrefslogtreecommitdiff
path: root/macros/latex209/contrib/misc/voorbeeld.sty
blob: 76db69914422841fc3825b0bcdecc268d9bce429 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
%%% ====================================================================
%%%  @LaTeX-style-file{
%%%     author          = "Werenfried Spit",
%%%     version         = "1.0.1",
%%%     date            = "25 October 1993",
%%%     time            = "17:00",
%%%     filename        = "voorbeeld.sty",
%%%     address         = "Departament de Fisica Teorica
%%%                        Universitat de Valencia
%%%                        c/ Moliner, 50
%%%                        E-46100 Burjassot, Valencia
%%%                        Espanya",
%%%     telephone       = "+34-6-386 4550",
%%%     checksum        = "03456 143 633 5962",
%%%     email           = "spit@vm.ci.uv.es
%%%                        spit@ific.uv.es",
%%%     codetable       = "ISO/ASCII",
%%%     keywords        = "LaTeX, linguistic examples",
%%%     supported       = "yes",
%%%     abstract        = "In linguistics people use examples that have the 
%%%                        lay out of items in a list, but the logical 
%%%                        structure of mathematical equations: they have 
%%%                        numbers that are reset only at the beginnings of 
%%%                        sections or chapters and that can be referenced to.
%%%                        Voorbeeld.sty (voorbeeld is dutch for example)
%%%                        defines the environment `voorbeelden' for this
%%%                        purpose. 
%%%                        Documentation at the end of this file.",
%%%    docstring        = "The checksum field above contains a CRC-16
%%%                        checksum as the first value, followed by the
%%%                        equivalent of the standard UNIX wc (word
%%%                        count) utility output of lines, words, and
%%%                        characters.  This is produced by Robert
%%%                        Solovay's checksum utility.",
%%%  }
%%% ====================================================================
%%%%%%%%%%% voorbeeldomgeving %%%%%%%%
%% (C) Werenfried Spit 08-01-90
%%
\newenvironment{voorbeelden}{\thevoorbeelden}{\endthevoorbeelden}
\newcount\@vbdepth \@vbdepth = 0
\@definecounter{vbcounti}
\@definecounter{vbcountii}
\@definecounter{vbcountiii}
\@definecounter{vbcountiv}
\@addtoreset{vbcounti}{section}


\def\thevoorbeelden{\ifnum \@vbdepth >3 \@toodeep\else
      \advance\@vbdepth \@ne
      \edef\@vbctr{vbcount\romannumeral\the\@vbdepth}\list
      {\csname label\@vbctr\endcsname}{\ifnum  \@vbdepth >1 \usecounter
        {\@vbctr}\else
      \@nmbrlisttrue\def
      \@listctr{vbcounti}\fi\def\makelabel##1{\hss\llap{##1}}}\fi}

\let\endthevoorbeelden =\endlist

\def\labelvbcounti{\bf\arabic{vbcounti}}
\def\thevbcounti{\arabic{vbcounti}}
\def\p@vbcountii{\thevbcounti}
\def\labelvbcountii{\bf\alph{vbcountii}}
\def\thevbcountii{\alph{vbcountii}}

\def\labelvbcountiii{\roman{vbcountiii}}
\def\thevbcountiii{\roman{vbcountiii}}
\def\p@vbcountiii{\thevbcounti(\thevbcountii)}
\def\labelvbcountiv{\alph{vbcountiv}}
\def\thevbcountiv{\alph{vbcountiv}}
\def\p@vbcountiv{\p@vbcountiii\thevbcountiii}


\endinput
%%%%%%% documentation and examples of usage  %%%%%%%
\documentstyle[voorbeeld,a4]{article}
\begin{document}
\begin{center}
{\large\bf Voorbeeld.sty}  \\[0.5\baselineskip]
{\it Werenfried Spit}      \\[\baselineskip]
\end{center}

In linguistical papers one often uses numbered examples. These examples
look like lists of numbered items, but logically they behave more like
displayed equations. It should be possible to generate automatic 
references to specific examples, and example counters are reset only 
at the beginning of a new chapter or section. 
This style defines an environment \verb|voorbeelden| that makes typesetting
such examples easier.

\paragraph{Usage}
The usage is analogous to that \verb|enumerate|, only now it
is possible to add labels:
\begin{quote}
\begin{voorbeelden}
\item \begin{voorbeelden} \item Volgens Jan was-ie ziek.     \label{Jan}
                          \item * Volgens Jan hij was ziek.  \label{Jan*}
       \end{voorbeelden}
\end{voorbeelden}
The starred example (\ref{Jan*}) is an ungrammatical sentence, 
just like (\ref{Eline}):
\begin{voorbeelden}
\item Osewoudt ontkende, dat hij Eline had zien lopen.       \label{Osewoudt}
\item * In Elines bed ze bracht heel wat zoete uurtjes door. \label{Eline}
\end{voorbeelden}
\end{quote} 
Which was produced by 
\begin{verbatim}
\begin{voorbeelden}
\item \begin{voorbeelden} \item Volgens Jan was-ie ziek.     \label{Jan}
                          \item * Volgens Jan hij was ziek.  \label{Jan*}
       \end{voorbeelden}
\end{voorbeelden}
The starred example (\ref{Jan*}) is an ungrammatical sentence, 
just like (\ref{Eline}):
\begin{voorbeelden}
\item Osewoudt ontkende, dat hij Eline had zien lopen.       \label{Osewoudt}
\item * In Elines bed ze bracht heel wat zoete uurtjes door. \label{Eline}
\end{voorbeelden}
\end{verbatim}
The counter for the top level numbering is reset every section, the
counters for sublevel numberings are reset every item (like an 
\verb|enumerate|). You can have three sublevels nested.

\paragraph{Tuning}
The counter for the top level numbering is reset every section. 
Change in the style file the line 
\begin{verbatim}
 \@addtoreset{vbcounti}{section}
\end{verbatim}
if you want the resetting to take place at another level.

\paragraph{The name of the game}
I first wrote this little style for use in a dutch linguistical 
thesis. `Voorbeeld' is the dutch word for example, so it seemed
most logical to use that as a name. When it was distributed 
wider I chose to keep the name, since there already exists a style
\verb|example.sty| (which defines an environment \verb|example| 
to show examples of \LaTeX\ usage). Feel free to change the 
name of the environment for your own {\em private} use, (as long
as you don't also use \verb|example.sty| this should do no harm)
but don't pass on a changed file. 
\end{document}
%% end of file %%