diff --git a/install.sh b/install.sh index 0224562..86eac8a 100755 --- a/install.sh +++ b/install.sh @@ -1,5 +1,17 @@ #!/bin/bash +function deploy_directory() +{ # {{{ +# @arg1: dst directory +# @arg2: src directory + + if [ ! -d $1 ]; then mkdir $1; fi; + cd $1; + + for i in `ls $2`; do ln -s $2/$i ./$i; done + cd .. +} # }}} + function deploy_for_desktop() { # {{{ cd ~ @@ -9,6 +21,9 @@ function deploy_for_desktop() ln -s $WAI/octaverc ./.octaverc ln -s $WAI/gitconfig ./.gitconfig + cd ~ + deploy_directory ~/texmf $WAI/texmf + cd ~ if [ ! -d "~/.my_utils" ]; then mkdir ~/.my_utils; fi; cd ~/.my_utils @@ -99,24 +114,9 @@ deploy_ssh deploy_mutt - - - cd ~ if [ -d "Programmation" ]; then mkdir Programmation; fi; cd ~/Programmation ln -s $WAI/git_auto_pull.sh ./git_auto_pull.sh - -function deploy_directory() -{ # {{{ -# @arg1: dst directory -# @arg2: src directory - - if [ ! -d $1 ]; then mkdir $1; fi; - cd $1; - - for i in `ls $2`; do ln -s $2/$i ./$i; done - cd .. -} # }}} diff --git a/texmf/tex/latex/frank_tex/frank_tex.sty b/texmf/tex/latex/frank_tex/frank_tex.sty new file mode 100644 index 0000000..8ce6606 --- /dev/null +++ b/texmf/tex/latex/frank_tex/frank_tex.sty @@ -0,0 +1,55 @@ +%% Informations générales +%%\NeedsTeXFormat{LaTeX2e}[1999/01/01] +\ProvidesPackage{frank_tex}[2013/10/01] + +%% Chargement des extensions +%\RequirePackage[dvips]{graphicx} + +\usepackage[T1]{fontenc} +\usepackage[utf8]{inputenc} +\usepackage{fontenc} + +\usepackage{graphicx} +\usepackage{amsmath} +\usepackage{amsfonts} +\usepackage{amssymb} + +\usepackage[french]{babel} + +\usepackage{indentfirst} +\setlength{\parindent}{1cm} + + +%% Déclaration des options +%\DeclareOption{option}{...} +%\DeclareOption*{...} +%\ProcessOptions + +\author{Frank Villaro-Dixon} + +%% Définition des commandes +\newcommand{\degree}{\ensuremath{^\circ}} +\newcommand{\irony}{\reflectbox{fuck ?}} +\newcommand{\interrobang}{‽} + +\newcommand{\aster}{*} % maybe \ding{97} ? +\newcommand{\asterism}{ + \begin{center} + \vspace{-1.75em} + \parbox{1in}{ % needed to prevent split across page boundaries + \begin{center} + \aster\\ + \aster\hspace{1.15em}\aster + \end{center} + } %\parbox + \vspace{-0.75em} + \end{center} +} + +\newcommand{\Therefore}{\ensuremath{\therefore }} +\newcommand{\Because}{\ensuremath{\because }} + +%\newcommand{\pi}{\ensuremath{^\pi}} + +%% Fin du package +\endinput diff --git a/texmf/tex/latex/frank_tex/fullpage.sty b/texmf/tex/latex/frank_tex/fullpage.sty new file mode 100644 index 0000000..38749a5 --- /dev/null +++ b/texmf/tex/latex/frank_tex/fullpage.sty @@ -0,0 +1,78 @@ +%% +%% This is file `fullpage.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% fullpage.dtx (with options: `package') +%% ============================================= +%% IMPORTANT NOTICE: +%% +%% This program can be redistributed and/or modified under the terms +%% of the LaTeX Project Public License Distributed from CTAN +%% archives in directory macros/latex/base/lppl.txt; either +%% version 1 of the License, or any later version. +%% +%% This is a generated file. +%% It may not be distributed without the original source file fullpage.dtx. +%% +%% Full documentation can be obtained by LaTeXing that original file. +%% Only a few abbreviated comments remain here to describe the usage. +%% ============================================= +%% Copyright 1994-1999 Patrick W Daly +%% Max-Planck-Institut f\"ur Aeronomie +%% Max-Planck-Str. 2 +%% D-37191 Katlenburg-Lindau +%% Germany +%% E-mail: daly@linmpi.mpg.de +\NeedsTeXFormat{LaTeX2e}[1994/06/01] +\ProvidesPackage{fullpage} + [1999/02/23 1.1 (PWD)] + % Sets all 4 margins to be either 1 inch or 1.5 cm, and specifies + % the page style + % Call as \usepackage[options]{fullpage} + % Options = in (default) for 1 inch + % cm for 1.5 cm + % plain (default) sets \pagestyle{plain} + % empty sets \pagestyle{empty} + % headings sets \pagestyle{headings} + % myheadings sets \pagestyle{myheadings} + %----------------------------------------------------------- +\newlength{\FP@margin} +\DeclareOption{in}{\setlength{\FP@margin}{1in}} +\DeclareOption{cm}{\setlength{\FP@margin}{1.5cm}} +\newif\ifFP@plain +\newif\ifFP@empty +\DeclareOption{plain}{\FP@plaintrue \FP@emptyfalse + \pagestyle{plain}} +\DeclareOption{empty}{\FP@plaintrue \FP@emptytrue + \pagestyle{empty}} +\DeclareOption{headings}{\FP@plainfalse \FP@emptyfalse + \pagestyle{headings}} +\DeclareOption{myheadings}{\FP@plainfalse \FP@emptyfalse + \pagestyle{myheadings}} +\ExecuteOptions{in,plain} +\ProcessOptions* +\ifFP@plain + \setlength{\headheight}{0pt} + \setlength{\headsep}{0pt} +\fi +\ifFP@empty + \setlength{\footskip}{0pt} +\fi +\setlength{\textwidth}{\paperwidth} +\addtolength{\textwidth}{-2\FP@margin} +\setlength{\oddsidemargin}{\FP@margin} +\addtolength{\oddsidemargin}{-1in} +\setlength{\evensidemargin}{\oddsidemargin} +\setlength{\textheight}{\paperheight} +\addtolength{\textheight}{-\headheight} +\addtolength{\textheight}{-\headsep} +\addtolength{\textheight}{-\footskip} +\addtolength{\textheight}{-2\FP@margin} +\setlength{\topmargin}{\FP@margin} +\addtolength{\topmargin}{-1in} +%% +%% <<<<< End of generated file <<<<<< +%% +%% End of file `fullpage.sty'. diff --git a/texmf/tex/latex/frank_tex/moreverb.sty b/texmf/tex/latex/frank_tex/moreverb.sty new file mode 100644 index 0000000..43d91d5 --- /dev/null +++ b/texmf/tex/latex/frank_tex/moreverb.sty @@ -0,0 +1,200 @@ +%%% moreverb.sty +%%% AJCD 20 Sep 91 +%%% adds various verbatim environments using Rainer Sch\"opf's new verbatim +%%% environment. + +%%% Marginal hacks (RF) to work `properly' with 2e +\def\filedate{1994/12/13} +\def\fileversion{v2.0} +% +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{moreverb} + [\filedate\space \fileversion\space + LaTeX2e package for `more' verbatim enhancements] +\typeout{Package: `moreverb' + \fileversion \space <\filedate> (RF, after AJCD and RmS)} +%\typeout{English Documentation \@spaces <\docdate>} % oh no there isn't + +%%% load verbatim style if not already loaded. +\@ifundefined{verbatim@processline}{\RequirePackage{verbatim}}{} + +%%% verbatimwrite writes all text in its body to a file, the name of which it +%%% is given as an argument. Written by RmS. +\newwrite \verbatim@out +\def\verbatimwrite#1{% + \@bsphack + \immediate\openout \verbatim@out #1 + \let\do\@makeother\dospecials + \catcode`\^^M\active \catcode`\^^I=12 + \def\verbatim@processline{% + \immediate\write\verbatim@out + {\the\verbatim@line}}% + \verbatim@start} + +\def\endverbatimwrite{% + \immediate\closeout\verbatim@out + \@esphack} + +%%% Auxiliary macros and counters for expanding tabs. Use by listing and +%%% verbatimtab environments. +\newcount\tab@position \newcount\tab@size +\newcount\verbatimtabsize \verbatimtabsize=8 +\def\@xobeytab{\leavevmode\penalty\@M + {\loop\ \global\advance\tab@position-1 \ifnum\tab@position>0 \repeat}} +\begingroup + \catcode`\^^I=\active + \gdef\@vobeytabs{\catcode`\^^I\active\let^^I\@xobeytab}% +\endgroup +\def\verbatim@tabexpand#1{% + \ifx#1\@nil \let\next\par \else + \ifx#1\@xobeysp \@xobeysp\advance\tab@position-1 \else + \ifx#1\@xobeytab \@xobeytab\else + #1\advance\tab@position-1 + \fi\fi + \ifnum\tab@position=0 \tab@position\tab@size \fi + \let\next\verbatim@tabexpand + \fi\next +} + +%%% listing defines a verbatim environment with numbered lines; it takes an +%%% optional argument specifying the number of lines between numbered +%%% lines, and a mandatory argument specifying the starting line. listingcont +%%% continues from the place where listing left off. +%%% The style in which the label is set can be altered by re-defining +%%% \listinglabel. * versions are provided. +\newcount\listing@line \listing@line=1 \newcount\listing@step \listing@step=1 +% Adding an \hbox in front of the line causes a line break, so I go +% through this rigmarole to get the lines aligned nicely. I probably +% missed some obvious reason why \hboxes don't work. +\def\listinglabel#1{\rlap{\small\rm\the#1}\hskip2.5em} +\def\thelisting@line{% + \setbox0\hbox{\listinglabel\listing@line}% + \@tempcnta=\listing@line + \divide\@tempcnta\listing@step \multiply\@tempcnta\listing@step + \ifnum\listing@line=1 \unhbox0 + \else \ifnum\@tempcnta=\listing@line \unhbox0 + \else \hskip\wd0 + \fi\fi} +\def\listing{\@ifnextchar[{\@listing}{\@listing[1]}} +\def\@listing[#1]#2{% + \global\listing@line=#2\global\listing@step=#1\listingcont} +\def\listingcont{% + \tab@size=\verbatimtabsize + \def\verbatim@processline{\tab@position\tab@size + \thelisting@line \global\advance\listing@line1 + \expandafter\verbatim@tabexpand\the\verbatim@line\@nil}% + \@verbatim\frenchspacing\@vobeyspaces\@vobeytabs\verbatim@start} +\let\endlisting=\endtrivlist +\let\endlistingcont=\endtrivlist +\@namedef{listing*}{\@ifnextchar[{\@listingstar}{\@listingstar[1]}} +\def\@listingstar[#1]#2{% + \global\listing@line=#2\global\listing@step=#1\relax + \csname listingcont*\endcsname} +\@namedef{listingcont*}{% + \def\verbatim@processline{% + \thelisting@line \global\advance\listing@line1 + \the\verbatim@line\par}% + \@verbatim\verbatim@start} +\expandafter\let\csname endlisting*\endcsname =\endtrivlist +\expandafter\let\csname endlistingcont*\endcsname =\endtrivlist + +%%% file input version of listing +\def\listinginput{% + \@ifnextchar[{\@listinginput}{\@listinginput[1]}} +{\catcode`\~=\active \lccode`\~=`\^^M \lccode`\N=`\N + \lowercase{% + \gdef\@listinginput[#1]#2#3{\begingroup + \global\listing@line=#2\global\listing@step=#1 + \tab@size=\verbatimtabsize + \def\verbatim@processline{\tab@position\tab@size + \thelisting@line \global\advance\listing@line1 + \expandafter\verbatim@tabexpand\the\verbatim@line\@nil}% + \@verbatim\frenchspacing\@vobeyspaces\@vobeytabs + \def\verbatim@addtoline##1~{% + \verbatim@line\expandafter{\the\verbatim@line##1}}% + \openin\verbtab@in=#3 + \ifeof\verbtab@in\typeout{No file #3.}\else + \verbtab@oktrue + \loop + \read\verbtab@in to \verbtab@line + \ifeof\verbtab@in\verbtab@okfalse\else + \expandafter\verbatim@addtoline\verbtab@line + \verbatim@processline + \verbatim@startline + \fi + \ifverbtab@ok\repeat + \closein\verbtab@in\fi + \endtrivlist\endgroup\@doendpe}}} + +%%% verbatimcmd is a verbatim environment with the exception of the escape and +%%% grouping characters \, {, }. +\def\verbatimcmd{% + \@verbatim \catcode`\\=0 \catcode`\{=1 \catcode`\}=2 + \frenchspacing\@vobeyspaces\verbatim@start +} +\def\endverbatimcmd{% + \let\par\relax + \def\verbatim@{\endtrivlist\endgroup}% + \begingroup} + +%%% boxedverbatim produces a verbatim environment in a framed box. +%%% written by Victor Eijkhout +%%% bug fix (supplied by David Carlisle) 1995/12/28, marked %%%DPC%%% +\def\boxedverbatim{% + % redefine `processline' to produce only a line as wide + % as the natural width of the line + \def\verbatim@processline{% + {\setbox0=\hbox{\the\verbatim@line}% + \hsize=\wd0 \the\verbatim@line\par}}% + % save the verbatim code in a box + \@minipagetrue%%%DPC%%% + \@tempswatrue%%%DPC%%% + \setbox0=\vbox\bgroup \verbatim +} +\def\endboxedverbatim{% + \endverbatim + \unskip\setbox0=\lastbox %%%DPC%%% + \egroup % close the box and `fbox' it + \fbox{\box0}% <<<=== change here for centering,... +} + +%%% verbatimtab is a verbatim environment which expands tab characters; it +%%% takes an optional argument specifying the width of tab stops +\def\verbatimtab{\futurelet\next\@verbatimtab} +\def\@verbatimtab{\if\next[ \let\next\@@verbatimtab\else + \def\next{\@@verbatimtab[\the\verbatimtabsize]}\fi\next} +\def\@@verbatimtab[#1]{% + \do@verbatimtab{#1}{% + \@verbatim\frenchspacing\@vobeyspaces\@vobeytabs\verbatim@start}% +} +\def\do@verbatimtab#1#2{% + \tab@size=#1 + \def\verbatim@processline{\tab@position\tab@size + \expandafter\verbatim@tabexpand\the\verbatim@line\@nil}#2 +} +\let\endverbatimtab=\endtrivlist + +%%% file input version of verbatimtab +\newread\verbtab@in \newif\ifverbtab@ok +\def\verbatimtabinput{% + \@ifnextchar[{\@verbatimtabinput}{\@verbatimtabinput[\the\verbatimtabsize]}} +{\catcode`\~=\active \lccode`\~=`\^^M \lccode`\N=`\N + \lowercase{% + \gdef\@verbatimtabinput[#1]#2{\begingroup + \do@verbatimtab{#1}{% + \@verbatim\frenchspacing\@vobeyspaces\@vobeytabs}% + \def\verbatim@addtoline##1~{% + \verbatim@line\expandafter{\the\verbatim@line##1}}% + \openin\verbtab@in=#2 + \ifeof\verbtab@in\typeout{No file #2.}\else + \verbtab@oktrue + \loop + \read\verbtab@in to \verbtab@line + \ifeof\verbtab@in\verbtab@okfalse\else + \expandafter\verbatim@addtoline\verbtab@line + \verbatim@processline + \verbatim@startline + \fi + \ifverbtab@ok\repeat + \closein\verbtab@in\fi + \endtrivlist\endgroup\@doendpe}}} diff --git a/texmf/tex/latex/frank_tex/qtree.sty b/texmf/tex/latex/frank_tex/qtree.sty new file mode 100644 index 0000000..4db8284 --- /dev/null +++ b/texmf/tex/latex/frank_tex/qtree.sty @@ -0,0 +1,1010 @@ +% +% qtree.sty, a LaTeX macro package for drawing trees from descriptions +% given in bracket notation. +% + \def\qTreeVersion{3.1b} + \def\qTreeDate{2008/12/12 } + +% QobiTree tree macros written by Jeffrey Mark Siskind (Qobi@cis.upenn.edu). +% Front end and extensions by Alexis Dimitriadis (alexis@ling.upenn.edu). +% +% Please direct questions/comments to alexis@ling.upenn.edu. +% + +% Most recent revisions: + +% 2008/12/12 -- 3.1b A roof with an empty label will be connected to the tree +% branches (but will look ugly because of the different angles) + +% 2006/03/08 -- Protected pict2e loading from possible redefinition of ^. +% Reported by Alan Munn. Extended documentation. + +% 2005/12/22 -- 3.0b Removed pgf mode, switched to pict2e.sty support for +% everything. Updated documentation. + +% 2005/05/22 -- Added customization hooks and `balanced' branch command, +% fixed final whitespace in \leaf. Many small tweaks. + +% 2005/05/13 -- Reorganized mode selection options, merged variant file +% forks. + +% 2005/04/07 -- Removed errant spaces, and arranged for trees to be truly +% left-aligned or centered. + +% 2005/02/13 -- Added pgf drawing mode, mode selection support. + +% 2004/07/05 -- Added a way to manipulate the height of single-child nodes. + +% 2002/11/05 -- Fixed display bug in first branch of 5-branching nodes. +% Reported by Paliath Narendran [dran@cs.albany.edu]. + +% 2002/04/17 -- Added provision for ``zero branching'' (empty non-terminals), +% as suggested by Ronald Greenberg [rig@cs.luc.edu]. + +% 2001/09/01 -- Finally made LaTeX2e aware; eepic inclusion is now +% controllable by a package option; massively revised +% documentation. + +% 2000/10/24 -- Fixed bug in last revision that broke parsing of \qroof. + +% 2000/9/28 -- Fixed handling of empty labels so that tree lines stay +% connected. +% -- Small spacing fixes: changed \0, \1 and \2 to \rlap their +% output so that it does not impact on centering. + +\typeout{Package: \qTreeDate v.\qTreeVersion Qtree: tree-drawing for + linguistics} + +% Attempt to preserve LaTeX 2.19 compatibility by not evaluating package +% option commands unless they are defined. Probably pointless... +% +\ifx\ProvidesPackage\undefined \else + \ProvidesPackage {qtree} [\qTreeDate v.\qTreeVersion Qtree: tree-drawing for + linguistics] + + \newif\ifqtreecenter \qtreecentertrue + \DeclareOption{nocenter}{\qtreecenterfalse} + \DeclareOption{center}{\qtreecentertrue} + + % Control automatic loading of graphics extensions + \newif\ifq@autoload \q@autoloadtrue + \DeclareOption{noload}{\q@autoloadfalse} + + % Compatibility options + \def\q@usage{Enhanced picture support for +both pdf and PostScript is now provided by the package pict2e.sty. +(If you need to suppress loading of pict2e.sty, use option [noload]).} + + \DeclareOption{pdf}{\typeout{WARNING: Option [pdf] is obsolete. \q@usage}} + + \DeclareOption{noeepic}{ + \typeout{WARNING: Option [(no)eepic] is obsolete. \q@usage}} + + \ProcessOptions + + % Autoload graphics extensions, unless [noload] was given. + \ifq@autoload + % Some linguistics styles like to redefine ^, which causes problems + % to pict2e.sty. We protect it by temporarily forcing the default + % catcode for ^. + \edef\svcatcode@up@{\the\catcode`\^} + \catcode`\^=7 + % DON'T COMMENT THIS OUT! If you don't want pict2e, + % just call qtree like this: \usepackage[noload]{qtree} + \RequirePackage{pict2e} + % restore the catcode of ^ to whatever value it had + \catcode`\^=\svcatcode@up@ \relax + \let\sv@up@catcode=\relax + \fi + +\fi % end of package options code + + +% Begin QobiTree code + +\newcounter{treecount} \setcounter{treecount}{0} +\newcounter{branchcount} +\newsavebox{\parentbox} +\newsavebox{\treebox} +\newsavebox{\treeboxone} +\newsavebox{\treeboxtwo} +\newsavebox{\treeboxthree} +\newsavebox{\treeboxfour} +\newsavebox{\treeboxfive} +\newsavebox{\treeboxsix} +\newsavebox{\treeboxseven} +\newsavebox{\treeboxeight} +\newsavebox{\treeboxnine} +\newsavebox{\treeboxten} +\newsavebox{\treeboxeleven} +\newsavebox{\treeboxtwelve} +\newsavebox{\treeboxthirteen} +\newsavebox{\treeboxfourteen} +\newsavebox{\treeboxfifteen} +\newsavebox{\treeboxsixteen} +\newsavebox{\treeboxseventeen} +\newsavebox{\treeboxeighteen} +\newsavebox{\treeboxnineteen} +\newsavebox{\treeboxtwenty} +\newlength{\treeoffsetone} +\newlength{\treeoffsettwo} +\newlength{\treeoffsetthree} +\newlength{\treeoffsetfour} +\newlength{\treeoffsetfive} +\newlength{\treeoffsetsix} +\newlength{\treeoffsetseven} +\newlength{\treeoffseteight} +\newlength{\treeoffsetnine} +\newlength{\treeoffsetten} +\newlength{\treeoffseteleven} +\newlength{\treeoffsettwelve} +\newlength{\treeoffsetthirteen} +\newlength{\treeoffsetfourteen} +\newlength{\treeoffsetfifteen} +\newlength{\treeoffsetsixteen} +\newlength{\treeoffsetseventeen} +\newlength{\treeoffseteighteen} +\newlength{\treeoffsetnineteen} +\newlength{\treeoffsettwenty} + +\newlength{\treeshiftone} +\newlength{\treeshifttwo} +\newlength{\treeshiftthree} +\newlength{\treeshiftfour} +\newlength{\treeshiftfive} +\newlength{\treeshiftsix} +\newlength{\treeshiftseven} +\newlength{\treeshifteight} +\newlength{\treeshiftnine} +\newlength{\treeshiftten} +\newlength{\treeshifteleven} +\newlength{\treeshifttwelve} +\newlength{\treeshiftthirteen} +\newlength{\treeshiftfourteen} +\newlength{\treeshiftfifteen} +\newlength{\treeshiftsixteen} +\newlength{\treeshiftseventeen} +\newlength{\treeshifteighteen} +\newlength{\treeshiftnineteen} +\newlength{\treeshifttwenty} +\newlength{\treewidthone} +\newlength{\treewidthtwo} +\newlength{\treewidththree} +\newlength{\treewidthfour} +\newlength{\treewidthfive} +\newlength{\treewidthsix} +\newlength{\treewidthseven} +\newlength{\treewidtheight} +\newlength{\treewidthnine} +\newlength{\treewidthten} +\newlength{\treewidtheleven} +\newlength{\treewidthtwelve} +\newlength{\treewidththirteen} +\newlength{\treewidthfourteen} +\newlength{\treewidthfifteen} +\newlength{\treewidthsixteen} +\newlength{\treewidthseventeen} +\newlength{\treewidtheighteen} +\newlength{\treewidthnineteen} +\newlength{\treewidthtwenty} +\newlength{\daughteroffsetone} +\newlength{\daughteroffsettwo} +\newlength{\daughteroffsetthree} +\newlength{\daughteroffsetfour} +\newlength{\branchwidthone} +\newlength{\branchwidthtwo} +\newlength{\branchwidththree} +\newlength{\branchwidthfour} +\newlength{\parentoffset} +\newlength{\treeoffset} +\newlength{\daughteroffset} +\newlength{\branchwidth} +\newlength{\parentwidth} +\newlength{\treewidth} +% + +% Fine-tuning of trees + +% The height of the line dominating 1-branching nodes. Can be redefined +% at any point to change behaviour (even in mid-tree). +\def\qtreeunaryht{2ex} + +% Amount of padding inserted around leaves and labels +\def\qtreepadding{\tabcolsep} + +% Amound of padding under the eaves of roofs. +\def\qroofpadding{0.4em} + +% Typeset a leaf or label, wrapping with padding. Multiple lines are +% centered, unless the optional argument [c] is overridden (i.e., by \qroof) +% The first non-optional argument (#2) is usually \qleafhook or \qlabelhook. +% This command used to be called \ontop (also it used to be a lot simpler!) +\newcommand{\qshow@text}[3][c]{{#2{\begin{tabular}[t] + {@{\hskip\qtreepadding}#1@{\hskip\qtreepadding}}#3\end{tabular}}}} + +% A ``leaf'' may actually be a roof; if so, we pad it normally but suppress +% the hook; leaf and label hooks are applied separately to the parts of the +% roof. +\def\qshow@leaf#1{\ifx\@qseenode\qroof \qshow@text{\relax}{#1}\else + \qshow@text{\qleafhook}{#1}\fi} + + +\let\qtreeinithook=\relax % global formatting/definitions hook +\let\qtreefinalhook=\relax % called just after the tree is output +\let\qleafhook=\relax % hook for leaf text +\let\qlabelhook=\relax % hook for non-terminal labels +\let\qbranch@hook=\relax % Called after completing a branch (undocumented) + +% Don't take up space for empty labels; as a result, branch segments will be +% attached to their parent branch when no label is given. +% (\rlap triggers space in {tabular}, so it's NON zero, and will be displayed). +\def\showparentbox{\ifdim\wd\parentbox>0pt + \hspace*{\parentoffset}\usebox{\parentbox}\\\fi} + + +% Adjust the bottom-most fork in a binary branching tree, so that branches +% will be of even size if the labels are. +% Use: +% Invoke just before closing the bottom-most (binary) fork; for example: +% \Tree [.X label_1 [.Y label_2 [.Z label_3 right !\qbalance{} ] +% This works by setting the width of ``right'' to triple the width of +% its sister, label_3. (A bit of geometry shows why :-) +\def\qbalance{\qsetw{3\wd\treeboxtwo}} + +% And a debugging/learning aid: +% Draw a (tight) frame around all parts of the tree. +% Note that these will override any content of the format hooks. +\def\qtreeshowframes{\let\qlabelhook=\frame \let\qleafhook=\frame} +% We can include this in \qtreeshowframes, but it's too much information +% \def\qbranch@hook{\setbox\treeboxone \hbox{\frame{\box\treeboxone}}} + +\def\qtreenoframes{\let\qlabelhook=\relax \let\qleafhook=\relax} +% \let \qbranch@hook=\relax} + + +% Put a frame around the just-completed node. +% +\def\qframesubtree{\setbox\treeboxone \hbox{\framebox{\box\treeboxone}}} + +% +\newcommand{\poptree}{% +\ifnum\value{treecount}=0\typeout{QobiTeX warning---Tree stack underflow}\fi +\addtocounter{treecount}{-1}% +\setlength{\treeoffsettwo}{\treeoffsetthree}% +\setlength{\treeoffsetthree}{\treeoffsetfour}% +\setlength{\treeoffsetfour}{\treeoffsetfive}% +\setlength{\treeoffsetfive}{\treeoffsetsix}% +\setlength{\treeoffsetsix}{\treeoffsetseven}% +\setlength{\treeoffsetseven}{\treeoffseteight}% +\setlength{\treeoffseteight}{\treeoffsetnine}% +\setlength{\treeoffsetnine}{\treeoffsetten}% +\setlength{\treeoffsetten}{\treeoffseteleven}% +\setlength{\treeoffseteleven}{\treeoffsettwelve}% +\setlength{\treeoffsettwelve}{\treeoffsetthirteen}% +\setlength{\treeoffsetthirteen}{\treeoffsetfourteen}% +\setlength{\treeoffsetfourteen}{\treeoffsetfifteen}% +\setlength{\treeoffsetfifteen}{\treeoffsetsixteen}% +\setlength{\treeoffsetsixteen}{\treeoffsetseventeen}% +\setlength{\treeoffsetseventeen}{\treeoffseteighteen}% +\setlength{\treeoffseteighteen}{\treeoffsetnineteen}% +\setlength{\treeoffsetnineteen}{\treeoffsettwenty}% +\setlength{\treeshifttwo}{\treeshiftthree}% +\setlength{\treeshiftthree}{\treeshiftfour}% +\setlength{\treeshiftfour}{\treeshiftfive}% +\setlength{\treeshiftfive}{\treeshiftsix}% +\setlength{\treeshiftsix}{\treeshiftseven}% +\setlength{\treeshiftseven}{\treeshifteight}% +\setlength{\treeshifteight}{\treeshiftnine}% +\setlength{\treeshiftnine}{\treeshiftten}% +\setlength{\treeshiftten}{\treeshifteleven}% +\setlength{\treeshifteleven}{\treeshifttwelve}% +\setlength{\treeshifttwelve}{\treeshiftthirteen}% +\setlength{\treeshiftthirteen}{\treeshiftfourteen}% +\setlength{\treeshiftfourteen}{\treeshiftfifteen}% +\setlength{\treeshiftfifteen}{\treeshiftsixteen}% +\setlength{\treeshiftsixteen}{\treeshiftseventeen}% +\setlength{\treeshiftseventeen}{\treeshifteighteen}% +\setlength{\treeshifteighteen}{\treeshiftnineteen}% +\setlength{\treeshiftnineteen}{\treeshifttwenty}% +\setlength{\treewidthtwo}{\treewidththree}% +\setlength{\treewidththree}{\treewidthfour}% +\setlength{\treewidthfour}{\treewidthfive}% +\setlength{\treewidthfive}{\treewidthsix}% +\setlength{\treewidthsix}{\treewidthseven}% +\setlength{\treewidthseven}{\treewidtheight}% +\setlength{\treewidtheight}{\treewidthnine}% +\setlength{\treewidthnine}{\treewidthten}% +\setlength{\treewidthten}{\treewidtheleven}% +\setlength{\treewidtheleven}{\treewidthtwelve}% +\setlength{\treewidthtwelve}{\treewidththirteen}% +\setlength{\treewidththirteen}{\treewidthfourteen}% +\setlength{\treewidthfourteen}{\treewidthfifteen}% +\setlength{\treewidthfifteen}{\treewidthsixteen}% +\setlength{\treewidthsixteen}{\treewidthseventeen}% +\setlength{\treewidthseventeen}{\treewidtheighteen}% +\setlength{\treewidtheighteen}{\treewidthnineteen}% +\setlength{\treewidthnineteen}{\treewidthtwenty}% +\setbox\treeboxtwo \box\treeboxthree +\setbox\treeboxthree \box\treeboxfour +\setbox\treeboxfour \box\treeboxfive +\setbox\treeboxfive \box\treeboxsix +\setbox\treeboxsix \box\treeboxseven +\setbox\treeboxseven \box\treeboxeight +\setbox\treeboxeight \box\treeboxnine +\setbox\treeboxnine \box\treeboxten +\setbox\treeboxten \box\treeboxeleven +\setbox\treeboxeleven \box\treeboxtwelve +\setbox\treeboxtwelve \box\treeboxthirteen +\setbox\treeboxthirteen \box\treeboxfourteen +\setbox\treeboxfourteen \box\treeboxfifteen +\setbox\treeboxfifteen \box\treeboxsixteen +\setbox\treeboxsixteen \box\treeboxseventeen +\setbox\treeboxseventeen \box\treeboxeighteen +\setbox\treeboxeighteen \box\treeboxnineteen +\setbox\treeboxnineteen \box\treeboxtwenty } +% +\newcommand{\leaf}[1]{% +\ifnum\value{treecount}=20\typeout{QobiTeX warning---Tree stack overflow}\fi% +\addtocounter{treecount}{1}% +\setbox\treeboxtwenty \box\treeboxnineteen +\setbox\treeboxnineteen \box\treeboxeighteen +\setbox\treeboxeighteen \box\treeboxseventeen +\setbox\treeboxseventeen \box\treeboxsixteen +\setbox\treeboxsixteen \box\treeboxfifteen +\setbox\treeboxfifteen \box\treeboxfourteen +\setbox\treeboxfourteen \box\treeboxthirteen +\setbox\treeboxthirteen \box\treeboxtwelve +\setbox\treeboxtwelve \box\treeboxeleven +\setbox\treeboxeleven \box\treeboxten +\setbox\treeboxten \box\treeboxnine +\setbox\treeboxnine \box\treeboxeight +\setbox\treeboxeight \box\treeboxseven +\setbox\treeboxseven \box\treeboxsix +\setbox\treeboxsix \box\treeboxfive +\setbox\treeboxfive \box\treeboxfour +\setbox\treeboxfour \box\treeboxthree +\setbox\treeboxthree \box\treeboxtwo +\setbox\treeboxtwo \box\treeboxone +\sbox{\treeboxone}{\qshow@leaf{#1}}% +\sbox{\treeboxone}{\raisebox{-\ht\treeboxone}{\usebox{\treeboxone}}}% +\setlength{\treeoffsettwenty}{\treeoffsetnineteen}% +\setlength{\treeoffsetnineteen}{\treeoffseteighteen}% +\setlength{\treeoffseteighteen}{\treeoffsetseventeen}% +\setlength{\treeoffsetseventeen}{\treeoffsetsixteen}% +\setlength{\treeoffsetsixteen}{\treeoffsetfifteen}% +\setlength{\treeoffsetfifteen}{\treeoffsetfourteen}% +\setlength{\treeoffsetfourteen}{\treeoffsetthirteen}% +\setlength{\treeoffsetthirteen}{\treeoffsettwelve}% +\setlength{\treeoffsettwelve}{\treeoffseteleven}% +\setlength{\treeoffseteleven}{\treeoffsetten}% +\setlength{\treeoffsetten}{\treeoffsetnine}% +\setlength{\treeoffsetnine}{\treeoffseteight}% +\setlength{\treeoffseteight}{\treeoffsetseven}% +\setlength{\treeoffsetseven}{\treeoffsetsix}% +\setlength{\treeoffsetsix}{\treeoffsetfive}% +\setlength{\treeoffsetfive}{\treeoffsetfour}% +\setlength{\treeoffsetfour}{\treeoffsetthree}% +\setlength{\treeoffsetthree}{\treeoffsettwo}% +\setlength{\treeoffsettwo}{\treeoffsetone}% +\setlength{\treeoffsetone}{0.5\wd\treeboxone}% +\setlength{\treeshifttwenty}{\treeshiftnineteen}% +\setlength{\treeshiftnineteen}{\treeshifteighteen}% +\setlength{\treeshifteighteen}{\treeshiftseventeen}% +\setlength{\treeshiftseventeen}{\treeshiftsixteen}% +\setlength{\treeshiftsixteen}{\treeshiftfifteen}% +\setlength{\treeshiftfifteen}{\treeshiftfourteen}% +\setlength{\treeshiftfourteen}{\treeshiftthirteen}% +\setlength{\treeshiftthirteen}{\treeshifttwelve}% +\setlength{\treeshifttwelve}{\treeshifteleven}% +\setlength{\treeshifteleven}{\treeshiftten}% +\setlength{\treeshiftten}{\treeshiftnine}% +\setlength{\treeshiftnine}{\treeshifteight}% +\setlength{\treeshifteight}{\treeshiftseven}% +\setlength{\treeshiftseven}{\treeshiftsix}% +\setlength{\treeshiftsix}{\treeshiftfive}% +\setlength{\treeshiftfive}{\treeshiftfour}% +\setlength{\treeshiftfour}{\treeshiftthree}% +\setlength{\treeshiftthree}{\treeshifttwo}% +\setlength{\treeshifttwo}{\treeshiftone}% +\setlength{\treeshiftone}{0pt}% +\setlength{\treewidthtwenty}{\treewidthnineteen}% +\setlength{\treewidthnineteen}{\treewidtheighteen}% +\setlength{\treewidtheighteen}{\treewidthseventeen}% +\setlength{\treewidthseventeen}{\treewidthsixteen}% +\setlength{\treewidthsixteen}{\treewidthfifteen}% +\setlength{\treewidthfifteen}{\treewidthfourteen}% +\setlength{\treewidthfourteen}{\treewidththirteen}% +\setlength{\treewidththirteen}{\treewidthtwelve}% +\setlength{\treewidthtwelve}{\treewidtheleven}% +\setlength{\treewidtheleven}{\treewidthten}% +\setlength{\treewidthten}{\treewidthnine}% +\setlength{\treewidthnine}{\treewidtheight}% +\setlength{\treewidtheight}{\treewidthseven}% +\setlength{\treewidthseven}{\treewidthsix}% +\setlength{\treewidthsix}{\treewidthfive}% +\setlength{\treewidthfive}{\treewidthfour}% +\setlength{\treewidthfour}{\treewidththree}% +\setlength{\treewidththree}{\treewidthtwo}% +\setlength{\treewidthtwo}{\treewidthone}% +\setlength{\treewidthone}{\wd\treeboxone}} +% +\newcommand{\branch}[2]{% +\setcounter{branchcount}{#1}% +% 0-branching +\ifnum\value{branchcount}=0\leaf{#2}\else% added 2002/04/19, RIG +% Branch label (all branch counts) +\sbox{\parentbox}{\qshow@text{\qlabelhook}{#2}}% +% 1-branching +\ifnum\value{branchcount}=1 +\setlength{\parentoffset}{\treeoffsetone}% +\addtolength{\parentoffset}{-0.5\wd\parentbox}% +\setlength{\daughteroffset}{0in}% +\ifdim\parentoffset<0in% +\setlength{\daughteroffset}{-\parentoffset}% +\setlength{\parentoffset}{0in}\fi% +\setlength{\parentwidth}{\parentoffset}% +\addtolength{\parentwidth}{\wd\parentbox}% +\setlength{\treeoffset}{\daughteroffset}% +\addtolength{\treeoffset}{\treeoffsetone}% +\setlength{\treewidth}{\wd\treeboxone}% +\addtolength{\treewidth}{\daughteroffset}% +\ifdim\treewidth<\parentwidth\setlength{\treewidth}{\parentwidth}\fi% +\sbox{\treebox}{\begin{minipage}{\treewidth}% +\begin{flushleft}% +\showparentbox +{\setlength{\unitlength}{\qtreeunaryht}% +\hspace*{\treeoffset}\qdraw@branches{1}}\\ +\vspace{-\baselineskip}% +\hspace*{\daughteroffset}% +\raisebox{-\ht\treeboxone}{\usebox{\treeboxone}}% +\end{flushleft}% +\end{minipage}}% +\setlength{\treeoffsetone}{\parentoffset}% +\addtolength{\treeoffsetone}{0.5\wd\parentbox}% +\setlength{\treeshiftone}{0pt}% +\setlength{\treewidthone}{\treewidth}% +\sbox{\treeboxone}{\usebox{\treebox}}% +% 2-branching +\else\ifnum\value{branchcount}=2 +\setlength{\branchwidthone}{\treewidthtwo}% +\addtolength{\branchwidthone}{\treeoffsetone}% +\addtolength{\branchwidthone}{-\treeshiftone}% +\addtolength{\branchwidthone}{-\treeoffsettwo}% +\setlength{\branchwidth}{\branchwidthone}% +\setlength{\daughteroffsetone}{\branchwidth}% +\addtolength{\daughteroffsetone}{-\branchwidthone}% +\addtolength{\daughteroffsetone}{-\treeshiftone}% +\setlength{\parentoffset}{-0.5\wd\parentbox}% +\addtolength{\parentoffset}{\treeoffsettwo}% +\addtolength{\parentoffset}{0.5\branchwidth}% +\setlength{\daughteroffset}{0in}% +\ifdim\parentoffset<0in% +\setlength{\daughteroffset}{-\parentoffset}% +\setlength{\parentoffset}{0in}\fi% +\setlength{\parentwidth}{\parentoffset}% +\addtolength{\parentwidth}{\wd\parentbox}% +\setlength{\treeoffset}{\daughteroffset}% +\addtolength{\treeoffset}{\treeoffsettwo}% +\setlength{\treewidth}{\wd\treeboxone}% +\addtolength{\treewidth}{\daughteroffsetone}% +\addtolength{\treewidth}{\treewidthtwo}% +\addtolength{\treewidth}{\daughteroffset}% +\ifdim\treewidth<\parentwidth\setlength{\treewidth}{\parentwidth}\fi% +\sbox{\treebox}{\begin{minipage}{\treewidth}% +\begin{flushleft}% +\showparentbox %\frame +{\setlength{\unitlength}{0.5\branchwidth}% +\hspace*{\treeoffset}\qdraw@branches{2}}\\ +\vspace{-\baselineskip}% +\hspace*{\daughteroffset}% +\makebox[\treewidthtwo][l]% +{\raisebox{-\ht\treeboxtwo}{\usebox{\treeboxtwo}}}% +\hspace*{\daughteroffsetone}% +\raisebox{-\ht\treeboxone}{\usebox{\treeboxone}}% +\end{flushleft}% +\end{minipage}}% +\setlength{\treeoffsetone}{\parentoffset}% +\addtolength{\treeoffsetone}{0.5\wd\parentbox}% +\setlength{\treeshiftone}{0pt}% +\setlength{\treewidthone}{\treewidth}% +\sbox{\treeboxone}{\usebox{\treebox}}\poptree% +% 3-branching +\else\ifnum\value{branchcount}=3 +\setlength{\branchwidthone}{\treewidthtwo}% +\addtolength{\branchwidthone}{\treeoffsetone}% +\addtolength{\branchwidthone}{-\treeshiftone}% +\addtolength{\branchwidthone}{-\treeoffsettwo}% +\setlength{\branchwidthtwo}{\treewidththree}% +\addtolength{\branchwidthtwo}{\treeoffsettwo}% +\addtolength{\branchwidthtwo}{-\treeshifttwo}% +\addtolength{\branchwidthtwo}{-\treeoffsetthree}% +\setlength{\branchwidth}{\branchwidthone}% +\ifdim\branchwidthtwo>\branchwidth% +\setlength{\branchwidth}{\branchwidthtwo}\fi% +\setlength{\daughteroffsetone}{\branchwidth}% +\addtolength{\daughteroffsetone}{-\branchwidthone}% +\addtolength{\daughteroffsetone}{-\treeshiftone}% +\setlength{\daughteroffsettwo}{\branchwidth}% +\addtolength{\daughteroffsettwo}{-\branchwidthtwo}% +\addtolength{\daughteroffsettwo}{-\treeshifttwo}% +\setlength{\parentoffset}{-0.5\wd\parentbox}% +\addtolength{\parentoffset}{\treeoffsetthree}% +\addtolength{\parentoffset}{\branchwidth}% +\setlength{\daughteroffset}{0in}% +\ifdim\parentoffset<0in% +\setlength{\daughteroffset}{-\parentoffset}% +\setlength{\parentoffset}{0in}\fi% +\setlength{\parentwidth}{\parentoffset}% +\addtolength{\parentwidth}{\wd\parentbox}% +\setlength{\treeoffset}{\daughteroffset}% +\addtolength{\treeoffset}{\treeoffsetthree}% +\setlength{\treewidth}{\wd\treeboxone}% +\addtolength{\treewidth}{\daughteroffsetone}% +\addtolength{\treewidth}{\treewidthtwo}% +\addtolength{\treewidth}{\daughteroffsettwo}% +\addtolength{\treewidth}{\treewidththree}% +\addtolength{\treewidth}{\daughteroffset}% +\ifdim\treewidth<\parentwidth\setlength{\treewidth}{\parentwidth}\fi% +\sbox{\treebox}{\begin{minipage}{\treewidth}% +\begin{flushleft}% +\showparentbox +{\setlength{\unitlength}{0.5\branchwidth}% +\hspace*{\treeoffset}\qdraw@branches{3}}\\ +\vspace{-\baselineskip}% +\hspace*{\daughteroffset}% +\makebox[\treewidththree][l]% +{\raisebox{-\ht\treeboxthree}{\usebox{\treeboxthree}}}% +\hspace*{\daughteroffsettwo}% +\makebox[\treewidthtwo][l]% +{\raisebox{-\ht\treeboxtwo}{\usebox{\treeboxtwo}}}% +\hspace*{\daughteroffsetone}% +\raisebox{-\ht\treeboxone}{\usebox{\treeboxone}}% +\end{flushleft}% +\end{minipage}}% +\setlength{\treeoffsetone}{\parentoffset}% +\addtolength{\treeoffsetone}{0.5\wd\parentbox}% +\setlength{\treeshiftone}{0pt}% +\setlength{\treewidthone}{\treewidth}% +\sbox{\treeboxone}{\usebox{\treebox}}\poptree\poptree% +% 4-branching +\else\ifnum\value{branchcount}=4 +\setlength{\branchwidthone}{\treewidthtwo}% +\addtolength{\branchwidthone}{\treeoffsetone}% +\addtolength{\branchwidthone}{-\treeshiftone}% +\addtolength{\branchwidthone}{-\treeoffsettwo}% +\setlength{\branchwidthtwo}{\treewidththree}% +\addtolength{\branchwidthtwo}{\treeoffsettwo}% +\addtolength{\branchwidthtwo}{-\treeshifttwo}% +\addtolength{\branchwidthtwo}{-\treeoffsetthree}% +\setlength{\branchwidththree}{\treewidthfour}% +\addtolength{\branchwidththree}{\treeoffsetthree}% +\addtolength{\branchwidththree}{-\treeshiftthree}% +\addtolength{\branchwidththree}{-\treeoffsetfour}% +\setlength{\branchwidth}{\branchwidthone}% +\ifdim\branchwidthtwo>\branchwidth% +\setlength{\branchwidth}{\branchwidthtwo}\fi% +\ifdim\branchwidththree>\branchwidth% +\setlength{\branchwidth}{\branchwidththree}\fi% +\setlength{\daughteroffsetone}{\branchwidth}% +\addtolength{\daughteroffsetone}{-\branchwidthone}% +\addtolength{\daughteroffsetone}{-\treeshiftone}% +\setlength{\daughteroffsettwo}{\branchwidth}% +\addtolength{\daughteroffsettwo}{-\branchwidthtwo}% +\addtolength{\daughteroffsettwo}{-\treeshifttwo}% +\setlength{\daughteroffsetthree}{\branchwidth}% +\addtolength{\daughteroffsetthree}{-\branchwidththree}% +\addtolength{\daughteroffsetthree}{-\treeshiftthree}% +\setlength{\parentoffset}{-0.5\wd\parentbox}% +\addtolength{\parentoffset}{\treeoffsetfour}% +\addtolength{\parentoffset}{1.5\branchwidth}% +\setlength{\daughteroffset}{0in}% +\ifdim\parentoffset<0in% +\setlength{\daughteroffset}{-\parentoffset}% +\setlength{\parentoffset}{0in}\fi% +\setlength{\parentwidth}{\parentoffset}% +\addtolength{\parentwidth}{\wd\parentbox}% +\setlength{\treeoffset}{\daughteroffset}% +\addtolength{\treeoffset}{\treeoffsetfour}% +\setlength{\treewidth}{\wd\treeboxone}% +\addtolength{\treewidth}{\daughteroffsetone}% +\addtolength{\treewidth}{\treewidthtwo}% +\addtolength{\treewidth}{\daughteroffsettwo}% +\addtolength{\treewidth}{\treewidththree}% +\addtolength{\treewidth}{\daughteroffsetthree}% +\addtolength{\treewidth}{\treewidthfour}% +\addtolength{\treewidth}{\daughteroffset}% +\ifdim\treewidth<\parentwidth\setlength{\treewidth}{\parentwidth}\fi% +\sbox{\treebox}{\begin{minipage}{\treewidth}% +\begin{flushleft}% +\showparentbox +{\setlength{\unitlength}{0.5\branchwidth}% +\hspace*{\treeoffset}\qdraw@branches{4}}\\ +\vspace{-\baselineskip}% +\hspace*{\daughteroffset}% +\makebox[\treewidthfour][l]% +{\raisebox{-\ht\treeboxfour}{\usebox{\treeboxfour}}}% +\hspace*{\daughteroffsetthree}% +\makebox[\treewidththree][l]% +{\raisebox{-\ht\treeboxthree}{\usebox{\treeboxthree}}}% +\hspace*{\daughteroffsettwo}% +\makebox[\treewidthtwo][l]% +{\raisebox{-\ht\treeboxtwo}{\usebox{\treeboxtwo}}}% +\hspace*{\daughteroffsetone}% +\raisebox{-\ht\treeboxone}{\usebox{\treeboxone}}% +\end{flushleft}% +\end{minipage}}% +\setlength{\treeoffsetone}{\parentoffset}% +\addtolength{\treeoffsetone}{0.5\wd\parentbox}% +\setlength{\treeshiftone}{0pt}% +\setlength{\treewidthone}{\treewidth}% +\sbox{\treeboxone}{\usebox{\treebox}}\poptree\poptree\poptree% +% 5-branching +\else\ifnum\value{branchcount}=5 +\setlength{\branchwidthone}{\treewidthtwo}% +\addtolength{\branchwidthone}{\treeoffsetone}% +\addtolength{\branchwidthone}{-\treeshiftone}% +\addtolength{\branchwidthone}{-\treeoffsettwo}% +\setlength{\branchwidthtwo}{\treewidththree}% +\addtolength{\branchwidthtwo}{\treeoffsettwo}% +\addtolength{\branchwidthtwo}{-\treeshifttwo}% +\addtolength{\branchwidthtwo}{-\treeoffsetthree}% +\setlength{\branchwidththree}{\treewidthfour}% +\addtolength{\branchwidththree}{\treeoffsetthree}% +\addtolength{\branchwidththree}{-\treeshiftthree}% +\addtolength{\branchwidththree}{-\treeoffsetfour}% +\setlength{\branchwidthfour}{\treewidthfive}% +\addtolength{\branchwidthfour}{\treeoffsetfour}% +\addtolength{\branchwidthfour}{-\treeshiftfour}% +\addtolength{\branchwidthfour}{-\treeoffsetfive}% +\setlength{\branchwidth}{\branchwidthone}% +\ifdim\branchwidthtwo>\branchwidth% +\setlength{\branchwidth}{\branchwidthtwo}\fi% +\ifdim\branchwidththree>\branchwidth% +\setlength{\branchwidth}{\branchwidththree}\fi% +\ifdim\branchwidthfour>\branchwidth% +\setlength{\branchwidth}{\branchwidthfour}\fi% +\setlength{\daughteroffsetone}{\branchwidth}% +\addtolength{\daughteroffsetone}{-\branchwidthone}% +\addtolength{\daughteroffsetone}{-\treeshiftone}% +\setlength{\daughteroffsettwo}{\branchwidth}% +\addtolength{\daughteroffsettwo}{-\branchwidthtwo}% +\addtolength{\daughteroffsettwo}{-\treeshifttwo}% +\setlength{\daughteroffsetthree}{\branchwidth}% +\addtolength{\daughteroffsetthree}{-\branchwidththree}% +\addtolength{\daughteroffsetthree}{-\treeshiftthree}% +\setlength{\daughteroffsetfour}{\branchwidth}% +\addtolength{\daughteroffsetfour}{-\branchwidthfour}% +\addtolength{\daughteroffsetfour}{-\treeshiftfour}% +\setlength{\parentoffset}{-0.5\wd\parentbox}% +\addtolength{\parentoffset}{\treeoffsetfive}% +\addtolength{\parentoffset}{2\branchwidth}% +\setlength{\daughteroffset}{0in}% +\ifdim\parentoffset<0in% +\setlength{\daughteroffset}{-\parentoffset}% +\setlength{\parentoffset}{0in}\fi% +\setlength{\parentwidth}{\parentoffset}% +\addtolength{\parentwidth}{\wd\parentbox}% +\setlength{\treeoffset}{\daughteroffset}% +\addtolength{\treeoffset}{\treeoffsetfive}% +\setlength{\treewidth}{\wd\treeboxone}% +\addtolength{\treewidth}{\daughteroffsetone}% +\addtolength{\treewidth}{\treewidthtwo}% +\addtolength{\treewidth}{\daughteroffsettwo}% +\addtolength{\treewidth}{\treewidththree}% +\addtolength{\treewidth}{\daughteroffsetthree}% +\addtolength{\treewidth}{\treewidthfour}% +\addtolength{\treewidth}{\daughteroffsetfour}% +\addtolength{\treewidth}{\treewidthfive}% +\addtolength{\treewidth}{\daughteroffset}% +\ifdim\treewidth<\parentwidth\setlength{\treewidth}{\parentwidth}\fi% +\sbox{\treebox}{\begin{minipage}{\treewidth}% +\begin{flushleft}% +\showparentbox +{\setlength{\unitlength}{0.5\branchwidth}% +\hspace*{\treeoffset}\qdraw@branches{5}}\\ +\vspace{-\baselineskip}% +\hspace*{\daughteroffset}% +\makebox[\treewidthfive][l]% +{\raisebox{-\ht\treeboxfive}{\usebox{\treeboxfive}}}% +\hspace*{\daughteroffsetfour}% +\makebox[\treewidthfour][l]% +{\raisebox{-\ht\treeboxfour}{\usebox{\treeboxfour}}}% +\hspace*{\daughteroffsetthree}% +\makebox[\treewidththree][l]% +{\raisebox{-\ht\treeboxthree}{\usebox{\treeboxthree}}}% +\hspace*{\daughteroffsettwo}% +\makebox[\treewidthtwo][l]% +{\raisebox{-\ht\treeboxtwo}{\usebox{\treeboxtwo}}}% +\hspace*{\daughteroffsetone}% +\raisebox{-\ht\treeboxone}{\usebox{\treeboxone}}% +\end{flushleft}% +\end{minipage}}% +\setlength{\treeoffsetone}{\parentoffset}% +\addtolength{\treeoffsetone}{0.5\wd\parentbox}% +\setlength{\treeshiftone}{0pt}% +\setlength{\treewidthone}{\treewidth}% +\sbox{\treeboxone}{\usebox{\treebox}}\poptree\poptree\poptree\poptree% +\else\typeout{QobiTeX warning--- Can't handle #1 branching}\fi\fi\fi\fi\fi\fi} +% +\newcommand{\faketreewidth}[1]{% + \sbox{\parentbox}{\qshow@text{\relax}{#1}}% + \setlength{\treewidthone}{0.5\wd\parentbox}% + \addtolength{\treewidthone}{\treeoffsetone}% + \setlength{\treeshiftone}{\treeoffsetone}% + \addtolength{\treeshiftone}{-0.5\wd\parentbox}} +% + +% set-tree-width: like \faketreewidth, but takes a dimension argument +% Use: \qsetw{1in} etc. +\newcommand{\qsetw}[1]{% + \treewidthone = #1 + \treewidthone = 0.5\treewidthone + \treeshiftone = -\treewidthone + \advance\treewidthone by \treeoffsetone + \advance\treeshiftone by \treeoffsetone} + +% Fix up alignment of the tree and print out. +% \Tree has already taken care of centering, etc. +% +\newcommand{\qobitree}{% + % Cancel padding inserted by \qshow@text + \setbox\treeboxone \hbox{% + \hskip-\qtreepadding \box\treeboxone \hskip-\qtreepadding}% + % Lower box, to top-align with baseline + \@tempdima=\ht\treeboxone + \advance\@tempdima by -\ht\strutbox + \leavevmode \raise-\@tempdima \box\treeboxone + % Now clean up + \setlength{\treeoffsetone}{\treeoffsettwo}% + \setbox\treeboxone \box\treeboxtwo + \poptree } + + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% Front end for qobitree. Reads a tree in bracketed notation and +% generates commands to build the specified tree. +% Tokens are space-delimited; brackets {} may be used to alter grouping. +% +% Alexis Dimitriadis (alexis@babel.ling.upenn.edu), Dec 6, 1993. +% +% Sample input: +% \Tree [ [ John ].NP [ has [ [ seen ].V [ {the book} ].NP ].T ].IP ].S +% To insert extra material, precede token with an exclamation mark, e.g. +% ... ].V !\faketreewidth{VPP} ... + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Very messy stack macros, to make up for lack of nested environments in +% qobitree. +% +% \Spush\Stack{X} Push X on stack \Stack. +% \Spop\Stack Pop top element off \Stack, leave in the input stream. +% \Spopd\Stack\to\v Define \v to be the top element of \Stack, pop it. +% + +% This will trigger a LaTeX diagnostic if we pop too far. +\def\qbstack{} +\def\qnstack{} + + +\newtoks\qta \newtoks\qtb +% Expand #2 and push on stack #1. Things already pushed are not +% reexpanded. +\long\def\Spush#1#2{\qta=\expandafter{#1}% + \edef#1{{#2}\noexpand\@@STP{\the\qta}}} + +% Push #2 on stack #1 unexpanded. +% +\long\def\SpushU#1#2{\qta=\expandafter{#1}\qtb={#2}% + \edef#1{{\the\qtb}\noexpand\@@STP{\the\qta}}} + +\def\@@STP{\def\@@StpV} + +% Pop the top element of stack #1, leaving in the input stream. +% +\def\Spop#1{#1\let#1=\@@StpV} + +% Pop the top element of stack #1, expand it, and define #2 to it. +% +\def\SpopD#1#2{\expandafter\qta#1\let#1=\@@StpV\edef#2{\the\qta}} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% This is the front end proper. Everything else is just sugar. +% (the stack macros are necessary). +% +\newcount\nbranches + +\def\Tree{\bgroup + \@ifundefined{qtreebugfixhook}{}\qtreebugfixhook % retained for compatibility + \automath \qtreeprimes@internal + \qtreeinithook + \ifqtreecenter\hskip 0pt plus 1fil\else\leavevmode\fi + \nbranches=0\relax \q@recurse } + +\def\endTree{\qobitree \qtreefinalhook \egroup} + +\def\q@recurse[{\@ifnextchar.{\qq@recurse}{\qq@recurse. }} +\def\qq@recurse.#1 {\SpushU\qnstack{#1}% + \Spush\qbstack{\number\nbranches}\nbranches=0\relax \q@lookfornodes } + +% \doanode should more properly be called \doaleaf. +% \@qseenode is the first token of our argument: handle specially if a roof. +% The space in \leaf is for terminating the argument of \qroof +\def\doanode#1 {\advance\nbranches by1 + \ifx\@qseenode\qroof \leaf{#1 }% + \else \leaf{#1}\fi \q@lookfornodes} + +\def\q@lookfornodes{\@ifnextchar]{\closeoff}{% + \@ifnextchar[{\advance\nbranches by1\relax \q@recurse}{% + \@ifnextchar!{\pushliteral}{\futurelet\@qseenode\doanode}}}} + +\def\pushliteral!#1 {#1\relax \q@lookfornodes} + +\def\closeoff]{\@ifnextchar.{\expandafter\@closeoff}{\expandafter\@closeoff. }} +% If either label is missing, use the other. +% Otherwise, disallow mismatched labels +% Push and pop right argument to make sure the tokens are in same state... +\def\@closeoff.#1 {% + \def\rarg{#1}% + \SpopD\qnstack\larg + \ifx\larg\@empty \let\larg=\rarg + \else \ifx\rarg\@empty \let\rarg=\larg \fi\fi + \ifx\larg\rarg \else + \errmessage{MISMATCHED LABELS, [.\larg\ ... ].\rarg}% + \fi + \@@closeoff\larg } + +\def\@@closeoff#1{\branch{\number\nbranches}{#1}% + \SpopD\qbstack\x\nbranches=\x \relax +% \showthe\nbranches + \qbranch@hook + \ifnum\nbranches>0 \expandafter\q@lookfornodes + \else \expandafter\endTree \fi} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% and another odd convenience: +% +% Make _, ^ go into math mode automatically in the scope of \automath +% +{ % Temporarily change catcodes + \catcode`\_=\active + \catcode`\^=\active + + \global\def\automath{% + \catcode`\_=\active + \catcode`\^=\active + \def_##1{\@ifnextchar^{\automath@two_{##1}}{\ensuremath{\sb{##1}}}}% + \def^##1{\@ifnextchar_{\automath@two^{##1}}{\ensuremath{\sp{##1}}}}} +} +\def\automath@two#1#2#3#4{\ensuremath{#1{#2}\relax #3{#4}}} +% Restore default catcodes for ^, _ +\def\noautomath{\catcode`\_=8 \catcode`\^=7 } + + +% Let \0, \1, \2 produce ^0, $'$, $''$ +% The \rlap results in better centering of the label (ignoring the +% superscript) +\def\qtreeprimes@internal{% + \def\0{\ifmmode ^0\else \rlap{$^0$}\fi}% + \def\1{\ifmmode '\else \rlap{$'$}\fi}% + \def\2{\ifmmode ''\else \rlap{$''$}\fi}% +} + +% Same commands, but without the \rlap feature +\def\qtreeprimes{% + \def\0{\ensuremath{^0}}% + \def\1{\ensuremath{'}}% + \def\2{\ensuremath{''}}} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% qroof: Build a triangular ``roof'' with label #2 and contents (under the +% roof) #1. The width of the roof is computed automatically. The contents +% may contain line breaks (\\). +% + +% The slope of the roof built by qroof (may be changed anywhere). +\newcount\qroofx +\newcount\qroofy +\qroofx=3 \qroofy=1 + +\newbox\@qrscratchbox + +% User command for requesting a roof +% +\def\qroof#1.#2 {{% + % padding under the "eaves" of the roof + \setbox\@qrscratchbox = \hbox{\let\qtreepadding=\qroofpadding + \qshow@text[l]{\qleafhook}{#1}}% + % we don't pad here, since the entire roof gets padded as a leaf. + \def\qtreepadding{0pt}% + \begin{tabular}{@{}c@{}} + \setbox\@tempboxa = \hbox{\qshow@text{\qlabelhook}{#2}}% + \ifdim\wd\@tempboxa>0pt \box\@tempboxa \\ \fi + \unitlength=\wd\@qrscratchbox \qdraw@roof \\[-0.6ex] + \box\@qrscratchbox +\end{tabular}}} + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% DRAWING UTILITIES + +% The drawing routines may be redefined. The new drawing configuration +% must provide the commands: +% +% \qdraw@branches{N} Draw N branches, each \unitlength wide +% \qdraw@roof Draw a roof, \unitlength wide +% +% (\unitlength is set to the proper value before these are called) + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% The original, ``picture'' driver: Uses the native {picture} environment. +% It is expected that it will be augmented (originally with eepic, but now +% with pict2e.sty) + +% Draws a roof with slope \qroofy/\qroofx, and width equal to the current +% width of \unitlength (which, during the actual drawing, is set to a +% suitable value +% Because we must use integer arithmetic, we divide \unitlength into +% 2\qroofx units for calculations + +\def\qdraw@roof{{% + \def\wwd{\count1}% + \wwd=\qroofx\relax + \multiply\wwd by 2 + \divide\unitlength by \wwd + \begin{picture}(\wwd,\qroofy) + \put(0, 0){\line(1,0){\wwd}} + \put(0, 0){\line(\qroofx, \qroofy){\qroofx}} + \put(\wwd, 0){\line(-\qroofx, \qroofy){\qroofx}} + \end{picture}}} + +% Draw one of the branching structures we need, using the standard {picture} +% environment (with or without eepic extensions). +% The parameter \unitlength is already set appropriately +% +\def\qdraw@branches#1{\ifcase#1\relax % Zero case is unused + \or % One-branching + \begin{picture}(0,1) + \put(0,0){\line(0,1){1}} + \end{picture}% + \or % Two-branching + \begin{picture}(2,0.5) + \put(0,0){\line(2,1){1}} + \put(2,0){\line(-2,1){1}} + \end{picture}% + \or % Three-branching + \begin{picture}(4,1) + \put(0,0){\line(2,1){2}} + \put(2,0){\line(0,1){1}} + \put(4,0){\line(-2,1){2}} + \end{picture}% + \or % Four-branching + \begin{picture}(6,1) + \put(0,0){\line(3,1){3}} + \put(2,0){\line(1,1){1}} + \put(4,0){\line(-1,1){1}} + \put(6,0){\line(-3,1){3}} + \end{picture}% + \or % Five-branching + \begin{picture}(8,1) + \put(0,0){\line(4,1){4}} + \put(2,0){\line(2,1){2}} + \put(4,0){\line(0,1){1}} + \put(6,0){\line(-2,1){2}} + \put(8,0){\line(-4,1){4}} + \end{picture}% + \else\typeout{Qtree error--- Can't handle #1-way branching} + \fi} + +% END OF PICTURE driver definitions + diff --git a/texmf/tex/latex/frank_tex/sistyle.sty b/texmf/tex/latex/frank_tex/sistyle.sty new file mode 100644 index 0000000..fa774b0 --- /dev/null +++ b/texmf/tex/latex/frank_tex/sistyle.sty @@ -0,0 +1,373 @@ +%% +%% This is file `sistyle.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% sistyle.dtx (with options: `package') +%% +%% Copyright (C) 2004--2008 Danie Els +%% +%% ------------------------------------------------------------------- +%% The SIstyle package +%% for SI units and number typesetting +%% ------------------------------------------------------------------- +%% This work may be distributed and/or modified under the conditions +%% of the LaTeX Project Public License, either version 1.3c of this +%% license or (at your option) any later version. The latest version +%% of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3c or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status 'maintained'. +%% +%% This Current Maintainer of this work is Danie Els (dnjels@sun.ac.za) +%% +%% This package consists of the files: sistyle.dtx +%% sistyle.ins +%% and the derived file: sistyle.sty +%% ------------------------------------------------------------------- +%% +\NeedsTeXFormat{LaTeX2e}[1999/12/01] +\ProvidesPackage{sistyle} + [2008/07/16 v2.3a SI units and numbers (DNJ Els)] +\RequirePackage{amstext} +\newif\ifSI@eTeX +\SI@eTeXfalse +\ifx\eTeXversion\@undefined +\else + \ifx\eTeXversion\relax + \else + \ifnum\eTeXversion>\z@ + \SI@eTeXtrue + \fi + \fi +\fi +\begingroup + \catcode`\Q=3 + \long\gdef\SI@ifempt#1{\SI@xifempt#1QQ\@secondoftwo\@firstoftwo\@nil} + \long\gdef\SI@xifempt#1#2Q#3#4#5\@nil{#4} +\endgroup + \newcommand{\GetMathFontFams}{% + \sbox{0}{$% + \@ifundefined{mathsf} + {\global\chardef\SI@sffam=99}% + {\mathsf{\global\chardef\SI@sffam=\fam}}% + \@ifundefined{mathtt} + {\global\chardef\SI@ttfam=99}% + {\mathtt{\global\chardef\SI@ttfam=\fam}}% + $}% + } +\AtBeginDocument{\GetMathFontFams} +\newcommand{\IfTbold}[2]{% + \if b\expandafter\@car\f@series\@nil% + #1\else #2\fi} +\newcommand{\IfMbold}[2]{% + \edef\temp@bm{bold}% + \ifx\math@version\temp@bm + #1\else #2\fi} +\newif\ifSIobeybold +\SIobeyboldfalse +\newcommand*{\SI@mathrm}{\mathrm} +\newcommand*{\SI@mathsf}{\mathsf} +\newcommand*{\SI@mathtt}{\mathtt} +\newcommand*{\SImathrm}[1]{\renewcommand*{\SI@mathrm}{#1}} +\newcommand*{\SImathsf}[1]{\renewcommand*{\SI@mathsf}{#1}} +\newcommand*{\SImathtt}[1]{\renewcommand*{\SI@mathtt}{#1}} +\newcommand*{\SI@defaultMfam}{\SI@mathrm} +\newcommand*{\SIdefaultMfam}[1]{\renewcommand*{\SI@defaultMfam}{#1}} +\newcommand*{\SI@defaultNfam}{\SI@mathrm} +\newcommand*{\SIdefaultNfam}[1]{\renewcommand*{\SI@defaultNfam}{#1}} +\newcommand*{\SI@defaultTfam}{\rmfamily} +\newcommand*{\SIdefaultTfam}[1]{\renewcommand*{\SI@defaultTfam}{#1}} +\newif\ifupmath +\upmathfalse +\newcommand*{\SIupmath}[2][\SI@defaultMfam]{% +\begingroup + \upmathtrue + \edef\temp@sf{\sfdefault}% + \edef\temp@tt{\ttdefault}% + \let\SI@bold=\relax + \ifmmode + \ifdim\displaywidth>0pt\relax%--- DISPLAY MATH ------------ + \ifnum\the\fam=\SI@sffam + \let\SI@mfam=\SI@mathsf + \let\SI@tfam=\sffamily + \else \ifnum\the\fam=\SI@ttfam + \let\SI@mfam=\SI@mathtt + \let\SI@tfam=\ttfamily + \else + \let\SI@mfam=#1% + \let\SI@tfam=\SI@defaultTfam + \fi\fi + \IfMbold{\def\SI@bold{\bfseries}}% + {\def\SI@bold{\mdseries}}% + \else%--- INLINE MATH ---------- + \ifx\f@family\temp@sf + \let\SI@mfam=\SI@mathsf + \let\SI@tfam=\sffamily + \else\ifx\f@family\temp@tt + \let\SI@mfam=\SI@mathtt + \let\SI@tfam=\ttfamily + \else + \let\SI@mfam=#1% + \let\SI@tfam=\SI@defaultTfam + \fi\fi + \IfTbold{\def\SI@bold{\boldmath}}% + {\def\SI@bold{\unboldmath}}% + \fi + \else%----- NORMAL TEXT -------------- + \ifx\f@family\temp@sf + \let\SI@mfam=\SI@mathsf + \let\SI@tfam=\sffamily + \else\ifx\f@family\temp@tt + \let\SI@mfam=\SI@mathtt + \let\SI@tfam=\ttfamily + \else + \let\SI@mfam=#1% + \let\SI@tfam=\SI@defaultTfam + \fi\fi + \IfTbold{\def\SI@bold{\boldmath}}% + {\def\SI@bold{\unboldmath}}% + \fi%----- END OF TEST -------------- + \text{% + \ifSIobeybold\SI@bold\else\unboldmath\mdseries\fi + \upshape\SI@tfam + $\SI@mfam{#2}$}% +\endgroup +\check@mathfonts} +\DeclareRobustCommand{\ensureupmath}{% + \ifupmath + \expandafter\@firstofone + \else + \expandafter\SIupmath + \fi} +\newcommand*{\SI@decsign}{{.}} +\newcommand*{\SIdecimalsign}[1]{\renewcommand*{\SI@decsign}{{#1}}} +\newcommand*{\SI@thousandsep}{{\,}} +\newcommand*{\SIthousandsep}[1]{\renewcommand*{\SI@thousandsep}{{#1}}} +\newcommand*{\SI@prod}{\ensuremath{{}\times{}}} +\newcommand*{\SIproductsign}[1]{\renewcommand*{\SI@prod}{\ensuremath{{}#1{}}}} +\newif\ifSIgroupfour +\SIgroupfourtrue +\def\SI@num#1{% + \SI@ifempt{#1}{}{% + \edef\SI@tmpa{\lowercase{\noexpand\SI@@num{\zap@space#1 \@empty}}}% + \SI@tmpa}} +\def\SI@@num#1{\SI@numsplit#1ee\SI@numexp\SI@realp\@empty} +\def\SI@numsplit#1e#2e#3#4#5{#4{#1}{#2}} +\def\SI@p@tst{+} +\def\SI@m@tst{-} +\def\SI@numexp#1#2{% + \SI@ifempt{#1}{}{% + \def\SI@tmpb{#1}% + \ifx\SI@tmpb\SI@p@tst\ensuremath{+}\else + \ifx\SI@tmpb\SI@m@tst\ensuremath{-}\else + \SI@realp{#1}{}\SI@prod% + \fi\fi}% + \ifmmode + 10^{\SI@realp{#2}{}}% + \else + 10\textsuperscript{\SI@realp{#2}{}}% + \fi} +\def\SI@realp#1#2{\SI@realpsplit#1..\SI@realfrc\SI@realc\@empty} +\def\SI@realpsplit#1.#2.#3#4#5{#4{#1}{#2}} +\def\SI@realc#1#2{\SI@realcsplit#1,,\SI@realfrc\SI@signedint\@empty} +\def\SI@realcsplit#1,#2,#3#4#5{#4{#1}{#2}} +\def\SI@realfrc#1#2{% + \SI@ifempt{#1}{\SI@int{0}}% + {\SI@signedint{#1}{}}% + \SI@decsign\SI@dec{#2}} +\def\SI@signedint#1#2{\SI@@signedint#1 } +\def\SI@@signedint#1#2 {% + \if +#1\ensuremath{+}% + \SI@ifempt{#2}{\SI@int{0}}{\SI@int{#2}}% + \else + \if -#1\ensuremath{-}% + \SI@ifempt{#2}{\SI@int{0}}{\SI@int{#2}}% + \else + \SI@int{#1#2}\fi \fi} +\def\SI@not@v#1{\SI@@not@v#1\@empty\@empty\@empty\@empty\@empty\@nil} +\def\SI@@not@v#1#2#3#4#5\@nil{% + \ifx\@empty#5\@empty + \expandafter\@firstoftwo + \else + \expandafter\@secondoftwo + \fi} +\def\SI@int#1{% + \ifSIgroupfour + \SI@not@v{#1}{#1}{\SI@intfmt{}#1\@empty\@empty\@empty}% + \else + \SI@intfmt{}#1\@empty\@empty\@empty% + \fi} +\def\SI@intfmt#1#2#3#4{% + \ifx\@empty#2\@empty% + \SI@addthousandsep#1\relax + \else + \ifx\@empty#3\@empty% + \SI@addthousandsep\@empty\@empty#1#2\relax + \else + \ifx\@empty#4\@empty% + \SI@addthousandsep\@empty#1#2#3\relax + \else + \SI@intfmtafterfi{#1#2#3#4}% + \fi + \fi + \fi} +\def\SI@intfmtafterfi#1\fi\fi\fi{\fi\fi\fi\SI@intfmt{#1}} +\def\SI@addthousandsep#1#2#3#4{#1#2#3% + \if\relax#4\relax + \else + \SI@thousandsep\expandafter\SI@addthousandsep\expandafter#4% + \fi} +\def\SI@dec#1{% + \ifSIgroupfour + \SI@not@v{#1}{#1}{\SI@decfmt#1\@empty\@empty\@empty\@empty}% + \else + \SI@decfmt#1\@empty\@empty\@empty\@empty% + \fi} +\def\SI@decfmt#1#2#3#4{#1#2#3% + \ifx\@empty#4\@empty% + \else + \SI@thousandsep\expandafter\SI@decfmt\expandafter#4% + \fi} +\newcommand*{\SInum}[1]{{% + \let\SI@unitdot=\pnt% + \SIupmath[\SI@defaultNfam]{\SI@num{#1}}}} +\DeclareRobustCommand*{\num}{\@ifstar{\SI@num}{\SInum}} +\ifSI@eTeX + \DeclareRobustCommand{\ang}{% + \begingroup + \catcode`;=12\relax + \catcode`@=11\relax + \SI@ang} + \def\SI@ang#1{% + \scantokens{\SI@@ang#1;;;\@nil}% + \endgroup} + \def\SI@@ang#1;#2;#3;#4\@nil{% + \SI@@@ang{#1}{#2}{#3}}% +\else + \DeclareRobustCommand{\ang}[1]{% + \@nameuse{SI@ang@\romannumeral\catcode`\;}{#1}}% + \begingroup + \catcode`\;=12\relax + \gdef\SI@ang@xii#1{\SI@@ang@xii#1;;;\@nil} + \gdef\SI@@ang@xii#1;#2;#3;#4\@nil{\SI@@@ang{#1}{#2}{#3}} + \catcode`\;=\active\relax + \gdef\SI@ang@xiii#1{\SI@@ang@xiii#1;;;\@nil} + \gdef\SI@@ang@xiii#1;#2;#3;#4\@nil{\SI@@@ang{#1}{#2}{#3}} + \endgroup +\fi +\let\SI@degs=\relax +\let\SI@mins=\relax +\let\SI@secs=\relax +\newcommand*{\SI@@@ang}[3]{{% + \SI@ifempt{#3}{}{\def\SI@secs{\SInum{#3}\SIupmath{\arcsec}}% + \def\SI@mins{\SInum{0}\SIupmath{\arcmin}}% + \def\SI@degs{\SInum{0}\SIupmath{\arcdeg}}}% + \SI@ifempt{#2}{}{\def\SI@mins{\SInum{#2}\SIupmath{\arcmin}}% + \def\SI@degs{\SInum{0}\SIupmath{\arcdeg}}}% + \SI@ifempt{#1}{}{\def\SI@degs{\SInum{#1}\SIupmath{\arcdeg}}}% + \SI@degs\SI@mins\SI@secs}} +\newcommand*{\SI@unitsep}{\,} +\newcommand*{\SIunitsep}[1]{\renewcommand*{\SI@unitsep}{#1}} +\newcommand*{\SI@unitspace}{\,} +\newcommand*{\SIunitspace}[1]{\renewcommand*{\SI@unitspace}{#1}} +\newcommand*{\SI@unitdot}{{\cdot}} +\newcommand*{\SIunitdot}[1]{\renewcommand*{\SI@unitdot}{#1}} +\DeclareMathSymbol{\pnt}{\mathord}{letters}{58} %(\pnt = .) +{\catcode`\.=13 \gdef.{\SI@unitdot}} +\newcommand*{\SIunit}[1]{% +\begingroup% + \mathcode`.="8000% + \def~{\SI@unitspace}% + \SIupmath{#1}% +\endgroup} +\DeclareRobustCommand*{\SI}[2]{% + \SI@ifempt{#1}{}{\SInum{#1}\SI@unitsep}% + \SIunit{#2}} +\AtBeginDocument{% + \@ifpackageloaded{textcomp}{% + \providecommand*{\micro}{\ensureupmath{\mbox{\textmu}}}% + \providecommand*{\ohm}{\ensureupmath{\mbox{\textohm}}}% + \providecommand*{\degC}{\ensureupmath{\mbox{\textcelsius}}}% + \providecommand*{\degF}{\ensureupmath{\mbox{\textdegree F}}}% + \providecommand*{\arcdeg}{\ensureupmath{\mbox{\textdegree}}}% + \providecommand*{\angstrom}{\ensureupmath{\mbox{\capitalring{A}}}}% + }{% + \providecommand*{\micro}{\ensureupmath{\mu}}% + \providecommand*{\ohm}{\ensureupmath{\Omega}}% + \providecommand*{\degC}{% + \ensureupmath{{}^{\circ}\kern-\scriptspace C}}% + \providecommand*{\degF}{% + \ensureupmath{{}^{\circ}\kern-\scriptspace F}}% + \providecommand*{\arcdeg}{\ensureupmath{{}^{\circ}}}% + \providecommand*{\angstrom}{\ensureupmath{\mbox{\AA}}}% + }% + \providecommand*{\arcmin}{\ensureupmath{{}^{\prime}}}% + \providecommand*{\arcsec}{\ensureupmath{{}^{\prime\prime}}}% +} +\newtoks\ttoks@A +\newtoks\ttoks@B +\newcommand{\SIstyle}[1]{% + \@ifundefined{SIstyle#1}% + {\PackageError{SIstyle}{Style `#1' is not defined}% + {See SIstyle package documentation}}% + {\@nameuse{SIstyle#1}}} +\newcommand{\AddToSIstyle}{% + \@ifstar{\SI@s@addto@stl}{\SI@addto@stl}} +\newcommand{\SI@s@addto@stl}[1]{% + \expandafter\let\csname SIstyle#1\endcsname\relax + \SI@addto@stl{#1}} +\newcommand{\SI@addto@stl}[2]{% + \expandafter\SI@addto@list\csname SIstyle#1\endcsname{#2}} +\@onlypreamble\AddToSIstyle +\newcommand*{\SIstyleToLang}[2]{% + \expandafter\SI@addto@list + \csname extras#1\expandafter\endcsname + \csname SIstyle#2\endcsname} +\@onlypreamble\SIstyleToLang +\newcommand{\SI@addto@list}[2]{% + \ttoks@A{#2}% + \ifx#1\@undefined + \edef#1{\the\ttoks@A}% + \else + \ifx#1\relax + \edef#1{\the\ttoks@A}% + \else + \ttoks@B\expandafter{#1}% + \edef#1{\the\ttoks@B\the\ttoks@A}% + \fi + \fi + \ttoks@A{}\ttoks@B\ttoks@A} +\AddToSIstyle{USA}{% + \SIdecimalsign{.}% + \SIthousandsep{\,}% + \SIunitsep{\,}% + \SIunitdot{\cdot}% + \SIunitspace{\;}% + \SIproductsign{\times}% + \SIobeyboldfalse + \SIgroupfourtrue} +\AddToSIstyle{German}{% + \SIdecimalsign{,}% + \SIthousandsep{\,}% + \SIproductsign{\cdot}% + \SIunitsep{\,}% + \SIunitspace{\,}% + \SIunitdot{\cdot}% + \SIobeyboldfalse + \SIgroupfourtrue} +\AddToSIstyle{S-Africa}{% + \SIdecimalsign{,}% + \SIthousandsep{\,}% + \SIproductsign{\times}% + \SIunitsep{\,}% + \SIunitspace{\,}% + \SIunitdot{\cdot}% + \SIobeyboldfalse + \SIgroupfourtrue} +\endinput +%% +%% End of file `sistyle.sty'. diff --git a/vim/spell/en.utf-8.add b/vim/spell/en.utf-8.add index d80e845..9500baf 100644 --- a/vim/spell/en.utf-8.add +++ b/vim/spell/en.utf-8.add @@ -25,3 +25,9 @@ csv Battelle superlinéaires superlinéaire +parsé +despotiste +ventilo +l'ordi +skippé +stacktrace