doc-src/ttbox.sty
author nipkow
Wed, 04 Aug 2004 11:25:08 +0200
changeset 15106 e8cef6993701
parent 11620 54e2f4c8c3cb
permissions -rw-r--r--
aded comment
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9692
e15aaebea14d proper setup;
wenzelm
parents:
diff changeset
     1
\ProvidesPackage{ttbox}[1997/06/25]
e15aaebea14d proper setup;
wenzelm
parents:
diff changeset
     2
\RequirePackage{alltt}
e15aaebea14d proper setup;
wenzelm
parents:
diff changeset
     3
e15aaebea14d proper setup;
wenzelm
parents:
diff changeset
     4
%%%Boxed terminal sessions
e15aaebea14d proper setup;
wenzelm
parents:
diff changeset
     5
e15aaebea14d proper setup;
wenzelm
parents:
diff changeset
     6
%Redefines \{ and \} to be in \tt font and \| to make a BACKSLASH
e15aaebea14d proper setup;
wenzelm
parents:
diff changeset
     7
\def\ttbraces{\chardef\{=`\{\chardef\}=`\}\chardef\|=`\\}
e15aaebea14d proper setup;
wenzelm
parents:
diff changeset
     8
e15aaebea14d proper setup;
wenzelm
parents:
diff changeset
     9
%Restores % as the comment character (especially, to suppress line breaks)
e15aaebea14d proper setup;
wenzelm
parents:
diff changeset
    10
\newcommand\comments{\catcode`\%=14\relax}
e15aaebea14d proper setup;
wenzelm
parents:
diff changeset
    11
e15aaebea14d proper setup;
wenzelm
parents:
diff changeset
    12
%alltt* environment: like alltt but smaller, and with \{ \} and \| as in ttbox
e15aaebea14d proper setup;
wenzelm
parents:
diff changeset
    13
\newenvironment{alltt*}{\begin{alltt}\footnotesize\ttbraces}{\end{alltt}}
e15aaebea14d proper setup;
wenzelm
parents:
diff changeset
    14
e15aaebea14d proper setup;
wenzelm
parents:
diff changeset
    15
%Indented alltt* environment with small point size
e15aaebea14d proper setup;
wenzelm
parents:
diff changeset
    16
%NO LINE BREAKS are allowed unless \pagebreak appears at START of a line
e15aaebea14d proper setup;
wenzelm
parents:
diff changeset
    17
\newenvironment{ttbox}{\begin{quote}\samepage\begin{alltt*}}%
e15aaebea14d proper setup;
wenzelm
parents:
diff changeset
    18
                      {\end{alltt*}\end{quote}}
e15aaebea14d proper setup;
wenzelm
parents:
diff changeset
    19
e15aaebea14d proper setup;
wenzelm
parents:
diff changeset
    20
{\obeylines\gdef\ttbreak
e15aaebea14d proper setup;
wenzelm
parents:
diff changeset
    21
{\allowbreak}}
e15aaebea14d proper setup;
wenzelm
parents:
diff changeset
    22
e15aaebea14d proper setup;
wenzelm
parents:
diff changeset
    23
%%%% more \tt things
e15aaebea14d proper setup;
wenzelm
parents:
diff changeset
    24
e15aaebea14d proper setup;
wenzelm
parents:
diff changeset
    25
\def\ttdescriptionlabel#1{\hspace\labelsep \tt #1}
e15aaebea14d proper setup;
wenzelm
parents:
diff changeset
    26
\def\ttdescription{\list{}{\labelwidth\z@ \itemindent-\leftmargin
e15aaebea14d proper setup;
wenzelm
parents:
diff changeset
    27
       \let\makelabel\ttdescriptionlabel}}
e15aaebea14d proper setup;
wenzelm
parents:
diff changeset
    28
e15aaebea14d proper setup;
wenzelm
parents:
diff changeset
    29
\let\endttdescription\endlist
e15aaebea14d proper setup;
wenzelm
parents:
diff changeset
    30
e15aaebea14d proper setup;
wenzelm
parents:
diff changeset
    31
\chardef\ttilde=`\~     % A tilde for \tt font
e15aaebea14d proper setup;
wenzelm
parents:
diff changeset
    32
\chardef\ttback=`\\     % A backslash for \tt font
e15aaebea14d proper setup;
wenzelm
parents:
diff changeset
    33
\chardef\ttlbrace=`\{   % A left brace for \tt font
e15aaebea14d proper setup;
wenzelm
parents:
diff changeset
    34
\chardef\ttrbrace=`\}   % A right brace for \tt font
11620
54e2f4c8c3cb Added \ttlbrack and \ttrbrack.
berghofe
parents: 9692
diff changeset
    35
\chardef\ttlbrack=`\[   % A left bracket for \tt font
54e2f4c8c3cb Added \ttlbrack and \ttrbrack.
berghofe
parents: 9692
diff changeset
    36
\chardef\ttrbrack=`\]   % A right bracket for \tt font
9692
e15aaebea14d proper setup;
wenzelm
parents:
diff changeset
    37
e15aaebea14d proper setup;
wenzelm
parents:
diff changeset
    38
\newcommand\out{\ \ttfamily\slshape}   %% for output from terminal sessions
e15aaebea14d proper setup;
wenzelm
parents:
diff changeset
    39
e15aaebea14d proper setup;
wenzelm
parents:
diff changeset
    40
\endinput