summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Master/texmf-dist/tex/latex/begriff/begriff.sty163
1 files changed, 163 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/begriff/begriff.sty b/Master/texmf-dist/tex/latex/begriff/begriff.sty
new file mode 100644
index 00000000000..537907d088a
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/begriff/begriff.sty
@@ -0,0 +1,163 @@
+% begriff.sty - a LaTeX2e package for typesetting begriffsschrift
+
+% Copyright (C) 2003 by Josh Parsons <josh@coombs.anu.edu.au>
+%
+% This program is free software; you can redistribute it and/or modify
+% it under the terms of the GNU General Public License as published by
+% the Free Software Foundation; either version 2 of the License, or
+% (at your option) any later version.
+%
+% This program is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+% General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with this program; if not, write to the Free Software
+% Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111,
+% USA.
+
+%%% identification
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{begriff}
+
+%%% initial code
+
+% thickness of lines
+\newlength{\BGthickness}
+\setlength{\BGthickness}{0.4pt}
+
+% additional length after a quantifier, conditional, negation, or assertion
+\newlength{\BGafterlen}
+\setlength{\BGafterlen}{7pt}
+
+% additional length before a quantifier, conditional, or negation
+\newlength{\BGbeforelen}
+\setlength{\BGbeforelen}{5pt}
+
+% space inserted before a formula
+\newlength{\BGspace}
+\setlength{\BGspace}{3pt}
+
+% total width of diagram
+\newlength{\BGlinewidth}
+\setlength{\BGlinewidth}{\linewidth}
+
+%%% options
+%\DeclareOption{nothanks}{
+% \renewcommand{\mythanks}[1]{}
+% \let\@mythanks\relax
+%}
+\ProcessOptions
+
+%%% package dependencies
+
+%%% main code
+\typeout{Begriffsschrift: 15 Nov 2003}
+
+% variable-sized parenthesis
+\newcommand{\BGbracket}[1]{%
+\setbox0=\hbox{\ensuremath{#1}}%
+\dimen0=\dp0%
+\addtolength{\dimen0}{.5\baselineskip}%
+\left(\vbox to \dp0 {\vskip.5\baselineskip\box0\vss}\right)%
+}
+
+% generate a terminal node with fill-line to the left
+\newcommand{\BGterm}[1]{\unskip%
+\setbox0=\hbox{%
+\setlength{\BGlinewidth}{0pt}%
+\vrule height \baselineskip depth 0pt width 0pt% strut
+\vrule height \BGthickness width \BGafterlen depth 0pt%
+\ensuremath{\hskip\BGspace #1}%
+}%
+\addtolength{\BGlinewidth}{-\wd0}%
+\vrule height \BGthickness width \BGlinewidth depth 0pt%
+\box0%
+\setlength{\BGlinewidth}{0pt}%
+}
+
+% box up some maths and subtract its width from linewidth
+\newcommand{\BGstem}[1]{\unskip%
+\setbox0=\hbox{%
+\setlength{\BGlinewidth}{0pt}%
+\ensuremath{\hskip\BGspace #1}%
+}%
+\addtolength{\BGlinewidth}{-\wd0}%
+\box0%
+\hskip\BGspace%
+}
+
+% generate a conditional \BGconditional{antecedent}{consequent}
+\newcommand{\BGconditional}[2]{\unskip%
+\addtolength{\BGlinewidth}{-\BGbeforelen}%
+\setbox0=\hbox{%
+\addtolength{\BGlinewidth}{-\BGafterlen}%
+\vrule height \baselineskip depth 0pt width 0pt% strut
+\vrule height \BGthickness width \BGafterlen depth 0pt%
+\ensuremath{\hskip\BGspace #1}%
+}%
+\setbox1=\hbox{%
+\addtolength{\BGlinewidth}{-\BGafterlen}%
+\vrule height 0pt depth .3\baselineskip width 0pt% strut
+\vrule height \BGthickness width \BGafterlen depth 0pt%
+\ensuremath{\hskip\BGspace #2}%
+}%
+\dimen0=0pt%
+\addtolength{\dimen0}{\dp1}%
+\addtolength{\dimen0}{\ht0}%
+\addtolength{\dimen0}{\lineskip}%
+\hbox{%
+\vrule width \BGbeforelen height \BGthickness depth 0pt%
+\kern-\BGthickness%
+\vrule width \BGthickness height \BGthickness depth \dimen0%
+\vtop{\box1\box0}%
+}%
+}
+
+% generate an assertion sign
+\newcommand{\BGassert}[0]{%
+\addtolength{\BGlinewidth}{-\BGafterlen}%
+\addtolength{\BGlinewidth}{-\BGthickness}%
+\vrule width \BGthickness height 5pt depth 5pt%
+\vrule depth 0pt height \BGthickness width \BGafterlen%
+\hskip \BGspace%
+}
+
+% generate a content stroke
+\newcommand{\BGcontent}[0]{%
+\addtolength{\BGlinewidth}{-\BGafterlen}%
+\vrule depth 0pt height \BGthickness width \BGafterlen%
+\hskip \BGspace%
+}
+
+% generate a negation
+\newcommand{\BGnot}[0]{\unskip%
+\addtolength{\BGlinewidth}{-\BGbeforelen}%
+\addtolength{\BGlinewidth}{-\BGafterlen}%
+\vrule width \BGbeforelen height \BGthickness depth 0pt%
+\kern-\BGthickness%
+\vrule width \BGthickness height \BGthickness depth 5pt%
+\vrule depth 0pt height \BGthickness width \BGafterlen%
+\hskip \BGspace%
+}
+
+% generate a universal quantifier
+\newcommand{\BGquant}[1]{\unskip%
+\addtolength{\BGlinewidth}{-\BGbeforelen}%
+\addtolength{\BGlinewidth}{-10pt}%
+\addtolength{\BGlinewidth}{-\BGafterlen}%
+\hbox{%
+\vrule width \BGbeforelen height \BGthickness depth 0pt%
+\setlength{\unitlength}{1pt}%
+\kern-\BGthickness%
+\begin{picture}(10,0)(0,0)%
+\linethickness{\BGthickness}%
+\qbezier(0,0)(5,-5)(10,0)%
+\end{picture}%
+\kern-10pt%
+\vbox{\hbox to 10pt {\hskip1pt\hskip\BGthickness\hss$_{#1}$\hss}\vskip1pt}%
+\vrule width \BGafterlen height \BGthickness depth 0pt%
+}%
+\hskip\BGspace%
+}