Debian Codegraph @

texmf-dist/doc/latex/frege/frege.tex

raw
1 \documentclass[12pt]{article}
2 \usepackage[bguq]{frege}
3 \usepackage{amsmath}
4
5 %% For condensed itemize:
6 \newcommand{\squishlist}{
7 \begin{list}{$\bullet$}{
8 \setlength{\itemsep}{0pt}
9 \setlength{\parsep}{0pt}
10 \setlength{\topsep}{0pt}
11 \setlength{\partopsep}{0pt}
12 \setlength{\leftmargin}{1em}
13 \setlength{\labelwidth}{1em}
14 \setlength{\parskip}{0pt}
15 \setlength{\partopsep}{0pt}
16 \setlength{\rightmargin}{0pt}
17 \setlength{\labelsep}{0.5em}}}
18 \newcommand{\squishlistend}{\end{list}}
19
20 \title{frege.sty \\ A \LaTeXe Package for Typesetting Begriffsschrift}
21 \author{Quirin Pamp \\ \texttt{[email protected]}}
22
23 \begin{document}
24 \maketitle
25 \section{Background}
26 \subsection{Motivation for this Package}
27 I recently decided to read Frege's \emph{Begriffsschrift} from 1879 and found that
28 the only copy I could find online was a rather poor quality scan of the original.
29 Since the copyright on german publications expires some 70 or so years after the
30 death of their author, I had the bright idea to combine reading the paper with
31 the making of an electronic copy. This required the typesetting of begriffsschrift.
32 A quick search on the internet assured me that there was a LaTeX package for just
33 this purpose, and off I went. However I quickly noticed that it would be very
34 difficult to achieve a typesetting I deemed sufficiently close to the original
35 using only the package \emph{begriff} by Josh Parsons. Despite the fact that I
36 have never written a LaTeX package before, a quick look at the source file (only
37 some 300 or so lines with plenty of comments) along with some head scratching
38 convinced me to embark on this further project.
39
40 With the help of the begriff package and the good people on Stack-Exchange, I
41 eventually produced a package that was able to do everything that the original
42 begriff package can, albeit with a few changes I consider an improvement. Further
43 versions largely reflect additional features I added as I continue to type up
44 Frege's original paper, as well as bug fixes and input by members of the LaTeX
45 community. Once I am done I will add the tex file for Fege's paper as the
46 definitive example for the usage of this package.
47
48 \subsection{The \emph{begriff} Package}
49 This package is based on begriff.sty released under the GNU General Public
50 License.
51 Copyright (C) 2003 by Josh Parsons ([email protected]) with changes made in
52 October 2004 by Richard Heck ([email protected]) and minor changes by Josh
53 Parsons to fix a problem with linespacing made in May 2005.
54
55 While I could not have done so without the aforementioned work, I have reworked the
56 package from the ground up, to the point where some of the underlying approaches
57 have changed. On the downside this means there is no simple way of converting
58 anything typeset using begriff.sty to use this package instead. I felt this was
59 necessary to achieve an end result I was happy with.
60
61 \subsection{The \emph{bguq} Package}
62 Since version 1.3 I added the option to use the bguq character for all
63 quantifiers. This character is provided by the bguq package by J.J. Green.
64
65 \section{Version History}
66 \subsection{Changes as Compared to begriff.sty}
67 \squishlist
68 \item correct (closer to the original typesetting) relative lengths of the
69 content stroke with respect to other strokes attached to it;
70 \item content strokes point at the middle of the following symbols, rather
71 than the bottom;
72 \item greater width for the assertion stroke as compared to the content stroke;
73 \item a more intuitive structure for the conditional (arguments are now given in
74 the same order as they appear on the left of a completed formula);
75 \item the command for the conditional with empty arguments now results in a
76 vertical line (conditional stroke) on it's own the other strokes are added as
77 the arguments;
78 \item the linewidth is properly accounted for so that things remain properly
79 centered when scaled;
80 \squishlistend
81
82 \subsection{Changes in Version 1.1}
83 \squishlist
84 \item added an optional scale factor to all basic strokes;
85 \item simplified the code for Fbracket in terms of that for Fbox;
86 \item rearranged the code in the style file in a more logical way;
87 \squishlistend
88
89 \subsection{Changes in Version 1.2}
90 \squishlist
91 \item added a new command ``Fargument'' for typesetting arguments;
92 \item added a new command ``Fstrut'' to be used in conjunction with Fargument;
93 \item changed Fbaselength to be equal to the full length of a basic stroke (20pt);
94 \item fixed a bug where the scale factor introduced in version 1.1 does not reset
95 after all uses;
96 \squishlistend
97
98 \subsection{Changes in Version 1.3}
99 \squishlist
100 \item made the ``():'' used in the Fargument command introduced in version 1.2
101 user defined so as to make the option properly optional;
102 \item added a strut to Fargument so as to produce visually correct centering;
103 \item added optional shorthands for all commands for a better flow of usage;
104 \item added the option ``bguq'' to the package which uses the bguq font by J.J.
105 Green for all quantifiers;
106 \squishlistend
107
108 \subsection{Changes and Features yet to come}
109 \squishlist
110 \item a way to display nested arguments;
111 \item the fregean conjunction (it exists);
112 \item a vertical shorthand stroke such as used by Frege for typesetting arguments
113 in his original paper;
114 \item scaling symbols automatically with changes in font size;
115 \item scaling of the bguq character with changes in Flinewidth;
116 \squishlistend
117
118 \section{Features and Usage}
119 \subsection{Commands}
120 \subsubsection{Basic Commands}
121 The following is a list of the basic commands provided by this package along with
122 accompanying output and the optional shorthand for the command.
123 \begin{flalign*}
124 &\mbox{Command:} & &\mbox{Output:} & &\mbox{Shorthand:}\\
125 &\mbox{\textbackslash Fcontent[1]} & &\Fcontent
126 & &\mbox{\textbackslash F[1]}\\
127 &\mbox{\textbackslash Fncontent[1]} & &\Fncontent
128 & &\mbox{\textbackslash Fn[1]}\\
129 &\mbox{\textbackslash Fnncontent[1]} & &\Fnncontent
130 & &\mbox{\textbackslash Fnn[1]}\\
131 &\mbox{\textbackslash Facontent[1]} & &\Facontent
132 & &\mbox{\textbackslash Fa[1]}\\
133 &\mbox{\textbackslash Fancontent[1]} & &\Fancontent
134 & &\mbox{\textbackslash Fan[1]}\\
135 &\mbox{\textbackslash Fanncontent[1]} & &\Fanncontent
136 & &\mbox{\textbackslash Fann[1]}\\
137 &\mbox{\textbackslash Fquant[1]\{a\}} & &\Fquant{a}
138 & &\mbox{\textbackslash Fq[1]}\\
139 &\mbox{\textbackslash Fnquant[1]\{a\}} & &\Fnquant{a}
140 & &\mbox{\textbackslash Fnq[1]\{a\}}\\
141 &\mbox{\textbackslash Fnnquant[1]\{a\}} & &\Fnnquant{a}
142 & &\mbox{\textbackslash Fnnq[1]\{a\}}\\
143 &\mbox{\textbackslash Fquantn[1]\{a\}} & &\Fquantn{a}
144 & &\mbox{\textbackslash Fqn[1]\{a\}}\\
145 &\mbox{\textbackslash Fquantnn[1]\{a\}} & &\Fquantnn{a}
146 & &\mbox{\textbackslash Fqnn[1]\{a\}}\\
147 &\mbox{\textbackslash Fnquantn[1]\{a\}} & &\Fnquantn{a}
148 & &\mbox{\textbackslash Fnqn[1]\{a\}}\\
149 &\mbox{\textbackslash Fnquantnn[1]\{a\}} & &\Fnquantnn{a}
150 & &\mbox{\textbackslash Fnqnn[1]\{a\}}\\
151 &\mbox{\textbackslash Fnnquantn[1]\{a\}} & &\Fnnquantn{a}
152 & &\mbox{\textbackslash Fnnqn[1]\{a\}}\\
153 &\mbox{\textbackslash Fnnquantnn[1]\{a\}} & &\Fnnquantnn{a}
154 & &\mbox{\textbackslash Fnnqnn[1]\{a\}}\\
155 &\mbox{\textbackslash Faquant[1]\{a\}} & &\Faquant{a}
156 & &\mbox{\textbackslash Faq[1]\{a\}}\\
157 &\mbox{\textbackslash Fanquant[1]\{a\}} & &\Fanquant{a}
158 & &\mbox{\textbackslash Fanq[1]\{a\}}\\
159 &\mbox{\textbackslash Fannquant[1]\{a\}} & &\Fannquant{a}
160 & &\mbox{\textbackslash Fannq[1]\{a\}}\\
161 &\mbox{\textbackslash Faquantn[1]\{a\}} & &\Faquantn{a}
162 & &\mbox{\textbackslash Faqn[1]\{a\}}\\
163 &\mbox{\textbackslash Faquantnn[1]\{a\}} & &\Faquantnn{a}
164 & &\mbox{\textbackslash Faqnn[1]\{a\}}\\
165 &\mbox{\textbackslash Fanquantn[1]\{a\}} & &\Fanquantn{a}
166 & &\mbox{\textbackslash Fanqn[1]\{a\}}\\
167 &\mbox{\textbackslash Fanquantnn[1]\{a\}} & &\Fanquantnn{a}
168 & &\mbox{\textbackslash Fanqnn[1]\{a\}}\\
169 &\mbox{\textbackslash Fannquantn[1]\{a\}} & &\Fannquantn{a}
170 & &\mbox{\textbackslash Fannqn[1]\{a\}}\\
171 &\mbox{\textbackslash Fannquantnn[1]\{a\}} & &\Fannquantnn{a}
172 & &\mbox{\textbackslash Fannqnn[1]\{a\}}\\
173 \end{flalign*}
174 This may seem like a daunting list, but there is an exceedingly simple way to think
175 about it. In a sense there are only two commands \textbackslash Fcontent[1] and
176 \textbackslash Fquant[1]\{\}. These two commands can be augmented with a
177 combination of as and ns so as to add assertion and negation strokes respectively.
178 Any stroke that is asserted (has a fat vertical line at the start) starts with
179 `\textbackslash Fa'. This may be followed by either one or two or no `n' to add one
180 or two or no negation strokes (the small vertical lines below the content
181 stroke). Next comes the name of the main command, either `quant' or `content'.
182 Finally the quantifiers may be followed by either one or two `n' to add one or two
183 negation strokes to the content stroke after the quantifier's depression.
184
185 Consider also that many of these commands are only really present for completeness
186 sake. It is difficult to imagine a situation where a twice negated quantifier with
187 twice negated content would ever be needed.
188
189 Since version 1.1 all basic strokes also have an optional scaling factor. A command
190 followed by [.5], for example would produce a stroke exactly half the default
191 length while [2] produces a stroke twice the default length. (The default length
192 is given by \textbackslash Fbaselength which is set to 20pt. Scaling allows for
193 greater control in the total length of formula as well as for a shorter syntax.
194 (We can replace expressions like \textbackslash Facontent \textbackslash Fcontent
195 with \textbackslash Facontent[2].) Care must be taken not to set a length that is
196 shorter than what is needed to fit all the parts of some basic stroke. This will
197 lead to negative lengths and hence unpredictable output.
198
199 All quantifiers also have a mandatory argument that specifies the variable
200 associated with the quantifier. (Mandatory arguments are contained in a set of
201 curly brackets \{ and \}). This argument should be a single small letter and
202 will be typeset above the semi circular depression in the assertion stroke in
203 mathfrak font which is provided by tha amssymb package. This font can be used in
204 maths mode by using the command `\textbackslash mathfrak\{\}'. Note that all the
205 commands provided by this package may be used in both math and text mode. (Though
206 math mode usually results in better formatting.)
207
208 Finally one may combine the above commands in arbitrary combinations which will
209 result in gapless longer strokes. (Eg.: $\Faquant[0.6]{a}\Fnquantn[1.4]{b}A$)
210 which may be roughly translated into english as ``for all $\mathfrak{a}$ there
211 exists a $\mathfrak{b}$ such that $A$''. (The commands I used for this expression
212 are \$\textbackslash Faquant\{a\}\textbackslash Fnquantn\{b\}A\$).
213
214 \subsubsection{Conditional}
215 The conditional is the most important command in this package since it gives
216 Frege's Begriffsschrift it's two dimensional structure.\\
217 The syntax for the Fconditional command is as follows:
218
219 \textbackslash Fconditional[\textless option\textgreater]
220 \{\textless consequent\textgreater\}\{\textless antecedent\textgreater\}\\
221 The shorthand version (since version 1.3) is given by ``\textbackslash Fcdt''.
222
223 The arguments may in principle be anything, but you will only get a begriffschrift
224 formula if the arguments are themselves given by appropriate commands from the list
225 of basic commands given earlier. As an example, an asserted conjunction between $A$
226 and $B$ would be given as follows:
227
228 \$\textbackslash Fconditional[\textbackslash Fancontent]\{\textbackslash Fncontent
229 A\}\{\textbackslash Fcontent B\}\$ \\
230 and produce the following output:
231 \begin{align*}
232 \Fbox{\Fconditional[\Fancontent]{\Fncontent A}{\Fcontent B}}
233 \end{align*}
234 In addition Fconditional may be nested as it's own argument to arbitrary depth.
235 Nesting in the option is not recommended. \\
236 A conditional with nested consequent may be given as follows:
237
238 \$\textbackslash Fconditional[\textbackslash Facontent]\{\textbackslash
239 Fcontent\textbackslash Fconditional\{\textbackslash Fcontent A\}\{\textbackslash
240 Fcontent B\}\}\{\textbackslash Fcontent\textbackslash Fcontent C\}\$\\
241 and produces the following output:
242 \begin{align*}
243 \Fbox{\Fconditional[\Facontent]{\Fcontent\Fconditional{\Fcontent A}
244 {\Fcontent B}}{\Fcontent[2] C}}
245 \end{align*}
246 A conditional with nested antecedent may be given as follows:
247
248 \$\textbackslash Fconditional[\textbackslash Facontent]\{\textbackslash Fcontent
249 \textbackslash Fcontent A\}\{\textbackslash Fcontent\textbackslash Fconditional
250 \{\textbackslash Fcontent B\}\{\textbackslash Fcontent C\}\}\$\\
251 and produces the following output:
252 \begin{align*}
253 \Fbox{\Fconditional[\Facontent]{\Fcontent[2] A}{\Fcontent\Fconditional%
254 {\Fcontent B}{\Fcontent C}}}
255 \end{align*}
256 Each section of a content stroke may thus be replaced with any of the strokes given
257 by the list of basic commands. Note that it is up to the user to place the
258 appropriate number of strokes in each argument to ensure that the content strokes
259 all line up on the right hand side.
260
261 \subsubsection{Brackets and Boxes}
262 There are two more commands to be considered:
263
264 \textbackslash Fbox\{\textless complex expression\textgreater\}\\
265 The shorthand version (since version 1.3) is given by \textbackslash Fb\{\}
266
267 \textbackslash Fbracket\{\textless complex expression\textgreater\}\\
268 The shorthand version (since version 1.3) is given by \textbackslash Fbb\{\}
269
270 Both Fbox and Fbracket take what I have called a `complex expression' for their
271 argument. A `complex expression' is any formula in begriffsschrift that has at
272 least one conditional in it. It is generally a good idea to put all complex
273 expressions into either a Fbox or a Fbracket. It is never necessary to place a
274 complex expressions into both an Fbox and an Fbracket since an Fbox simply is a
275 Fbracket without the actual brackets. Fbracket exists only for convenience with
276 the same effect being achieved by \textbackslash left(\textbackslash Fbox\{\}
277 \textbackslash right).
278
279 The reason why the Fbox is a good idea, is that the baseline is very near the top of
280 a complex expression of Begriffsschrift, which can make for some odd formatting
281 effects. In addition to placing the baseline at the middle of a complex expression
282 an Fbox ensures the expression is treated by LaTeX as a single object and given
283 enough space.
284
285 Finally a complex expression may not format correctly in some environments (like
286 the align* environment for example) unless it is placed in an Fbox. In short,
287 always use an Fbox (or Fbracket).
288
289 \subsubsection{Arguments and Struts}
290 Since version 1.2 two commands have been added that allow for the typesetting of
291 arguments. The syntax for the argument command is as follows:
292
293 \textbackslash Fargument[\textless premise 0\textgreater]\{\textless premise
294 1\textgreater\}\{\textless premise 2\textgreater\}\{\textless conclusion
295 \textgreater\}\\
296 The shorthand version (since version 1.3) is given by \textbackslash Farg
297
298 In the following esample the optional argument for premise 0 (an absent premise
299 takes the value `$(X):$' the premises are the two formulas above the therfore line
300 and the conclusion is the formula below the therefore line. The Begriffschrift
301 expressions in the arguments of the Fargument command do not need to be placed in
302 an Fbox, since the Fargument command works by boxing it's arguments allready.
303 \begin{align*}
304 \Fargument[(X):]
305 {\Fconditional[\Facontent]
306 {\Fcontent[2] A}
307 {\Fcontent\Fconditional{\Fcontent B}{\Fcontent C}}}
308 {\Fstrut[2]\Facontent C}
309 {\Fstrut[2]\Facontent A}
310 \end{align*}
311 where $X=\Facontent B$; (this is typeset seperately from the Fargument command);
312
313 The three begriffsschrift formulas above are in fact aligned leftbound. To make
314 them appear rightbound no matter what the relative lengths of $A$, $B$, and $C$,
315 the command ``Fstrut'' has been used in front of $\Facontent C$ and $\Facontent A$.
316 The command ``\textbackslash Fstrut[1]'' works exactly like an invisible content
317 stroke, that is it inserts space of length Fbaselength. Like all basic strokes it
318 can be scaled via an optional scale factor. Since version 1.3 it may be called by
319 the optional shorthand ``\textbackslash Fs''
320
321 \subsection{Lengths}
322 In theory all the dimensions in this package can be changed with the command
323 \textbackslash setlength\{\textless name of length\textgreater\}\{\textless new
324 value\textgreater\}, though I have not done a great deal of testing and recommend
325 sticking to the default values. The following then is a table of all lengths: \\
326 \begin{tabular}{|l|l|l|}
327 \hline
328 name & default value & description \\
329 \hline
330 \textbackslash Fbaselength & 20pt & the length of the basic strokes \\
331 \textbackslash Flinewidth & 0.5pt & the line width \\
332 \textbackslash Fspace & 2pt & seperation between lines and text/formula \\
333 \textbackslash Fassertwidth & 3\textbackslash Flinewidth & width of assert
334 stroke \\
335 \textbackslash Fraiseheight & 1ex-\textbackslash Flinewidth & height of content
336 lines above baseline \\
337 \textbackslash Fnegsep & 3\textbackslash Flinewidth & seperation between a
338 double negation \\
339 \textbackslash Fnegshort & 2\textbackslash Flinewidth & space between negation
340 stroke and baseline \\
341 \textbackslash Fquantwidth & 6pt & width of the semi-circular quantifier
342 depression \\
343 \hline
344 \end{tabular}
345 the height of the conditional stroke is determined by the size of the contents of
346 the conditionals argument, as well as the baselineskip of the surrounding text. It
347 cannot be changed manually.
348
349 \subsection{The \emph{bguq} Option}
350 Since version 1.3 this package may be called with the option ``bguq'' as follows: \\
351 \textbackslash usepackage[bguq]\{frege\}\\
352 If the option is enabled all quantifiers will be typeset using the bguq font
353 provided by the bguq package by J.J. Green. (This document is typeset using the
354 option). This means that the bguq package must be installed if the option is
355 enabled. (It can be found on ctan).
356
357 Warning: At present the bguq character scales with font size while the rest of the
358 symbols provided by this package do not. Also the bguq character does not respond
359 to a change in Flinewidth.
360
361 \subsection{Final Example}
362 The Geach-Kaplan sentance (with thanks to Marcus Rossberg):
363 \begin{align*}
364 \Fbox%
365 {%
366 \Fconditional[{\Facontent[.2]\Fnquant{F}\Fcontent[.2]}]%
367 {%
368 \Fcontent%
369 \Fconditional%
370 {%
371 \Fcontent[3]%
372 \Fbox%
373 {%
374 f\Fbracket%
375 {%
376 \Fconditional[\Faquant{a}]%
377 {\Fcontent C\mathfrak{(a)}}%
378 {\Fcontent \mathfrak{F(a)}}%
379 }%
380 }%
381 }%
382 {\Fcontent\Fnquantn{b}\Fcontent\mathfrak{F(b)}}%
383 }%
384 {%
385 \Fcontent[0.4]%
386 \Fquant[0.6]{c}%
387 \Fquant[0.6]{d}%
388 \Fcontent[0.4]%
389 \Fconditional%
390 {%
391 \Fncontent%
392 \Fconditional{\Fcontent\mathfrak{c=d}}{\Fcontent\mathfrak{F(d)}}%
393 }%
394 {%
395 \Fncontent%
396 \Fconditional{\Fncontent\mathfrak{F(c)}}{\Fcontent A\mathfrak{(c,d)}}%
397 }%
398 }%
399 }%
400 \end{align*}
401 And that is all. \\
402 For comments, suggestions, identified errors, email me at \\
403 \textless [email protected]\textgreater.
404 \end{document}
405
406 \section{GNU General Public License}
407 This package and all accompanying documentation is released under the GNU General
408 Public License. It is free software; you can redistribute it and/or modify it under
409 the terms of the GNU General Public License as published by the Free Software
410 Foundation; either version 2 of the License, or (at your option) any later version.
411
412 This program is distributed in the hope that it will be useful, but WITHOUT ANY
413 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
414 PARTICULAR PURPOSE. See the GNU General Public License for more details.
415
416 You should have received a copy of the GNU General Public License along with this
417 program; if not, write to the Free Software Foundation, Inc., 59 Temple Place -
418 Suite 330, Boston, MA 02111, USA. (Or just search for it online.)