Skip to content
Browse files

Adding LaTeX files that i've got in my /opt/local/share/texmf-local d…

…ir to make the book compile
  • Loading branch information...
1 parent 027606a commit 1d78695b56261e2058a4c278940e465a04678fe0 Meredith Gregory committed Mar 5, 2010
View
302 src/main/book/content/local/bcprules.sty
@@ -0,0 +1,302 @@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%% %%%
+%%% BCP's latex tricks for typesetting inference rules %%%
+%%% %%%
+%%% Version 1.3 %%%
+%%% %%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%
+%%% This package supports two styles of rules: named and unnamed.
+%%% Unnamed rules are centered on the page. Named rules are set so
+%%% that a series of them will have the rules centered in a vertical
+%%% column taking most of the page and the labels right-justified.
+%%% When a label would overlap its rule, the label is moved down.
+%%%
+%%% The width of the column of labels can be varied using a command of the
+%%% form
+%%%
+%%% \typicallabel{T-Arrow-I}
+%%%
+%%% The default setting is:
+%%%
+%%% \typicallabel{}
+%%%
+%%% In other words, the column of rules takes up the whole width of
+%%% the page: rules are centered on the centerline of the text, and no
+%%% extra space is left for the labels.
+%%%
+%%% The minimum distance between a rule and its label can be altered by a
+%%% command of the form
+%%%
+%%% \setlength{\labelminsep}{0.5em}
+%%%
+%%% (This is the default value.)
+%%%
+%%% Examples:
+%%%
+%%% An axiom with a label in the right-hand column:
+%%%
+%%% \infax[The name]{x - x = 0}
+%%%
+%%% An inference rule with a name:
+%%%
+%%% \infrule[Another name]
+%%% {\mbox{false}}
+%%% {x - x = 1}
+%%%
+%%% A rule with multiple premises on the same line:
+%%%
+%%% \infrule[Wide premises]
+%%% {x > 0 \andalso y > 0 \andalso z > 0}
+%%% {x + y + z > 0}
+%%%
+%%% A rule with several lines of premises:
+%%%
+%%% \infrule[Long premises]
+%%% {x > 0 \\ y > 0 \\ z > 0}
+%%% {x + y + z > 0}
+%%%
+%%% A rule without a name, but centered on the same vertical line as rules
+%%% and axioms with names:
+%%%
+%%% \infrule[]
+%%% {x - y = 5}
+%%% {y - x = -5}
+%%%
+%%% A rule without a name, centered on the page:
+%%%
+%%% \infrule
+%%% {x = 5}
+%%% {x - 1 > 0}
+%%%
+%%%
+%%% Setting the flag \indexrulestrue causes an index entry to be
+%%% generated for each named rule.
+%%%
+%%% Setting the flag \suppressrulenamestrue causes the names of all rules
+%%% to be left blank
+%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%% A switch controlling the sizes of rule names
+\newif\ifsmallrulenames \smallrulenamesfalse
+\newcommand{\smallrulenames}{\smallrulenamestrue}
+\newcommand{\choosernsize}[2]{\ifsmallrulenames#1\else#2\fi}
+
+%%% The font for setting inference rule names
+\newcommand{\rn}[1]{%
+ \ifmmode
+ \mathchoice
+ {\mbox{\choosernsize{\small}{}\sc #1}}
+ {\mbox{\choosernsize{\small}{}\sc #1}}
+ {\mbox{\choosernsize{\tiny}{\small}\sc #1}}
+ {\mbox{\choosernsize{\tiny}{\tiny}\uppercase{#1}}}%
+ \else
+ \hbox{\choosernsize{\small}{}\sc #1}%
+ \fi}
+
+\newif\ifsuppressrulenames
+\suppressrulenamesfalse
+
+\newif\ifbcprulessavespace
+\bcprulessavespacefalse
+
+\newif\ifbcprulestwocol
+\bcprulestwocolfalse
+
+%%% How to display a rule's name to the right of the rule
+\newcommand{\inflabel}[1]{%
+ \ifsuppressrulenames\else
+ \def\lab{#1}%
+ \ifx\lab\empty
+ \relax
+ \else
+ (\rn{\lab})%
+ \fi\fi
+}
+
+%%% Amount of extra space to add before and after a rule
+\newlength{\afterruleskip}
+\setlength{\afterruleskip}{\bigskipamount}
+
+%%% Minimum distance between a rule and its label
+\newlength{\labelminsep}
+\setlength{\labelminsep}{0.2em}
+
+%%% The ``typical'' width of the column of labels: labels are allowed
+%%% to project further to the left if necessary; the rules will be
+%%% centered in a column of width \linewidth - \labelcolwidth
+\newdimen\labelcolwidth
+
+%%% Set the label column width by providing a ``typical'' label --
+%%% i.e. a label of average length
+\newcommand{\typicallabel}[1]{
+ \setbox \@tempboxa \hbox{\inflabel{#1}}
+ \labelcolwidth \wd\@tempboxa
+ }
+\typicallabel{}
+
+%%% A flag controlling generation of index entries
+\newif \ifindexrules \indexrulesfalse
+
+%%% Allocate some temporary registers
+\newbox\@labelbox
+\newbox\rulebox
+\newdimen\ruledim
+\newdimen\labeldim
+
+%%% Put a rule and its label on the same line if this can be done
+%%% without overlapping them; otherwise, put the label on the next
+%%% line. Put a small amount of vertical space above and below.
+\newcommand{\layoutruleverbose}[2]%
+ {\unvbox\voidb@x % to make sure we're in vmode
+ \addvspace{\afterruleskip}%
+
+ \setbox \rulebox \hbox{$\displaystyle #2$}
+
+ \setbox \@labelbox \hbox{#1}
+ \ruledim \wd \rulebox
+ \labeldim \wd \@labelbox
+
+ %%% Will it all fit comfortably on one line?
+ \@tempdima \linewidth
+ \advance \@tempdima -\labelcolwidth
+ \ifdim \@tempdima < \ruledim
+ \@tempdima \ruledim
+ \else
+ \advance \@tempdima by \ruledim
+ \divide \@tempdima by 2
+ \fi
+ \advance \@tempdima by \labelminsep
+ \advance \@tempdima by \labeldim
+ \ifdim \@tempdima < \linewidth
+ % Yes, everything fits on a line
+ \@tempdima \linewidth
+ \advance \@tempdima -\labelcolwidth
+ \hbox to \linewidth{%
+ \hbox to \@tempdima{%
+ \hfil
+ \box\rulebox
+ \hfil}%
+ \hfill
+ \hbox to 0pt{\hss\box\@labelbox}%
+ }%
+ \else
+ % No, better put the label on the next line
+ \@tempdima \linewidth
+ \advance \@tempdima -\labelcolwidth
+ \hbox to \linewidth{%
+ \hbox to \@tempdima{%
+ \hfil
+ \box\rulebox
+ \hfil}
+ \hfil}%
+ \penalty10000
+ \hbox to \linewidth{%
+ \hfil
+ \box\@labelbox}%
+ \fi
+
+ \addvspace{\afterruleskip}%
+ \@doendpe % use LaTeX's trick of inhibiting paragraph indent for
+ % text immediately following a rule
+ \ignorespaces
+ }
+
+% Simplified form for when there is no label
+\newcommand{\layoutrulenolabel}[1]%
+ {\unvbox\voidb@x % to make sure we're in vmode
+ \addvspace{\afterruleskip}%
+
+ \setbox \rulebox \hbox{$\displaystyle #1$}
+
+ \@tempdima \linewidth
+ \advance \@tempdima -\labelcolwidth
+ \hbox to \@tempdima{%
+ \hfil
+ \box\rulebox
+ \hfil}%
+
+ \addvspace{\afterruleskip}%
+ \@doendpe % use LaTeX's trick of inhibiting paragraph indent for
+ % text immediately following a rule
+ \ignorespaces
+ }
+
+% Alternate form, for when we need to save space
+%\newcommand{\layoutruleterse}[2]%
+% {\noindent
+% \parbox[b]{0.5\linewidth}{\layoutruleverbose{#1}{#2}}}
+
+\newcommand{\layoutruleterse}[2]%
+ {\setbox \rulebox \hbox{$\displaystyle #2$}
+ \noindent
+ \parbox[b]{0.5\linewidth}
+ {\vspace*{0.4em} \hfill\box\rulebox\hfill~}
+ }
+
+%%% Select low-level layout driver based on \bcprulessavespace flag
+\newcommand{\layoutrule}[2]{%
+ \ifbcprulessavespace
+ \layoutruleterse{#1}{#2}
+ \else
+ \layoutruleverbose{#1}{#2}
+ \fi
+}
+
+%%% Highlighting for new versions of rules
+\newif\ifnewrule \newrulefalse
+\newcommand{\setrulebody}[1]{%
+ \ifnewrule
+ \@ifundefined{HIGHLIGHT}{%
+ \fbox{\ensuremath{#1}}%
+ }{%
+ \HIGHLIGHT{#1}}%
+ \else
+ #1
+ \fi
+}
+
+%%% Commands for setting axioms and rules
+\newcommand{\typesetax}[1]{
+ \setrulebody{%
+ \begin{array}{@{}c@{}}#1\end{array}}}
+\newcommand{\typesetrule}[2]{
+ \setrulebody{%
+ \frac{\begin{array}{@{}c@{}}#1\end{array}}
+ {\begin{array}{@{}c@{}}#2\end{array}} }}
+
+%%% Indexing
+\newcommand{\ruleindexprefix}[1]{%
+ \gdef\ruleindexprefixstring{#1}}
+\ruleindexprefix{}
+\newcommand{\maybeindex}[1]{%
+ \ifindexrules
+ \index{\ruleindexprefixstring#1@\rn{#1}}%
+ \fi}
+
+%%% Setting axioms, with or without names
+\def\infax{\@ifnextchar[{\@infaxy}{\@infaxx}}
+\def\@infaxx#1{%
+ \ifbcprulessavespace $\typesetax{#1}$%
+ \else \layoutrulenolabel{\typesetax{#1}}%
+ \fi\newrulefalse\ignorespaces}
+\def\@infaxy[#1]{\maybeindex{#1}\@infax{\inflabel{#1}}}
+\def\@infax#1#2{\layoutrule{#1}{\typesetax{#2}}\ignorespaces}
+
+%%% Setting rules, with or without names
+\def\infrule{\@ifnextchar[{\@infruley}{\@infrulex}}
+\def\@infrulex#1#2{%
+ \ifbcprulessavespace $\typesetrule{#1}{#2}$%
+ \else \layoutrulenolabel{\typesetrule{#1}{#2}}%
+ \fi\newrulefalse\ignorespaces}
+\def\@infruley[#1]{\maybeindex{#1}\@infrule{\inflabel{#1}}}
+\def\@infrule#1#2#3{\layoutrule{#1}{\typesetrule{#2}{#3}}\ignorespaces}
+
+%%% Miscellaneous helpful definitions
+\newcommand{\andalso}{\quad\quad}
+
+% Abbreviations
+\newcommand{\infabbrev}[2]{\infax{#1 \quad\eqdef\quad #2}}
+
View
17 src/main/book/content/local/bigpage.sty
@@ -0,0 +1,17 @@
+\setlength{\oddsidemargin}{2.5cm}
+\setlength{\evensidemargin}{2.5cm}
+%\setlength{\topmargin}{2.2cm}
+\setlength{\topmargin}{2cm}
+\addtolength{\oddsidemargin}{-1in}
+\addtolength{\evensidemargin}{-1in}
+\addtolength{\topmargin}{-1.5in}
+\setlength{\textwidth}{16cm}
+%\setlength{\textheight}{23.25cm}
+\setlength{\textheight}{22cm}
+\setcounter{bottomnumber}{2}
+\renewcommand{\bottomfraction}{0.99}
+\renewcommand{\topfraction}{0.99}
+\renewcommand{\textfraction}{0.01}
+\renewcommand{\floatpagefraction}{0.90}
+
+
View
328 src/main/book/content/local/code.sty
@@ -0,0 +1,328 @@
+% code.sty: -*- latex -*-
+% Latex macros for a "weak" verbatim mode.
+% -- like verbatim, except \, {, and } have their usual meanings.
+
+% Environments: code, tightcode, codeaux, codebox, centercode
+% Commands: \dcd, \cddollar, \cdmath, \cd, \codeallowbreaks, \codeskip, \^
+% Already defined in LaTeX, but of some relevance: \#, \$, \%, \&, \_, \{, \}
+
+% Changelog at the end of the file.
+
+% These commands give you an environment, code, that is like verbatim
+% except that you can still insert commands in the middle of the environment:
+% \begin{code}
+% for(x=1; x<loop_bound; x++)
+% y += x^3; /* {\em Add in {\tt x} cubed} */
+% \end{code}
+%
+% All characters are ordinary except \{}. To get \{} in your text,
+% you use the commands \\, \{, and \}.
+
+% These macros mess with the definition of the special chars (e.g., ^_~%).
+% The characters \{} are left alone, so you can still have embedded commands:
+% \begin{code} f(a,b,\ldots,y,z) \end{code}
+% However, if your embedded commands use the formerly-special chars, as in
+% \begin{code} x := x+1 /* \mbox{\em This is $y^3$} */ \end{code}
+% then you lose. The $ and ^ chars are scanned in as non-specials,
+% so they don't work. If the chars are scanned *outside* the code env,
+% then you have no problem:
+% \def\ycube{$y^3$}
+% \begin{code} x := x+1 /* {\em This is \ycube} */ \end{code}
+% If you must put special chars inside the code env, you do it by
+% prefixing them with the special \dcd ("decode") command, that
+% reverts the chars to back to special status:
+% \begin{code} x := x+1 /* {\dcd\em This is $y^3$} */ \end{code}
+% \dcd's scope is bounded by its enclosing braces. It is only defined within
+% the code env. You can also turn on just $ with the \cddollar command;
+% you can turn on just $^_ with the \cdmath command. See below.
+%
+% Alternatively, just use \(...\) for $...$, \sp for ^, and \sb for _.
+
+% WARNING:
+% Like \verb, you cannot put a \cd{...} inside an argument to a macro
+% or a command. If you try, for example,
+% \mbox{\cd{$x^y$}}
+% you will lose. That is because the text "\cd{$x^y$}" gets read in
+% as \mbox's argument before the \cd executes. But the \cd has to
+% have a chance to run before LaTeX ever reads the $x^y$ so it can
+% turn off the specialness of $ and ^. So, \cd has to appear at
+% top level, not inside an argument. Similarly, you can't have
+% a \cd or a \code inside a macro (Although you could use \gdef to
+% define a macro *inside* a \cd, which you could then use outside.
+% Don't worry about this if you don't understand it.)
+
+% BUG: In the codebox env, the effect of a \dcd, \cddollar, or \cdmath
+% command is reset at the end of each line. This can be hacked by
+% messing with the \halign's preamble, if you feel up to it.
+
+% Useage note: the initial newline after the \begin{code} or
+% \begin{codebox} is eaten, but the last newline is not.
+% So,
+% \begin{code}
+% foo
+% bar
+% \end{code}
+% leaves one more blank line after bar than does
+% \begin{code}
+% foo
+% bar\end{code}
+% Moral: get in the habit of terminating code envs without a newline
+% (as in the second example).
+%
+
+%
+% get the paragraph indentation (use \edef and \the to force evaluation)
+%
+\edef\codeindent{\the\parindent}
+
+
+% All this stuff tweaks the meaning of space, tab, and newline.
+%===============================================================================
+% \cd@obeyspaces
+% Turns all spaces into non-breakable spaces.
+% Note: this is like \@vobeyspaces except without spurious space in defn.
+% @xobeysp is basically a space; it's defined in latex.tex.
+%
+{\catcode`\ =\active\gdef\cd@obeyspaces{\catcode`\ =\active\let =\@xobeysp}}
+
+
+
+% \cd@obeytabs
+% Turns all tabs into 8 non-breakable spaces (which is bogus).
+%
+{\catcode`\^^I=\active %
+ \gdef\cd@obeytabs{\catcode`\^^I=\active\let^^I=\cd@tab}}
+
+\def\cd@tab{\@xobeysp\@xobeysp\@xobeysp\@xobeysp\@xobeysp\@xobeysp\@xobeysp\@xobeysp}
+
+
+
+% \cd@obeylines
+% Turns all cr's into linebreaks. Pagebreaks are not permitted between lines.
+% This is copied from lplain.tex's \obeylines, with the cr def'n changed.
+%
+{\catcode`\^^M=\active % these lines must end with %
+ \gdef\cd@obeylines{\catcode`\^^M=\active\let^^M=\cd@cr}}
+
+% What ^M turns into.
+\def\cd@cr{\par\penalty10000 } % TeX magicness
+%
+% If the "\leavevmode" is included, the blank lines are not compressed out
+% but you will end up with extra space at the bottom of your code if you
+% put the "\end{code}" on a new line.
+%\def\cd@cr{\par\penalty10000\leavevmode} % TeX magicness
+%\def\cd@cr{\par\penalty10000\mbox{}} % LaTeX
+
+
+% \codeallowbreaks
+% Same as \cd@obeylines, except pagebreaks are allowed.
+% Put this command inside a code env to allow pagebreaks.
+
+{\catcode`\^^M=\active % these lines must end with %
+ \gdef\codeallowbreaks{\catcode`\^^M\active\let^^M\cd@crbr}}
+
+\def\cd@crbr{\leavevmode\endgraf} % What ^M turns into.
+
+
+% \cd@obeycrsp
+% Turns cr's into non-breakable spaces. Used by \cd.
+
+{\catcode`\^^M=\active % these lines must end with %
+ \gdef\cd@obeycrsp{\catcode`\^^M=\active\let^^M=\@xobeysp}}
+
+% =============================================================================
+
+% Set up code environment, in which most of the common special characters
+% appearing in code are treated verbatim, namely: $&#^_~%
+% \ { } are still enabled so that macros can be called in this
+% environment. Use \\, \{, and \} to use these characters verbatim
+% in this environment.
+%
+% Inside a group, you can make
+% all the hacked chars special with the \dcd command
+% $ special with the \cddollar command
+% $^_ special with the \cdmath command.
+% If you have a bunch of math $..$'s in your code env, then a global \cddollar
+% or \cdmath at the beginning of the env can save a lot of trouble.
+% When chars are special (e.g., after a \dcd), you can still get #$%&_{} with
+% \#, \$, \%, \&, \_, \{, and \} -- this is standard LaTeX.
+% Additionally, \\ gives \ inside the code env, and when \cdmath
+% makes ^ special, it also defines \^ to give ^.
+
+%The hacked characters can be made special again
+% within a group by using the \dcd command.
+
+% Note: this environment allows no breaking of lines whatsoever; not
+% at spaces or hypens. To arrange for a break use the standard \- command,
+% or a \discretionary{}{}{} which breaks, but inserts nothing. This is useful,
+% for example for allowing hypenated identifiers to be broken, e.g.
+% \def\={\discretionary{}{}{}} %optional break
+% FOO-\=BAR.
+
+% setupsmallcode added by JHR
+%
+\def\setupsmallcode{\parsep=0pt\parindent=0pt%
+ \renewcommand{\baselinestretch}{1.0}%
+ \small\tt\frenchspacing\catcode``=13\@noligs%
+ \def\\{\char`\\}\def\_{\char`\_}%
+ \def\{{\char`\{}\def\}{\char`\}}%
+ \let\dcd=\cd@dcd\let\cddollar=\cd@dollarspecial\let\cdmath=\cd@mathspecial%
+ \@makeother\$\@makeother\&\@makeother\#%
+ \@makeother\^\@makeother\_\@makeother\~%
+ \@makeother\%\cd@obeytabs\cd@obeyspaces}
+
+\def\setupcode{\parsep=0pt\parindent=0pt%
+ \tt\frenchspacing\catcode``=13\@noligs%
+ \def\\{\char`\\}\def\_{\char`\_}%
+ \def\{{\char`\{}\def\}{\char`\}}%
+ \let\dcd=\cd@dcd\let\cddollar=\cd@dollarspecial\let\cdmath=\cd@mathspecial%
+ \@makeother\$\@makeother\&\@makeother\#%
+ \@makeother\^\@makeother\_\@makeother\~%
+ \@makeother\%\cd@obeytabs\cd@obeyspaces}
+% other: $&#^_~%
+% left special: \{}
+% unnecessary: @`'"
+
+
+%% codebox, centerbox
+%%=============================================================================
+%% The codebox env makes a box exactly as wide as it needs to be
+%% (i.e., as wide as the longest line of code is). This is useful
+%% if you want to center a chunk of code, or flush it right, or
+%% something like that. The optional argument to the environment,
+%% [t], [c], or [b], specifies how to vertically align the codebox,
+%% just as with arrays or other boxes. Default is [c].
+
+%% Must be a newline immediately after "\begin{codebox}[t]"!
+
+{\catcode`\^^M=\active % these lines must end with %
+ \gdef\cd@obeycr{\catcode`\^^M=\active\let^^M=\cr}}
+
+% If there is a [<letter>] option, then the following newline will
+% be read *after* ^M is bound to \cr, so we're cool. If there isn't
+% an option given (i.e., default to [c]), then the @\ifnextchar will
+% gobble up the newline as it gobbles whitespace. So we insert the
+% \cr explicitly. Isn't TeX fun?
+\def\codebox{\leavevmode\@ifnextchar[{\@codebox}{\@codebox[c]\cr}} %]
+
+\def\@codebox[#1]%
+ {\hbox\bgroup$\if #1t\vtop \else \if#1b\vbox \else \vcenter \fi\fi\bgroup%
+ \tabskip\z@\setupsmallcode\cd@obeycr% just before cd@obey
+ \halign\bgroup##\hfil\span}
+
+\def\endcodebox{\crcr\egroup\egroup\m@th$\egroup}
+
+% Center the box on the page:
+\newenvironment{centercode}%
+ {\begin{center}\begin{codebox}[c]}%
+ {\end{codebox}\end{center}}
+
+
+%% code, codeaux, tightcode
+%%=============================================================================
+%% Code environment as described above. Lines are kept on one page.
+%% This actually works by setting a huge penalty for breaking
+%% between lines of code. Code is indented same as other displayed paras.
+%% Note: to increase left margin, use \begin{codeaux}{\leftmargin=1in}.
+
+% To allow pagebreaks, say \codeallowbreaks immediately inside the env.
+% You can allow breaks at specific lines with a \pagebreak form.
+
+%% N.B.: The \global\@ignoretrue command must be performed just inside
+%% the *last* \end{...} before the following text. If not, you will
+%% get an extra space on the following line. Blech.
+
+%% This environment takes two arguments.
+%% The second, required argument is the \list parameters to override the
+%% \@listi... defaults.
+%% - Usefully set by clients: \topsep \leftmargin
+%% - Possible, but less useful: \partopsep
+%% The first, optional argument is the extra \parskip glue that you get around
+%% \list environments. It defaults to the value of \parskip.
+\def\codeaux{\@ifnextchar[{\@codeaux}{\@codeaux[\parskip]}} %]
+\def\@codeaux[#1]#2{%
+ \bgroup\parskip#1%
+ \begin{list}{}%
+ {\parsep\z@\leftmargin=\codeindent\rightskip\z@\listparindent\z@\itemindent\z@#2}%
+ \item[]\setupsmallcode\cd@obeylines}%
+\def\endcodeaux{\end{list}\leavevmode\egroup\ignorespaces\global\@ignoretrue}
+
+%% Code env is codeaux with the default margin and spacing \list params:
+\def\code{\codeaux{}} \let\endcode=\endcodeaux
+
+%% Like code, but with no extra vertical space above and below.
+\def\tightcode{\codeaux[=0pt]{\topsep\z@}}%
+\let\endtightcode\endcodeaux
+% {\vspace{-1\parskip}\begin{codeaux}{\partopsep\z@\topsep\z@}}%
+% {\end{codeaux}\vspace{-1\parskip}}
+
+
+
+% Reasonable separation between lines of code
+\newcommand{\codeskip}{\penalty0\vspace{2ex}}
+
+
+% \cd is used to build a code environment in the middle of text.
+% Note: only difference from display code is that cr's are taken
+% as unbreakable spaces instead of linebreaks.
+
+\def\cd{\leavevmode\begingroup\ifmmode\let\startcode=\startmcode\else%
+ \let\startcode\starttcode\fi%
+ \setupcode\cd@obeycrsp\startcode}
+
+\def\starttcode#1{#1\endgroup}
+\def\startmcode#1{\hbox{#1}\endgroup}
+
+
+% Restore $&#^_~% to their normal catcodes
+% Define \^ to give the ^ char.
+% \dcd points to this guy inside a code env.
+\def\cd@dcd{\catcode`\$=3\catcode`\&=4\catcode`\#=6\catcode`\^=7%
+ \catcode`\_=8\catcode`\~=13\catcode`\%=14\def\^{\char`\^}}
+
+% Selectively enable $, and $^_ as special.
+% \cd@mathspecial also defines \^ give the ^ char.
+% \cddollar and \cdmath point to these guys inside a code env.
+\def\cd@dollarspecial{\catcode`\$=3}
+\def\cd@mathspecial{\catcode`\$=3\catcode`\^=7\catcode`\_=8%
+ \def\^{\char`\^}}
+
+
+% Change log:
+% Started off as some macros found in C. Rich's library.
+% Olin 1/90:
+% Removed \makeatletter, \makeatother's -- they shouldn't be there,
+% because style option files are read with makeatletter. The terminal
+% makeatother screwed things up for the following style options.
+% Olin 3/91:
+% Rewritten.
+% - Changed things so blank lines don't get compressed out (the \leavevmove
+% in \cd@cr and \cd@crwb).
+% - Changed names to somewhat less horrible choices.
+% - Added lots of doc, so casual hackers can more easily mess with all this.
+% - Removed `'"@ from the set of hacked chars, since they are already
+% non-special.
+% - Removed the bigcode env, which effect can be had with the \codeallowbreaks
+% command.
+% - Removed the \@noligs command, since it's already defined in latex.tex.
+% - Win big with the new \dcd, \cddollar, and \cdmath commands.
+% - Now, *only* the chars \{} are special inside the code env. If you need
+% more, use the \dcd command inside a group.
+% - \cd now works inside math mode. (But if you use it in a superscript,
+% it still comes out full size. You must explicitly put a \scriptsize\tt
+% inside the \cd: $x^{\cd{\scriptsize\tt...}}$. A \leavevmode was added
+% so that if you begin a paragraph with a \cd{...}, TeX realises you
+% are starting a paragraph.
+% - Added the codebox env. Tricky bit involving the first line hacked
+% with help from David Long.
+%
+% JHR 8/19/91:
+% - Added \setupsmallcode to use in multi-line code displays (code, codeaux and
+% codebox environments).
+%
+% JHR 8/31/91:
+% - changed size of small code to \small (from \footnotesize). Also added
+% code to set the baselinestretch to 1 in smallcode.
+%
+% JHR 9/12/91:
+% - added \codeindent (set to \parindent)
View
1,912 src/main/book/content/local/diagrams.sty
1,912 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
2,237 src/main/book/content/local/listings.sty
@@ -0,0 +1,2237 @@
+%%
+%% This is file `listings.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% listings.dtx (with options: `kernel')
+%%
+%% Please read the software license in listings-1.3.dtx or listings-1.3.pdf.
+%%
+%% (w)(c) 1996--2004 Carsten Heinz and/or any other author listed
+%% elsewhere in this file.
+%% (c) 2006 Brooks Moses
+%%
+%% Send comments and ideas on the package, error reports and additional
+%% programming languages to <bmoses@dpdx.net>.
+%%
+\def\filedate{2007/02/22}
+\def\fileversion{1.4}
+\NeedsTeXFormat{LaTeX2e}
+\AtEndOfPackage{\ProvidesPackage{listings}
+ [\filedate\space\fileversion\space(Carsten Heinz)]}
+\def\lst@CheckVersion#1{\edef\reserved@a{#1}%
+ \ifx\lst@version\reserved@a \expandafter\@gobble
+ \else \expandafter\@firstofone \fi}
+\let\lst@version\fileversion
+\def\lst@InputCatcodes{%
+ \makeatletter \catcode`\"12%
+ \catcode`\^^@\active
+ \catcode`\^^I9%
+ \catcode`\^^L9%
+ \catcode`\^^M9%
+ \catcode`\%14%
+ \catcode`\~\active}
+\def\lst@RestoreCatcodes#1{%
+ \ifx\relax#1\else
+ \noexpand\catcode`\noexpand#1\the\catcode`#1\relax
+ \expandafter\lst@RestoreCatcodes
+ \fi}
+\edef\lst@RestoreCatcodes{%
+ \noexpand\lccode`\noexpand\/`\noexpand\/%
+ \lst@RestoreCatcodes\"\^^I\^^M\~\^^@\relax
+ \catcode12\active}
+\lst@InputCatcodes
+\AtEndOfPackage{\lst@RestoreCatcodes}
+\def\@lst{lst}
+\def\lst@IfSubstring#1#2{%
+ \def\lst@temp##1#1##2##3\relax{%
+ \ifx \@empty##2\expandafter\@secondoftwo
+ \else \expandafter\@firstoftwo \fi}%
+ \expandafter\lst@temp#2#1\@empty\relax}
+\def\lst@IfOneOf#1\relax#2{%
+ \def\lst@temp##1,#1,##2##3\relax{%
+ \ifx \@empty##2\expandafter\@secondoftwo
+ \else \expandafter\@firstoftwo \fi}%
+ \expandafter\lst@temp\expandafter,#2,#1,\@empty\relax}
+\def\lst@DeleteKeysIn#1#2{%
+ \expandafter\lst@DeleteKeysIn@\expandafter#1#2,\relax,}
+\def\lst@DeleteKeysIn@#1#2,{%
+ \ifx\relax#2\@empty
+ \expandafter\@firstoftwo\expandafter\lst@RemoveCommas
+ \else
+ \ifx\@empty#2\@empty\else
+ \def\lst@temp##1,#2,##2{%
+ ##1%
+ \ifx\@empty##2\@empty\else
+ \expandafter\lst@temp\expandafter,%
+ \fi ##2}%
+ \edef#1{\expandafter\lst@temp\expandafter,#1,#2,\@empty}%
+ \fi
+ \fi
+ \lst@DeleteKeysIn@#1}
+\def\lst@RemoveCommas#1{\edef#1{\expandafter\lst@RC@#1\@empty}}
+\def\lst@RC@#1{\ifx,#1\expandafter\lst@RC@ \else #1\fi}
+\def\lst@ReplaceIn#1#2{%
+ \expandafter\lst@ReplaceIn@\expandafter#1#2\@empty\@empty}
+\def\lst@ReplaceInArg#1#2{\lst@ReplaceIn@#1#2\@empty\@empty}
+\def\lst@ReplaceIn@#1#2#3{%
+ \ifx\@empty#3\relax\else
+ \def\lst@temp##1#2##2{%
+ \ifx\@empty##2%
+ \lst@lAddTo#1{##1}%
+ \else
+ \lst@lAddTo#1{##1#3}\expandafter\lst@temp
+ \fi ##2}%
+ \let\@tempa#1\let#1\@empty
+ \expandafter\lst@temp\@tempa#2\@empty
+ \expandafter\lst@ReplaceIn@\expandafter#1%
+ \fi}
+\providecommand*\@gobblethree[3]{}
+\def\lst@GobbleNil#1\@nil{}
+\def\lst@Swap#1#2{#2#1}
+\def\lst@true{\let\lst@if\iftrue}
+\def\lst@false{\let\lst@if\iffalse}
+\lst@false
+\def\lst@IfNextCharsArg#1{%
+ \def\lst@tofind{#1}\lst@IfNextChars\lst@tofind}
+\def\lst@IfNextChars#1#2#3{%
+ \let\lst@tofind#1\def\@tempa{#2}\def\@tempb{#3}%
+ \let\lst@eaten\@empty \lst@IfNextChars@}
+\def\lst@IfNextChars@{\expandafter\lst@IfNextChars@@\lst@tofind\relax}
+\def\lst@IfNextChars@@#1#2\relax#3{%
+ \def\lst@tofind{#2}\lst@lAddTo\lst@eaten{#3}%
+ \ifx#1#3%
+ \ifx\lst@tofind\@empty
+ \let\lst@next\@tempa
+ \else
+ \let\lst@next\lst@IfNextChars@
+ \fi
+ \expandafter\lst@next
+ \else
+ \expandafter\@tempb
+ \fi}
+\def\lst@IfNextCharActive#1#2#3{%
+ \begingroup \lccode`\~=`#3\lowercase{\endgroup
+ \ifx~}#3%
+ \def\lst@next{#1}%
+ \else
+ \def\lst@next{#2}%
+ \fi \lst@next #3}
+\def\lst@for#1\do#2{%
+ \def\lst@forbody##1{#2}%
+ \def\@tempa{#1}%
+ \ifx\@tempa\@empty\else\expandafter\lst@f@r#1,\@nil,\fi
+}
+\def\lst@f@r#1,{%
+ \def\@tempa{#1}%
+ \ifx\@tempa\@nnil\else\lst@forbody{#1}\expandafter\lst@f@r\fi
+}
+\def\lst@MakeActive#1{%
+ \let\lst@temp\@empty \lst@MakeActive@#1%
+ \relax\relax\relax\relax\relax\relax\relax\relax\relax}
+\begingroup
+\catcode`\^^@=\active \catcode`\^^A=\active \catcode`\^^B=\active
+\catcode`\^^C=\active \catcode`\^^D=\active \catcode`\^^E=\active
+\catcode`\^^F=\active \catcode`\^^G=\active \catcode`\^^H=\active
+\gdef\lst@MakeActive@#1#2#3#4#5#6#7#8#9{\let\lst@next\relax
+ \ifx#1\relax
+ \else \lccode`\^^@=`#1%
+ \ifx#2\relax
+ \lowercase{\lst@lAddTo\lst@temp{^^@}}%
+ \else \lccode`\^^A=`#2%
+ \ifx#3\relax
+ \lowercase{\lst@lAddTo\lst@temp{^^@^^A}}%
+ \else \lccode`\^^B=`#3%
+ \ifx#4\relax
+ \lowercase{\lst@lAddTo\lst@temp{^^@^^A^^B}}%
+ \else \lccode`\^^C=`#4%
+ \ifx#5\relax
+ \lowercase{\lst@lAddTo\lst@temp{^^@^^A^^B^^C}}%
+ \else \lccode`\^^D=`#5%
+ \ifx#6\relax
+ \lowercase{\lst@lAddTo\lst@temp{^^@^^A^^B^^C^^D}}%
+ \else \lccode`\^^E=`#6%
+ \ifx#7\relax
+ \lowercase{\lst@lAddTo\lst@temp{^^@^^A^^B^^C^^D^^E}}%
+ \else \lccode`\^^F=`#7%
+ \ifx#8\relax
+ \lowercase{\lst@lAddTo\lst@temp{^^@^^A^^B^^C^^D^^E^^F}}%
+ \else \lccode`\^^G=`#8%
+ \ifx#9\relax
+ \lowercase{\lst@lAddTo\lst@temp{^^@^^A^^B^^C^^D^^E^^F^^G}}%
+ \else \lccode`\^^H=`#9%
+ \lowercase{\lst@lAddTo\lst@temp{^^@^^A^^B^^C^^D^^E^^F^^G^^H}}%
+ \let\lst@next\lst@MakeActive@
+ \fi \fi \fi \fi \fi \fi \fi \fi \fi
+ \lst@next}
+\endgroup
+\def\lst@DefActive#1#2{\lst@MakeActive{#2}\let#1\lst@temp}
+\def\lst@DefOther#1#2{%
+ \begingroup \def#1{#2}\escapechar\m@ne \expandafter\endgroup
+ \expandafter\lst@DefOther@\meaning#1\relax#1}
+\def\lst@DefOther@#1>#2\relax#3{\edef#3{\zap@space#2 \@empty}}
+\def\lst@InsideConvert#1{%
+ \lst@ifmathescape
+ \lst@InsideConvert@e#1$\@nil
+ \lst@if
+ \lst@InsideConvert@ey#1\@nil
+ \else
+ \lst@InsideConvert@#1 \@empty
+ \expandafter\@gobbletwo
+ \fi
+ \expandafter\lst@next
+ \else
+ \lst@InsideConvert@#1 \@empty
+ \fi}
+\begingroup \lccode`\~=`\ \relax \lowercase{%
+\gdef\lst@InsideConvert@#1 #2{%
+ \lst@MakeActive{#1}%
+ \ifx\@empty#2%
+ \lst@lExtend\lst@arg{\lst@temp}%
+ \else
+ \lst@lExtend\lst@arg{\lst@temp~}%
+ \expandafter\lst@InsideConvert@
+ \fi #2}
+}\endgroup
+\def\lst@InsideConvert@e#1$#2\@nil{%
+ \ifx\@empty#2\@empty \lst@false \else \lst@true \fi}
+\def\lst@InsideConvert@ey#1$#2$#3\@nil{%
+ \lst@InsideConvert@#1 \@empty
+ \lst@lAddTo\lst@arg{%
+ \lst@ifdropinput\else
+ \lst@TrackNewLines\lst@OutputLostSpace \lst@XPrintToken
+ \setbox\@tempboxa=\hbox\bgroup$\lst@escapebegin
+ #2%
+ \lst@escapeend$\egroup \lst@CalcLostSpaceAndOutput
+ \lst@whitespacefalse
+ \fi}%
+ \def\lst@next{\lst@InsideConvert{#3}}%
+}
+\def\lst@XConvert{\@ifnextchar\bgroup \lst@XConvertArg\lst@XConvert@}
+\def\lst@XConvertArg#1{%
+ {\lst@false \let\lst@arg\@empty
+ \lst@XConvert#1\@nil
+ \global\let\@gtempa\lst@arg}%
+ \lst@lExtend\lst@arg{\expandafter{\@gtempa}}%
+ \lst@XConvertNext}
+\def\lst@XConvert@#1{%
+ \ifx\@nil#1\else
+ \begingroup\lccode`\~=`#1\lowercase{\endgroup
+ \lst@lAddTo\lst@arg~}%
+ \expandafter\lst@XConvertNext
+ \fi}
+\def\lst@XConvertNext{%
+ \lst@if \expandafter\lst@XConvertX
+ \else \expandafter\lst@XConvert \fi}
+\def\lst@XConvertX#1{%
+ \ifx\@nil#1\else
+ \lst@XConvertX@#1\relax
+ \expandafter\lst@XConvert
+ \fi}
+\def\lst@XConvertX@#1#2\relax{%
+ \begingroup\lccode`\~=`#1\lowercase{\endgroup
+ \lst@XCConvertX@@~}{#2}}
+\def\lst@XCConvertX@@#1#2{\lst@lAddTo\lst@arg{{#1#2}}}
+\def\lst@Require#1#2#3#4#5{%
+ \begingroup
+ \aftergroup\lst@true
+ \ifx\@empty#3\@empty\else
+ \def\lst@prefix{#2}\let\lst@require\@empty
+ \edef\lst@temp{\expandafter\zap@space#3 \@empty}%
+ \lst@for\lst@temp\do{%
+ \ifx\@empty##1\@empty\else \lstKV@OptArg[]{##1}{%
+ #4[####1]{####2}%
+ \@ifundefined{\@lst\lst@prefix @\lst@malias $\lst@oalias}%
+ {\edef\lst@require{\lst@require,\lst@malias $\lst@oalias}}%
+ {}}%
+ \fi}%
+ \global\let\lst@loadaspects\@empty
+ \lst@InputCatcodes
+ \ifx\lst@require\@empty\else
+ \lst@for{#5}\do{%
+ \ifx\lst@require\@empty\else
+ \InputIfFileExists{##1}{}{}%
+ \fi}%
+ \fi
+ \ifx\lst@require\@empty\else
+ \PackageError{Listings}{Couldn't load requested #1}%
+ {The following #1s weren't loadable:^^J\@spaces
+ \lst@require^^JThis may cause errors in the sequel.}%
+ \aftergroup\lst@false
+ \fi
+ \ifx\lst@loadaspects\@empty\else
+ \lst@RequireAspects\lst@loadaspects
+ \fi
+ \fi
+ \endgroup}
+\def\lst@IfRequired[#1]#2{%
+ \lst@NormedDef\lst@temp{[#1]#2}%
+ \expandafter\lst@IfRequired@\lst@temp\relax}
+\def\lst@IfRequired@[#1]#2\relax#3{%
+ \lst@IfOneOf #2$#1\relax\lst@require
+ {\lst@DeleteKeysIn@\lst@require#2$#1,\relax,%
+ \global\expandafter\let
+ \csname\@lst\lst@prefix @#2$#1\endcsname\@empty
+ #3}}
+\let\lst@require\@empty
+\def\lst@NoAlias[#1]#2{%
+ \lst@NormedDef\lst@oalias{#1}\lst@NormedDef\lst@malias{#2}}
+\gdef\lst@LAS#1#2#3#4#5#6#7{%
+ \lst@Require{#1}{#2}{#3}#4#5%
+ #4#3%
+ \@ifundefined{lst#2@\lst@malias$\lst@oalias}%
+ {\PackageError{Listings}%
+ {#1 \ifx\@empty\lst@oalias\else \lst@oalias\space of \fi
+ \lst@malias\space undefined}%
+ {The #1 is not loadable. \@ehc}}%
+ {#6\csname\@lst#2@\lst@malias $\lst@oalias\endcsname #7}}
+\def\lst@RequireAspects#1{%
+ \lst@Require{aspect}{asp}{#1}\lst@NoAlias\lstaspectfiles}
+\let\lstloadaspects\lst@RequireAspects
+\@ifundefined{lstaspectfiles}
+ {\newcommand\lstaspectfiles{lstmisc0.sty,lstmisc.sty}}{}
+\gdef\lst@DefDriver#1#2#3#4{%
+ \@ifnextchar[{\lst@DefDriver@{#1}{#2}#3#4}%
+ {\lst@DefDriver@{#1}{#2}#3#4[]}}
+\gdef\lst@DefDriver@#1#2#3#4[#5]#6{%
+ \def\lst@name{#1}\let\lst@if#4%
+ \lst@NormedDef\lst@driver{\@lst#2@#6$#5}%
+ \lst@IfRequired[#5]{#6}{\begingroup \lst@true}%
+ {\begingroup}%
+ \lst@setcatcodes
+ \@ifnextchar[{\lst@XDefDriver{#1}#3}{\lst@DefDriver@@#3}}
+\gdef\lst@DefDriver@@#1#2{%
+ \lst@if
+ \global\@namedef{\lst@driver}{#1{#2}}%
+ \fi
+ \endgroup
+ \@ifnextchar[\lst@XXDefDriver\@empty}
+\gdef\lst@XXDefDriver[#1]{%
+ \ifx\@empty#1\@empty\else
+ \lst@if
+ \lstloadaspects{#1}%
+ \else
+ \@ifundefined{\lst@driver}{}%
+ {\xdef\lst@loadaspects{\lst@loadaspects,#1}}%
+ \fi
+ \fi}
+\gdef\lst@XDefDriver#1#2[#3]#4#5{\lst@DefDriver@@#2{also#1=[#3]#4,#5}}
+\let\lst@UserCommand\gdef
+\newcommand*\lst@BeginAspect[2][]{%
+ \def\lst@curraspect{#2}%
+ \ifx \lst@curraspect\@empty
+ \expandafter\lst@GobbleAspect
+ \else
+ \let\lst@next\@empty
+ \lst@IfRequired[]{#2}%
+ {\lst@RequireAspects{#1}%
+ \lst@if\else \let\lst@next\lst@GobbleAspect \fi}%
+ {\let\lst@next\lst@GobbleAspect}%
+ \expandafter\lst@next
+ \fi}
+\def\lst@EndAspect{%
+ \csname\@lst patch@\lst@curraspect\endcsname
+ \let\lst@curraspect\@empty}
+\long\def\lst@GobbleAspect#1\lst@EndAspect{\let\lst@curraspect\@empty}
+\def\lst@Key#1#2{%
+ \@ifnextchar[{\lstKV@def{#1}{#2}}%
+ {\def\lst@temp{\lst@Key@{#1}{#2}}
+ \afterassignment\lst@temp
+ \global\@namedef{KV@\@lst @#1}####1}}
+\def\lstKV@def#1#2[#3]{%
+ \global\@namedef{KV@\@lst @#1@default\expandafter}\expandafter
+ {\csname KV@\@lst @#1\endcsname{#3}}%
+ \def\lst@temp{\lst@Key@{#1}{#2}}\afterassignment\lst@temp
+ \global\@namedef{KV@\@lst @#1}##1}
+\def\lst@Key@#1#2{%
+ \ifx\relax#2\@empty\else
+ \begingroup \globaldefs\@ne
+ \csname KV@\@lst @#1\endcsname{#2}%
+ \endgroup
+ \fi}
+\def\lst@UseHook#1{\csname\@lst hk@#1\endcsname}
+\def\lst@AddToHook{\lst@ATH@\iffalse\lst@AddTo}
+\def\lst@AddToHookExe{\lst@ATH@\iftrue\lst@AddTo}
+\def\lst@AddToHookAtTop{\lst@ATH@\iffalse\lst@AddToAtTop}
+\long\def\lst@ATH@#1#2#3#4{%
+ \@ifundefined{\@lst hk@#3}{%
+ \expandafter\gdef\csname\@lst hk@#3\endcsname{}}{}%
+ \expandafter#2\csname\@lst hk@#3\endcsname{#4}%
+ \def\lst@temp{#4}%
+ #1% \iftrue|false
+ \begingroup \globaldefs\@ne \lst@temp \endgroup
+ \fi}
+\long\def\lst@AddTo#1#2{%
+ \expandafter\gdef\expandafter#1\expandafter{#1#2}}
+\def\lst@AddToAtTop#1#2{\def\lst@temp{#2}%
+ \expandafter\expandafter\expandafter\gdef
+ \expandafter\expandafter\expandafter#1%
+ \expandafter\expandafter\expandafter{\expandafter\lst@temp#1}}
+\def\lst@lAddTo#1#2{\expandafter\def\expandafter#1\expandafter{#1#2}}
+\def\lst@Extend#1#2{%
+ \expandafter\lst@AddTo\expandafter#1\expandafter{#2}}
+\def\lst@lExtend#1#2{%
+ \expandafter\lst@lAddTo\expandafter#1\expandafter{#2}}
+\RequirePackage{keyval}[1997/11/10]
+\def\lstKV@TwoArg#1#2{\gdef\@gtempa##1##2{#2}\@gtempa#1{}{}}
+\def\lstKV@ThreeArg#1#2{\gdef\@gtempa##1##2##3{#2}\@gtempa#1{}{}{}}
+\def\lstKV@FourArg#1#2{\gdef\@gtempa##1##2##3##4{#2}\@gtempa#1{}{}{}{}}
+\def\lstKV@OptArg[#1]#2#3{%
+ \gdef\@gtempa[##1]##2{#3}\lstKV@OptArg@{#1}#2\@}
+\def\lstKV@OptArg@#1{\@ifnextchar[\lstKV@OptArg@@{\lstKV@OptArg@@[#1]}}
+\def\lstKV@OptArg@@[#1]#2\@{\@gtempa[#1]{#2}}
+\def\lstKV@XOptArg[#1]#2#3{%
+ \global\let\@gtempa#3\lstKV@OptArg@{#1}#2\@}
+\def\lstKV@CSTwoArg#1#2{%
+ \gdef\@gtempa##1,##2,##3\relax{#2}%
+ \@gtempa#1,,\relax}
+\def\lstKV@SetIf#1{\lstKV@SetIf@#1\relax}
+\def\lstKV@SetIf@#1#2\relax#3{\lowercase{%
+ \expandafter\let\expandafter#3%
+ \csname if\ifx #1t}true\else false\fi\endcsname}
+\def\lstKV@SwitchCases#1#2#3{%
+ \def\lst@temp##1\\#1&##2\\##3##4\@nil{%
+ \ifx\@empty##3%
+ #3%
+ \else
+ ##2%
+ \fi
+ }%
+ \lst@temp\\#2\\#1&\\\@empty\@nil}
+\lst@UserCommand\lstset{\begingroup \lst@setcatcodes \lstset@}
+\def\lstset@#1{\endgroup \ifx\@empty#1\@empty\else\setkeys{lst}{#1}\fi}
+\def\lst@setcatcodes{\makeatletter \catcode`\==12\relax}
+\def\lst@NewMode#1{%
+ \ifx\@undefined#1%
+ \lst@mode\lst@newmode\relax \advance\lst@mode\@ne
+ \xdef\lst@newmode{\the\lst@mode}%
+ \global\chardef#1=\lst@mode
+ \lst@mode\lst@nomode
+ \fi}
+\newcount\lst@mode
+\def\lst@newmode{\m@ne}% init
+\lst@NewMode\lst@nomode % init (of \lst@mode :-)
+\def\lst@UseDynamicMode{%
+ \@tempcnta\lst@dynamicmode\relax \advance\@tempcnta\@ne
+ \edef\lst@dynamicmode{\the\@tempcnta}%
+ \expandafter\lst@Swap\expandafter{\expandafter{\lst@dynamicmode}}}
+\lst@AddToHook{InitVars}{\let\lst@dynamicmode\lst@newmode}
+\def\lst@EnterMode#1#2{%
+ \bgroup \lst@mode=#1\relax #2%
+ \lst@FontAdjust
+ \lst@lAddTo\lst@entermodes{\lst@EnterMode{#1}{#2}}}
+\lst@AddToHook{InitVars}{\let\lst@entermodes\@empty}
+\let\lst@entermodes\@empty % init
+\def\lst@LeaveMode{%
+ \ifnum\lst@mode=\lst@nomode\else
+ \egroup \expandafter\lsthk@EndGroup
+ \fi}
+\lst@AddToHook{EndGroup}{}% init
+\def\lst@InterruptModes{%
+ \lst@Extend\lst@modestack{\expandafter{\lst@entermodes}}%
+ \lst@LeaveAllModes}
+\lst@AddToHook{InitVars}{\global\let\lst@modestack\@empty}
+\def\lst@ReenterModes{%
+ \ifx\lst@modestack\@empty\else
+ \lst@LeaveAllModes
+ \global\let\@gtempa\lst@modestack
+ \global\let\lst@modestack\@empty
+ \expandafter\lst@ReenterModes@\@gtempa\relax
+ \fi}
+\def\lst@ReenterModes@#1#2{%
+ \ifx\relax#2\@empty
+ \gdef\@gtempa##1{#1}%
+ \expandafter\@gtempa
+ \else
+ \lst@AddTo\lst@modestack{{#1}}%
+ \expandafter\lst@ReenterModes@
+ \fi
+ {#2}}
+\def\lst@LeaveAllModes{%
+ \ifnum\lst@mode=\lst@nomode
+ \expandafter\lsthk@EndGroup
+ \else
+ \expandafter\egroup\expandafter\lst@LeaveAllModes
+ \fi}
+\lst@AddToHook{ExitVars}{\lst@LeaveAllModes}
+\lst@NewMode\lst@Pmode
+\lst@NewMode\lst@GPmode
+\def\lst@modetrue{\let\lst@ifmode\iftrue \lsthk@ModeTrue}
+\let\lst@ifmode\iffalse % init
+\lst@AddToHook{ModeTrue}{}% init
+\def\lst@Lmodetrue{\let\lst@ifLmode\iftrue}
+\let\lst@ifLmode\iffalse % init
+\lst@AddToHook{EOL}{\@whilesw \lst@ifLmode\fi \lst@LeaveMode}
+\def\lst@NormedDef#1#2{\lowercase{\edef#1{\zap@space#2 \@empty}}}
+\def\lst@NormedNameDef#1#2{%
+ \lowercase{\edef\lst@temp{\zap@space#1 \@empty}%
+ \expandafter\xdef\csname\lst@temp\endcsname{\zap@space#2 \@empty}}}
+\def\lst@GetFreeMacro#1{%
+ \@tempcnta\z@ \def\lst@freemacro{#1\the\@tempcnta}%
+ \lst@GFM@}
+\def\lst@GFM@{%
+ \expandafter\ifx \csname\lst@freemacro\endcsname \relax
+ \edef\lst@freemacro{\csname\lst@freemacro\endcsname}%
+ \else
+ \advance\@tempcnta\@ne
+ \expandafter\lst@GFM@
+ \fi}
+\newbox\lst@gtempboxa
+\newtoks\lst@token \newcount\lst@length
+\def\lst@ResetToken{\lst@token{}\lst@length\z@}
+\lst@AddToHook{InitVarsBOL}{\lst@ResetToken \let\lst@lastother\@empty}
+\lst@AddToHook{EndGroup}{\lst@ResetToken \let\lst@lastother\@empty}
+\def\lst@lettertrue{\let\lst@ifletter\iftrue}
+\def\lst@letterfalse{\let\lst@ifletter\iffalse}
+\lst@AddToHook{InitVars}{\lst@letterfalse}
+\def\lst@Append#1{\advance\lst@length\@ne
+ \lst@token=\expandafter{\the\lst@token#1}}
+\def\lst@AppendOther{%
+ \lst@ifletter \lst@Output\lst@letterfalse \fi
+ \futurelet\lst@lastother\lst@Append}
+\def\lst@AppendLetter{%
+ \lst@ifletter\else \lst@OutputOther\lst@lettertrue \fi
+ \lst@Append}
+\def\lst@SaveToken{%
+ \global\let\lst@gthestyle\lst@thestyle
+ \global\let\lst@glastother\lst@lastother
+ \xdef\lst@RestoreToken{\noexpand\lst@token{\the\lst@token}%
+ \noexpand\lst@length\the\lst@length\relax
+ \noexpand\let\noexpand\lst@thestyle
+ \noexpand\lst@gthestyle
+ \noexpand\let\noexpand\lst@lastother
+ \noexpand\lst@glastother}}
+\def\lst@IfLastOtherOneOf#1{\lst@IfLastOtherOneOf@ #1\relax}
+\def\lst@IfLastOtherOneOf@#1{%
+ \ifx #1\relax
+ \expandafter\@secondoftwo
+ \else
+ \ifx\lst@lastother#1%
+ \lst@IfLastOtherOneOf@t
+ \else
+ \expandafter\expandafter\expandafter\lst@IfLastOtherOneOf@
+ \fi
+ \fi}
+\def\lst@IfLastOtherOneOf@t#1\fi\fi#2\relax{\fi\fi\@firstoftwo}
+\newdimen\lst@currlwidth % \global
+\newcount\lst@column \newcount\lst@pos % \global
+\lst@AddToHook{InitVarsBOL}
+ {\global\lst@currlwidth\z@ \global\lst@pos\z@ \global\lst@column\z@}
+\def\lst@CalcColumn{%
+ \@tempcnta\lst@column
+ \advance\@tempcnta\lst@length
+ \advance\@tempcnta-\lst@pos}
+\newdimen\lst@lostspace % \global
+\lst@AddToHook{InitVarsBOL}{\global\lst@lostspace\z@}
+\def\lst@UseLostSpace{\ifdim\lst@lostspace>\z@ \lst@InsertLostSpace \fi}
+\def\lst@InsertLostSpace{%
+ \lst@Kern\lst@lostspace \global\lst@lostspace\z@}
+\def\lst@InsertHalfLostSpace{%
+ \global\lst@lostspace.5\lst@lostspace \lst@Kern\lst@lostspace}
+\newdimen\lst@width
+\lst@Key{basewidth}{0.6em,0.45em}{\lstKV@CSTwoArg{#1}%
+ {\def\lst@widthfixed{##1}\def\lst@widthflexible{##2}%
+ \ifx\lst@widthflexible\@empty
+ \let\lst@widthflexible\lst@widthfixed
+ \fi
+ \def\lst@temp{\PackageError{Listings}%
+ {Negative value(s) treated as zero}%
+ \@ehc}%
+ \let\lst@error\@empty
+ \ifdim \lst@widthfixed<\z@
+ \let\lst@error\lst@temp \let\lst@widthfixed\z@
+ \fi
+ \ifdim \lst@widthflexible<\z@
+ \let\lst@error\lst@temp \let\lst@widthflexible\z@
+ \fi
+ \lst@error}}
+\lst@AddToHook{FontAdjust}
+ {\lst@width=\lst@ifflexible\lst@widthflexible
+ \else\lst@widthfixed\fi \relax}
+\lst@Key{fontadjust}{false}[t]{\lstKV@SetIf{#1}\lst@iffontadjust}
+\def\lst@FontAdjust{\lst@iffontadjust \lsthk@FontAdjust \fi}
+\lst@AddToHook{InitVars}{\lsthk@FontAdjust}
+\def\lst@OutputBox#1{\lst@alloverstyle{\box#1}}
+\def\lst@alloverstyle#1{#1}% init
+\def\lst@Kern#1{%
+ \setbox\z@\hbox{{\lst@currstyle{\kern#1}}}%
+ \global\advance\lst@currlwidth \wd\z@
+ \lst@OutputBox\z@}
+\def\lst@CalcLostSpaceAndOutput{%
+ \global\advance\lst@lostspace \lst@length\lst@width
+ \global\advance\lst@lostspace-\wd\@tempboxa
+ \global\advance\lst@currlwidth \wd\@tempboxa
+ \global\advance\lst@pos -\lst@length
+ \setbox\@tempboxa\hbox{\let\lst@OutputBox\box
+ \ifdim\lst@lostspace>\z@ \lst@leftinsert \fi
+ \box\@tempboxa
+ \ifdim\lst@lostspace>\z@ \lst@rightinsert \fi}%
+ \lst@OutputBox\@tempboxa \lsthk@PostOutput}
+\lst@AddToHook{PostOutput}{}% init
+\def\lst@OutputToken{%
+ \lst@TrackNewLines \lst@OutputLostSpace
+ \lst@ifgobbledws
+ \lst@gobbledwhitespacefalse
+ \lst@@discretionary
+ \fi
+ \lst@CheckMerge
+ {\lst@thestyle{\lst@FontAdjust
+ \setbox\@tempboxa\lst@hbox
+ {\lsthk@OutputBox
+ \lst@lefthss
+ \expandafter\lst@FillOutputBox\the\lst@token\@empty
+ \lst@righthss}%
+ \lst@CalcLostSpaceAndOutput}}%
+ \lst@ResetToken}
+\lst@AddToHook{OutputBox}{}% init
+\def\lst@gobbledwhitespacetrue{\global\let\lst@ifgobbledws\iftrue}
+\def\lst@gobbledwhitespacefalse{\global\let\lst@ifgobbledws\iffalse}
+\lst@AddToHookExe{InitBOL}{\lst@gobbledwhitespacefalse}% init
+\def\lst@Delay#1{%
+ \lst@CheckDelay
+ #1%
+ \lst@GetOutputMacro\lst@delayedoutput
+ \edef\lst@delayed{\the\lst@token}%
+ \edef\lst@delayedlength{\the\lst@length}%
+ \lst@ResetToken}
+\def\lst@Merge#1{%
+ \lst@CheckMerge
+ #1%
+ \edef\lst@merged{\the\lst@token}%
+ \edef\lst@mergedlength{\the\lst@length}%
+ \lst@ResetToken}
+\def\lst@MergeToken#1#2{%
+ \advance\lst@length#2%
+ \lst@lExtend#1{\the\lst@token}%
+ \expandafter\lst@token\expandafter{#1}%
+ \let#1\@empty}
+\def\lst@CheckDelay{%
+ \ifx\lst@delayed\@empty\else
+ \lst@GetOutputMacro\@gtempa
+ \ifx\lst@delayedoutput\@gtempa
+ \lst@MergeToken\lst@delayed\lst@delayedlength
+ \else
+ {\lst@ResetToken
+ \lst@MergeToken\lst@delayed\lst@delayedlength
+ \lst@delayedoutput}%
+ \let\lst@delayed\@empty
+ \fi
+ \fi}
+\def\lst@CheckMerge{%
+ \ifx\lst@merged\@empty\else
+ \lst@MergeToken\lst@merged\lst@mergedlength
+ \fi}
+\let\lst@delayed\@empty % init
+\let\lst@merged\@empty % init
+\def\lst@column@fixed{%
+ \lst@flexiblefalse
+ \lst@width\lst@widthfixed\relax
+ \let\lst@OutputLostSpace\lst@UseLostSpace
+ \let\lst@FillOutputBox\lst@FillFixed
+ \let\lst@hss\hss
+ \def\lst@hbox{\hbox to\lst@length\lst@width}}
+\def\lst@FillFixed#1{#1\lst@FillFixed@}
+\def\lst@FillFixed@#1{%
+ \ifx\@empty#1\else \lst@hss#1\expandafter\lst@FillFixed@ \fi}
+\def\lst@column@flexible{%
+ \lst@flexibletrue
+ \lst@width\lst@widthflexible\relax
+ \let\lst@OutputLostSpace\lst@UseLostSpace
+ \let\lst@FillOutputBox\@empty
+ \let\lst@hss\@empty
+ \let\lst@hbox\hbox}
+\def\lst@column@fullflexible{%
+ \lst@column@flexible
+ \def\lst@OutputLostSpace{\lst@ifnewline \lst@UseLostSpace\fi}%
+ \let\lst@leftinsert\@empty
+ \let\lst@rightinsert\@empty}
+\def\lst@column@spaceflexible{%
+ \lst@column@flexible
+ \def\lst@OutputLostSpace{%
+ \lst@ifwhitespace
+ \ifx\lst@outputspace\lst@visiblespace
+ \else
+ \lst@UseLostSpace
+ \fi
+ \else
+ \lst@ifnewline \lst@UseLostSpace\fi
+ \fi}%
+ \let\lst@leftinsert\@empty
+ \let\lst@rightinsert\@empty}
+\def\lst@outputpos#1#2\relax{%
+ \def\lst@lefthss{\lst@hss}\let\lst@righthss\lst@lefthss
+ \let\lst@rightinsert\lst@InsertLostSpace
+ \ifx #1c%
+ \let\lst@leftinsert\lst@InsertHalfLostSpace
+ \else\ifx #1r%
+ \let\lst@righthss\@empty
+ \let\lst@leftinsert\lst@InsertLostSpace
+ \let\lst@rightinsert\@empty
+ \else
+ \let\lst@lefthss\@empty
+ \let\lst@leftinsert\@empty
+ \ifx #1l\else \PackageWarning{Listings}%
+ {Unknown positioning for output boxes}%
+ \fi
+ \fi\fi}
+\def\lst@flexibletrue{\let\lst@ifflexible\iftrue}
+\def\lst@flexiblefalse{\let\lst@ifflexible\iffalse}
+\lst@Key{columns}{[c]fixed}{\lstKV@OptArg[]{#1}{%
+ \ifx\@empty##1\@empty\else \lst@outputpos##1\relax\relax \fi
+ \expandafter\let\expandafter\lst@arg
+ \csname\@lst @column@##2\endcsname
+ \lst@arg
+ \ifx\lst@arg\relax
+ \PackageWarning{Listings}{Unknown column format `##2'}%
+ \else
+ \lst@ifflexible
+ \let\lst@columnsflexible\lst@arg
+ \else
+ \let\lst@columnsfixed\lst@arg
+ \fi
+ \fi}}
+\let\lst@columnsfixed\lst@column@fixed % init
+\let\lst@columnsflexible\lst@column@flexible % init
+\lst@Key{flexiblecolumns}\relax[t]{%
+ \lstKV@SetIf{#1}\lst@ifflexible
+ \lst@ifflexible \lst@columnsflexible
+ \else \lst@columnsfixed \fi}
+\newcount\lst@newlines
+\lst@AddToHook{InitVars}{\global\lst@newlines\z@}
+\lst@AddToHook{InitVarsBOL}{\global\advance\lst@newlines\@ne}
+\def\lst@NewLine{%
+ \ifx\lst@OutputBox\@gobble\else
+ \par\noindent \hbox{}%
+ \fi
+ \global\advance\lst@newlines\m@ne
+ \lst@newlinetrue}
+\def\lst@newlinetrue{\global\let\lst@ifnewline\iftrue}
+\lst@AddToHookExe{PostOutput}{\global\let\lst@ifnewline\iffalse}% init
+\def\lst@TrackNewLines{%
+ \ifnum\lst@newlines>\z@
+ \lsthk@OnNewLine
+ \lst@DoNewLines
+ \fi}
+\lst@AddToHook{OnNewLine}{}% init
+\lst@Key{emptylines}\maxdimen{%
+ \@ifstar{\lst@true\@tempcnta\@gobble#1\relax\lst@GobbleNil}%
+ {\lst@false\@tempcnta#1\relax\lst@GobbleNil}#1\@nil
+ \advance\@tempcnta\@ne
+ \edef\lst@maxempty{\the\@tempcnta\relax}%
+ \let\lst@ifpreservenumber\lst@if}
+\def\lst@DoNewLines{
+ \@whilenum\lst@newlines>\lst@maxempty \do
+ {\lst@ifpreservenumber
+ \lsthk@OnEmptyLine
+ \global\advance\c@lstnumber\lst@advancelstnum
+ \fi
+ \global\advance\lst@newlines\m@ne}%
+ \@whilenum \lst@newlines>\@ne \do
+ {\lsthk@OnEmptyLine \lst@NewLine}%
+ \ifnum\lst@newlines>\z@ \lst@NewLine \fi}
+\lst@AddToHook{OnEmptyLine}{}% init
+\lst@Key{identifierstyle}{}{\def\lst@identifierstyle{#1}}
+\lst@AddToHook{EmptyStyle}{\let\lst@identifierstyle\@empty}
+\def\lst@GotoTabStop{%
+ \ifnum\lst@newlines=\z@
+ \setbox\@tempboxa\hbox{\lst@outputspace}%
+ \setbox\@tempboxa\hbox to\wd\@tempboxa{{\lst@currstyle{\hss}}}%
+ \lst@CalcLostSpaceAndOutput
+ \else
+ \global\advance\lst@lostspace \lst@length\lst@width
+ \global\advance\lst@column\lst@length \lst@length\z@
+ \fi}
+\def\lst@OutputOther{%
+ \lst@CheckDelay
+ \ifnum\lst@length=\z@\else
+ \let\lst@thestyle\lst@currstyle
+ \lsthk@OutputOther
+ \lst@OutputToken
+ \fi}
+\lst@AddToHook{OutputOther}{}% init
+\let\lst@currstyle\relax % init
+\def\lst@Output{%
+ \lst@CheckDelay
+ \ifnum\lst@length=\z@\else
+ \ifx\lst@currstyle\relax
+ \let\lst@thestyle\lst@identifierstyle
+ \else
+ \let\lst@thestyle\lst@currstyle
+ \fi
+ \lsthk@Output
+ \lst@OutputToken
+ \fi
+ \let\lst@lastother\relax}
+\lst@AddToHook{Output}{}% init
+\def\lst@GetOutputMacro#1{%
+ \lst@ifletter \global\let#1\lst@Output
+ \else \global\let#1\lst@OutputOther\fi}
+\def\lst@PrintToken{%
+ \lst@ifletter \lst@Output \lst@letterfalse
+ \else \lst@OutputOther \let\lst@lastother\@empty \fi}
+\def\lst@XPrintToken{%
+ \lst@PrintToken \lst@CheckMerge
+ \ifnum\lst@length=\z@\else \lst@PrintToken \fi}
+\def\lst@BeginDropOutput#1{%
+ \xdef\lst@BDOnewlines{\the\lst@newlines}%
+ \global\let\lst@BDOifnewline\lst@ifnewline
+ \lst@EnterMode{#1}%
+ {\lst@modetrue
+ \let\lst@OutputBox\@gobble
+ \aftergroup\lst@BDORestore}}
+\def\lst@BDORestore{%
+ \global\lst@newlines\lst@BDOnewlines
+ \global\let\lst@ifnewline\lst@BDOifnewline}
+\let\lst@EndDropOutput\lst@LeaveMode
+\def\lst@ProcessLetter{\lst@whitespacefalse \lst@AppendLetter}
+\def\lst@ProcessOther{\lst@whitespacefalse \lst@AppendOther}
+\def\lst@ProcessDigit{%
+ \lst@whitespacefalse
+ \lst@ifletter \expandafter\lst@AppendLetter
+ \else \expandafter\lst@AppendOther\fi}
+\def\lst@whitespacetrue{\global\let\lst@ifwhitespace\iftrue}
+\def\lst@whitespacefalse{\global\let\lst@ifwhitespace\iffalse}
+\lst@AddToHook{InitVarsBOL}{\lst@whitespacetrue}
+\lst@Key{tabsize}{8}
+ {\ifnum#1>\z@ \def\lst@tabsize{#1}\else
+ \PackageError{Listings}{Strict positive integer expected}%
+ {You can't use `#1' as tabsize. \@ehc}%
+ \fi}
+\lst@Key{showtabs}f[t]{\lstKV@SetIf{#1}\lst@ifshowtabs}
+\lst@Key{tab}{\kern.06em\hbox{\vrule\@height.3ex}%
+ \hrulefill\hbox{\vrule\@height.3ex}}
+ {\def\lst@tab{#1}}
+\def\lst@ProcessTabulator{%
+ \lst@XPrintToken \lst@whitespacetrue
+ \global\advance\lst@column -\lst@pos
+ \@whilenum \lst@pos<\@ne \do
+ {\global\advance\lst@pos\lst@tabsize}%
+ \lst@length\lst@pos
+ \lst@PreGotoTabStop}
+\def\lst@PreGotoTabStop{%
+ \lst@ifshowtabs
+ \lst@TrackNewLines
+ \setbox\@tempboxa\hbox to\lst@length\lst@width
+ {{\lst@currstyle{\hss\lst@tab}}}%
+ \lst@CalcLostSpaceAndOutput
+ \else
+ \lst@ifkeepspaces
+ \@tempcnta\lst@length \lst@length\z@
+ \@whilenum \@tempcnta>\z@ \do
+ {\lst@AppendOther\lst@outputspace
+ \advance\@tempcnta\m@ne}%
+ \lst@OutputOther
+ \else
+ \lst@GotoTabStop
+ \fi
+ \fi
+ \lst@length\z@ \global\lst@pos\z@}
+\def\lst@outputspace{\ }
+\def\lst@visiblespace{\lst@ttfamily{\char32}\textvisiblespace}
+\lst@Key{showspaces}{false}[t]{\lstKV@SetIf{#1}\lst@ifshowspaces}
+\lst@Key{keepspaces}{false}[t]{\lstKV@SetIf{#1}\lst@ifkeepspaces}
+\lst@AddToHook{Init}
+ {\lst@ifshowspaces
+ \let\lst@outputspace\lst@visiblespace
+ \lst@keepspacestrue
+ \fi}
+\def\lst@keepspacestrue{\let\lst@ifkeepspaces\iftrue}
+\def\lst@ProcessSpace{%
+ \lst@ifkeepspaces
+ \lst@PrintToken
+ \lst@whitespacetrue
+ \lst@AppendOther\lst@outputspace
+ \lst@PrintToken
+ \else \ifnum\lst@newlines=\z@
+ \lst@AppendSpecialSpace
+ \else \ifnum\lst@length=\z@
+ \global\advance\lst@lostspace\lst@width
+ \global\advance\lst@pos\m@ne
+ \lst@whitespacetrue
+ \else
+ \lst@AppendSpecialSpace
+ \fi
+ \fi \fi}
+\def\lst@AppendSpecialSpace{%
+ \lst@ifwhitespace
+ \lst@PrintToken
+ \global\advance\lst@lostspace\lst@width
+ \global\advance\lst@pos\m@ne
+ \lst@gobbledwhitespacetrue
+ \else
+ \lst@PrintToken
+ \lst@whitespacetrue
+ \lst@AppendOther\lst@outputspace
+ \lst@PrintToken
+ \fi}
+\lst@Key{formfeed}{\bigbreak}{\def\lst@formfeed{#1}}
+\def\lst@ProcessFormFeed{%
+ \lst@XPrintToken
+ \ifnum\lst@newlines=\z@
+ \lst@EOLUpdate \lsthk@InitVarsBOL
+ \fi
+ \lst@formfeed
+ \lst@whitespacetrue}
+\def\lst@Def#1{\lccode`\~=#1\lowercase{\def~}}
+\def\lst@Let#1{\lccode`\~=#1\lowercase{\let~}}
+\lst@AddToAtTop{\try@load@fontshape}{\def\space{ }}
+\def\lst@SelectStdCharTable{%
+ \lst@Def{9}{\lst@ProcessTabulator}%
+ \lst@Def{12}{\lst@ProcessFormFeed}%
+ \lst@Def{32}{\lst@ProcessSpace}}
+\def\lst@CCPut#1#2{%
+ \ifnum#2=\z@
+ \expandafter\@gobbletwo
+ \else
+ \lccode`\~=#2\lccode`\/=#2\lowercase{\lst@CCPut@~{#1/}}%
+ \fi
+ \lst@CCPut#1}
+\def\lst@CCPut@#1#2{\lst@lAddTo\lst@SelectStdCharTable{\def#1{#2}}}
+\lst@CCPut \lst@ProcessOther
+ {"21}{"22}{"28}{"29}{"2B}{"2C}{"2E}{"2F}
+ {"3A}{"3B}{"3D}{"3F}{"5B}{"5D}
+ \z@
+\lst@CCPut \lst@ProcessDigit
+ {"30}{"31}{"32}{"33}{"34}{"35}{"36}{"37}{"38}{"39}
+ \z@
+\lst@CCPut \lst@ProcessLetter
+ {"40}{"41}{"42}{"43}{"44}{"45}{"46}{"47}
+ {"48}{"49}{"4A}{"4B}{"4C}{"4D}{"4E}{"4F}
+ {"50}{"51}{"52}{"53}{"54}{"55}{"56}{"57}
+ {"58}{"59}{"5A}
+ {"61}{"62}{"63}{"64}{"65}{"66}{"67}
+ {"68}{"69}{"6A}{"6B}{"6C}{"6D}{"6E}{"6F}
+ {"70}{"71}{"72}{"73}{"74}{"75}{"76}{"77}
+ {"78}{"79}{"7A}
+ \z@
+\def\lst@CCPutMacro#1#2#3{%
+ \ifnum#2=\z@ \else
+ \begingroup\lccode`\~=#2\relax \lccode`\/=#2\relax
+ \lowercase{\endgroup\expandafter\lst@CCPutMacro@
+ \csname\@lst @um/\expandafter\endcsname
+ \csname\@lst @um/@\endcsname /~}#1{#3}%
+ \expandafter\lst@CCPutMacro
+ \fi}
+\def\lst@CCPutMacro@#1#2#3#4#5#6{%
+ \lst@lAddTo\lst@SelectStdCharTable{\def#4{#5#1}}%
+ \def#1{\lst@UM#3}%
+ \def#2{#6}}
+\def\lst@UM#1{\csname\@lst @um#1@\endcsname}
+\lst@CCPutMacro
+ \lst@ProcessOther {"23}\#
+ \lst@ProcessLetter{"24}\textdollar
+ \lst@ProcessOther {"25}\%
+ \lst@ProcessOther {"26}\&
+ \lst@ProcessOther {"27}{\lst@ifupquote \textquotesingle
+ \else \char39\relax \fi}
+ \lst@ProcessOther {"2A}{\lst@ttfamily*\textasteriskcentered}
+ \lst@ProcessOther {"2D}{\lst@ttfamily{-{}}{$-$}}
+ \lst@ProcessOther {"3C}{\lst@ttfamily<\textless}
+ \lst@ProcessOther {"3E}{\lst@ttfamily>\textgreater}
+ \lst@ProcessOther {"5C}{\lst@ttfamily{\char92}\textbackslash}
+ \lst@ProcessOther {"5E}\textasciicircum
+ \lst@ProcessLetter{"5F}{\lst@ttfamily{\char95}\textunderscore}
+ \lst@ProcessOther {"60}{\lst@ifupquote \textasciigrave
+ \else \char96\relax \fi}
+ \lst@ProcessOther {"7B}{\lst@ttfamily{\char123}\textbraceleft}
+ \lst@ProcessOther {"7C}{\lst@ttfamily|\textbar}
+ \lst@ProcessOther {"7D}{\lst@ttfamily{\char125}\textbraceright}
+ \lst@ProcessOther {"7E}\textasciitilde
+ \lst@ProcessOther {"7F}-
+ \@empty\z@\@empty
+\def\lst@ttfamily#1#2{\ifx\f@family\ttdefault#1\relax\else#2\fi}
+\lst@AddToHook{Init}{\edef\ttdefault{\ttdefault}}
+\lst@Key{upquote}{false}[t]{\lstKV@SetIf{#1}\lst@ifupquote
+ \lst@ifupquote
+ \@ifundefined{textasciigrave}%
+ {\let\KV@lst@upquote\@gobble
+ \lstKV@SetIf f\lst@ifupquote \@gobble\fi
+ \PackageError{Listings}{Option `upquote' requires `textcomp'
+ package.\MessageBreak The option has been disabled}%
+ {Add \string\usepackage{textcomp} to your preamble.}}%
+ {}%
+ \fi}
+\AtBeginDocument{%
+ \@ifpackageloaded{upquote}{\RequirePackage{textcomp}%
+ \lstset{upquote}}{}%
+ \@ifpackageloaded{upquote2}{\lstset{upquote}}{}}
+\def\lst@activecharstrue{\let\lst@ifactivechars\iftrue}
+\def\lst@activecharsfalse{\let\lst@ifactivechars\iffalse}
+\lst@activecharstrue
+\def\lst@SelectCharTable{%
+ \lst@SelectStdCharTable
+ \lst@ifactivechars
+ \catcode9\active \catcode12\active \catcode13\active
+ \@tempcnta=32\relax
+ \@whilenum\@tempcnta<128\do
+ {\catcode\@tempcnta\active\advance\@tempcnta\@ne}%
+ \fi
+ \lst@ifec \lst@DefEC \fi
+ \let\do\lst@do@noligs \verbatim@nolig@list
+ \lsthk@SelectCharTable
+ \lst@DeveloperSCT
+\lst@DefRange
+ \ifx\lst@Backslash\relax\else
+ \lst@LetSaveDef{"5C}\lsts@backslash\lst@Backslash
+ \fi}
+\lst@Key{SelectCharTable}{}{\def\lst@DeveloperSCT{#1}}
+\lst@Key{MoreSelectCharTable}\relax{\lst@lAddTo\lst@DeveloperSCT{#1}}
+\lst@AddToHook{SetLanguage}{\let\lst@DeveloperSCT\@empty}
+\def\lst@do@noligs#1{%
+ \begingroup \lccode`\~=`#1\lowercase{\endgroup
+ \lst@do@noligs@~}}
+\def\lst@do@noligs@#1{%
+ \expandafter\expandafter\expandafter\def
+ \expandafter\expandafter\expandafter#1%
+ \expandafter\expandafter\expandafter{\expandafter\lst@NoLig#1}}
+\def\lst@NoLig{\advance\lst@length\m@ne \lst@Append\lst@nolig}
+\def\lst@nolig{\lst@UM\@empty}%
+\@namedef{\@lst @um@}{\leavevmode\kern\z@}
+\def\lst@SaveOutputDef#1#2{%
+ \begingroup \lccode`\~=#1\relax \lowercase{\endgroup
+ \def\lst@temp##1\def~##2##3\relax}{%
+ \global\expandafter\let\expandafter#2\@gobble##2\relax}%
+ \expandafter\lst@temp\lst@SelectStdCharTable\relax}
+\lst@SaveOutputDef{"5C}\lstum@backslash
+\lst@Key{extendedchars}{true}[t]{\lstKV@SetIf{#1}\lst@ifec}
+\def\lst@DefEC{%
+ \lst@CCECUse \lst@ProcessLetter
+ ^^80^^81^^82^^83^^84^^85^^86^^87^^88^^89^^8a^^8b^^8c^^8d^^8e^^8f%
+ ^^90^^91^^92^^93^^94^^95^^96^^97^^98^^99^^9a^^9b^^9c^^9d^^9e^^9f%
+ ^^a0^^a1^^a2^^a3^^a4^^a5^^a6^^a7^^a8^^a9^^aa^^ab^^ac^^ad^^ae^^af%
+ ^^b0^^b1^^b2^^b3^^b4^^b5^^b6^^b7^^b8^^b9^^ba^^bb^^bc^^bd^^be^^bf%
+ ^^c0^^c1^^c2^^c3^^c4^^c5^^c6^^c7^^c8^^c9^^ca^^cb^^cc^^cd^^ce^^cf%
+ ^^d0^^d1^^d2^^d3^^d4^^d5^^d6^^d7^^d8^^d9^^da^^db^^dc^^dd^^de^^df%
+ ^^e0^^e1^^e2^^e3^^e4^^e5^^e6^^e7^^e8^^e9^^ea^^eb^^ec^^ed^^ee^^ef%
+ ^^f0^^f1^^f2^^f3^^f4^^f5^^f6^^f7^^f8^^f9^^fa^^fb^^fc^^fd^^fe^^ff%
+ ^^00}
+\def\lst@CCECUse#1#2{%
+ \ifnum`#2=\z@
+ \expandafter\@gobbletwo
+ \else
+ \ifnum\catcode`#2=\active
+ \lccode`\~=`#2\lccode`\/=`#2\lowercase{\lst@CCECUse@#1~/}%
+ \else
+ \lst@ifactivechars \catcode`#2=\active \fi
+ \lccode`\~=`#2\lccode`\/=`#2\lowercase{\def~{#1/}}%
+ \fi
+ \fi
+ \lst@CCECUse#1}
+\def\lst@CCECUse@#1#2#3{%
+ \expandafter\def\csname\@lst @EC#3\endcsname{\lst@UM#3}%
+ \expandafter\let\csname\@lst @um#3@\endcsname #2%
+ \edef#2{\noexpand#1%
+ \expandafter\noexpand\csname\@lst @EC#3\endcsname}}
+\lst@AddToHook{Init}
+ {\let\lsts@nfss@catcodes\nfss@catcodes
+ \let\nfss@catcodes\lst@nfss@catcodes}
+\def\lst@nfss@catcodes{%
+ \lst@makeletter
+ ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\relax
+ \@makeother (\@makeother )\@makeother ,\@makeother :\@makeother\&%
+ \@makeother 0\@makeother 1\@makeother 2\@makeother 3\@makeother 4%
+ \@makeother 5\@makeother 6\@makeother 7\@makeother 8\@makeother 9%
+ \@makeother =\lsts@nfss@catcodes}
+\def\lst@makeletter#1{%
+ \ifx\relax#1\else\catcode`#111\relax \expandafter\lst@makeletter\fi}
+\lst@Key{useoutput}{2}{\edef\lst@useoutput{\ifcase0#1 0\or 1\else 2\fi}}
+\lst@AddToHook{Init}
+{\edef\lst@OrgOutput{\the\output}%
+\ifcase\lst@useoutput\relax
+\or
+ \output{\global\setbox\lst@gtempboxa\box\@cclv
+ \expandafter\egroup
+ \lst@SaveToken
+ \lst@InterruptModes
+ \setbox\@cclv\box\lst@gtempboxa
+ \bgroup\lst@OrgOutput\egroup
+ \bgroup
+ \aftergroup\pagegoal\aftergroup\vsize
+ \aftergroup\lst@ReenterModes\aftergroup\lst@RestoreToken}%
+\else
+ \output{\lst@RestoreOrigCatcodes
+ \lst@ifec \lst@RestoreOrigExtendedCatcodes \fi
+ \lst@OrgOutput}%
+\fi}
+\def\lst@GetChars#1#2#3{%
+ \let#1\@empty
+ \@tempcnta#2\relax \@tempcntb#3\relax
+ \loop \ifnum\@tempcnta<\@tempcntb\relax
+ \lst@lExtend#1{\expandafter\catcode\the\@tempcnta=}%
+ \lst@lExtend#1{\the\catcode\@tempcnta\relax}%
+ \ifnum\the\catcode\@tempcnta=\active
+ \begingroup\lccode`\~=\@tempcnta
+ \lowercase{\endgroup
+ \lst@lExtend#1{\expandafter\let\expandafter~\csname
+ lstecs@\the\@tempcnta\endcsname}%
+ \expandafter\let\csname lstecs@\the\@tempcnta\endcsname~}%
+ \fi
+ \advance\@tempcnta\@ne
+ \repeat}
+\begingroup \catcode12=\active\let^^L\@empty
+\gdef\lst@ScanChars{%
+ \let\lsts@ssL^^L%
+ \def^^L{\par}%
+ \lst@GetChars\lst@RestoreOrigCatcodes\@ne {128}%
+ \let^^L\lsts@ssL
+ \lst@GetChars\lst@RestoreOrigExtendedCatcodes{128}{256}}
+\endgroup
+\lst@Key{rescanchars}\relax{\lst@ScanChars}
+\AtBeginDocument{\lst@ScanChars}
+\lst@Key{alsoletter}\relax{%
+ \lst@DoAlso{#1}\lst@alsoletter\lst@ProcessLetter}
+\lst@Key{alsodigit}\relax{%
+ \lst@DoAlso{#1}\lst@alsodigit\lst@ProcessDigit}
+\lst@Key{alsoother}\relax{%
+ \lst@DoAlso{#1}\lst@alsoother\lst@ProcessOther}
+\lst@AddToHook{SelectCharTable}
+ {\lst@alsoother \lst@alsodigit \lst@alsoletter}
+\lst@AddToHookExe{SetLanguage}% init
+ {\let\lst@alsoletter\@empty
+ \let\lst@alsodigit\@empty
+ \let\lst@alsoother\@empty}
+\def\lst@DoAlso#1#2#3{%
+ \lst@DefOther\lst@arg{#1}\let#2\@empty
+ \expandafter\lst@DoAlso@\expandafter#2\expandafter#3\lst@arg\relax}
+\def\lst@DoAlso@#1#2#3{%
+ \ifx\relax#3\expandafter\@gobblethree \else
+ \begingroup \lccode`\~=`#3\relax \lowercase{\endgroup
+ \def\lst@temp##1\def~##2##3\relax{%
+ \edef\lst@arg{\def\noexpand~{\noexpand#2\expandafter
+ \noexpand\@gobble##2}}}}%
+ \expandafter\lst@temp\lst@SelectStdCharTable\relax
+ \lst@lExtend#1{\lst@arg}%
+ \fi
+ \lst@DoAlso@#1#2}
+\def\lst@SaveDef#1#2{%
+ \begingroup \lccode`\~=#1\relax \lowercase{\endgroup\let#2~}}
+\def\lst@DefSaveDef#1#2{%
+ \begingroup \lccode`\~=#1\relax \lowercase{\endgroup\let#2~\def~}}
+\def\lst@LetSaveDef#1#2{%
+ \begingroup \lccode`\~=#1\relax \lowercase{\endgroup\let#2~\let~}}
+\def\lst@CDef#1{\lst@CDef@#1}
+\def\lst@CDef@#1#2#3#4{\lst@CDefIt#1{#2}{#3}{#4#2#3}#4}
+\def\lst@CDefX#1{\lst@CDefX@#1}
+\def\lst@CDefX@#1#2#3{\lst@CDefIt#1{#2}{#3}{}}
+\def\lst@CDefIt#1#2#3#4#5#6#7#8{%
+ \ifx\@empty#2\@empty
+ \def#1{#6\def\lst@next{#7#4#8}\lst@next}%
+ \else \ifx\@empty#3\@empty
+ \def#1##1{%
+ #6%
+ \ifx##1#2\def\lst@next{#7#4#8}\else
+ \def\lst@next{#5##1}\fi
+ \lst@next}%
+ \else
+ \def#1{%
+ #6%
+ \lst@IfNextCharsArg{#2#3}{#7#4#8}%
+ {\expandafter#5\lst@eaten}}%
+ \fi \fi}
+\def\lst@CArgX#1#2\relax{%
+ \lst@DefActive\lst@arg{#1#2}%
+ \expandafter\lst@CArg\lst@arg\relax}
+\def\lst@CArg#1#2\relax{%
+ \lccode`\/=`#1\lowercase{\def\lst@temp{/}}%
+ \lst@GetFreeMacro{lst@c\lst@temp}%
+ \expandafter\lst@CArg@\lst@freemacro#1#2\@empty\@empty\relax}
+\def\lst@CArg@#1#2#3#4\@empty#5\relax#6{%
+ \let#1#2%
+ \ifx\@empty#3\@empty
+ \def\lst@next{#6{#2{}{}}}%
+ \else
+ \def\lst@next{#6{#2#3{#4}}}%
+ \fi
+ \lst@next #1}
+\def\lst@CArgEmpty#1\@empty{#1}
+\lst@Key{excludedelims}\relax
+ {\lsthk@ExcludeDelims \lst@NormedDef\lst@temp{#1}%
+ \expandafter\lst@for\lst@temp\do
+ {\expandafter\let\csname\@lst @ifex##1\endcsname\iftrue}}
+\def\lst@DelimPrint#1#2{%
+ #1%
+ \begingroup
+ \lst@mode\lst@nomode \lst@modetrue
+ #2\lst@XPrintToken
+ \endgroup
+ \lst@ResetToken
+ \fi}
+\def\lst@DelimOpen#1#2#3#4#5#6\@empty{%
+ \lst@TrackNewLines \lst@XPrintToken
+ \lst@DelimPrint#1{#6}%
+ \lst@EnterMode{#4}{\def\lst@currstyle#5}%
+ \lst@DelimPrint{#1#2}{#6}%
+ #3}
+\def\lst@DelimClose#1#2#3\@empty{%
+ \lst@TrackNewLines \lst@XPrintToken
+ \lst@DelimPrint{#1#2}{#3}%
+ \lst@LeaveMode
+ \lst@DelimPrint{#1}{#3}}
+\def\lst@BeginDelim{\lst@DelimOpen\iffalse\else{}}
+\def\lst@EndDelim{\lst@DelimClose\iffalse\else}
+\def\lst@BeginIDelim{\lst@DelimOpen\iffalse{}{}}
+\def\lst@EndIDelim{\lst@DelimClose\iffalse{}}
+\lst@AddToHook{SelectCharTable}{\lst@DefDelims}
+\lst@AddToHookExe{SetLanguage}{\let\lst@DefDelims\@empty}
+\def\lst@Delim#1{%
+ \lst@false \let\lst@cumulative\@empty \let\lst@arg\@empty
+ \@ifstar{\@ifstar{\lst@Delim@{#1}}%
+ {\let\lst@cumulative\relax
+ \lst@Delim@{#1}}}%
+ {\lst@true\lst@Delim@{#1}}}
+\def\lst@Delim@#1[#2]{%
+ \gdef\lst@delimtype{#2}%
+ \@ifnextchar[\lst@Delim@sty
+ {\lst@Delim@sty[#1]}}
+\def\lst@Delim@sty[#1]{%
+ \def\lst@delimstyle{#1}%
+ \ifx\@empty#1\@empty\else
+ \lst@Delim@sty@ #1\@nil
+ \fi
+ \@ifnextchar[\lst@Delim@option
+ \lst@Delim@delim}
+\def\lst@Delim@option[#1]{\def\lst@arg{[#1]}\lst@Delim@delim}
+\def\lst@Delim@sty@#1#2\@nil{%
+ \if\relax\noexpand#1\else
+ \edef\lst@delimstyle{\expandafter\noexpand
+ \csname\@lst @\lst@delimstyle\endcsname}%
+ \fi}
+\def\lst@Delim@delim#1\relax#2#3#4#5#6#7#8{%
+ \ifx #4\@empty \lst@Delim@delall{#2}\fi
+ \ifx\@empty#1\@empty
+ \ifx #4\@nil
+ \@ifundefined{\@lst @#2DM@\lst@delimtype}%
+ {\lst@Delim@delall{#2@\lst@delimtype}}%
+ {\lst@Delim@delall{#2DM@\lst@delimtype}}%
+ \fi
+ \else
+ \expandafter\lst@Delim@args\expandafter
+ {\lst@delimtype}{#1}{#5}#6{#7}{#8}#4%
+ \let\lst@delim\@empty
+ \expandafter\lst@IfOneOf\lst@delimtype\relax#3%
+ {\@ifundefined{\@lst @#2DM@\lst@delimtype}%
+ {\lst@lExtend\lst@delim{\csname\@lst @#2@\lst@delimtype
+ \expandafter\endcsname\lst@arg}}%
+ {\lst@lExtend\lst@delim{\expandafter\lst@UseDynamicMode
+ \csname\@lst @#2DM@\lst@delimtype
+ \expandafter\endcsname\lst@arg}}%
+ \ifx #4\@nil
+ \let\lst@temp\lst@DefDelims \let\lst@DefDelims\@empty
+ \expandafter\lst@Delim@del\lst@temp\@empty\@nil\@nil\@nil
+ \else
+ \lst@lExtend\lst@DefDelims\lst@delim
+ \fi}%
+ {\PackageError{Listings}{Illegal type `\lst@delimtype'}%
+ {#2 types are #3.}}%
+ \fi}
+\def\lst@Delim@args#1#2#3#4#5#6#7{%
+ \begingroup
+ \lst@false \let\lst@next\lst@XConvert
+ \@ifnextchar #4{\xdef\lst@delimtype{\expandafter\@gobble
+ \lst@delimtype}%
+ #5\lst@next#2\@nil
+ \lst@lAddTo\lst@arg{\@empty#6}%
+ \lst@GobbleNil}%
+ {\lst@next#2\@nil
+ \lst@lAddTo\lst@arg{\@empty#3}%
+ \lst@GobbleNil}%
+ #1\@nil
+ \global\let\@gtempa\lst@arg
+ \endgroup
+ \let\lst@arg\@gtempa
+ \ifx #7\@nil\else
+ \expandafter\lst@Delim@args@\expandafter{\lst@delimstyle}%
+ \fi}
+\def\lst@Delim@args@#1{%
+ \lst@if
+ \lst@lAddTo\lst@arg{{{#1}\lst@modetrue}}%
+ \else
+ \ifx\lst@cumulative\@empty
+ \lst@lAddTo\lst@arg{{{}#1}}%
+ \else
+ \lst@lAddTo\lst@arg{{{#1}}}%
+ \fi
+ \fi}
+\def\lst@Delim@del#1\@empty#2#3#4{%
+ \ifx #2\@nil\else
+ \def\lst@temp{#1\@empty#2#3}%
+ \ifx\lst@temp\lst@delim\else
+ \lst@lAddTo\lst@DefDelims{#1\@empty#2#3{#4}}%
+ \fi
+ \expandafter\lst@Delim@del
+ \fi}
+\def\lst@Delim@delall#1{%
+ \begingroup
+ \edef\lst@delim{\expandafter\string\csname\@lst @#1\endcsname}%
+ \lst@false \global\let\@gtempa\@empty
+ \expandafter\lst@Delim@delall@\lst@DefDelims\@empty
+ \endgroup
+ \let\lst@DefDelims\@gtempa}
+\def\lst@Delim@delall@#1{%
+ \ifx #1\@empty\else
+ \ifx #1\lst@UseDynamicMode
+ \lst@true
+ \let\lst@next\lst@Delim@delall@do
+ \else
+ \def\lst@next{\lst@Delim@delall@do#1}%
+ \fi
+ \expandafter\lst@next
+ \fi}
+\def\lst@Delim@delall@do#1#2\@empty#3#4#5{%
+ \expandafter\lst@IfSubstring\expandafter{\lst@delim}{\string#1}%
+ {}%
+ {\lst@if \lst@AddTo\@gtempa\lst@UseDynamicMode \fi
+ \lst@AddTo\@gtempa{#1#2\@empty#3#4{#5}}}%
+ \lst@false \lst@Delim@delall@}
+\gdef\lst@DefDelimB#1#2#3#4#5#6#7#8{%
+ \lst@CDef{#1}#2%
+ {#3}%
+ {\let\lst@bnext\lst@CArgEmpty
+ \lst@ifmode #4\else
+ #5%
+ \def\lst@bnext{#6{#7}{#8}}%
+ \fi
+ \lst@bnext}%
+ \@empty}
+\gdef\lst@DefDelimE#1#2#3#4#5#6#7{%
+ \lst@CDef{#1}#2%
+ {#3}%
+ {\let\lst@enext\lst@CArgEmpty
+ \ifnum #7=\lst@mode%
+ #4%
+ \let\lst@enext#6%
+ \else
+ #5%
+ \fi
+ \lst@enext}%
+ \@empty}
+\lst@AddToHook{Init}{\let\lst@bnext\relax \let\lst@enext\relax}
+\gdef\lst@DefDelimBE#1#2#3#4#5#6#7#8#9{%
+ \lst@CDef{#1}#2%
+ {#3}%
+ {\let\lst@bnext\lst@CArgEmpty
+ \ifnum #7=\lst@mode
+ #4%
+ \let\lst@bnext#9%
+ \else
+ \lst@ifmode\else
+ #5%
+ \def\lst@bnext{#6{#7}{#8}}%
+ \fi
+ \fi
+ \lst@bnext}%
+ \@empty}
+\gdef\lst@delimtypes{s,l}
+\gdef\lst@DelimKey#1#2{%
+ \lst@Delim{}#2\relax
+ {Delim}\lst@delimtypes #1%
+ {\lst@BeginDelim\lst@EndDelim}
+ i\@empty{\lst@BeginIDelim\lst@EndIDelim}}
+\lst@Key{delim}\relax{\lst@DelimKey\@empty{#1}}
+\lst@Key{moredelim}\relax{\lst@DelimKey\relax{#1}}
+\lst@Key{deletedelim}\relax{\lst@DelimKey\@nil{#1}}
+\gdef\lst@DelimDM@l#1#2\@empty#3#4#5{%
+ \lst@CArg #2\relax\lst@DefDelimB{}{}{}#3{#1}{#5\lst@Lmodetrue}}
+\gdef\lst@DelimDM@s#1#2#3\@empty#4#5#6{%
+ \lst@CArg #2\relax\lst@DefDelimB{}{}{}#4{#1}{#6}%
+ \lst@CArg #3\relax\lst@DefDelimE{}{}{}#5{#1}}
+\def\lst@ReplaceInput#1{\lst@CArgX #1\relax\lst@CDefX{}{}}
+