Debian Codegraph @

texmf-dist/doc/latex/philex/philexmanual.tex

raw
1 \documentclass[11pt]{article}
2 \usepackage[utf8]{inputenc}
3 \usepackage[oldpunct,hyper]{philex}
4 \usepackage{eqparbox}
5 \usepackage[left=6cm,right=4cm,top=4cm,bottom=5cm]{geometry}
6
7 \newcommand{\qut}[1]{`#1'}
8 \usepackage[english]{babel}
9
10 \usepackage{latexsym,amssymb,amsmath,amsthm,wasysym,fixltx2e}
11 \usepackage{calc}
12
13 \newcounter{hour}
14 \newcounter{minute}
15
16 \newcommand{\emp}{\emph}
17 \newcommand{\note}{\footnote}
18 \setcounter{hour}{\time/60}
19 \setcounter{minute}{\time-60*\thehour}
20 \ifnum\thehour<10 \def\nowh{0\thehour} \else \def\nowh{\thehour}\fi
21 \ifnum\theminute<10\def\nowm{0\theminute} \else \def\nowm{\theminute}\fi
22 \def\now{\nowh:\nowm\\License type: lppl}
23 \def\aut{Peter Pagin\\ [email protected]}
24 \def\home{\begin{flushright}
25 \item Department of Philosophy
26 \item Stockholm University
27 \item [email protected]
28 \end{flushright}}
29 \usepackage[colorlinks,linkcolor=black,bookmarksnumbered]{hyperref}
30
31 \begin{document}
32 \title{The \tt philex \rm Package \\ version 1.3}
33 \author{\aut}
34 \date{\today, \now}
35 \maketitle
36 \reversemarginpar
37 \setlength{\marginparwidth}{3cm}
38 \subsection*{Changes since version 1.2}
39 -- Added automatic handling of long environment \verb+names+.\\
40 -- Added draft mode, with margin printing of \verb+labels+.\\
41 -- Bugfix: Broken cross-references to \verb+\lbb+ environments with optional names, now fixed.
42
43
44 \section*{Manual}
45 The \verb+philex+ package is intended for use in subjects like philosophy and linguistics, where there is a need both of many example sentences and of named principles, and of cross-references to them in the text. Sometimes one wants cross-reference to environment numbers (or prefix plus number), sometimes to a non-numbered named environment, and sometimes to the content of the environment, for repeating the content in running text or in another environment. The package is a small addition to Wolfgang Sternefeld's \verb+linguex+ package and requires \verb+linguex+. As of version 0.2 it also requires \verb+calc+. \verb+philex+ will load \verb+linguex+ if it is installed. The purpose of \verb+philex+ is to add functions for more flexible cross-referencing, for repeating and embedding named or numbered environments, \verb+hyperref+ support and a some further formatting options.
46
47 As of version 0.5 \verb+philex+ writes cross-ref information to the .aux file and reads that information at the beginning of the subsequent run of typesetting. This allows forward cross-referencing to environments that are named or numbered+named, such as \rf{clauses} on p. \pageref{clauses},
48 in analogy to the \verb+\label+-reference system of LaTeX itself. As of version 0.9 hyperlinks produced by \verb+hyperref+ are created also for named environments with the \verb+<hyper>+ package option.
49
50 \section{Calling the package}
51 \verb+philex+ is \marginpar{\tt philex} called by adding \verb+\usepackage[<package options>]{philex}+ in the preamble. This will also automatically load the \verb+linguex+ package, as well as \verb+xspace+ and \verb+cgloss4e+, which are used by \verb+linguex+. If \verb+linguex+ is called separately, it should be called \emp{before} \verb+philex+, since \verb+philex+ (marginally) redefines some commands in \verb+linguex+. \verb+philex+ also calls the \verb+calc+, \verb+ifthen+ and \verb+suffix+ packages.
52
53 \section{Package options}
54 With \marginpar{\tt <hyper>} the \verb+<hyper>+ option hyperlinks will be created by cross-references to named environments (such as \verb+\lbp+). This requires that the \verb+hyperref+ package is called (should be called last). If \verb+hyperref+ is called without the \verb+<hyper>+ option, hyperlinks will anyway be created from the usual \verb+philex+ cross-references that make use of the basic label- and cross-reference function in LaTeX.
55
56 With the \verb+<draft>+ option, labels \marginpar{\tt <draft>} will be printed in boldface in the margins, top-level \verb+labels+ in the left-hand margin, and sub-level \verb+labels+ in the right-hand margin. This is intended as a help to writing cross-reference intensive texts. \verb+Labels+ are often hard to remember, and the environment to be cross-referenced is usually easier to find in the pdf output than in the source file. Finding the \verb+label+ printed there is then convenient. The vertical alignment of the margin-printed \verb+labels+ with the \verb+philex+ environment itself is not exact. Occasionally, the \verb+label+ does not follow the environment across a page break (I have managed to fix this only partially), but usually the alignment is quite good.
57
58 The horizontal position of \verb+labels+ printed in the left margin can be adjusted by means of \verb+\renewcommand{\philmarginfactor}{}+. Default is \(1.2\). Higher values push the \verb+labels+ closer to the page edge.
59
60 With the \verb+<oldpunct>+ package option \marginpar{\tt <oldpunct>} the old punctuation commands (see below) will still work. This is for the purpose of using more recent versions of \verb+philex+ with older files, without needing search-and-replace.
61
62 \section{Top-level environments}
63 The basic environment command of \verb+philex+ is \marginpar{\tt \(\backslash\)lb} \verb+\lb{}{}+. It takes two obligatory arguments. The first argument is the label of the environment, and the second is the content of the environment itself. \verb+\lb+ uses the \verb+\ex.+ formatting of \verb+linguex+, and thereby the \verb+ExNo+ counter. Type
64
65 \begin{verbatim}
66 \lb{nice}{This is a nice day. \\ Not too hot.}
67 \end{verbatim}
68 and the result will be
69
70 \lb{nice}{This is a nice day.\\ Not too hot.}
71 in case it is the first \verb+\lb+-environment in your document.
72
73 In \verb+linguex+ you leave a blank line after sentence to close the environment. The blank line gives a \verb+\par+-command to TeX. In \verb+philex+ the \verb+\par+-command is built into the top-level environments. So you leave a blank line after an \verb+\lb{}{}+-environment only if you want to start a new paragraph. The reason for this change is that only this way will the \verb+philex+ package work together with the \verb+extract+ package by Hendri Adriaens, which can be used for extracting material, e.g. for generating a handout, from documents making use of \verb+philex+. \verb+linguex+ comes together with Sternefeld's \verb+linguho+ package, which has the function of generating a handout from documents using \verb+linguex+. \verb+linguho+ does not work with \verb+philex+, since the \verb+linguex+ environments are not explicit in the document. The corresponding function, only more flexible, can be served with the \verb+extract+ package.
74
75 In many cases you \marginpar{Update with \tt\(\backslash\)lbu}will want to produce a variant of the original sentence, which will have the same name or number as the original, but with an added suffix, like a letter or a prime symbol. This is achieved with the \verb+\lbu{}{}{}{}+-command. It takes four obligatory arguments. The first is the label of the new sentence, the second is the label of the environment you are giving a variant of, the third is the suffix you want to add, and the fourth is the new content itself.
76
77 \begin{verbatim}
78 \lbu{nicy}{nice}{\('\)}{But that yesterday was even nicer.}
79 \end{verbatim}%
80 %
81 produces
82
83 \lbu{nicy}{nice}{\('\)}{But yesterday was even nicer.}
84
85 You may also want to \marginpar{\texttt{Named} environments with \tt\(\backslash\)lbp} have \verb+named+ environments, such as in \rf{life} below (exemplifying forward cross-reference) \bron
86
87 \lbp{life}{W}{Life is wonderful!}%
88 %
89 These are produced with the \verb+\lbp{}{}{}+-command which makes use of the optional argument to \verb+\ex.[]+ in \verb+linguex+. If you later change the \verb+name+ of the principle, or the formulation, the changes are reflected in the cross-references and repetitions after the next typesetting, as long as you do not change the labels.
90
91 And updates with \verb+\lbu+, like
92
93 \lbu{newlife}{life}{\textsuperscript{+}}{\q Life is terrific!}
94 work as before. Concerning long \verb+names+ and horizontal alignment, see Section \ref{length}.
95
96 In case you \marginpar{Prefixed numbering with \tt\(\backslash\)lbpx} wish a list of independently numbered principles with a shared \verb+name+ stem, there are four independent series. Use one of the \verb+\lbpx+-commands, where \verb+x+ is one of \verb+a,b,c,d+. You can format the listing with \verb+\bpxformat{}{}{}+, where again \verb+x+ has the corresponding value. The first argument sets the numbering style (see below), the second the prefix and the third argument the suffix.
97 Then the \verb+\lbpx+-command picks it up: \bpaformat{1}{(T}{)}
98
99 \begin{verbatim}
100 \bpaformat{1}{(T}{)}
101 \lbpa{kno}{John is in the know.}
102 \lbpa{hu}{Elsa is, too.}
103 \lbpa{kne}{Alfred agrees.}
104 \end{verbatim}
105 produces
106 \lbpa{kno}{John is in the know.}
107 \lbpa{hu}{Elsa is, too.}
108 \lbpa{kne}{Alfred agrees.}
109 These enumerations are independent of \verb+ExNO+ and of each other, and the counters (\verb+bpx+) are reset with the relevant \verb+\bpxformat+.
110 They still work with sub-clauses, cross-references and the rest of the apparatus. Note that these enumerations do not have to be contiguous:
111
112 \lbpa{glufs}{But he shouldn't.}
113
114 There \marginpar{Simple counter} is also an additional counter, \verb+bna+, with associated commands: the \verb+\bns+ command resets the counter; the \verb+\bn+ command steps the counter, prints its current value, and produces a \verb+\quad+ space. Useful for listing a number of comments.
115
116 All the top-level \marginpar{Centering} environments take an optional argument \verb+[c]+ for centering the text.
117
118 \begin{verbatim}
119 \lb[c]{compo}{\[\mu(\sigma(t_{1},\ldots, t_{n}))
120 = r_{\sigma}(\mu(t_{1}),\ldots, \mu(t_{n}))\]}
121 \end{verbatim}
122 produces
123
124 \lb[c]{compo}{\[\mu(\sigma(t_{1},\ldots, t_{n}))=r_{\sigma}(\mu(t_{1}), \ldots, \mu(t_{n}))\]}
125 In this example a displaymath environment (\verb+\[..\]+ or \verb+$$..$$+) has been used. This produces extra vertical space above and below, suitable for equations. With centering and in-line math environment (\verb+\(..\)+ or \verb+$..$+), no extra vertical space is produced.
126
127
128 The default for \verb+philex+ is centering in the entire column, i.e. along \verb+\columnwidth+. As an alternative, you can make \verb+philex+ center the text within the \verb+philex+ text area itself. This puts the text slightly more to the right. To achieve this, give the command \verb+\narrowcenter+ before the relevant environment. To later revert to the default option, give the command \verb+\widecenter+.
129
130 Horizontal alignment \marginpar{Alignment} within a \verb+philex+ environment can be easily achieved by means of Scott Pakin's elegant \verb+eqparbox+ package. The code
131
132 \begin{verbatim}
133 \lb{alignthis}{\eqmakebox[hit][l]{\(2+3\)} \quad = \quad \(5\) \\
134 \eqmakebox[hit][l]{\(2+3+4\)} \quad = \quad \(9\)}
135 \end{verbatim}
136 automatically generates alignment after a second round of typesetting, without the need of an equation align environment:
137
138 \lb{alignthis}{\eqmakebox[hit][l]{\(2+3\)} \quad = \quad \(5\) \\
139 \eqmakebox[hit][l]{\(2+3+4\)} \quad = \quad \(9\)}
140
141 \verb+linguex+ provides the \verb+\exi.+ \marginpar{Labelled brackets} command for generating labelled brackets that display syntactic structure. This command can be used in \verb+philex+ but can not be integrated into proper \verb+philex+ commands without loss of \verb+philex+ features, such as hyperlinks. However, it is easy to add labels manually, especially by means of the \verb+\textsubscript+ command provided by the \verb+fixltx2e+ package, by Frank Mittelbach, David Carlisle, Chris Rowley, and Walter Schmidt. The result will be the same. The following example is from the \verb+linguex+ manual but implemented with \verb+\textsubscript+:
142
143 \begin{verbatim}
144 \lb{braclabel}{[[\textsubscript{NP} Fritz ][ snores ]]%
145 \textsubscript{S}}
146 \end{verbatim}
147
148 \lb{braclabel}{[[\textsubscript{NP} Fritz ][ snores ]]%
149 \textsubscript{S}}
150
151 \verb+linguex+ also \marginpar{Glosses} provides the the \verb+exg.+ command, and associated sub-sentence commands, for generating glosses. As above, these commands are available when \verb+philex+ is used, but cannot be integrated in \verb+philex+ environments without loss of features. However, \verb+linguex+ here builds on the \verb+cgloss4e+ package by Hans-Peter Kolb and Craig Thiersch. This package is called by \verb+philex+ and the commands of \verb+cgloss4e+ can be directly applied in \verb+philex+ environments. The \verb+\gll+ command introduces the sentence-gloss pair, and the \verb+\glt+ or \verb+\trans+ command introduces free translation. The following example, here embedded in \verb+\lb+, is taken from the manual for \verb+cgloss4e+ (which is also the manual for \verb+gb4e+):
152
153 \begin{verbatim}
154 \lb{gloss}{\gll Wenn jemand in die W\"uste zieht ... \\
155 If someone in the desert draws and lives ... \\
156 \trans ‘if one retreats to the desert and ... ’}
157 \end{verbatim}
158
159 \lb{gloss}{\gll Wenn jemand in die W\"uste zieht ... \\
160 If someone in the desert draws and lives ... \\
161 \trans ‘if one retreats to the desert and ... ’}
162
163 Grammaticality judgments, \marginpar{Grammaticality judgments} and other judgments of oddity, can now be inserted, with the symbols of your choice, by means of the \verb+\oddity+ command.
164
165 \begin{verbatim}
166 \lb{gram}{
167 \lba{grama}{\oddity{*}He lives in N.Y since two years.}
168 \lbb{gramb}{\oddity{??}Whom does he live in N.Y. since two years?}}
169 \end{verbatim}%
170 %
171 delivers
172 \newpage
173
174 \lb{gram}{
175 \lba{grama}{\oddity{*}He lives in N.Y since two years.}
176 \lbb{gramb}{\oddity{??}Whom does he live in N.Y. since two years?}}
177
178 By means of \verb+philex+ commands, the brackets can be \marginpar{Top-level brackets} removed or replaced for all the top-level environments except \verb+\lb+ itself. However, as of version 4.0 of \verb+linguex+, the brackets for the \verb+\lb+ command can be customized.
179
180 \begin{verbatim}
181 \renewcommand{\ExLBr}{]}
182 \renewcommand{\ExRBr}{[}
183 \renewcommand{\FnExLBr}{\{}
184 \renewcommand{\FnExRBr}{\}}
185 \end{verbatim}%
186 %
187 You can change the \verb+\lb+ brackets to square brackets in main text and to curly brackets in footnotes.
188
189
190 For the other cases, you might e.g. want an \verb+\lbp+ environment without \verb+name+. To turn the brackets off, give the command \verb+\broff+ before the environment. To turn them back on later, give the command \verb+\bron+.
191
192 The non-\verb+\lb+ top-level brackets can be reset by the two-argument command \verb+\philbrackets+. For instance \verb+\philbrackets{[}{]}+ will make the following environment \verb+names+ have square brackets.
193
194 There is sometimes a reason \marginpar{Punctuation} to embed the content of an environment in running text or in another environment, so that changes in the original environment are automatically reflected (see below on cross-references). You might then not want the original full stop of an environment sentence to come along. For this purpose, there is a punctuation command \verb+\philpunct+ at the end of top-level environments. By default, \verb+\philpunct+ is set to be empty. You can redefine it to provide a full stop by means of \verb+\philfullstop+ before the environment. The command \verb+\philcomma+ redefines it to produce a comma, \verb+\philexclaim+ produces an exclamation mark, \verb+\philquestion+ a question mark, and \verb+\philempty+ turns it back to empty. By means of \verb+\renewcommand{\philpunct}{}+ you can set it as you like.
195
196 In earlier versions of \verb+philex+ the corresponding commands were \verb+\p+, \verb+\s+ (for full stop), \verb+\km+ (for comma) and \verb+\q+ (empty). Mostly because I have learned that it is bad design to use one-letter commands, these are now replaced by the new commands. In case of typesetting a file with the old commands, choose the package option \verb+<oldpunct>+.
197
198 \verb+linguex+ has \marginpar{Footnotes} sensitivity to footnote contexts, and provides a separate counter, \verb+FnExNo+, that is reset in each footnote. This is inherited by \verb+philex+.\note
199 {The result is illustrated by
200 \lb{ffnote}{A first footnote example:}
201 \lb{sfnote}{A second footnote example.}
202 which shows that numbering is lowercase roman.}
203
204 \section{Sub-environments}
205 \verb+linguex+ and \marginpar{\tt \(\backslash\)lba, \(\backslash\)lbb, and \(\backslash\)lbz} hence also \verb+philex+ provides sub-environments (sublists). To illustrate, the code
206
207 \begin{verbatim}
208 \lbp{clauses}{PP}{Some main words, followed by
209 \lba{first}{Time flies
210 \lba{firstnew}{Like an arrow}
211 \lbz{lastnew}{And much too fast}}
212 \lbb{second}{But never stops}
213 \lbz{last}{Which is lucky}
214 and a concluding comment.}
215 \end{verbatim}
216 produces
217
218 \lbp{clauses}{PP}{Some main words, followed by
219 \lba{first}{Time flies}
220 \lba{firstnew}{Like an arrow}
221 \lbz{lastnew}{And much too fast}
222 \lbb{second}{But never stops}
223 \lbz{last}{Which is lucky}
224 and a concluding comment.}
225 As shown in the source example, the sub-environments must be embedded in the last argument of the top-level command. A second-level sub-environment need not be embedded in the first-level sub-environment (and so on).
226
227 As exemplified, sub-environments can be nested up to three levels. The first two levels have their own counters, \verb+SubExNo+ and \verb+SubSubExNo+, provided by \verb+linguex+.
228
229 The \verb+\lba+ command restarts the counter of the relevant level. The \verb+\lbb+ command steps the counter, while the \verb+\lbz+ command steps the counter and closes the level, returning to the next higher level. It is not necessary to use \verb+\lbz+ for the last item at the first sub-level (i.e. at the end of a top-level environment). In case only a single sub-environment is used, the command \verb+\z.+ of \verb+linguex+ returns to the higher level.
230
231 The \verb+names+ of the first two sub-levels can be \marginpar{\tt name formatting} customized in two ways, with respect to numbering style and with respect to brackets. The command \verb+\subformat+ takes three arguments.
232
233 The first argument determines the numbering style. The value \qut{R} displays the counter in upper-case roman numerals, \qut{r} in lower case roman, \qut{1} in arabic numerals, \qut{A} in upper-case alphabetic listing, and \qut{a} in lower-case alphabetic listing. Default for the first sub-level is lower-case alphabetic.
234
235 The second argument sets the prefix (opening bracket) and the third argument sets the suffix (closing bracket). Default for the first sub-level is no left-hand bracket and a period for the suffix, as shown in the example.
236
237 The corresponding command for the second sub-level is \verb+\subsubformat+, with the same arguments and values. Default for the second sub-level is lower-case roman numerals for displaying the counter, and ordinary left- and right-hand round brackets, as shown in the example (these defaults are set by \verb+linguex+). To exemplify, the source code
238
239 \begin{verbatim}
240 \lbu{clausesup}{clauses}{$'$}{
241 \subformat{A}{}{)}
242 \subsubformat{1}{[}{]}
243 Some introductory words, followed by
244 \lba{firstb}{Time flies}
245 \lba{firstnewb}{Like an arrow}
246 \lbz{lastnewb}{And much too fast}
247 \lbb{secondb}{But never stops}
248 \lbz{lastb}{Which is lucky}
249 and a concluding comment.}
250 \end{verbatim}
251
252 produces
253
254 \lbu{clausesup}{clauses}{$'$}{
255 \subformat{A}{}{)}
256 \subsubformat{1}{[}{]}
257 Some introductory words, followed by
258 \lba{firstb}{Time flies}
259 \lba{firstnewb}{Like an arrow}
260 \lbz{lastnewb}{And much too fast}
261 \lbb{secondb}{But never stops}
262 \lbz{lastb}{Which is lucky}
263 and a concluding comment.}
264
265 If the sub-formatting commands are given within the top-level environment, they control only the labels within that environment. If they are given outside, the commands are valid until superseded by later commands.
266
267 The sub-level commands \marginpar{\texttt{Names} for \\ sub-environments} have an optional argument (inherited from \verb+linguex+) that can be used for \verb+naming+ sub-environments. For instance, the source
268
269 \begin{verbatim}
270 \lb{crane}{The saying
271 \lba[S]{squeak}{The squeaky wheel gets the grease}
272 \z.
273 is often confirmed.}
274 \end{verbatim}
275 produces
276
277
278 \lb{crane}{The saying
279 \lba[S]{squeak}{The squeaky wheel gets the grease}
280 \z.
281 is often confirmed.}
282 Round brackets are put in by default. This can be reset locally by means of the \verb+\philbrackets+ command. For instance:
283
284 \begin{verbatim}
285 \lbu{craneup}{crane}{\('\)}{\philbrackets{[}{]}The saying
286 \lba[S]{craneupa}{The squeaky wheel gets the grease}
287 \z.
288 is often confirmed.}
289 \end{verbatim}
290
291 \lbu{craneup}{crane}{\('\)}{\philbrackets{[}{]}The saying
292 \lba[S]{craneupa}{The squeaky wheel gets the grease}
293 \z.
294 is often confirmed.}%
295 %
296
297
298 Punctuation for sub-environments \marginpar{Punctuation for \\ sub-environments} is controlled by means of the commands \verb+\philsubpunct+, \verb+\philsubstop+, \verb+\philsubcomma+, \verb+\philsubexclaim+, \verb+\philsubquestion+, and \verb+\philsubempty+, analogous to the corresponding top-level commands. The corresponding older commands where \verb+\pt+, \verb+\stp+ (full stop), \verb+\kmt+ (comma), and \verb+\qt+ (empty). As before, they are made active by means of the \verb+<oldpunct>+ package option.
299
300 \section{Cross-references}
301 The first (mandatory) argument of all environment commands are used by \verb+philex+ to give a \verb+\label+ command. If the environment is numbered by a counter, the label makes the environment accessible for cross-reference by the standard cross-reference mechanism of LaTeX. For instance, \verb+\ref{nice}+ produces the cross-reference `\ref{nice}' to the first \verb+\lb+ environment on page \pageref{nice}.\note
302 {The reason for the fuss about brackets is that in order to modify the material within the brackets, e.g. with {\tt \(\backslash\)lbu}, the brackets cannot be hard-coded into the cross-reference command, but must be put in afterwords.}
303
304 However, \verb+philex+ provides \marginpar{\tt \(\backslash\)rf, \(\backslash\)rn} its own cross-reference command, \verb+\rf+, which has a wider function. It provides ordinary cross-references in accordance with the numbering style of the antecedent, and keeps track of the embedding. It also provides cross-references to \verb+named+ environments, where there is no counter value to pick up. The difference between \verb+\rf+ and \verb+\rn+ is that the latter leaves out the brackets. So we will have the productions
305 \begin{trivlist}
306 \item \noindent \verb+\rf{nice}+ \(\longrightarrow\) \rf{nice} \hfill (target on page \pageref{nice})
307 \item \noindent \verb+\rf{kne}+ \(\longrightarrow\) \rf{kne} \hfill (target on page \pageref{kne})
308 \item \noindent \verb+\rn{kne}+ \(\longrightarrow\) \rn{kne} \hfill (target on page \pageref{kne})
309 \item \verb+\rn{clauseup}+ \(\longrightarrow\) \rn{clausesup} \hfill (target on page \pageref{clausesup})
310 \item \verb+\rf{lastnew}+ \(\longrightarrow\) \rf{lastnew}\hfill (target on page \pageref{lastnew})
311 \item \verb+\rf{lastnewb}+ \(\longrightarrow\) \rf{lastnewb} \hfill (target on page \pageref{lastnewb})
312 \item \verb+\rn{lastnewb}+ \(\longrightarrow\) \rn{craneupa} \hfill (target on page \pageref{craneupa})
313 \item \verb+\rf{lastnewb}+ \(\longrightarrow\) \rf{craneupa} \hfill (target on page \pageref{craneupa})
314 \end{trivlist}
315 Both \verb+\rf+ and \verb+\rn+ have an optional argument which produces an optional suffix. \verb+\rf[*]{nice}+ produces \rf[*]{nice}. The last example is not perfect, as the round brackets are produced instead of the square brackets used at the target. As things stand at the moment, this has to be corrected manually by using \verb+\rn+ instead, or \verb+\rnx+.
316
317 When cross-references to \marginpar{\tt \(\backslash\)rfx, \(\backslash\)rnx} subsentences are local, i.e. appear shortly after the top-level sentence, you might find it inelegant to include the main \verb+name+ or number. In such cases, context disambiguates an abbreviated cross-reference. The commands \verb+\rfx+ and \verb+\rnx+ allow you leave out its head. Compare with lines five and six of the list above:
318
319 \begin{trivlist}
320 \item \verb+\rfx{lastnew}+ \(\longrightarrow\) \rfx{lastnew}\hfill (target on page \pageref{lastnew})
321 \item \verb+\rnx{lastnewb}+ \(\longrightarrow\) \rnx{lastnewb} \hfill (target on page \pageref{lastnewb})
322 \end{trivlist}
323
324 Both \verb+linguex+ and \verb+philex+ \marginpar{Inner delimiters} provide customizing of inner delimiters in complex cross-references. \verb+linguex+ has changed in version 4.0 (see its manual). With \verb+philex+, use the \verb+\phildashes{}{}+ \marginpar{\tt \(\backslash\)phildashes} command. This works together with the \verb+\subformat+ and the \verb+\subsubformat+ commands. The first argument sets the delimiter between the top-level reference and the reference to the first sub-environment, while the second argument sets the delimiter between references to the first and the second sub-level environments. To illustrate. We use the input
325 \begin{verbatim}
326 \lb{cool}{We would like a colon
327 \phildashes{:}{}
328 \subformat{a}{}{)}
329 \lba{coola}{before reference to this.}
330 \lba{coolb}{but nothing more before reference to this}}
331 \end{verbatim}
332 to create and make a cross-reference with \verb+\rf{coolb}+ to \rf{coolb} below:
333 \lb{cool}{We would like a colon
334 \phildashes{:}{}
335 \subformat{a}{}{)}
336 \lba{coola}{before reference to this}
337 \lba{coolb}{but nothing more before reference to this.}}
338
339 If the \verb+hyperref+ package \marginpar{\tt hyperref} is called (must be called last) in the preamble, all ordinary cross-references of the label+cross-reference mechanism of LaTeX are by default made into pdf hyperlinks. This includes all cross-references in \verb+philex+ that rely on counters. If the \verb+<hyper>+ package option is also called, cross-references to \verb+named+ environments are made into hyperlinks as well.
340
341 This is useful for reading pdf:s on the screen, and also for \verb+beamer+ slide-show presentations: click on a cross-reference to a \verb+named+ principle, and you are taken to the page where that principle is stated. In \verb+beamer+ you are taken to the first slide of the relevant frame.
342
343 Sub-environments can \marginpar{Cross-reference to \\ sub-environments in footnotes} be used in footnotes as well. But here, to get the cross-references right, the \verb+subformat+ command must be used.\note
344 {This is illustrated by
345 \lb{ffnote}{A first footnote example:
346 \subformat{a}{}{)}
347 \lba{fnota}{Be careful in footnotes.}}
348 \lb{sfnote}{A second footnote example.}
349 This cross-reference to \rf{fnota} is correct.}
350 The example is produced by the input
351 \begin{verbatim}
352 \lb{ffnote}{A first footnote example:
353 \subformat{a}{}{)}
354 \lba{fnota}{Be careful in footnotes.}}
355 \lb{sfnote}{A second footnote example.
356 This cross-reference to \rf{fnota} is correct.}
357 \end{verbatim}
358
359 \verb+philex+ also has cross-reference \marginpar{Repeating content} functions for repeating the \emp{contents} of environment. By means of \verb+\rp{nicy}+ you repeat the content of \rf{nicy}: \rp{nicy} If you want to embed the content in another sentence, you may want the initial capital letter to be made lowercase. Then use the \verb+\ml+ command, as in
360
361 \lb{jsays}{John says that \ml{nice}}
362 produced by
363 \begin{verbatim}
364 \lb{jsays}{John says that \ml{nice}}
365 \end{verbatim}
366
367 In case you want a full stop at the end of an earlier environment and want to embed the content without the stop, you can use the \verb+\philfullstop+ command to have it inserted for you:
368
369
370
371
372 \begin{verbatim}
373 \philfullstop
374 \lb{stop}{It is very cold}
375 \philexclaim
376 \lb{ifstop}{If \ml{stop}, you should put on a cap}
377 \end{verbatim}
378 produces
379
380 \philfullstop
381 \lb{stop}{It is very cold}
382 \philexclaim
383
384 \lb{ifstop}{If \ml{stop}, you should put on a cap}
385 \philempty
386
387 One can repeat an entire environment with label by means of the \verb+\rff+ command. \verb+\rff{nice}+ produces \rff{nice}
388
389 Occasionally, a \verb+named+ or \marginpar{\tt \(\backslash\)rffnot} numbered sentence carries a footnote reference, and when repeating the sentence later, you may not also want to repeat the footnote reference, nor the note itself. The alternative command \verb+\rffnot+ allows you to leave them out:
390
391 \begin{verbatim}
392 \lb{norepeat}{This ends with a footnote reference.\footnote
393 {You don't want to repeat this note.}}
394 \end{verbatim}
395
396 \lb{norepeat}{This ends with a footnote reference.\footnote
397 {You don't want to repeat this note.}}%
398 %
399 Now you can repeat the sentence without the note by
400 \verb+\rffnot{norepeat}+, which delivers: \rffnot{norepeat}
401
402 \section{Lengths and spaces}\label{length}
403 \verb+linguex+ provides a number of length and spacing commands that can be used to customize the appearance of \verb+philex+ environments. Below are given the length name, brief explanation, and the default value set by \verb+linguex+. \qut{hspace} is short for \qut{horizontal space} and \qut{vspace} analogously:
404
405 \begin{trivlist}
406 \item \verb+\Exlabelsep+ (hspace after label) \hfill \verb+1.3em+
407 \item \verb+\Extopsep+ (extra vspace above and below) \hfill \verb+.66\baselineskip+
408 \item \verb+\SubExleftmargin+ (hspace after sub-level \verb+name+) \hfill \verb+2em+
409 \item \verb+\SubSubExleftmargin+ (hspace after sub-sub-level \verb+name+) \hfill \verb+2.4em+
410 \item \verb+\Exindent+ (indent of the environment) \hfill \verb+0pt+
411 \end{trivlist}
412 Beside these, \verb+philex+ modifies \verb+linguex+ by letting two re-definable commands replace hard-coded lengths:
413
414 \begin{trivlist}
415 \item \verb+\phlabelwidth{}+ (width of label) \hfill \verb+3em+
416 \item \verb+\phlabeldefault+ (returns to default value)
417 \item \verb+\phlabelsep{}+ (sets hspace after label to the argument, e.g. 1cm)
418 \item \verb+\phlabelsepdefault+ (sets default value of the label separation)
419 \item \verb+\Exredux+ (vspace reduction between environments) \hfill \verb+-\baselineskip+
420 \end{trivlist}
421
422 As of version 1.3, \verb+philex+ has built-in features for automatic handling of long \verb+names+. By default, the \verb+\labelsep+ parameter adjusts so that the inner left margin moves to the right. This is illustrated by:
423
424 \begin{verbatim}
425 \broff
426 \lbp{compo}{Compositionality:}{The meaning of a complex
427 expression is a function of the meanings of its parts and
428 its mode of composition.}
429 \end{verbatim}
430
431 \broff
432
433 \lbp{compo}{Compositionality:}{The meaning of a complex expression is a function of the meanings of its parts and its mode of composition.}%
434 \bron%
435 The \verb+\lbp+ and \verb+\lbu+ have this feature. For two-column documents, the label separation should preferably be somewhat reduced. This has to be set manually by means of these commands, since there is no automatic adaptation to two-column options or environments.
436
437 You might have \marginpar{\tt \(\backslash\)lbpsep, \(\backslash\)lbusep} several consecutive environment with \verb+names+ of different lengths that you wish to have horizontally aligned. This is automatically achieved by the \verb+\lbpsep+ and \verb+\lbusep+ environments. To illustrate:
438
439 \begin{verbatim}
440 \lbp{shortname}{Name}{You might have several consecutive
441 environments with \texttt{names} of different lengths that
442 you wish to have horizontally aligned.}
443 \lbpsep{longname}{shortname}{Longername}{You might have several
444 consecutive environments with \texttt{names} of different
445 lengths that you wish to have horizontally aligned.}
446 \end{verbatim}%
447 %
448 produces%
449 %
450 \newpage
451 \lbp{shortname}{Name}{You might have several consecutive environments with \texttt{names} of different lengths that you wish to have horizontally aligned.}
452 \lbpsep{longname}{shortname}{Longername}{You might have several consecutive environments with \texttt{names} of different lengths that you wish to have horizontally aligned.}%
453 %
454 The \verb+\lbpsep+ takes four mandatory arguments, where the second is the \verb+label+ of the \verb+philex+ environment you want to align with. You can add as many \verb+\lbpsep+ environments as you like; if they have the same target (second mandatory argument), they will align to each other, so that the longest \verb+name+ sets the inner left margin for all others. In case a later environment has a longer \verb+name+ than an earlier one, as in the example above, an extra round of typesetting is required to achieve alignment.
455
456 The \verb+\lbusep+ command takes five mandatory arguments. The first three are as in the \verb+\lbu+ command, the fourth provides the target of alignment, i.e. the \verb+label+ of the environment you want to align with (this might and might not be the same as the environment whose \verb+label+ you provide in the second argument), and the fifth provides the content of the environment.
457
458 In addition, \marginpar{\tt \(\backslash\)sepset} \verb+philex+ provides a \emp{non-printing} command \verb+\sepset+ whose only purpose is to provide a \verb+name+ for later alignment:
459
460 \begin{verbatim}
461 \sepset{labelexample}{nameexample}
462 \end{verbatim}%
463 %
464 After such a command has been given, \verb+labelexample+ can be used in the third and fourth arguments of \verb+\lbpsep+ and \verb+\lbusep+, respectively.
465
466 As of version \marginpar{\tt \(\backslash\)lbpx names} 1.3 of \verb+philex+, the \verb+\lbpx+ environments also have automatic margin adjustment for long \verb+names+. In these cases, the \verb+name+ is set as usual, with the \verb+\bpxformat+ command. If the second or third argument is long, the inner left margin will adjust, as in:
467
468 \begin{verbatim}
469 \bpbformat{1}{\bf Definition }{.}
470 \lbpb{firstdef}{A proposition is known \emp{a priori} to be
471 true iff the knowledge is not evidentially based on experience.}
472 \end{verbatim}
473 yields
474
475 \bpbformat{1}{\bf Definition }{.}
476
477 \lbpb{firstdef}{A proposition is known \emp{a priori} to be true iff the knowledge is not evidentially based on experience.}
478
479 There are also \verb+starred+ \marginpar{\tt \(\backslash\)lbp*, \(\backslash\)lbu*, \(\backslash\)lbpx*} variants of \verb+\lbp+, \verb+\lbu+, and \verb+\lbpx+. The starred commands produce an indented first line in response to a long \verb+name+, but leaves the left margin in place for the following lines:
480
481 \begin{verbatim}
482 \lbp*{compo2}{Compositionality}{The meaning of a complex
483 expression is a function of the meanings of its parts and
484 its mode of composition.}
485 \end{verbatim}%
486 %
487 produces
488
489 \lbp*{compo2}{Compositionality}{The meaning of a complex expression is a function of the meanings of its parts and its mode of composition.}
490
491
492 Vertical spacing \marginpar{Vertical spacing} is controlled with \verb+\Extopsep+ and \verb+\Exredux+. The second controls the reduction of inter-environment vertical space and needs to be adapted to the general control of vertical space. To illustrate, the input
493
494 \begin{verbatim}
495 \setlength{\Extopsep}{2\baselineskip}
496 \setlength{\Exredux}{-3\baselineskip}
497 \end{verbatim}
498 has the following effect on vertical spacing:
499
500 \setlength{\Extopsep}{2\baselineskip}
501 \setlength{\Exredux}{-3\baselineskip}
502
503 \lb{vertia}{First vertical space example}
504 \lb{vertib}{Second vertical space example}
505 \lb{vertic}{Third vertical space example}
506 Next line comes here.
507
508 \setlength{\Extopsep}{.66\baselineskip}
509 \setlength{\Exredux}{-1\baselineskip}
510
511
512 \section{Troubleshooting}
513 The most \marginpar{Infelicitous labels} common problem you can run into with \verb+philex+ derives from an infelicitous choice of label (first argument to the commands). \verb+philex+ creates new command names (control sequences) from the labels, and especially with short labels it sometimes happens that a generated label coincides with a control sequence defined by TeX, or LaTeX, or some document class or package. Typesetting will halt with an error message that does not give the appropriate information. The location of the error need not be right either.
514
515 To remedy, try replacing your latest label(s) by new ones that are unlikely to clash with other control sequences.
516
517 Another type or error \marginpar{\tt hyperref \normalfont and the\\ .aux file} can occur in case the \verb+hyperref+ package is used, and \verb+hyperref+ does not find the information it needs in the .aux file, perhaps because of an error in a previous round.
518
519 The remedy is to enter non-stop typesetting mode by pressing \qut{r} in response to the error message. Typesetting will be completed, with incorrect results, but the next round of typesetting will then work as it should. If there is still a problem, abort typesetting, trash the auxiliary file and start over.
520
521 A problem may arise \marginpar{math environment in \tt lbu} because LaTeX style math environment delimiters (\verb+\(..\)+) are used in the third argument (the update symbol) of the \verb+\lbu+ command. To avoid this problem, use TeX style delimiters (\verb+$..$+) instead.
522
523 A further possible problem derives from \marginpar{Clash between \\ \texttt {hyperref} and \\ \texttt{linguex}} a clash between \verb+linguex+ and fairly recent versions of \verb+hyperref+. This (as has been explained to me by Heiko Oberdiek) depends on a conflict over the use of \verb+\b+. The result will be that sub-environments will lack labels and be incorrectly formatted.
524
525 The remedy has been provided by Heiko Oberdiek, who has added a workaround in \verb+hyperref+. To make use of this, make sure that your version of \verb+hyperref+ is 6.78o (from 2009.02.02) or later.
526
527 There is \marginpar{Clash between \\ \texttt{setspace} and \\ \tt linguex} a conflict between the \verb+setspace+ package and \verb+linguex+. The problem seems to be that \verb+setspace+ redefines \verb+\@footnotetext+ in a way that interferes with the way \verb+linguex+ is meant to work in footnotes.
528
529 To avoid this problem, load \verb+philex+ (and \verb+linguex+ too, if called) \emp{after} \verb+setspace+. Also, don't use the \verb+\setstretch+ command in the preamble for setting line spacing. Rather set a \verb+spacing+ environment in the main body, after \verb+\begin{document}+. This environment may span the entire main document.
530
531 There is a clash \marginpar{Clash between \\ \texttt{SIUnitx} and \\ \tt linguex} between \verb+linguex+ and the \verb+SIUnitx+ package. Thanks to Tom Hodgson and Alan Munn for the following description and solution:
532
533
534 ``\verb+linguex+ defines a command \verb+\bg.+ to introduce glosses. It also creates aliases to this command \verb+\cg.+, \verb+\dg.+, \verb+\eg.+ and \verb+\fg.+. The \verb+\fg.+ command conflicts with \verb+SIUnitx+, which defines \verb+\fg+ as femtogram. The simple solution is to load linguex and then redefine \verb+\fg.+ to nothing, and then load \verb+SIUnitx+. Since the \verb+\fg.+ command isn't necessary in linguex (and isn't even really documented), it's an easily worked around problem, and not really a bug, since both are end user commands.
535
536 \begin{verbatim}
537 \documentclass{article}
538
539 \usepackage{linguex}
540 \def\fg{}
541 \usepackage{siunitx}
542
543 \begin{document}
544 Foo
545 \end{document}''
546 \end{verbatim}
547
548 There is also a \marginpar{Clash with \texttt{tipa}} clash between \verb+linguex+ and the \verb+tipa+ font/symbol package, as well as between \verb+tipa+ and \verb+philex+ with the \verb+oldpunct+ package option. Call \verb+tipa+ before calling \verb+linguex+ or \verb+philex+ (thanks to J. \qut{mach} wust). This does not, however, completely remove the conflict with the \verb+oldpunct+ package option. To avoid this, use current \verb+philex+ commands, which makes the option dispensable.
549
550 Finally, \marginpar{Comments} bug reports, comments or suggestions are welcome and should be directed to Peter Pagin at \hyperref{mailto:[email protected]}{}{}{[email protected]}.
551
552 \section{Version history}
553 \subsection*{Changes in version 1.2}
554 -- Grammaticality judgments added.\\
555 -- Bugfix: Horizontal spacing with \verb+\rn+. Fixed.\footnote
556 {This bug was fixed in version 1.01, but stupidly reintroduced in version 1.1 because of bad file management.}
557 \subsection*{Changes in version 1.1}
558 -- Local cross-references added.\\
559 -- Possibility of repeating a sentence without its associated footnote.\\
560 -- \verb+\bpxformat+ now resets \verb+bpx+ counters.\\
561 -- Extra counter \verb+bnp+ and associated commands.\\
562 -- Manual: labelled brackets.\\
563 -- Manual: glosses.\\
564 -- Bugfix: cross-references to sub-sentences did not work properly in connection with unusual combinations of using and not using optional arguments. Now fixed.
565
566 \subsection*{Changes in version 1.01}
567 -- Bugfix: eliminated unwanted space after \verb+\rn{}+ cross-references.
568
569 \subsection*{Changes in version in version 1.0}
570 -- \quad Adapted the package to version 4.1 of \verb+linguex+.\\
571 -- \quad Added two commands for label separation.
572
573 \subsection*{Changes in version 0.9 (internal version)}
574 -- \quad Added support for \verb+hyperref+ for named environments.\\
575 \noindent -- \quad Added naming options for sub-environments (\verb+\lba+, \verb+\lbb+, \verb+\lbz+).\\
576 \noindent -- \quad Added customizing of brackets and numbering-style for second-level sub-environments.\\
577 \noindent -- \quad Corrected errors in vertical spacing for \verb+\lbu+ and \verb+\rff+.\\
578 \noindent -- \quad Corrected an error in the centering option, and added an alternative for centering.\\
579 \noindent -- \quad Replaced earlier (overly short) punctuation commands, and added a package option for using the old commands.\\
580 \noindent -- Added customizing of vertical spacing and horizontal spacing as well as label length.\\
581 \noindent -- \quad Made the \verb+\lbpx+ environments labels more customizable.\\
582 \noindent -- \quad Rewrote and reorganized the manual.
583
584 \subsection*{Changes in version 0.6}
585 Corrected vertical spacing between adjacent \verb+\lb+ and \verb+\lbp+ environments.
586
587 \subsection*{Changes in version 0.5}
588 In version 0.3, forward cross-reference was effected by means of writing command definitions to a separate file, \emp{myfile}-px.tex, which was subsequently read-in at the beginning of the following run of typesetting. In version 0.5 the information is instead written to the .aux file and then read from the .aux file in the subsequent run. This method is more elegant and eliminates problems with the implementation of the old method. The improvement is due to Robin Fairbairns.
589
590
591
592
593
594 \end{document}