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