%%
%% This is file `listout.tex',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% grabhedr.dtx 
%% dialogl.dtx 
%% menus.dtx 
%% listout.dtx 
%% This is a generated file.
%% 
%% Copyright 1994 Michael John Downes
%% Copyright 2013 TeX Users Group.
%% 
%% It may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1
%% 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.3 or later is part of all distributions of LaTeX
%% version 2003/12/01 or later.
%% 
%% This file has the LPPL maintenance status "unmaintained".
%% 
%% The list of all files belonging to the distribution is given in the file
%% `manifest.txt'.
%% 
%% The list of derived (unpacked) files belonging to the distribution
%% and covered by LPPL is defined by the unpacking scripts (with
%% extension .ins) which are part of the distribution.
%%% ====================================================================
%%%  @LaTeX-style-file{
%%%     filename        = "grabhedr.dtx",
%%%     version         = "1.99a",
%%%     date            = "2013/01/24",
%%%     author          = "Michael Downes",
%%%     copyright       = "This file is part of the dialogl package, released
%%%                        under the LPPL; see dialogl.ins for details."
%%%     keywords        = "TeX, file header,
%%%     supported       = "no",
%%%     abstract        = "This file defines a macro \inputfwh
%%%       to be used instead of \input, to allow TeX to grab
%%%       information from standardized file headers in the form
%%%       proposed by Nelson Beebe during his term as president of the
%%%       TeX Users Group. Of which all this here is an example.",
%%%  }
%%% ====================================================================
\begingroup
\catcode96 12 % left quote
\catcode`\= 12
\catcode`\{=1 \catcode`\}=2 \catcode`\#=6
\catcode`\$=3 \catcode`\~=13 \catcode`\^=7
\catcode`\_=8 \catcode`\^^M=5 \catcode`\"=12
\catcode`\@=11
\gdef\@empty{}
\long\gdef\@gobble#1{}
\long\gdef\@gobbletwo#1#2{}
\long\gdef\@gobblethree#1#2#3{}
\long\gdef\@car#1#2\@nil{#1}
\ifx\UndEFiNed\@@input % LaTeX not loaded.
  \edef\0{\meaning\input}\edef\1{\string\input}%
  \ifx\0\1%
    \global\let\@@input\input
  \else
    \errhelp{%
Grabhedr.sty needs to know the name of the
\input primitive in order to define \inputfwh
properly. Consult a TeXnician for help.}
    \errmessage{%
      Non-primitive \noexpand\input detected}%
  \fi
\fi
\global\toksdef\toks@=0
\long\gdef\afterfi#1\fi{\fi#1}
\global\let\nx@\noexpand
\global\let\xp@\expandafter
\begingroup \lccode`\.=`\%%
\lowercase{\gdef\@percentchar{.}}%
\endgroup
\gdef\fileversiondate#1#2#3{%
  \xp@\xdef\csname#1\endcsname{#2 (#3)}%
  \def\filename{#1}\def\fileversion{#2}%
  \def\filedate{#3}%
  \message{#1 \csname#1\endcsname}%
}
\xdef\@filehdrstart{%
  \@percentchar\@percentchar\@percentchar\space
  ==================================%
  ==================================}
\gdef\@scanfileheader#1@#2#{\@xscanfileheader}
\long\gdef\@xscanfileheader#1{%
  \@yscanfileheader#1{} version = "??",
  date = "??",\@yscanfileheader}
\long\gdef\@yscanfileheader
  #1 filename = "#2",#3 version = "#4",%
  #5 date = "#6",#7\@yscanfileheader{%
  \endgroup
  \csname fileversiondate\endcsname{#2}{#4}{#6}%
}
\begingroup
\lccode`\$=`\^^M
\lowercase{\gdef\@readfirstheaderline#1$}{%
  \toks@{#1}%
  \edef\@tempa{\@percentchar\the\toks@}%
  \ifx\@tempa\@filehdrstart
    \endgroup \begingroup
    \catcode`\%=9 \catcode`\^^M=5 \catcode`\@=11
    \catcode`\ =10 \catcode`\==12 \catcode`\"=12
  \xp@\@scanfileheader
  \else
    \message{(* Missing file header? *)}%
    \afterfi\endgroup
  \fi}
\endgroup
\gdef\@xinputfwh{%
  \ifx\next\@readfirstheaderline
    \catcode`\%=12 \catcode`\{=12 \catcode`\}=12
    \catcode`\\=12 \catcode`\^^L=12
    \catcode`\^=12
    \catcode`\^^M=3\relax
  \else \endgroup\fi
}
\gdef\@inputfwh{\futurelet\next\@xinputfwh}
\gdef\inputfwh#1{%
  \begingroup\catcode`\%=\active
  \endlinechar`\^^M\relax
  \lccode`\~=`\%\relax
  \lowercase{\let~}\@readfirstheaderline
  \xp@\@inputfwh\@@input #1\relax
}
\gdef\localcatcodes#1{%
  \ifx\@empty\@catcodestack
    \gdef\@catcodestack{{}}%
  \fi
  \def\do##1##2{%
    \ifnum##2>\z@
      \catcode\number`##1 \space
      \number\catcode`##1\relax
    \expandafter\do\fi}%
  \xdef\@catcodestack{{\do#1\relax\m@ne}%
    \@catcodestack}%
  \def\do##1##2{\catcode`##1 ##2\relax\do}%
  \do#1\ {\catcode32\let\do}%
}
\gdef\@catcodestack{{}}
\gdef\restorecatcodes{%
  \begingroup
  \ifx\@empty\@catcodestack
    \errmessage{Can't pop catcodes;
      \nx@\@catcodestack = empty}%
    \endgroup
  \else
    \def\do##1##2\do{%
      \gdef\@catcodestack{##2}%
      \endgroup##1}%
    \xp@\do\@catcodestack\do
  \fi
}
\expandafter\gdef\csname trap.input\endcsname
  \input#1 \relax{%
    \expandafter\ifx\csname#1\endcsname\relax
      \afterfi\inputfwh{#1}\relax
    \fi}
\endgroup
%%% ====================================================================
%%%  @LaTeX-style-file{
%%%     filename        = "dialogl.dtx",
%%%     version         = "1.99a",
%%%     date            = "2013/01/24",
%%%     author          = "Michael Downes",
%%%     copyright       = "This file is part of the dialogl package, released
%%%                        under the LPPL; see dialogl.ins for details."
%%%     keywords        = "TeX, dialog",
%%%     supported       = "no",
%%%     abstract        = "This file provides macros for writing
%%%       messages and menus on screen, and reading user responses. It
%%%       can be used with LaTeX as a documentstyle option, or in
%%%       other forms of TeX by a standard \input statement.",
%%%  }
%%% ====================================================================
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% The line break is significant here:
\localcatcodes{\@{11}\ {10}\
{5}\~{13}\"{12}\#{6}\^{7}\`{12}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begingroup
\def\do{12 \catcode`}
\catcode`\~\do\!\do\@\do\#\do\$\do\^\do\&
\do\*\do\(\do\)\do\-\do\_\do\=\do\[\do\]
\do\;\do\:\do\'\do\"\do\<\do\>\do\,\do\.
\do\/\do\?\do\|12\relax
\escapechar -1
\edef\\{\string\\}
\edef\{{\string\{}\edef\}{\string\}}
\catcode`\ =12\catcode`\%=12
\xdef\otherchars
{ !"#$%&'()*+,-./:;<=>?[\\]^_`\{|\}~}
\endgroup %              ^     ^  ^
\begingroup
\endlinechar = -1
\def\do{12 \catcode`}
\catcode`\^^@\do\^^A\do\^^B\do\^^C
\do\^^D\do\^^E\do\^^F\do\^^G\do\^^H\do\^^I
\do\^^J\do\^^K\do\^^L\do\^^M\do\^^N\do\^^O
\do\^^P\do\^^Q\do\^^R\do\^^S\do\^^T\do\^^U
\do\^^V\do\^^W\do\^^X\do\^^Y\do\^^Z\do\^^[
\do\^^\\do\^^]\do\^^^\do\^^_\do\^^? 12\relax
\gdef\controlchars{^^@^^A^^B^^C^^D^^E^^F^^G
  ^^H^^I^^J^^K^^L^^M^^N^^O^^P^^Q^^R^^S^^T
  ^^U^^V^^W^^X^^Y^^Z^^[^^\^^]^^^^^_^^?}
\endgroup
\begingroup
\def\do{12 \catcode`}
\catcode`\^^80\do\^^81\do\^^82\do\^^83\do\^^84
\do\^^85\do\^^86\do\^^87\do\^^88\do\^^89\do\^^8a
\do\^^8b\do\^^8c\do\^^8d\do\^^8e\do\^^8f
\do\^^90\do\^^91\do\^^92\do\^^93\do\^^94\do\^^95
\do\^^96\do\^^97\do\^^98\do\^^99\do\^^9a\do\^^9b
\do\^^9c\do\^^9d\do\^^9e\do\^^9f
\do\^^a0\do\^^a1\do\^^a2\do\^^a3\do\^^a4\do\^^a5
\do\^^a6\do\^^a7\do\^^a8\do\^^a9\do\^^aa\do\^^ab
\do\^^ac\do\^^ad\do\^^ae\do\^^af
\do\^^b0\do\^^b1\do\^^b2\do\^^b3\do\^^b4\do\^^b5
\do\^^b6\do\^^b7\do\^^b8\do\^^b9\do\^^ba\do\^^bb
\do\^^bc\do\^^bd\do\^^be\do\^^bf
\do\^^c0\do\^^c1\do\^^c2\do\^^c3\do\^^c4\do\^^c5
\do\^^c6\do\^^c7\do\^^c8\do\^^c9\do\^^ca\do\^^cb
\do\^^cc\do\^^cd\do\^^ce\do\^^cf
\do\^^d0\do\^^d1\do\^^d2\do\^^d3\do\^^d4\do\^^d5
\do\^^d6\do\^^d7\do\^^d8\do\^^d9\do\^^da\do\^^db
\do\^^dc\do\^^dd\do\^^de\do\^^df
\do\^^e0\do\^^e1\do\^^e2\do\^^e3\do\^^e4\do\^^e5
\do\^^e6\do\^^e7\do\^^e8\do\^^e9\do\^^ea\do\^^eb
\do\^^ec\do\^^ed\do\^^ee\do\^^ef
\do\^^f0\do\^^f1\do\^^f2\do\^^f3\do\^^f4\do\^^f5
\do\^^f6\do\^^f7\do\^^f8\do\^^f9\do\^^fa\do\^^fb
\do\^^fc\do\^^fd\do\^^fe\do\^^ff 12\relax
\gdef\highchars{%
^^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}
\endgroup
\def\actively#1#2{\catcode`#2\active
  \begingroup \lccode`\~=`#2\relax
  \lowercase{\endgroup#1~}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\mesjsetup{\begingroup \count@=12
  \def\do##1{\catcode`##1\count@ \do}%
  \xp@\do\otherchars{a11 \@gobbletwo}%
  \xp@\do\controlchars{a11 \@gobbletwo}%
  \xp@\do\highchars{a11 \@gobbletwo}%
  \actively\edef\^^I{ \space\space\space
    \space\space\space\space}%
  \endlinechar=`\^^M\actively\let\^^M=\relax
  \catcode`\{=1 \catcode`\}=2 }
\def\sendmesj{\newlinechar`\^^J%
  \actively\def\^^M{^^J}%
  \immediate\write\sixt@@n{\mesjtext}\endgroup}
\def\mesj{\mesjsetup \afterassignment\sendmesj
  \def\mesjtext}
\def\sendprompt{%
  \newlinechar`\!\relax \actively\def\^^M{!}%
  \message{\mesjtext}\endgroup}
\def\promptmesj{\mesjsetup
  \afterassignment\sendprompt \def\mesjtext}
\def\storemesj#1{\mesjsetup
  \catcode`\#=6 % to allow arguments if needed
  \afterassignment\endgroup
  \long\gdef#1}
\def\fmesj#1#2#{\mesjsetup
  \catcode`\#=6 % restore to normal
  \toks@{\long\gdef#1#2}%
  \def\@tempa{%
    \edef\@tempa{%
      \the\toks@{%
      \begingroup\def\nx@\mesjtext{\the\toks2 }%
        \nx@\sendmesj}%
    }%
    \@tempa
    \endgroup % Turn off the \mesjsetup catcodes
  }%
  \afterassignment\@tempa
  \toks2=}
\def\xmesjsetup{\mesjsetup
  \iffalse{\fi
  \catcode`\\=0 \catcode`\%=14
  \begingroup \lccode`\0=`\\\lccode`\1=`\{%
  \lccode`\2=`\}\lccode`\3=`\%%
  \lowercase{\endgroup \def\\{0}\def\{{1}%
    \def\}{2}\def\%{3}}%
  \iffalse}\fi
  \edef\&{\string &}%
  \actively\let\&=\noexpand
  \actively\let\^^M=\relax
  \def\.{}%
  \def\ { }\edef~{\string ~}%
  \begingroup \lccode`\~=`\^^M%
    \lowercase{\endgroup \def\^^M{~}}%
  \let\^^J\^^M \def\par{\^^M\^^M}%
}
\def\xmesj{\xmesjsetup \afterassignment\sendmesj
  \edef\mesjtext}
\def\promptxmesj{\xmesjsetup
  \afterassignment\sendprompt \edef\mesjtext}
\def\storexmesj#1#2#{\xmesjsetup
  \catcode`\#=6 % to allow arguments if needed
  \edef\#{\string##}%
  \afterassignment\endgroup
  \long\xdef#1#2}
\def\fxmesj#1#2#{\xmesjsetup
  \catcode`\#=6 % restore to normal
  \edef\#{\string##}%
  \toks@{\long\xdef#1#2}%
  \def\@tempa{%
    \edef\@tempa{%
      \the\toks@{\begingroup
      \def\nx@\nx@\nx@\mesjtext{\the\toks\tw@}%
      \nx@\nx@\nx@\sendmesj}}%
    \@tempa % execute the constructed xdef
    \endgroup % restore normal catcodes
  }%
  \afterassignment\@tempa
  \toks\tw@=}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\readline#1#2{%
  \begingroup \count@ 12 %
  \def\do##1{\catcode`##1\count@ \do}%
  \xp@\do\otherchars{a11 \@gobbletwo}%
  \xp@\do\controlchars{a11 \@gobbletwo}%
  \xp@\do\highchars{a11 \@gobbletwo}%
  \catcode`\ =10 \catcode`\^^I=10 %
  \catcode`\^^M=9 % ignore
  \endlinechar`\^^M
  \read\m@ne to#2%
  \edef#2{\def\nx@#2{#2}}%
  \xp@\endgroup #2%
  \ifx\@empty#2\def#2{#1}\fi
}
\def\xreadline#1#2{%
  \begingroup
    \xp@\let\csname bye\endcsname\relax
    \xp@\let\csname newif\endcsname\relax
    \xp@\let\csname newcount\endcsname\relax
    \xp@\let\csname newdimen\endcsname\relax
    \xp@\let\csname newskip\endcsname\relax
    \xp@\let\csname newmuskip\endcsname\relax
    \xp@\let\csname newtoks\endcsname\relax
    \xp@\let\csname newbox\endcsname\relax
    \xp@\let\csname newinsert\endcsname\relax
    \xp@\let\csname +\endcsname\relax
    \actively\let\^^L\relax
  \catcode`\^^M=9 % ignore
  \endlinechar`\^^M% reset to normal
  \read\m@ne to#2%
  \toks@\xp@{#2}%
  \edef\@tempa{\def\nx@#2{\the\toks@}}%
  \xp@\endgroup \@tempa
  \ifx\@empty#2\def#2{#1}\fi
}
\def\readchar#1#2{%
  \readline{#1}#2%
  \edef#2{\xp@\@car#2#1{}\@nil}%
}
\def\readChar#1#2{%
  \readline{#1}#2%
  \changecase\uppercase#2%
  \edef#2{\xp@\@car #2#1{}\@nil}%
}
\def\changecase#1#2{\@casetoks\xp@{#2}%
  \edef#2{#1{\def\nx@#2{\the\@casetoks}}}#2}
\newtoks\@casetoks
\def\checkinteger#1#2{\let\scansign@\@empty
  \def\scanresult@{#2}%
  \xp@\scanint#1x\endscan}
\def\scanint#1{%
  \ifodd 0#11 %
    \def\@tempa{\afterassignment\endscan
      \scanresult@=\scansign@#1}%
  \else
    \if -#1\relax
      \edef\scansign@{%
        \ifx\@empty\scansign@ -\fi}%
      \def\@tempa{\scanint}%
    \else
      \if +#1\relax
        \def\@tempa{\scanint}%
      \else % not a valid number
        \def\@tempa{%
          \scanresult@=-\maxdimen\endscan}%
  \fi\fi\fi
  \@tempa
}
\def\endscan#1\endscan{}
\newcount\dimenfirstpart
\newtoks\dimentoks
\def\scandimen#1{%
  \ifodd 0#11
    \def\@tempa{\def\@tempa{\scandimenb}%
      \afterassignment\@tempa
      \dimenfirstpart#1}%
  \else
    \if \if,#1.\else#1\fi.%
      \def\@tempa{\scandimenc}%
    \else
      \if -#1% then flipflop the sign
        \edef\scansign@{%
          \ifx\@empty\scansign@ -\fi}%
        \def\@tempa{\scandimen}%
      \else
        \if +#1% then ignore it
          \def\@tempa{\scandimen}%
        \else % not a valid dimen
          \def\@tempa{%
            \scanresult@=-\maxdimen\endscan}%
  \fi\fi\fi\fi
  \@tempa
}
\def\scandimenb#1{%
  \if \if,#1.\else#1\fi.%
    \def\@tempa{\scandimenc}%
  \else
    \def\@tempa{\scanunitsa#1}%
  \fi
  \@tempa
}
\def\scandimenc#1{%
  \ifodd 0#11 \dimentoks\xp@{%
      \the\dimentoks#1}%
    \def\@tempa{\scandimenc}%
  \else
  \def\@tempa{\scanunitsa#1}%
  \fi
  \@tempa
}
\def\scanunitsa#1\endscan{%
  \def\@tempa##1true##2##3\@tempa{##2}%
  \lowercase{%
    \xp@\ifx\xp@\end
    \@tempa#1true\end\@tempa
  }%
    \let\dimentrue@\@empty
    \def\@tempa{\scanunitsb#1\endscan}%
  \else
    \def\dimentrue@{true}%
    \def\@tempa##1true##2\@tempa{%
      \def\@tempa{##1}%
      \ifx\@tempa\@empty
        \def\@tempa{\scanunitsb##2\endscan}%
      \else
        \def\@tempa{\scanunitsb xx\endscan}%
      \fi}%
    \@tempa#1\@tempa
  \fi
  \@tempa
}
\def\scanunitsb#1#2{%
  \def\@tempa##1#1#2##2##3\@nil{##2}%
  \def\@tempb##1{T\@tempa
    pcTptTcmTccTemTexTinTmmTddTspT##1F\@nil}%
  \lowercase{%
  \if\@tempb{#1#2}%
  }%
   \scanresult@=\scansign@
     \number\dimenfirstpart.\the\dimentoks
     \dimentrue@#1#2\relax
  \else
    \scanresult@=-\maxdimen
  \fi
  \endscan
}
\def\checkdimen#1#2{%
  \let\scansign@\@empty \def\scanresult@{#2}%
  \let\dimentrue@\@empty
  \dimenfirstpart\z@ \dimentoks{}%
  \xp@\scandimen#1xx\endscan
}
\restorecatcodes
%%% ====================================================================
%%%  @LaTeX-style-file{
%%%     filename        = "menus.dtx",
%%%     version         = "1.99a",
%%%     date            = "2013/01/24",
%%%     author          = "Michael Downes",
%%%     copyright       = "This file is part of the dialogl package, released
%%%                        under the LPPL; see dialogl.ins for details."
%%%     keywords        = "TeX, menus",
%%%     supported       = "no",
%%%     abstract        = "This file provides functions for writing
%%%       messages and menus on screen, and reading user responses. It
%%%       can be used with LaTeX as a documentstyle option, or in
%%%       other forms of TeX by a standard \input statement.",
%%%  }
%%% ====================================================================
\localcatcodes{\@{11}%
  \~{13}\"{12}\#{6}\^{7}\`{12}\${3}\:{12}}
\storexmesj\menuprefix{
======================================================================
}
\let\menusuffix=\menuprefix
\storemesj\inmenuA{
}
\storemesj\inmenuB{
}
\storemesj\menuline{  }
\def\menutopline{}
\def\menubotline{}
\storemesj\endmenuline{
}%
\def\menunumber#1{[#1] }
\def\menuprompt{\promptmesj{Your choice? }}
\newtoks\menufirstpart
\newtoks\menuchoices
\newtoks\menulastpart
\def\fmenu#1#2#{\mesjsetup
  \catcode`\#=6 % for parameters
  \toks@{\fxmenub{\gdef}{\begingroup}{}#1{#2}}%
  \def\@tempa##1##{%
    \def\@tempa####1####{%
      \def\@tempa{\the\toks@}%
      \afterassignment\@tempa \menulastpart}%
    \afterassignment\@tempa \menuchoices}%
  \afterassignment\@tempa \menufirstpart
}
\begingroup % localize \lccode change
\lccode`\~=`\^^M
\lowercase{%
\long\gdef\stripM#1$~#2#3\stripM#4{%
  \ifx$#2%
    \stripMa#1\stripMa#4%
  \else
    \stripMb#2#3\stripMb#4%
  \fi
}
}% end lowercase
\lowercase{%
\long\gdef\stripMa $#1\stripMa#2{%
  \stripMb#1$~$$\stripMb#2}
}% end lowercase
\lowercase{%
\long\gdef\stripMb#1~$#2#3\stripMb#4{%
  \ifx$#2%
    \stripMc#1\stripMc#4%
  \else
    \stripMd#1\stripMd#4%
  \fi
}
}% end lowercase
\long\gdef\stripMc#1$#2\stripMc#3{%
  \stripMd#1\stripMd#3}
\long\gdef\stripMd#1\stripMd#2{#2{#1}}
\endgroup
\begingroup \lccode`\~=`\^^M
\lowercase{%
\gdef\stripcontrolMs#1{\xp@\stripM
  \xp@$\the#1$~$$\stripM#1}
}% end lowercase
\lowercase{%
\gdef\addmenulines#1#2#3{%
  \def ~##1~##2{%
    #1\xp@{\the#1#2##1#3}%
    \ifx\end##2\xp@\@gobbletwo\fi~##2}%
  \edef\@tempa{\nx@~\the#1\nx@~}#1{}%
  \@tempa\end}
}% end lowercase
\endgroup % restore lccode of ~
\def\fxmenub#1#2#3#4#5{%
  \stripcontrolMs\menufirstpart
  \stripcontrolMs\menulastpart
  \stripcontrolMs\menuchoices
  \addmenulines\menuchoices\menuline\endmenuline
  \actively\let\^^M\relax % needed for \xdef
  \toks@{\long#1#4#5}% e.g. \xdef\foo##1##2
  \edef\@tempa{\the\menufirstpart}%
  \ifx\@tempa\@empty
    \let\nxa@\@gobble
  \else
    \addmenulines\menufirstpart
      \menutopline\endmenuline
    \let\nxa@\nx@
  \fi
 \edef\@tempa{\the\menulastpart}%
  \ifx\@tempa\@empty
    \let\nxb@\@gobble
  \else
    \addmenulines\menulastpart
      \menubotline\endmenuline
    \let\nxb@\nx@
  \fi
\edef\@tempa{{#3\nx@#3#2%
    \def#3\nx@#3\mesjtext{%
      #3\nx@#3\menuprefix
      \the\menufirstpart #3\nxa@#3\inmenuA
      \the\menuchoices #3\nxb@#3\inmenuB
      \the\menulastpart #3\nx@#3\menusuffix}%
    #3\nx@#3\sendmesj
    #3\nx@#3\menuprompt}}%
  \toks2 \xp@{\@tempa}%
  \edef\@tempa{\the\toks@\the\toks2 }%
  \let\menutopline\relax \let\menuline\relax
  \let\menubotline\relax \let\endmenuline\relax
  \let\menunumber\relax
  \@tempa % finally, execute the \gdef or \xdef
  \endgroup % matches \mesjsetup done by \fxmenu
}% end \fxmenub
\def\fxmenu#1#2#{\xmesjsetup
  \toks@{\fxmenub{\xdef}{\xmesjsetup}\nx@#1{#2}}%
  \def\@tempa##1##{%
    \def\@tempa####1####{%
      \def\@tempa{\the\toks@}%
      \afterassignment\@tempa \menulastpart}%
    \afterassignment\@tempa \menuchoices}%
  \afterassignment\@tempa \menufirstpart
}
\def\notyet#1{%
  \errmessage{Not yet implemented:  \string#1}}
\long\def\nmenu#1#2#3#4#5{\notyet\nmenu}
\long\def\nxmenu#1#2#3#4#5{\notyet\nxmenu}
\newtoks\optionstack
\let\curmenu\@empty
\let\estart\relax
\let\eend\relax
\def\pushoptions#1{%
  \edef\pushtemp{\estart
    \def\nx@\curmenu{\curmenu}%
    \eend
    \the\optionstack}%
  \global\optionstack\xp@{\pushtemp}%
  \edef\curmenu{\curmenu#1}%
}
\def\popoptions{%
  \edef\@tempa{\the\optionstack}%
  \ifx\@empty\@tempa
    \errmessage{Can't pop empty stack
      (\string\optionstack)}%
  \else
    \def\estart##1\eend##2\@nil{%
      \global\optionstack{##2}%
      \let\estart\relax##1}%
    \the\optionstack\@nil
  \fi
}
\fmesj\moptionX{Exiting . . .}
\def\repeatoption{%
  \csname moption\curmenu\endcsname}
\def\moptionQ{\popoptions \repeatoption}
\fxmesj\badoptionmesj#1{%
?---I don't understand "#1".}
\def\optionexec#1{%
  \if ?#1\relax \let\@tempa\moptionhelp
  \else \if Q#1\relax
    \ifx\curmenu\@empty \let\@tempa\moptionX
    \else \let\@tempa\moptionQ \fi
  \else \if X#1\relax \let\@tempa\moptionX
  \else
    \xp@\let\xp@\@tempa
      \csname moption\curmenu#1\endcsname
    \ifx\@tempa\relax
      \badoptionmesj{#1}\let\@tempa\repeatoption
    \else
      \pushoptions{#1}%
    \fi
  \fi\fi\fi
  \@tempa
}
\def\optionfileexec#1{\notyet\optionfileexec}
\def\xoptiontest#1{TT\fi
  \begingroup \def\0{?}\def\1{Q}%
  \def\2{q}\def\3{x}\def\4{X}%
    \aftergroup\if\aftergroup T%
    \ifx\0#1\aftergroup T%
    \else\ifx\1#1\aftergroup T%
    \else\ifx\2#1\aftergroup T%
    \else\ifx\3#1\aftergroup T%
    \else\ifx\4#1\aftergroup T%
    \else \aftergroup F%
    \fi\fi\fi\fi\fi
  \endgroup
}
\fxmesj\menuhelpmesj{&\menuprefix%
A response of Q will usually send you back to %
the previous menu.
A response of X will get you entirely out of %
the menu system.
&\menusuffix%
Press the <Return> key ( Enter ) to continue:
}
\def\moptionhelp{%
  \menuhelpmesj \readline{}\reply \repeatoption}
\def\moptionhelp{%
  \menuhelpmesj \readline{}\reply \repeatoption}
\xp@\def\csname moption?\endcsname{%
  \moptionhelp}
\def\specialhelp#1#2{%
  \let\specialhelpreply=#1\def#1{?}\begingroup
  \def\menuhelpmesj{\let#1\specialhelpreply
    \promptxmesj{#2\
Press <return> to continue:}\endgroup}%
}
\def\specialhelpreply{}
\def\lettermenu#1{%
  \csname menu#1\endcsname
  \readChar{Q}\reply \optionexec\reply
}
\restorecatcodes
%%% ====================================================================
%%%  @TeX-file{
%%%     filename        = "listout.dtx",
%%%     version         = "1.99a",
%%%     date            = "2013/01/24",
%%%     author          = "Michael Downes",
%%%     copyright       = "This file is part of the dialogl package, released
%%%                        under the LPPL; see dialogl.ins for details."
%%%     keywords        = "tex, verbatim",
%%%     abstract        = "The purpose of this macro file is to print
%%%       verbatim listings of arbitrary text files, fitting as much
%%%       text per sheet of paper as possible. The default settings
%%%       are for US letter size paper 8.5 x 11 inches, two `pages'
%%%       per sheet, landscape mode, but extensive customization
%%%       facilities are provided. To conserve even more paper, you
%%%       should take advantage of any two-sided capabilities your
%%%       printer may happen to have.",
%%%  }
%%% ====================================================================
\localcatcodes{\@{11}\~{13}\"{12}\:{12}}
\def\xmeaning#1{\xp@\xmeaningtrim\meaning#1}
\def\xmeaningtrim#1->{}
\def\TRUE{TT}
\def\FALSE{TF}
\def\@empty{}
\def\@iden#1{#1}
\def\datesepchar{ }
\let\keepleadingzeros\FALSE
\def\twodigits#1{\ifnum#1<10 0\fi
  \xp@\@iden\xp@{\number#1}}
\edef\themonth{\number\month}
\edef\theday{\number\day}
\edef\theyear{\number\year}
\edef\yearmodC{\xp@\@gobbletwo\number\year}
\def\Jan{January}   \def\Feb{February}
\def\Mar{March}     \def\Apr{April}
\def\May{May}       \def\Jun{June}
\def\Jul{July}      \def\Aug{August}
\def\Sep{September} \def\Oct{October}
\def\Nov{November}  \def\Dec{December}
\def\datesetup{%
  \edef\themonthname{%
    \ifcase\month ?% case 0---THIS CAN'T HAPPEN
    \or\Jan\or\Feb\or\Mar\or\Apr\or\May\or\Jun
    \or\Jul\or\Aug\or\Sep\or\Oct\or\Nov\or\Dec
    \else ?\fi}%
  \def\do##1##2##3##4\od{##1##2##3}%
  \edef\themon{\xp@\do\themonthname\od}%
  \let\theMON\themon \changecase\uppercase\theMON
  \if\keepleadingzeros
    \edef\themonth{\twodigits\month}%
    \edef\theday{\twodigits\day}%
  \else
    \edef\themonth{\number\month}%
    \edef\theday{\number\day}%
  \fi
}
\datesetup
\def\dateA{%
  \theyear\datesepchar\themonth\datesepchar\theday}
\def\dateB{%
  \yearmodC\datesepchar\themonth\datesepchar\theday}
\def\dateC{%
  \themonth\datesepchar\theday\datesepchar\yearmodC}
\def\dateD{%
  \themonth\datesepchar\theday\datesepchar\theyear}
\def\dateE{%
  \theday\datesepchar\themon\datesepchar\yearmodC}
\def\dateF{%
  \theday\datesepchar\themon\datesepchar\theyear}
\def\dateG{%
  \theday\datesepchar\theMON\datesepchar\yearmodC}
\def\dateH{%
  \theday\datesepchar\theMON\datesepchar\theyear}
\def\dateI{%
  \themonthname\space\number\day, \theyear}
\def\dateJ{%
  \theday\datesepchar\themonthname\datesepchar\theyear}
\def\todaysdate{\dateJ}
\count@=\time \divide\count@ 60
\edef\thehour{\twodigits\count@}
\multiply\count@ -60 \advance\count@\time
\edef\theminute{\twodigits\count@}
\def\ampmpunct{.}
\count@=\thehour\relax
\ifnum\count@>11 \def\ampm{p}%
  \ifnum\count@>12
    \begingroup \advance\count@ -12
      \aftergroup\edef\aftergroup\thehourmodtwelve
      \aftergroup{\xp@
    \endgroup \number\count@}%
  \else
    \edef\thehourmodtwelve{12}%
  \fi
\else
  \def\ampm{a}%
  \ifnum\count@=0 \count@=12 \fi
  \edef\thehourmodtwelve{\number\count@}%
\fi
\let\AMPM\ampm \changecase\uppercase\AMPM
\def\midnoon#1{\ifnum\time=0 midnight\else
  \ifnum\time=720 noon\else#1\fi\fi}
\def\timesepchar{:}
\def\timeA{\thehour\theminute}
\def\timeB{\thehour\timesepchar\theminute}
\def\timeC{\thehourmodtwelve\timesepchar\theminute
  \space\midnoon{\ampm m}}
\def\timeD{\thehourmodtwelve\timesepchar\theminute
  \space\midnoon{\ampm\ampmpunct m\ampmpunct}}
\def\timeE{\thehourmodtwelve\timesepchar\theminute
  \space\midnoon{\AMPM M}}
\def\timeF{\thehourmodtwelve\timesepchar\theminute
  \space\midnoon{\AMPM\ampmpunct M\ampmpunct}}
\def\nowtime{\timeB}
\chardef\curcol=1
\chardef\totalcols=2
\countdef\firstpageno=1
\countdef\lastpageno=2
\newbox\prevcolsbox
\newdimen\paht \newdimen\pawd
\newdimen\fullwd
\newdimen\colwd
\let\dependentcolwd\TRUE
\newdimen\leftmargin
\newdimen\rightmargin
\let\dependentrightmargin\TRUE
\def\computerfc{\relax \rightmargin=\leftmargin
  \computefc }
\def\computefc{\fullwd=\pawd
  \advance\fullwd-\leftmargin
  \advance\fullwd-\rightmargin
  \colwd\fullwd
  \advance\colwd \intercolspace
  \divide\colwd \totalcols
  \advance\colwd -\intercolspace
  \edef\columnwidth{\the\colwd}%
}
\def\computefr{\fullwd\colwd
  \advance\fullwd \intercolspace
  \multiply\fullwd \totalcols
  \advance\fullwd -\intercolspace
  \rightmargin\pawd
  \advance\rightmargin-\leftmargin
  \advance\rightmargin-\fullwd
}
\newdimen\colht
\newdimen\intercolspace \newdimen\overrun
\newdimen\runheadht \newdimen\runfootht
\newdimen\bottommargin \newdimen\topmargin
\def\computebc{\bottommargin=\topmargin \computec}
\def\computec{%
  \colht\paht \advance\colht -\topmargin
  \advance\colht -\bottommargin
  \advance\colht -\runheadht
  \advance\colht -\runfootht
  \roundcolht
  \bottommargin\paht
  \advance\bottommargin -\topmargin
  \advance\bottommargin -\colht
}
\def\roundcolht{%
  \advance\colht .5\baselineskip
  \divide\colht\baselineskip
  \edef\columnheight{\number\colht\space lines}%
  \multiply\colht\baselineskip
  \advance\colht\topskip
  \advance\colht -\baselineskip
}
\let\dependentcolht\TRUE
\let\dependentbottommargin\TRUE
\def\computeb{%
  \roundcolht
  \bottommargin\paht
  \advance\bottommargin -\topmargin
  \advance\bottommargin -\colht
}
\ifx\UndEFiNed\pageno \countdef\pageno=0 \fi
\def\pagenumber{[\number\pageno]\thinspace{%
  \csname\pagenumberfont
    \pagenumberfontsize\endcsname
  \number\lastpageno}}
\let\landscape=\TRUE
\def\pagenumbermessage{%
  \ifnum\totalcols>\@ne
    \message{%
Printing `pages' \the\firstpageno--\the\lastpageno
\space on \if\landscape landscape \fi sheet
\the\pageno}%
  \fi}
\def\Ncols{\relax
  \ifnum\curcol=\totalcols
    \pagenumbermessage
    \shipout\hbox to\fullwd{%
      \unhbox\prevcolsbox\curcolbox}%
    \global\advance\pageno\@ne
    \global\chardef\curcol \z@
    \ifnum\totalcols>\@ne
      \global\advance\lastpageno \@ne
      \global\firstpageno\lastpageno
    \fi
  \else
    \global\setbox\prevcolsbox\hbox{%
      \unhbox\prevcolsbox\curcolbox
      \hskip\intercolspace plus1fil\relax}%
    \ifnum\totalcols>\@ne
      \global\advance\lastpageno \@ne
    \fi
  \fi
  \edef\next{\global\mathchardef\curcol=
    \ifcase\curcol
      1\or 2\or 3\or 4\or 5\or 6\or 7\or 8\or 9\or
      10\or 11\or 12\or 13\or 14\or 15\or 16\or
      17\or 18\or 19\or 20%
    \else "7FFF\fi\relax
  }%
  \next
}
\newtoks\runhead \newtoks\runfoot
\def\loheadline#1{\relax
  \if\ifdim#1=\colwd T\else
     \ifnum\curcol=\@ne T\else F\fi\fi T%
    \vbox to\runheadht{\rlap{\hbox to#1{%
      \csname\runheadfont\runheadfontsize\endcsname
      \the\runhead}}\vss}%
    \nointerlineskip
  \fi
}
\def\lofootline#1{\relax
  \if \ifdim#1=\colwd T\else
      \ifnum\curcol=1 T\else F\fi\fi T%
    \nointerlineskip
    \vbox to\runfootht{\vfil\rlap{\hbox to#1{%
      \csname\runheadfont\runheadfontsize\endcsname
      \the\runfoot}}\kern-\prevdepth
      \vfilneg\vss}%
  \fi
}
\def\setupheadlineandfootline{%
  \gdef\hfwd{\colwd}%
  \if\runheads
    \setbox\z@\hbox{%
      \csname\runheadfont\runheadfontsize\endcsname
      \the\runhead}%
    \ifdim\wd\z@>\colwd \gdef\hfwd{\fullwd}\fi
  \fi
  \if\runfeet
    \setbox\z@\hbox{%
      \csname\runfootfont\runfootfontsize\endcsname
      \the\runfoot}%
    \ifdim\wd\z@>\colwd \gdef\hfwd{\fullwd}\fi
  \fi
  \if\runheads
    \if\runfeet
      \gdef\curcolbox{\vtop{\loheadline\hfwd
        \vbox to\vsize{\unvbox255 \vss}%
        \lofootline\hfwd}}%
    \else
      \gdef\curcolbox{%
        \vtop{\loheadline\hfwd \vtop{\unvbox255 }}}%
    \fi
  \else
    \if\runfeet
      \gdef\curcolbox{\vtop{\null\nointerlineskip
        \vbox to\vsize{\unvbox255 \vss}%
        \lofootline\hfwd}}%
    \else
      \gdef\curcolbox{%
        \vtop{\null\unvbox255 }}%
    \fi
  \fi
}
\newbox\tableaderbox
\chardef\spacespertab=8
\newdimen\tabwidth
\def\printtaba{%
  \hfil\egroup
  \setbox\z@\hbox{\unhbox\z@ \unskip}%
  \dimen@\wd\z@ \divide\dimen@\tabwidth
  \multiply\dimen@\tabwidth
  \advance\dimen@\tabwidth
  \advance\dimen@ -\wd\z@
  \setbox\z@\hbox to \hsize\bgroup \unhbox\z@
    \spacebreak\hbox to\dimen@{%
      \leaders\copy\tableaderbox\hfil}%
}
\def\newfileprinttab{\printtaba
  \message{%
Say, this file contains a tab character}%
  \global\let\printtab\printtaba}
\let\printtab=\newfileprinttab
\newdimen\charwidth
\def\inittabs{%
  \setbox\z@\hbox{m}\charwidth\wd\z@
  \tabwidth\spacespertab\charwidth
  \ifcase\tabselect % case 0: blank tabs option.
    \setbox\tableaderbox\hbox to\charwidth{}%
  \or % case 1: dots option.
    \setbox\tableaderbox\hbox to.2em{%
        \hskip\z@ plus2\p@ minus3\p@
        \mathhexbox 201% \cdot character
        \kern.1em }%
  \or % case 2: dashed option.
    \setbox\tableaderbox\hbox to.3em{%
        \hskip-.1em plus2sp minus2sp%
        \vrule width.25em height.25em\kern.15em }%
  \or % case 3: hrule option.
    \setbox\tableaderbox\hbox{%
      \vrule width\charwidth height2\p@ depth-1.5\p@}%
  \else % case 4: tiny TAB option.
    \setbox\tableaderbox\hbox to.5em{\hss
        \vbox to6\p@{%
          \offinterlineskip\csname roman5\endcsname
          \hbox to7\p@{T\hss}\vss
            \hbox to7\p@{\hss\kern-.1em A\hss}\vss
          \hbox to7\p@{\hss B}\kern-2\p@}%
        \hss}%
  \fi
  \let\printtab\newfileprinttab
 }
\def\tabstyle{\ifcase\tabselect blank space\or
  dots\or dashed lines\or horizontal rules\else
  tiny TABs\fi}
\newdimen\charboxsidekern
\charboxsidekern=.3pt
\newbox\charboxstrut
\def\characterbox#1{%
  \hbox to.5em{\hss
    \dimen@.22\p@ \dimen@ii -.11\p@
    \vrule width\dimen@ \kern\dimen@ii
    \vbox{\hrule height\dimen@
      \kern\charboxsidekern
      \hbox{\kern\charboxsidekern
        #1\kern\charboxsidekern
        \copy\charboxstrut}%
      \dimen4 \prevdepth
      \advance\dimen4 \charboxsidekern
      \advance\dimen@ \dimen4
      \hrule depth\dimen@ height -\dimen4
    }%
    \kern\dimen@ii\vrule width\dimen@\hss}}
\def\controlchara#1{%
  \message{Warning:
Invisible control character, printing boxed letter}%
  \characterbox{#1}%
  \gdef\controlchar##1{%
    \message{@}\characterbox{##1}}%
}
\def\controlchar{\controlchara}
\newtoks\controlcharassignments
\begingroup
\def\do#1{\count@=`#1 \next \do}
\def\next{\lccode`\~=\count@ \advance\count@ 64
  \ifnum\count@>127 \advance\count@ -128 \fi
  \lccode`\.=\count@
  \lowercase{\let~\relax
    \global\controlcharassignments\xp@{%
    \the\controlcharassignments
    \def~{\controlchar{.}}}}%
}
\xp@\do\controlchars{a \@gobbletwo}
\endgroup
\def\unknownchara{%
  \xmesj{Warning: Unspecified character
    (system-dependent interpretation);\
    printing question mark instead}%
  \characterbox{?}%
  \gdef\unknownchar{\message{?}\characterbox{?}}%
}
\def\unknownchar{\unknownchara}
\def\eightbitaction{B}
\newtoks\highASCIIassignments
\newtoks\highBSCIIassignments
\highASCIIassignments{%
  \def\do{\catcode\count@=12 \advance\count@\@ne
    \ifnum\count@>\@cclv \expandafter\@gobble\fi\do}%
  \count@=128 \do}
\begingroup
\def\do{%
  \global\catcode\count@\active
  \lccode`\~\count@
  \lowercase{\global\highBSCIIassignments
    \xp@{\the\highBSCIIassignments
      \def~{\unknownchar}}}%
  \ifnum\count@<255\relax
    \advance\count@ 1\relax
    \xp@\do % tail recursion
  \fi}
\count@=128\relax \do \endgroup
\def\thisfilename{??}
\let\printtitles=\TRUE
\def\@dogobble#1\do{}
\def\nonttfont#1{%
  \def\do##1{\mathcode`##1`##1 \do}%
  \xp@\do\otherchars{.`.\relax \@dogobble}%
  \mathcode`\<"268 \mathcode`\>"269
  \mathcode`\\"26E \mathcode`\_"8000
  \mathcode`\{"266 \mathcode`\|"26A
  \mathcode`\}"267 \mathcode`\~"218
  \mathcode`\""8000
  \actively\def\_{%
    \leavevmode\kern.06em\vbox{%
      \hrule width.4em height.06em}}%
  \actively\def\"{^{\prime\prime}}%
  \textfont\z@
    \csname\titlefont\titlefontsize\endcsname
    \everymath{}\mathsurround\z@
  $\fam\z@#1$%
}
\escapechar=-1
\edef\DOSdirsepchar{\string\\}
\escapechar=`\\
\def\Macintoshdirsepchar{:}
\def\Unixdirsepchar{/}
\xp@\def\csname VAX/VMSdirsepchar\endcsname{]}
\def\chopname#1{%
  \edef\dirsepchar{%
    \csname\systemtype dirsepchar\endcsname}%
  \edef\@tempa{%
    \def\nx@\do####1\dirsepchar}%
  \@tempa
  ##2{%
    \toks@\xp@{\next@}%
    \ifx\end##2% then just add ##1 at the end
      \edef\next@{\the\toks@##1}%
    \else
      \edef\next@{\the\toks@##1%
        \dirsepchar\nx@\allowbreak}%
      \afterfi\do##2%
    \fi
  }%
  \edef\@tempa{\toks@{}\def\nx@\next@{}%
    \nx@\do#1\dirsepchar\nx@\end}%
  \@tempa
  \let#1\next@
  \ifx\@empty\dirprefix
  \else
    \edef#1{\xmeaning\dirprefix\allowbreak#1}%
  \fi
}
\def\printtitle{%
  \bigskip
  \centerline{%
    \csname\titlefont\titlefontsize\endcsname
    \chopname\thisfilename
    \ifdim\fontdimen3\font=\z@
      \csname\titlecase\endcsname
        \xp@{\thisfilename}%
    \else
      \csname\titlecase\endcsname
        \xp@{\xp@
        \nonttfont\xp@{\thisfilename}}%
    \fi
  }% end \centerline
  \if S\newfileoption \smallskip
  \else\bigskip\fi
}
\def\newfileoption{P}
\def\newfileS{%
  \dimen@\pagegoal \advance\dimen@-\pagetotal
  \ifdim\dimen@<3\baselineskip
  \xp@\eject\fi
}
\def\newfileC{\vfil\eject}
\def\newfileP{%
  \vfil\eject
  \loop
  \ifnum\curcol>\@ne
    \hbox to\colwd{%
          \vrule width\z@ depth\vsize\hfil}%
    \eject
  \repeat
}
\def\newfileR{\vfil\eject
  \ifnum\curcol=\@ne
    \hbox to\colwd{%
      \vrule width\z@ depth\vsize\hfil}%
  \xp@\eject
  \fi
}
\newcount\linenumberfreq \linenumberfreq=1
\newcount\linecount
\newcount\linesubcount
\def\printlinenumber{\llap{%
  \global\advance\linecount\@ne
  \global\advance\linesubcount\@ne
  \ifnum\linesubcount=\linenumberfreq
    \lnfnt \the\linecount\space
    \global\linesubcount\z@
  \fi
}}%
\def\spacebreak{}
\def\markedbreak{\penalty\z@}
\let\noextralinebreaks=\TRUE
\def\newunnumberedline{\hskip\rightskip \egroup
  \box\z@ \controlLbreak
  \setbox\z@\hbox to\hsize\bgroup}%
\def\newnumberedline{%
  \newunnumberedline\printlinenumber}%
\def\unnumberedbreakingline{\relax
  \ifnum\lastpenalty=\@ne \null\fi
  \hskip\rightskip\egroup
  \hfuzz \p@
  \noindent\unhbox\z@ %
  {\hangindent1em
  \parfillskip\z@ plus1fil \endgraf}%
  \hfuzz\maxdimen
  \controlLbreak
  \setbox\z@\hbox to\hsize\bgroup \penalty\@ne
}%
\def\numberedbreakingline{%
  \unnumberedbreakingline\printlinenumber}
\lowercase{\let\@sptoken= } %
\let\CR\newunnumberedline
\def\CRSPsetup{%
  \setupbreakingchars
  \if\noextralinebreaks
    \overrun\rightmargin
    \actively\let\ = \@sptoken\relax
    \if\linenumbers
      \let\CR\newnumberedline
    \else
      \let\CR\newunnumberedline
    \fi
  \else
    \actively\edef\ {\spacebreak\space}%
    \if\linenumbers
      \let\CR\numberedbreakingline
    \else
      \let\CR\unnumberedbreakingline
    \fi
  \fi
  \actively\let\^^M\CR
  \rightskip\z@ plus\hsize minus\overrun
  \parfillskip\z@skip
}
\def\listout#1{\endgraf
  \begingroup
  \listoutsetup
  \gdef\thisfilename{#1}%
  \xdef\thisfilename{\xmeaning\thisfilename}%
  \if\printtitles \printtitle \fi
  \listoutmoresetup
  \CRSPsetup
  \hfuzz\maxdimen
  \setbox\z@\hbox to\hsize\bgroup \penalty\@ne
  \input#1 \hfil\egroup
  \hfuzz\p@
  \penalty0 %
  \csname newfile\newfileoption\endcsname
  \ifvoid\prevcolsbox
  \else
    \savelistoutimage
  \fi
  \endgroup }
%%    Restore the previous output routine. Interestingly,
%%    \cw{the}\cw{output} returns an extra pair of braces
%%    (as hinted at in the \tex/book); so the extra step
%%    with \cw{toks@} here is slightly better than simply
%%    \cw{global}\cw{output}{\cw{the}\cw{output}}.
%%\showthe\output
\def\savelistoutimage{%
  \xdef\listoutimage{%
    \let\nx@\landscape%
      \if\landscape\nx@\TRUE
      \else\nx@\FALSE\fi
    \pawd\the\pawd \paht\the\paht
    \topmargin\the\topmargin
    \bottommargin\the\bottommargin
    \leftmargin\the\leftmargin
    \rightmargin\the\rightmargin
    \normalbaselineskip\the\normalbaselineskip
    \normalbaselines
    \mathchardef\curcol\number\curcol\relax
    \chardef\totalcols\number\totalcols\relax
    \colwd\the\colwd \colht\the\colht
    \fullwd\the\fullwd
    \intercolspace\the\intercolspace
    \overrun\the\overrun
    \def\nx@\todaysdate{\todaysdate}%
    \def\nx@\nowtime{\nowtime}%
    \def\nx@\pagenumberfont{\pagenumberfont}%
    \def\nx@\pagenumberfontsize{%
      \pagenumberfontsize}
    \pageno\the\pageno
    \lastpageno\the\lastpageno
    \firstpageno\the\firstpageno
    \def\nx@\hfwd{\hfwd}%
    \def\nx@\thisfilename{\thisfilename}%
    \let\nx@\runheads%
      \if\runheads\nx@\TRUE
      \else\nx@\FALSE\fi
    \runhead{\the\runhead}%
    \def\nx@\runheadfont{\runheadfont}%
    \def\nx@\runheadfontsize{%
      \runheadfontsize}%
    \runheadht\the\runheadht
    \let\nx@\runfeet%
      \if\runfeet\nx@\TRUE
      \else\nx@\FALSE\fi
    \runfoot{\the\runfoot}%
    \def\nx@\runfootfont{\runfootfont}%
    \def\nx@\runfootfontsize{%
      \runfootfontsize}%
    \runfootht\the\runfootht
    \hoffset\the\hoffset \voffset\the\voffset
    \relax
  }%
}
\fxmesj\reportlayout{
Using paper size &\the&\pawd x &\the&\paht%
 (&\paperwidth x &\paperheight),
&\number&\totalcols columns, intercolumnspace%
 = &\the&\intercolspace,
column width = &\the&\colwd, column height%
 = &\the&\colht,
top margin = &\the&\topmargin, left margin%
 = &\the&\leftmargin.
}
\def\listoutsetup{%
  \output{\Ncols}%
  \loadfonts
  \csname\mainfont\mainfontsize\endcsname
  \xp@\let\xp@\lnfnt
     \csname\linenumberfont
       \linenumberfontsize\endcsname
  \normalbaselines
  \if\dependentcolht
    \if\dependentbottommargin \computebc
    \else \computec\fi
  \else
    \computeb
  \fi
  \vsize\colht
  \parskip \z@\relax
  \if\dependentcolwd
    \if\dependentrightmargin \computerfc
    \else \computefc \fi
  \else
    \computefr
  \fi
  \hsize\colwd
  \parindent\z@
  \ifdim\overfullrule>\z@ \overfullrule 2\p@\fi
  \setupheadlineandfootline
  \datesetup
  \voffset\m@ne truein \hoffset\voffset
  \advance\voffset\topmargin \advance\hoffset\leftmargin
  \setbox\charboxstrut\hbox{%
    \vrule height.5emwidth\z@}%
  \inittabs
  \clubpenalty\@M \widowpenalty\@M
  \count@12\relax
  \def\do##1{\catcode`##1\count@ \do}%
  \xp@\do\otherchars{a11 \@gobbletwo}%
  \count@\active
  \xp@\do\controlchars{a11 \@gobbletwo}%
  \the\controlcharassignments
  \global\let\controlchar\controlchara
  \if L\controlLaction
    \actively\let\^^L\linespaceL
  \else
    \if N\controlLaction
      \actively\let\^^L\ejectL
    \fi
  \fi
  \the\csname high\eightbitaction SCIIassignments\endcsname
  \global\let\unknownchar\unknownchara
  \actively\def\`{\kern\z@`}%
  \hfuzz\p@
}
\def\linespaceL{\message{Found a ^L character}\CR}
\def\ejectL{%
  \message{Found a ^L character}%
  \gdef\controlLbreak{\eject}\CR\global\let\controlLbreak\relax
}
\let\controlLbreak\relax
\def\controlLaction{N}
\actively\let\^^L=\ejectL
\def\listoutmoresetup{%
  \global\linecount\z@ \global\linesubcount\z@
  \ifnum\totalcols>\@ne
    \global\firstpageno\@ne
    \global\lastpageno\@ne
  \fi
  \relax
  \frenchspacing
  \global\let\printtab\newfileprinttab
  \actively\def\^^I{\printtab}%
  \langnohyphens
}
\def\DVImesj{}
\fxmesj\landscapereminder{%
********************************************%
***********************
*     REMINDER: print in LANDSCAPE mode     %
                      *
********************************************%
***********************}
\def\listoutfinish{%
  \ifvoid\prevcolsbox
  \else
    \wlog{Clearing out previous file}%
    \begingroup
    \listoutimage \output{\Ncols}%
    \def\newfileoption{P}%
    \hbox to\colwd{}%
    \csname newfile\newfileoption\endcsname
    \DVImesj
    \if\landscape
      \landscapereminder
    \fi
    \endgroup
  \fi
}
\def\xfont#1={%
  \xp@\font\csname#1\endcsname=}
\def\ftypewriter{cmtt}
\def\fbold{cmbx}
\def\froman{cmr}
\def\fitalic{cmti}
\def\fsansserif{cmss}
\def\loadfont#1#2{%
  \relax\ifnum#2>100 \loadscaledfont{#1}{#2}%
  \else
    \global\xfont#1#2=\csname f#1\endcsname
    \ifnum#2=14 10 scaled\magstep2
    \else\ifnum#2=12 10 scaled\magstep1
    \else\ifnum#2=11 10 scaled\magstephalf
    \else#2\fi\fi\fi
    \relax
  \fi
}
\def\loadscaledfont#1#2{\global\xfont#1#2=#1 scaled #2\relax}
\loadfont{typewriter}{8} % for main text
\loadfont{bold}{10} % for titles
\loadfont{roman}{5} % for line numbers
\loadfont{roman}{6} % for running heads
\def\mainfont{typewriter}
\def\mainfontsize{8}
\csname\mainfont\mainfontsize\endcsname
\def\titlefont{bold}
\def\titlefontsize{10}
\def\linenumberfont{typewriter}
\def\linenumberfontsize{8}
\def\pagenumberfont{bold}
\def\pagenumberfontsize{7}
\def\runheadfont{roman}
\def\runheadfontsize{7}
\def\runfootfont{roman}
\def\runfootfontsize{7}
\def\loadfonts{\relax
  \xp@\ifx\csname\mainfont\mainfontsize\endcsname\relax
    \loadfont\mainfont\mainfontsize
  \fi
  \xp@\ifx\csname\pagenumberfont
        \pagenumberfontsize\endcsname\relax
    \loadfont\pagenumberfont\pagenumberfontsize
  \fi
  \if\printtitles
    \xp@\ifx\csname\titlefont
          \titlefontsize\endcsname\relax
      \loadfont\titlefont\titlefontsize
    \fi
  \fi
  \if\linenumbers
    \xp@\ifx\csname\linenumberfont
          \linenumberfontsize\endcsname\relax
      \loadfont\linenumberfont\linenumberfontsize
    \fi
  \fi
  \if\runheads
    \xp@\ifx\csname\runheadfont
          \runheadfontsize\endcsname\relax
      \loadfont\runheadfont\runheadfontsize
    \fi
  \fi
  \if\runfeet
    \xp@\ifx\csname\runfootfont
          \runfootfontsize\endcsname\relax
      \loadfont\runfootfont\runfootfontsize
    \fi
  \fi
}
\tracingstats=1
\ifx\undefined\language
  \def\langnohyphens{\hyphenchar\font\m@ne}
\else
  \xp@\ifx\csname newlanguage\endcsname\relax
    \def\langnohyphens{\language\@cclv}
  \else
    \csname newlanguage\endcsname
      \nohyphenslanguage
    \def\langnohyphens{%
      \language\nohyphenslanguage}%
  \fi
\fi
\def\setupbreakingchars{%
  \ifx\breakingchars\@empty
    \ifx\spacebreak\@empty
      \let\noextralinebreaks\TRUE
    \else
      \let\noextralinebreaks\FALSE
    \fi
  \else
    \let\noextralinebreaks\FALSE
    \def\do##1{\ifx\end##1\else
      \xp@\actively\xp@
      \def\csname##1\endcsname{##1\markedbreak}%
      \xp@\do\fi}%
    \xp@\do\breakingchars\end
    \let\spacebreak\markedbreak
  \fi
  \exhyphenpenalty\@M
}
\def\iwlos#1{\immediate\write#1}
\storexmesj\losfirstline{%
\% &\losname.los &\todaysdate &\nowtime
\% Option settings for listout.tex.}%
\def\addmonth#1{%
  \toks4 \xp@{#1}%
  \edef\next{\the\toks2
    \string\def\string#1{\the\toks4 }}%
  \toks2 \xp@{\next}%
}
\begingroup
\endlinechar13 \catcode\endlinechar13
\gdef\logoptionsettings#1{\begingroup%
  \newlinechar13\relax\actively\let\^^M\relax%
  \toks2 {}%
  \addmonth\Jan \addmonth\Feb \addmonth\Mar%
  \toks2 \xp@{\the\toks2\relax
  }%
  \addmonth\Apr \addmonth\May \addmonth\Jun%
  \toks2 \xp@{\the\toks2\relax
  }%
  \addmonth\Jul \addmonth\Aug \addmonth\Sep%
  \toks2 \xp@{\the\toks2\relax
  }%
  \addmonth\Oct \addmonth\Nov \addmonth\Dec%
  \iwlos{#1}{%
    \losfirstline
    \the\toks2\relax
  }%
  \iwlos{#1}{%
    \string\let\string\landscape=%
      \if\landscape\string\TRUE
      \else\string\FALSE\fi
    \string\pawd=\the\pawd
    \string\def\string\paperwidth{\paperwidth}
    \string\paht=\the\paht
    \string\def\string\paperheight{\paperheight}
    \string\topmargin=\the\topmargin
    \string\bottommargin=\the\bottommargin
    \string\leftmargin=\the\leftmargin
    \string\rightmargin=\the\rightmargin
    \string\normalbaselineskip=%
      \the\normalbaselineskip\string\relax
    \string\def\string\mainfontsize{\mainfontsize}
    \string\def\string\mainfont{\mainfont}
    \string\chardef\string\totalcols=%
      \number\totalcols\string\relax
    \string\colwd=\the\colwd
    \string\def\string\columnwidth{\columnwidth}
    \string\let\string\dependentcolwd=%
      \if\dependentcolwd\string\TRUE
      \else\string\FALSE\fi
    \string\let\string\dependentrightmargin=%
      \if\dependentrightmargin\string\TRUE
      \else\string\FALSE\fi
    \string\colht=\the\colht
    \string\def\string\columnheight{\columnheight}
    \string\let\string\dependentcolht=%
      \if\dependentcolht\string\TRUE
      \else\string\FALSE\fi
    \string\let\string\dependentbottommargin=%
      \if\dependentbottommargin\string\TRUE
      \else\string\FALSE\fi
    \string\intercolspace=\the\intercolspace
    \string\overrun=\the\overrun
    \string\fullwd=\the\fullwd
  }%
  \iwlos{#1}{%
    \string\def\string\newfileoption{%
      \newfileoption}
    \string\let\string\printtitles=%
      \if\printtitles\string\TRUE
      \else\string\FALSE\fi
    \string\def\string\titlefont{\titlefont}
    \string\def\string\titlefontsize{%
      \titlefontsize}
    \string\def\string\titlecase{\titlecase}
    \string\def\string\datesepchar{\datesepchar}
    \string\def\string\todaysdate{%
      \xp@\string\todaysdate}
    \string\def\string\nowtime{%
      \xp@\string\nowtime}
    \string\def\string\timesepchar{\timesepchar}
    \string\def\string\ampmpunct{\ampmpunct}
    \string\let\string\keepleadingzeros=%
      \if\keepleadingzeros\string\TRUE
      \else\string\FALSE\fi
    \string\def\string\linenumberfontsize{%
      \linenumberfontsize}
    \string\def\string\linenumberfont{%
      \linenumberfont}
    \string\let\string\linenumbers=%
      \if\linenumbers\string\TRUE
      \else\string\FALSE\fi
    \string\linenumberfreq=%
      \number\linenumberfreq\string\relax
    \string\def\string\pagenumberfont{%
      \pagenumberfont}
    \string\def\string\pagenumberfontsize{%
      \pagenumberfontsize}
    \string\let\string\runheads=%
      \if\runheads\string\TRUE
      \else\string\FALSE\fi
    \string\runhead={\the\runhead}
    \string\def\string\runheadfont{\runheadfont}
    \string\def\string\runheadfontsize{%
      \runheadfontsize}
    \string\runheadht=\the\runheadht
    \string\let\string\runfeet=%
      \if\runfeet\string\TRUE\else\string\FALSE\fi
    \string\runfoot={\the\runfoot}
    \string\def\string\runfootfont{\runfootfont}
    \string\def\string\runfootfontsize{%
      \runfootfontsize}
    \string\runfootht=\the\runfootht
    \string\def\string\spacebreak{\spacebreak}
    \string\def\string\breakingchars{%
      \breakingchars}
    \string\let\string\noextralinebreaks=%
      \if\noextralinebreaks\string\TRUE
      \else\string\FALSE\fi
    \string\def\string\controlLaction{\controlLaction}
    \string\def\string\eightbitaction{\eightbitaction}
    \string\def\string\systemtype{\systemtype}
    \string\def\string\losdir{\losdir}
    \string\storemesj\string\dirprefix{\dirprefix}
    \string\chardef\string\spacespertab=%
      \number\spacespertab\string\relax
    \string\chardef\string\tabselect=%
      \number\tabselect\string\relax
}\endgroup}%
\endgroup% percent to avoid catcode 12 endlinechar
\def\Jan{January}\def\Feb{February}\def\Mar{March}\relax
\def\Apr{April}\def\May{May}\def\Jun{June}\relax
\def\Jul{July}\def\Aug{August}\def\Sep{September}\relax
\def\Oct{October}\def\Nov{November}\def\Dec{December}\relax
\let\landscape=\TRUE
\pawd=794.96999pt
\def\paperwidth{11in}
\paht=614.295pt
\def\paperheight{8.5in}
\topmargin=18.06749pt
\bottommargin=19.22751pt
\leftmargin=21.68121pt
\rightmargin=21.68121pt
\normalbaselineskip=10.0pt\relax
\def\mainfontsize{10}
\def\mainfont{typewriter}
\chardef\totalcols=2\relax
\colwd=369.38373pt
\def\columnwidth{369.38373pt}
\let\dependentcolwd=\TRUE
\let\dependentrightmargin=\TRUE
\colht=577.0pt
\def\columnheight{64 lines}
\let\dependentcolht=\TRUE
\let\dependentbottommargin=\TRUE
\intercolspace=12.0pt
\overrun=21.68121pt
\fullwd=751.60756pt
\def\newfileoption{P}
\let\printtitles=\TRUE
\def\titlefont{bold}
\def\titlefontsize{10}
\def\titlecase{none}
\def\datesepchar{/}
\def\todaysdate{\dateA}
\def\nowtime{\timeB}
\def\timesepchar{:}
\def\ampmpunct{.}
\let\keepleadingzeros=\TRUE
\def\linenumberfontsize{5}
\def\linenumberfont{roman}
\let\linenumbers=\FALSE
\linenumberfreq=1\relax
\def\pagenumberfont{bold}
\def\pagenumberfontsize{7}
\let\runheads=\TRUE
\runhead={\todaysdate \space \nowtime \space \hfil
  \thisfilename \space \hfil \pagenumber }
\def\runheadfont{roman}
\def\runheadfontsize{7}
\runheadht=24.0pt
\let\runfeet=\FALSE
\runfoot={}
\def\runfootfont{roman}
\def\runfootfontsize{6}
\runfootht=24.0pt
\def\spacebreak{\penalty \z@ }
\def\breakingchars{}
\let\noextralinebreaks=\FALSE
\def\controlLaction{N}
\def\systemtype{DOS}
\def\losdir{}
\storemesj\dirprefix{}
\chardef\spacespertab=8\relax
\chardef\tabselect=1\relax
\def\losname{default}
\edef\losfile{\losdir\losname.los }
\openin15=\losfile \relax
\ifeof15 \closein15 \expandafter\@gobbletwo
\else
\immediate\write16{Reading option settings from `\losname.los' . . .}
\closein15 \fi
\input\losfile % try entering "nul" if file not found
\datesetup
\normalbaselines
\ifx\undefined\interactive
  \def\next{listout}%
  \edef\next{\xmeaning\next}%
  \edef\jobname{\jobname}%
  \ifx\next\jobname
    \let\interactive\TRUE
  \else
    \let\interactive\FALSE
  \fi
\else
  \let\interactive\TRUE
\fi
\if\interactive
\else \restorecatcodes \endinput \fi
\def\printfiles{%\reportlayout
  \mesj{OK, let's print some files.}%
  \begingroup
  \listoutsetup \let\listoutsetup\relax
  \fileloop
  \endgroup
  \listoutfinish
  \csname \string @\string @end\endcsname
  \end
}%
\newcount\numberoffiles
\def\fileloop{%
  \promptmesj{!File name? (<return> to stop): }%
  \readline{}\reply
  \ifx\reply\@empty
  \else
    \global\advance\numberoffiles 1 \relax
  \afterfi
    \xp@\listout\xp@{\reply}%
    \fileloop
  \fi
}
\fxmesj\DVImesj{%
*******************************************************************
*     DVI file name is \jobname.dvi                                *
*******************************************************************}
\mesj{
:---------------------------------------------------------------------
:  This is listout.tex: a tool for printing out `verbatim' listings of
:  text files with reasonably robust, and customizable, handling of
:  overlong lines, tab characters and other special characters, number
:  of columns, font size/line spacing, et cetera.
:---------------------------------------------------------------------
:  For additional information (e.g., about noninteractive use), or to
:  change option settings, enter
:    m   or   M
:  to enter the listout.tex menu system. Otherwise just press the
:  <return> key to continue:
:}
\message{:?: }
\readChar{X}\reply
\if M\reply \else\xp@\printfiles\fi
\message{Starting up the listout.tex menu system . . .}
\storexmesj\menuprefix{
======================================================================
}
\storexmesj\menusuffix{
         Q  Quit         X  Exit        ?  Help
======================================================================
}
\storexmesj\inmenuA{
}
\storexmesj\inmenuB{
}
\fxmesj\menuhelpmesj{%
======================================================================
--- <return> means the carriage return, or `Enter', key.
--- When selecting items from a menu with letter labels, you can enter
your choice in lowercase or uppercase.
--- A prompt that asks for `TeX units' requires in response a
measurement using the units recognized by TeX, for example

      cm  mm  in  pt  pc  dd  cc

--- A response of Q will usually send you back to the previous menu.
--- A response of X will get you entirely out of the menu system.
======================================================================
To continue, press the <return> key . . .}
\def\confirm#1{\xmesj{\
* #1}}
\fmenu\mainmenu{
                    MAIN  MENU
}{
A  Action for new files            L  Line numbers
B  Breaking lines                  M  Margins
C  Column width/height             N  Number of columns
D  Date/time form                  O  Orientation
E  Expectoration                   P  Paper size
F  Font, line spacing              R  Running heads/feet
G  General information             S  System info
H  Heading/title for each file     T  Tab treatment
I  Info about current settings     V  Various other things
}{}
\def\moption{\mainmenu \readChar{Q}\reply
  \let\prevmenu\@empty \let\curmenu\@empty \optionexec\reply}
\fmenu\menuA#1{
The various actions possible at the beginning of a new file are:
}{
S  Space (one line of blank space, but not a new column,
     at the beginning of each new file)
C  New column
P  New page
R  New page and right-hand column
}{
These options are mutually exclusive. The currently selected option
is #1. See also option H in the main menu.
}
\def\moptionA{\menuA{\newfileoption}%
  \readChar{Q}\reply \optionexec\reply}
\def\moptionAS{\def\newfileoption{S}%
  \confirm{%
  Each file will start immediately after the preceding file, with\
* some intervening blank space.}%
  \popoptions\moptionQ}
\def\moptionAC{\def\newfileoption{C}%
  \confirm{%
  Each file will start at the top of the next column.}%
  \popoptions\moptionQ}
\def\moptionAP{\def\newfileoption{P}%
  \confirm{%
  Each file will start on a new page.}%
  \popoptions\moptionQ}
\def\moptionAR{\def\newfileoption{R}%
  \confirm{%
  Each file will start on a new page, in the right-hand column.}
  \popoptions\moptionQ}
\def\menuBtest{%
  \ifx\spacebreak\@empty
    \ifx\breakingchars\@empty
Long lines will not be broken.%
    \else
Extra line breaks will be allowed after the characters\
\
\ \ \ \ \ \breakingchars\
      \ifdim\overrun=\z@
      \else\
(with overrun of \the\overrun\space allowed).%
      \fi
    \fi
  \else
    \ifx\breakingchars\@empty
Extra line breaks will be allowed at spaces.%
    \else
Extra line breaks will be allowed at spaces and\
after the characters\
\
\ \ \ \ \ \breakingchars\
    \fi
    \ifdim\overrun=\z@
    \else\
(with overrun of \the\overrun\space allowed).%
    \fi
  \fi
}
\fxmenu\menuB{
Files being printed sometimes contain unusually long lines.
You can choose the action that will be taken for overlong lines:
}{
N  No line breaking allowed
S  Allow breaks at spaces only
C  Allow line breaks at other characters
O  Change the overrun amount
}{
Current setting: &\menuBtest
}
\def\moptionB{\lettermenu{B}}
\def\moptionBS{%
  \let\spacebreak\markedbreak \let\breakingchars\@empty
  \overrun\rightmargin \let\noextralinebreaks\FALSE
  \confirm{\menuBtest}\popoptions\moptionQ
}
\def\moptionBN{%
  \let\spacebreak\@empty \let\breakingchars\@empty
  \overrun=\rightmargin
  \confirm{\menuBtest}\popoptions\moptionQ
}
\def\moptionBO{%
  \promptmesj{Desired overrun value [TeX units] ? }%
  \readline{Q}\reply
  \if\xoptiontest\reply
  \else
    \checkdimen\reply\dimen@
    \ifdim\dimen@=-\maxdimen
    \else
      \overrun\reply\relax
      \confirm{New overrun value = \the\overrun.}%
      \def\reply{Q}%
    \fi
  \fi
  \optionexec\reply
}
\def\moptionBC{%
  \xmesj{%
Enter a list of characters. Line breaks will be allowed after any\
character in the list.\
Note: if this list is nonempty breaks will be allowed at spaces,\
even if you didn't include a space in the list.}%
  \readline{}\breakingchars
  \ifx\@empty\breakingchars
  \else \let\spacebreak\markedbreak\fi
  \let\noextralinebreaks\FALSE
  \overrun=\rightmargin
  \confirm{\menuBtest}%
  \popoptions\moptionQ
}
\fxmenu\menuC{
Column width is normally computed automatically, from the specified
paper width, number of columns, margins, and intercolumn space.
However, if you provide an explicit value for column width it will
be used and the right margin will be adjusted as necessary.
Similarly, column height is computed automatically from the
paper height and the top and bottom margins, unless you provide an
explicit value.
}{
W  Change column width
H  Change column height
I  Change intercolumn space
}{
Current column width: &\columnwidth.
Current column height: &\columnheight.
Current intercolumn space: &\the&\intercolspace.
}
\def\moptionC{\lettermenu C}
\def\moptionCW{%
  \xmesj{%
For width in characters, enter just a number; otherwise enter a\
measurement using standard TeX units. To revert to automatic computing\
of the column width, give an empty reply (i.e., just press <return>).}%
  \message{Column width: }%
  \readline{}\reply
  \ifx\reply\@empty
    \let\dependentcolwd\TRUE
    \if\dependentrightmargin \computerfc \else \computefc \fi
    \def\reply{A}% report new value through \moptionCWA
  \fi
  \if\xoptiontest\reply
  \else
    \checkdimen\reply\dimen@
    \ifdim\dimen@=-\maxdimen
      \checkinteger\reply\count@
      \ifnum\count@=-\maxdimen
      \else
        \colwd.5em \multiply\colwd\count@\relax
        \edef\columnwidth{\the\count@\space characters}%
        \let\dependentcolwd\FALSE
        \def\reply{A}%
      \fi
    \else
      \colwd\dimen@ \let\columnwidth\reply \let\dependentcolwd\FALSE
      \def\reply{B}%
    \fi
  \fi
  \optionexec\reply
}
\def\moptionCWA{%
  \confirm{Column width set to \columnwidth.}%
  \popoptions\moptionQ}
\def\moptionCWB{%
  \confirm{Column width set to \columnwidth\space (= \the\colwd)}%
  \popoptions\moptionQ}
\def\moptionCH{%
  \xmesj{%
For height in lines, enter just a number; otherwise enter a\
measurement using standard TeX units. To revert to automatic computing\
of the column height, give an empty reply (i.e., just press <return>).}%
  \message{Column height: }%
  \readline{}\reply
  \ifx\reply\@empty
    \let\dependentcolht\TRUE
    \if\dependentbottommargin \computebc \else \computec \fi
    \def\reply{A}% report new value through \moptionCWA
  \fi
  \if\xoptiontest\reply
  \else
    \checkdimen\reply\dimen@
    \ifdim\dimen@=-\maxdimen
      \checkinteger\reply\count@
      \ifnum\count@=-\maxdimen
      \else
        \let\dependentcolht\FALSE
        \colht\baselineskip \multiply\colht\count@
        \advance\colht -\baselineskip \advance\colht\topskip
        \computeb
        \edef\columnheight{\the\count@\space lines}%
        \def\reply{A}%
      \fi
    \else
      \colht\dimen@ \let\columnheight\reply
      \let\dependentcolht\FALSE \computeb
      \def\reply{B}%
    \fi
  \fi
  \optionexec\reply
}
\def\moptionCHA{%
  \confirm{Column height set to \columnheight.\
* (Bottom margin adjusted to \the\bottommargin.)}%
  \popoptions\moptionQ}
\def\moptionCHB{%
  \confirm{Column height set to \columnheight\space (= \the\colht)\
* (Bottom margin adjusted to \the\bottommargin.)}%
  \popoptions\moptionQ}
\def\moptionCI{%
  \promptmesj{Enter desired intercolumn space [TeX units]: }%
  \readline{Q}\reply
  \ifx\optiontest\reply
  \else
    \checkdimen\reply\dimen@
    \ifdim\dimen@=-\maxdimen
    \else
      \intercolspace=\dimen@
      \confirm{%
Intercolumn space set to \reply\space (= \the\intercolspace).}%
      \if\linenumbers\ifdim\intercolspace<12\p@
      \confirm{\
* Warning: small intercolumn space, might not be big enough\
* for line numbers to fit ...}%
      \fi\fi
      \def\reply{Q}%
    \fi
  \fi
  \optionexec\reply
}
\fxmenu\menuD{}{
D  Change date format
S  Change separator character
Z  &\if&\keepleadingzeros\.Omit&\else\.Add&\fi %
leading zeros in the day and month
T  Change time format
}{
Current date and time format is `&\todaysdate &\nowtime'.
}
\def\moptionD{\lettermenu D}
\fxmenu\menuDD{
Date options:
}{
A  &\dateA
B  &\dateB
C  &\dateC
D  &\dateD
E  &\dateE
F  &\dateF
G  &\dateG
H  &\dateH
I  &\dateI
J  &\dateJ
}{
Current date format is &\todaysdate.
}
\def\moptionDD{\menuDD \readChar{Q}\reply
  \count@=\xp@`\reply\relax
  \ifnum\count@>64 \ifnum\count@<75
    \xp@\def\xp@\todaysdate\xp@{\csname date\reply\endcsname}%
    \confirm{New date form: \todaysdate}%
    \def\reply{Q}%
  \fi\fi
  \optionexec\reply
}
\def\moptionDS{\promptmesj{!%
Current separator character between the parts of a date is
`\datesepchar'.!%
New separator: }%
  \readchar{}\reply
  \if Q\reply
    \confirm{Date separator char unchanged.}%
  \else
    \if ?\reply
    \else
      \if X\reply
        \confirm{Date separator char unchanged.}%
      \else
        \let\datesepchar\reply
        \confirm{New date format: \todaysdate.}%
        \def\reply{Q}%
      \fi
    \fi
  \fi
  \optionexec\reply
}
\def\moptionDZ{%
  \if\keepleadingzeros
    \let\keepleadingzeros\FALSE
    \edef\themonth{\number\month}\edef\theday{\number\day}%
  \else
    \let\keepleadingzeros\TRUE
    \edef\themonth{\twodigits\month}\edef\theday{\twodigits\day}%
  \fi
  \confirm{Leading zeros will
    \if\keepleadingzeros NOT \else \fi
    be omitted in day and month numbers}%
  \def\reply{Q}\optionexec\reply
}
\fxmenu\menuDT{
Time format options:
}{
A  &\timeA (HoursMinutes, 24-hour cycle)
B  &\timeB (Hours:Minutes, 24-hour cycle)
C  &\timeC (12-hour cycle)
D  &\timeD
E  &\timeE
F  &\timeF
}{
Current time format is &\nowtime.
}
\def\moptionDT{\menuDT \readChar{Q}\reply
  \if A\if B\reply A\else\if C\reply A\else\if D\reply A\else
       \if E\reply A\else\if F\reply A\else\reply\fi\fi\fi\fi\fi
    \xp@\def\xp@\nowtime\xp@{\csname time\reply\endcsname}%
    \def\reply{Z}%
  \fi
  \optionexec\reply
}
\def\moptionDTZ{\confirm{New time format: \nowtime}%
  \popoptions\moptionQ}
\fmenu\menuE{
This option allows you to save all the current option settings in a
file for later reuse. If you use the file name `default.los' the saved
settings will be used as defaults for future runs. Or you can use
different file names to have multiple saved sets of option settings.
}{
S  Save settings
L  Load saved settings from file
D  Specify a default directory/folder for .los files
}{
The last option allows you to specify a location if you want to
keep listout.tex and all its .los files in a particular directory or
folder. This works best if the given location is one searched
automatically by TeX (e.g., by being included in the `TeX inputs path').
}
\def\moptionE{\lettermenu{E}}
\def\losname{default}
\def\losdir{}

\def\lossorrymessage{\message{%
? Could not create `\losdir\losname.los';
maybe there was a system problem.}}
\def\currentdir{}
\def\moptionES{\xmesj{\
Enter the desired file name. The default name (if you just press the\
<return> key) is `default'. A file extension `.los' will be added\
automatically:}%
  \readline{default}\reply
  \edef\losname{\reply}%
  \def\next##1.los##2##3\next{\ifx\relax##2\else
    \def\losname{##1}\fi}
  \xp@\next\losname.los\relax\next
  \confirm{%
File name: `\losname.los' ---OK? If not, enter n or N to cancel:}%
  \readChar{Y}\reply
  \if Y\reply
    \edef\losfirstline{\xp@\@gobble\string
\% Option settings for listout.tex, \todaysdate\space\nowtime}%
    \immediate\openout15=\losdir\losname.los \relax
    \logoptionsettings{15}%
    \immediate\closeout15 \relax
    \openin15=\losdir\losname.los \relax
    \ifeof15 \lossorrymessage
    \else \testlocation \fi
    \closein15 \relax
  \fi
  \popoptions\moptionQ
}
\def\testlocation{%
  \begingroup
    \catcode`\%=12 \catcode`\\=12 \catcode\endlinechar=9
    \read15 to\next
    \ifx\next\losfirstline
      \confirm{%
New `\losname.los' file successfully created}%
      \ifx\losdir\@empty
        \testinputtable
      \else
        \message{%
(in location `\losdir')}%
      \fi
    \else
      \lossorrymessage
    \fi
  \endgroup
}
\def\testinputtable{%
  \actively\def\%##1@{%
    \edef\next{\xp@\@gobble\string\%##1}%
    \ifx\next\losfirstline
    \else
      \message{%
... but guess what: it seems to be inaccessible for \nx@\input by TeX%
      }%
    \fi
    \endinput}%
  \endlinechar`\@ \relax
  \input\losname.los \relax
}
\def\moptionEL{\xmesj{\
Enter the name of the desired option file:}%
  \readline{}\reply
  \ifx\@empty\reply
  \else
    \def\next##1.los##2##3\next{\ifx\relax##2\else
      \def\reply{##1}\fi}
    \xp@\next\reply.los\relax\next
    \xmesj{\
Attempting to load \reply.los . . .}%
    \input\reply.los\space\relax
  \fi
  \def\reply{Q}\optionexec\reply
}
\def\moptionED{\xmesj{\
Current location name is `\losdir'.\
Enter a new location name (directory or folder or whatever, depending\
on your system). For Unix or DOS, make sure you include the final\
slash. (For DOS, use slashes instead of backslashes.) Just press\
<return> if you want to leave the current location unchanged:}%
  \readline{}\reply
  \ifx\@empty\reply
  \else
    \let\losdir\reply
    \confirm{Location name is now: `\losdir'}%
  \fi
  \def\reply{Q}\optionexec\reply
}
\fxmenu\menuF{}{
F  Change font
S  Change font size
L  Change line spacing
T  Test font availability
N  Add new font
}{
Current settings: &\mainfont &\mainfontsize / &\the&\baselineskip.
}
\def\moptionF{\lettermenu F}
\fxmenu\genfontmenu{
&\firstpart
Font choices:
}{
R  Roman
B  Bold
I  Italic
T  Typewriter
S  Sans serif
}{
Current choice is `&\fonttoget'.
}
\def\getfont#1#2#3{%
  \let\fonttoget#1\def\firstpart{#2}%
  \genfontmenu \readChar{Q}\reply
  \edef\next{\if R\reply roman%
             \else\if B\reply bold%
             \else\if I\reply italic%
             \else\if S\reply sansserif%
             \else\if T\reply typewriter%
             \fi\fi\fi\fi\fi}%
  \ifx\next\@empty
  \else
    \let#1\next \def\reply{Q}%
    \confirm{#3 font is now `#1'.}%
  \fi
  \optionexec\reply
}
\def\moptionFF{\getfont\mainfont{%
Note: Font style `typewriter' is recommended for printing computer\
program code verbatim because the character set of most non-typewriter\
fonts lacks certain characters such as { } | \string~ and \\ .}%
{Main}}
\fmesj\wholepointsizes{
Note: Currently only whole point sizes are supported; the fractional
part in a fractional point size will be ignored. If a font/size
combination is not available on your system there will be an error
message later on when we try to load the font.
}%
\def\getfontsize#1#2{\wholepointsizes
  \mesj{Current #2 font size is #1.}%
  \promptmesj{Desired font size? }%
  \readline{Q}\reply
  \if\xoptiontest\reply
  \else
    \checkinteger\reply\count@
    \ifnum\count@>\z@
      \edef#1{\the\count@}%
      \confirm{New font size for #2: #1}%
      \def\reply{Q}%
    \fi
  \fi
  \optionexec\reply
}
\def\moptionFS{\getfontsize\mainfontsize{main text}}
\def\moptionFL{\promptmesj{Desired line spacing [TeX units] ? }%
  \readline{Q}\reply
  \if\xoptiontest\reply
  \else
    \checkdimen\reply\dimen@
    \ifdim\dimen@>\z@
      \normalbaselineskip\dimen@\relax \normalbaselines
      \confirm{New line spacing: \the\normalbaselineskip}%
      \def\reply{Q}%
    \fi
  \fi
  \optionexec\reply
}
\fxmenu\menuFT{
Font to test load?
}{
M  main font
T  title font
L  line number font
P  page number font
H  running head font
F  running foot font
A  all of the above
}{}
\def\moptionFT{\menuFT
  \readChar{Q}\reply
  \if M\reply
    \testload\mainfont\mainfontsize
    \def\reply{Q}%
  \else\if T\reply
    \testload\titlefont\titlefontsize
    \def\reply{Q}%
  \else\if L\reply
    \testload\linenumberfont\linenumberfontsize
    \def\reply{Q}%
  \else\if P\reply
    \testload\pagenumberfont\pagenumberfontsize
    \def\reply{Q}%
  \else\if H\reply
    \testload\runheadfont\runheadfontsize
    \def\reply{Q}%
  \else\if F\reply
    \testload\runfootfont\runfootfontsize
    \def\reply{Q}%
  \else\if A\reply
    \testload\mainfont\mainfontsize
    \testload\pagenumberfont\pagenumberfontsize
    \testload\titlefont\titlefontsize
    \testload\linenumberfont\linenumberfontsize
    \testload\runheadfont\runheadfontsize
    \testload\runfootfont\runfootfontsize
    \def\reply{Q}%
  \fi\fi\fi\fi\fi\fi\fi
  \optionexec\reply
}
\def\testload#1#2{\loadfont#1#2\relax
  \xp@\ifx\csname#1#2\endcsname\nullfont
    \confirm{Unsuccessful font load...}%
  \else
    \confirm{Font successfully loaded.}%
  \fi
}
\fxmesj\menuFN{
To use a custom font you must give two pieces of information: the
name of the font metrics file (.tfm file), not including the .tfm
extension, and a magnification (using TeX's standard notation: 1000 =
100\%, 1200 = 120\%, ...).
}
\def\moptionFN{\menuFN
  \promptmesj{OK, first give the font name: }%
  \readline{Q}\reply
  \if\xoptiontest\reply
  \else
    \let\mainfont\reply
    \def\reply{Q}%
    \promptmesj{Font magnification? [default=1000]: }%
    \readline{1000}\reply
    \if\xoptiontest\reply
    \else
      \checkinteger\reply\count@
      \ifnum\count@>100 %
        \let\mainfontsize\reply
        \def\reply{Q}%
      \fi
    \fi
    \xmesj{\
Attempting to load new font `\mainfont\ scaled \mainfontsize'; if you\
get an error message, press RETURN to continue, and try again.\
    }%
  \testload\mainfont\mainfontsize
  \fi
  \optionexec\reply
}
\fmesj\menuGa{
:  General information on a couple of subjects:
:
:  ---Non-interactive usage: Create a driver file containing
:
:   \input listout
:   %    Change options here, if desired
:   \listout{first.file}
:   \listout{second.file}
:   ...
:   \listoutfinish
:   \end
:
:  The \listoutfinish command is required to support the possibility
:  where multiple files are printed running together without intervening
:  page breaks. To find out how to change options, look at the file
:  default.los.
:
:  Press <return> to continue . . .}
\fmesj\menuGb{
:  ---Treatment of control characters and eight-bit characters: The
:  default behavior is to assume no knowledge about the meaning of
:  characters in the range 0--31 and 127--255, because depending on the
:  source, the intended meaning of one of these characters in a given
:  file can vary widely. And the default main font (cmtt) can't handle
:  characters above 127 anyway. In order to preserve vertical alignment
:  when printing with a monospace font (the usual case) control
:  characters aren't printed as multicharacter sequences (e.g. ^^F), but
:  as boxed letters. The first control character encountered in a file
:  will generate a warning/explanatory message on screen. Similarly,
:  characters above ASCII 126 are printed simply as boxed question
:  marks. This behavior can be overridden by changing the main font to a
:  256-character font and choosing the 8-bit option in the V menu.
:
:  Press <return> to continue . . .}

\def\moptionG{\menuGa\readline{}\reply\menuGb\readline{}\reply \moptionQ}
\fxmenu\menuH{}{
T  Turn filename titles&\if&\printtitles off&\else on&\fi
F  Change font of titles
S  Change font size
C  Change capitalization
}{
Current settings: %
&\titlefont &\titlefontsize, capitalization = &\titlecase.
}
\def\moptionH{\lettermenu H}
\def\moptionHT{%
  \if\printtitles \let\printtitles\FALSE
  \else \let\printtitles\TRUE \fi
  \confirm{%
The name of each file \if\printtitles WILL \else will NOT \fi
be printed as a title at the\
* beginning of the file.
}%
  \if\printtitles\else\popoptions\fi
  \moptionQ
}%
\def\moptionHF{\getfont\titlefont{}{Title}}
\def\moptionHS{\getfontsize\titlefontsize{titles}}
\fxmenu\menuHC{
Title capitalization choices:
}{
N  None
L  Lowercase
U  Uppercase
}{
Current choice is &\titlecase.
}
\def\moptionHC{\menuHC \readChar{Q}\reply
  \if L\reply
    \def\titlecase{lowercase}%
    \confirm{Capitalization is now: lowercase.}%
    \def\reply{Q}%
  \else\if U\reply
    \def\titlecase{uppercase}%
    \confirm{Capitalization is now: uppercase.}%
    \def\reply{Q}%
  \else\if N\reply
    \def\titlecase{none}%
    \confirm{Capitalization is now: none.}%
    \def\reply{Q}%
  \fi\fi\fi
  \optionexec\reply}
\fxmesj\menuIa{
Current option settings:
Orientation: &\if&\landscape landscape&\else portrait&\fi
Paper size: &\paperwidth x &\paperheight (&\the\pawd x &\the\paht)
Margins: Top &\the\topmargin, bottom &\the\bottommargin,
  left &\the\leftmargin, right &\the\rightmargin
&\number\totalcols columns, column width = &\columnwidth (&\the\colwd),
Column height: &\columnheight (&\the\colht)
Intercolumn space: &\the\intercolspace
Full width of text area: &\the\fullwd
Main font: &\mainfont &\mainfontsize
Linespacing: &\the\normalbaselineskip
Each new file starts%
&\if\.S&\newfileoption%
 immediately after the previous file.
&\else&\if\.C&\newfileoption%
 at the top of a new column.
&\else&\if\.P&\newfileoption%
 on a new page.
&\else&\if\.R&\newfileoption%
 on the right-hand-side of a new page.
&\else ??? unknown.
&\fi&\fi&\fi&\fi%
File names are &\if&\printtitles&\else\.not&\fi%
  printed as titles at the beginning of each file.
&\if&\printtitles%
File name font: &\titlefont &\titlefontsize
File name capitalization: &\titlecase
&\fi%
Date and time print in the form &\todaysdate and &\nowtime.
Line numbers are turned%
&\if&\linenumbers ON, font &\linenumberfont &\linenumberfontsize,
  every &\number\linenumberfreq line%
&\ifnum&\linenumberfreq=1 &\else s&\fi
&\else OFF&\fi
Press <return> to continue: }
\fxmesj\menuIb{
Page number font: &\pagenumberfont&\pagenumberfontsize
Running heads are turned &\if&\runheads ON:
  &\the\runhead,
  font &\runheadfont &\runheadfontsize,
  runhead takes up &\the\runheadht from column height.
&\else OFF &\fi
Running feet are turned &\if&\runfeet ON:
  &\the\runfoot,
  font &\runfootfont &\runfootfontsize,
  runfoot takes up &\the\runfootht from column height.
&\else OFF &\fi
Tabs are printed &\number\spacespertab characters wide, %
in style `&\tabstyle'.
&\if&\noextralinebreaks%
Line breaks are preserved exactly as in the original file.
&\else%
Extra line breaks are allowed at spaces and/or other characters.
Text is allowed to overrun right margin by &\the\overrun.
&\fi%
Control-L is defined to &\if\.N&\controlLaction%
end the current column.
&\else print as &\if\.L&\controlLaction%
a one-line vertical space.
&\else%
a boxed L.
&\fi&\fi%
System type is set to &\systemtype.
Directory for .los files: &\losdir
Directory prefix for file name titles: &\dirprefix
Press <return> to continue: }
\def\moptionI{\menuIa \readline{}\reply \menuIb
  \readChar{Q}\reply \optionexec\reply}
\fxmenu\menuL{}{
T  Turn line numbers&\if&\linenumbers off&\else on&\fi
F  Change font of line numbers
S  Change font size of line numbers
N  Change numbering frequency
}{&\if&\linenumbers
Current settings: &\linenumberfont &\linenumberfontsize, %
numbering every&\ifnum&\linenumberfreq=1 line%
&\else &\the&\linenumberfreq lines&\fi.%
&\fi%
}
\def\moptionL{\lettermenu L}
\def\moptionLT{%
  \if\linenumbers
    \let\linenumbers\FALSE
  \else
    \let\linenumbers\TRUE
  \fi
  \confirm{Line numbers are switched \if\linenumbers on\else off\fi.}%
  \if\if\linenumbers\ifdim\leftmargin<12\p@ T
       \else\ifnum\totalcols>\@ne
          \ifdim\intercolspace<12\p@ T\else F\fi
        \else F\fi\fi\else F\fi T%
      \confirm{\
* You might want to check the left margin and/or intercolspace\
* to make sure there's enough room for the line numbers.}%
  \else\popoptions\fi
  \moptionQ
}
\def\moptionLF{\getfont\linenumberfont{}{Line number}}
\def\moptionLS{\getfontsize\linenumberfontsize{line numbers}}
\def\moptionLN{%
  \xmesj{%
Current line numbering frequency is every
\ifnum\linenumberfreq=1 line%
\else\ \number\linenumberfreq\ lines\fi.\
New line numbering frequency? (1 = every line, 2 = every 2 lines,\
and so forth):}%
  \readline{Q}\reply
  \if\xoptiontest\reply
  \else
    \checkinteger\reply\count@
    \ifnum\count@>\z@
      \linenumberfreq=\count@
      \confirm{New line numbering frequency: \the\linenumberfreq}%
      \def\reply{Q}%
    \fi
  \fi
  \optionexec\reply
}
\fxmenu\menuM{
Current margin settings: top &\the&\topmargin, left &\the&\leftmargin,
bottom &\the&\bottommargin, right &\the&\rightmargin.
}{
L  Change left margin
T  Change top margin
B  Change bottom margin
R  Change right margin
}{}
\def\moptionM{\lettermenu M}
\fxmesj\menuMB#1{
Current bottom margin is #1.
If you specify a new bottom margin, column height will be recomputed to
come as close as possible to the desired value (nearest integer multiple
of line spacing), taking the currently specified paper height and top
margin into consideration. To revert to automatic computing of bottom
margin, give an empty reply (i.e., just press the <return> key).
Otherwise enter a measurement using TeX units:}
\def\moptionMB{\menuMB{\the\bottommargin}%
  \readline{}\reply
  \ifx\@empty\reply
    \let\dependentbottommargin\TRUE
    \if\dependentcolht
      \computebc
    \fi
    \def\reply{Q}%
  \else
    \if\xoptiontest\reply
    \else
      \checkdimen\reply\dimen@
      \ifdim\dimen@=-\maxdimen % not a valid dimension
      \else
        \bottommargin\dimen@
        \computec
        \confirm{New column height: \the\colht\
* New bottom margin: \the\bottommargin}%
        \def\reply{Q}%
      \fi
    \fi
  \fi
  \optionexec\reply
}
\fxmesj\menuML#1{
Current left margin is #1 (measured from the left edge of the
paper to the left edge of the text).
<return> to keep the current value, or enter a new value:}
\def\moptionML{\menuML{\the\leftmargin}%
  \readline{Q}\reply
  \if\xoptiontest\reply
  \else
    \checkdimen\reply\dimen@
    \ifdim\dimen@=-\maxdimen
    \else
      \leftmargin\dimen@
      \confirm{New left margin: \the\leftmargin}%
      \if\linenumbers\ifdim\leftmargin<12\p@
      \confirm{\
* Warning: small left margin, might not be big enough for line\
* numbers to fit ...}%
      \fi\fi
      \def\reply{Q}%
    \fi
  \fi
  \optionexec\reply
}
\fxmesj\menuMR#1{
Current right margin is #1 (measured from the right edge of the
paper to the right edge of the text). To revert to automatic
computation of the right margin, give an empty reply; or enter a new
value using TeX units (or enter Q or X or ? to quit/exit/get-help).
New right margin:}
\def\moptionMR{\menuMR{\the\rightmargin}%
  \readline{}\reply
  \ifx\@empty\reply
    \let\dependentrightmargin\TRUE
    \rightmargin=\leftmargin
    \confirm{New right margin: \the\rightmargin}%
    \def\reply{Q}%
  \fi
  \if\xoptiontest\reply
  \else
    \checkdimen\reply\dimen@
    \ifdim\dimen@=-\maxdimen
    \else
      \rightmargin\dimen@
      \confirm{New right margin: \the\rightmargin}%
      \let\dependentrightmargin\FALSE
      \def\reply{Q}%
    \fi
  \fi
  \optionexec\reply
}
\fxmesj\menuMT#1{
Current top margin is #1 (measured from the top edge of the
paper to the top of the running head or the text).
<return> to keep the current value, or enter a new value:}
\def\moptionMT{\menuMT{\the\topmargin}%
  \readline{Q}\reply
  \if\xoptiontest\reply
  \else
    \checkdimen\reply\dimen@
    \ifdim\dimen@=-\maxdimen
    \else
      \topmargin\dimen@
      \confirm{New top margin: \the\topmargin}%
      \def\reply{Q}%
    \fi
  \fi
  \optionexec\reply
}
\fxmesj\menuN#1{
Number of columns: #1.
<return> to keep the current value, or enter a new value
(a number greater than 0):}
\def\moptionN{\menuN{\number\totalcols}%
  \readline{Q}\reply
  \if\xoptiontest\reply
  \else
    \checkinteger\reply\count@
    \ifnum\count@=-\maxdimen
    \else
      \if\ifnum\count@>\z@
         \ifnum\count@<\sixt@@n T\else F\fi\else F\fi T%
        \chardef\totalcols=\count@
        \if\dependentcolwd
          \if\dependentrightmargin \computerfc \else \computefc \fi
        \else
          \computefr
        \fi
        \confirm{%
  Number of columns: \number\totalcols\space
  (column width: \the\colwd, %
\ifnum\totalcols>\@ne intercolumn space: \the\intercolspace,\
* \fi total width: \the\fullwd)}
        \def\reply{Q}%
      \else
        \ifnum\count@>20
          \specialhelp\reply
            {Maximum number of columns is 20, sorry...}%
        \else
          \specialhelp\reply
            {Number of columns must be greater than 0}%
        \fi
      \fi
    \fi
  \fi
  \optionexec\reply
}
\fxmenu\menuO{
Current orientation: &\if&\landscape\.landscape.&\else\.portrait&\fi
}{
P  Switch to portrait orientation
L  Switch to landscape orientation
}{}
\def\moptionO{\menuO \readChar{Q}\reply
  \if P\reply
    \if\landscape \let\landscape\FALSE
      \dimen@\paht \paht\pawd \pawd\dimen@
    \fi
    \confirm{Orientation is now: portrait}%
    \def\reply{Q}%
  \else
    \if L\reply
      \if\landscape \else \let\landscape\TRUE
        \dimen@\paht \paht\pawd \pawd\dimen@
      \fi
      \confirm{Orientation is now: landscape}%
      \def\reply{Q}%
    \fi
  \fi
  \optionexec\reply
}
\fxmenu\menuP{
Current paper size: &\paperwidth x &\paperheight
}{
W  Change paper width
H  Change paper height
U  U.S. letter size paper: 8.5in x 11in
A  A4 paper: 21cm x 29.7cm
}{}
\def\moptionP{\lettermenu P}
\def\moptionPW{\promptmesj{New paper width: }%
  \readline{Q}\reply
  \if\xoptiontest\reply
  \else
    \checkdimen\reply\dimen@
    \ifdim\dimen@=-\maxdimen
    \else
      \ifdim\dimen@>1cm
        \let\paperwidth\reply
        \pawd\dimen@
        \confirm{New paper width: \paperwidth\space(\the\pawd)}%
        \def\reply{Q}%
      \else
        \specialhelp\reply{%
Sorry, I can't believe you really want a width of \reply!}%
      \fi
    \fi
  \fi
  \optionexec\reply
}
\def\moptionPH{\promptmesj{New paper height: }%
  \readline{Q}\reply
  \if\xoptiontest\reply
  \else
    \checkdimen\reply\dimen@
    \ifdim\dimen@=-\maxdimen
    \else
      \ifdim\dimen@>1cm
        \let\paperheight\reply
        \paht\dimen@
        \confirm{New paper height: \paperheight\space(\the\paht)}%
        \def\reply{Q}%
      \else
        \specialhelp\reply{%
Sorry, I can't believe you really want a height of \reply!}%
      \fi
    \fi
  \fi
  \optionexec\reply
}
\def\moptionPU{%
  \if\landscape
    \paht=8.5truein \pawd=11truein
    \def\paperheight{8.5in}\def\paperwidth{11in}%
  \else
    \paht=11truein \pawd=8.5truein
    \def\paperheight{11in}\def\paperwidth{8.5in}%
  \fi
  \confirm{New paper width: \paperwidth\space(\the\pawd)\
* New paper height: \paperheight\space(\the\paht)%
\if\landscape\
(landscape)\fi}%
  \moptionQ
}
\def\moptionPA{%
  \if\landscape
    \paht=21cm \pawd=29.7cm
    \def\paperheight{21cm}\def\paperwidth{29.7cm}%
  \else
    \paht=29.7cm \pawd=21cm
    \def\paperheight{29.7cm}\def\paperwidth{21cm}%
  \fi
  \confirm{New paper width: \paperwidth\space(\the\pawd)\
* New paper height: \paperheight\space(\the\paht)%
  \if\landscape\
  (landscape)\fi}%
  \moptionQ
}
\fxmenu\menuR{
Running heads are turned &\if&\runheads\.on.
Running head contents:
&\the&\runhead
&\else\.off.
&\fi%
Running feet are turned &\if&\runfeet\.on.
Running foot contents:
&\the&\runfoot
&\else\.off.
&\fi%
}{
H  Change running heads
F  Change running feet
}{}
\def\moptionR{\lettermenu R}
\fmenu\menuRHorF#1{}{
C  Change running #1 contents
F  Change running #1 font
S  Change running #1 font size
}{}
\def\moptionRH{\menuRHorF{head}\readChar{Q}\reply \optionexec\reply}
\fxmesj\menuRHC{
Current running head contents:
&\the&\runhead
Enter new running head contents (to turn off running heads,
just press <return>):}
\def\moptionRHC{\menuRHC
  \xreadline{}\reply
  \if\xoptiontest\reply
  \else
    \global\runhead\xp@{\reply}%
    \ifx\reply\@empty
      \global\let\runheads\FALSE
    \else
      \global\let\runheads\TRUE
      \confirm{New running head:\
               \the\runhead}%
    \fi
    \def\reply{Q}%
  \fi
  \optionexec\reply
}
\def\moptionRHF{\getfont\runheadfont{}{Running head}}
\def\moptionRHS{\getfontsize\runheadfontsize{running heads}}
\def\moptionRF{\menuRHorF{foot}\readChar{Q}\reply \optionexec\reply}
\fxmesj\menuRFC{
Current running foot contents:
&\the&\runfoot
Enter new running foot contents (to turn off running feet,
just press <return>):}
\def\moptionRFC{\menuRFC
  \xreadline{}\reply
  \if\xoptiontest\reply
  \else
    \global\runfoot\xp@{\reply}%
    \ifx\reply\@empty
      \global\let\runfeet\FALSE
    \else
      \global\let\runfeet\TRUE
      \confirm{New running foot:\
               \the\runfoot}%
    \fi
    \def\reply{Q}%
  \fi
  \optionexec\reply
}
\def\moptionRFF{\getfont\runfootfont{}{Running foot}}
\def\moptionRFS{\getfontsize\runfootfontsize{running feet}}
\fxmenu\menuS{
System information. Current system type is &\systemtype;
directory prefix to be used for all files printed in this run is
&\ifx&\@empty&\dirprefix\.null.&\else
&\dirprefix&\fi
}{
S  Change system type
D  Change directory prefix
}{}
\def\moptionS{\lettermenu{S}}
\fxmenu\menuSS{
System type options:
}{
D  DOS
M  Macintosh
U  Unix
V  VAX/VMS
O  Other
}{
Currently this information is only used to help in printing directory
names that may occur in the titles printed at the beginning of each
file. Current system type is &\systemtype.
}
\def\moptionSS{\menuSS
  \readChar{Q}\reply
  \if D\reply \def\systemtype{DOS}\def\currentdir{./}\def\reply{Q}%
  \else\if M\reply
    \def\systemtype{Macintosh}\def\currentdir{}\def\reply{Q}%
  \else\if U\reply
    \def\systemtype{Unix}\def\currentdir{./}\def\reply{Q}%
  \else\if V\reply
    \def\systemtype{VAX/VMS}%
    \edef\currentdir{sys\string $disk:[]}\def\reply{Q}%
  \else \def\systemtype{other}\def\currentdir{}\def\reply{Q}%
  \fi\fi\fi\fi
  \optionexec\reply
}
\fxmesj\menuSD{
Current directory/folder prefix for all file names is
&\ifx&\@empty&\dirprefix\.null.&\else
  `&\dirprefix'
&\fi
Enter the new directory prefix below.
(Enter Q to quit without changing the prefix.)}
\def\moptionSD{%
  \menuSD
  \readline{}\reply
  \let\next\reply \changecase\uppercase\next
  \if\xoptiontest\next
    \let\reply\next
  \else
    \let\dirprefix\reply
    \ifx\dirprefix\@empty
      \confirm{Directory prefix is now null.}%
    \else
      \confirm{New directory name:\
        \dirprefix\
      }%
    \fi
    \def\reply{Q}%
  \fi
  \optionexec\reply
}
\fxmenu\menuT{
Currently tabs will print as &\tabstyle.
The horizontal extent of each tab will be %
&\number&\spacespertab spaces.
}{
T  Change tab representation
N  Change the number of spaces per tab
}{}
\def\moptionT{\lettermenu T}
\fmenu\menuTT#1{
Tab representation choices:
}{
B  Blank space
.  Dots
-  Dashed line
H  Hrulefill
T  Tiny`TAB's fill
}{
These are better understood by trying them out than by having them
explained in words. Current tab style is `#1'.
}
\def\reportnewtabstyle#1{%
  \chardef\tabselect=#1 \relax
  \confirm{Tab style is now `\tabstyle'}%
  \def\reply{Q}%
}
\def\moptionTT{\menuTT\tabstyle
  \readChar{Q}\reply
  \if B\reply
    \reportnewtabstyle{0}%
  \else\if .\reply
    \reportnewtabstyle{1}%
  \else\if -\reply
    \reportnewtabstyle{2}%
  \else\if H\reply
    \reportnewtabstyle{3}%
  \else\if T\reply
    \reportnewtabstyle{4}%
  \fi\fi\fi\fi\fi
  \optionexec\reply
}
\def\moptionTN{%
  \promptmesj{Enter the desired number of spaces per tab: }%
  \readline{Q}\reply
  \if\xoptiontest\reply
  \else
    \checkinteger\reply\count@
    \ifnum\count@=-\maxdimen
    \else
      \ifnum\count@<256
        \chardef\spacespertab=\count@
        \confirm{%
  The number of spaces per tab is now \number\spacespertab.}%
        \def\reply{Q}%
      \else
        \mesj{Sorry, spaces per tab cannot be more than 255.}%
        \def\reply{}%  repeat the prompt
      \fi
    \fi
  \fi
  \optionexec\reply
}
\fmenu\menuV{}{
  8  Treatment of 8-bit characters
  L  Treatment of Control-L characters
}{}
\def\moptionV{\lettermenu{V}}
\fxmenu\menuVL{
Three choices are offered for the treatment of Control-L characters:
}{
  B  Print a boxed L (same treatment as other control characters)
  L  Print one line of space
  N  End current text column, start a new column
}{
Current setting is &\controlLaction.
}
\def\moptionVL{\menuVL
  \readChar{Q}\reply
  \if B\reply
    \let\controlLaction\reply
    \confirm{Control-L characters will print as boxed L's}%
  \else\if L\reply
    \let\controlLaction\reply
    \confirm{Control-L characters will print as a one-line space}%
  \else\if N\reply
    \let\controlLaction\reply
    \confirm{%
Control-L characters will perform a `formfeed' [new column] action}%
  \fi\fi\fi
  \def\reply{Q}\optionexec\reply
}
\expandafter\fxmenu\csname menuV8\endcsname{
Two choices are offered for the treatment of 8-bit characters, that
is, characters in the range 128--255:
}{
  A  Print according to the current font
  B  Print a boxed question mark
}{
Current setting is &\eightbitaction.
For option A, you must be careful to also select a font that is capable
of printing 8-bit characters (see option F in the main menu); otherwise,
8-bit characters will disappear silently from the printed output with
nothing more than a warning in the TeX log.
}
\expandafter\def\csname moptionV8\endcsname{%
  \csname menuV8\endcsname
  \readchar{Q}\reply
  \if A\reply \def\eightbitaction{A}%
  \else\if B\reply \def\eightbitaction{B}%
  \fi\fi
  \def\reply{Q}\optionexec\reply
}
\moption
\printfiles
\endinput
%%
%% End of file `listout.tex'.
