%%%% LinoTeXPlus.tex, June 92 -- Feb 1993
 %%% --- part of the LinoTeX package, 1991-
 %%% for interactive "mousing" with TeX.
 %%% Master postings: 
 %%%    ftp matups.matups.fr  [192.54.146.4] 
 %%%    ftp rsovax.ups.circe.fr  [130.84.128.100]
 %%% 
 %%% All you have to do to adapt your
 %%% article <myart>.tex is sweep all the macros
 %%% and parameter settings into the style file
 %%% <myart>.sty,  something that is good 
 %%% practice in any event.

 %%% AIM: create a TEMPORARY format and some .tex files
 %% for use of LinoTeXPlus with a specific article.
 %% This format is for the selection test file
 %% not for the whole article!

 %%% COMPILATION PROCEDURE:
 %% See after \endinput
 %% See also LinoTeX.doc

 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 \chardef\LinoEmark=\the\catcode`\!
 \catcode`\!=12
 \chardef\LinoAtmark=\the\catcode`\@
 \catcode`\@=11
 
  \def\ms@g{\immediate\write16}

 \ms@g{}
 \ms@g{ ********* LinoTeXPlus format compiler *********}
 \ms@g{ *** Hit return and select style file to compile}
 \ms@g{ *** to create format and .tex files to repeatedly }
 \ms@g{ *** compose selections from your article.} 
 \ms@g{ *** The style file must contain all your macros and params!}
 \ms@g{ *** You must now be running the base format for your article.}
 \ms@g{ *** And remember OzTeX must be using INITEX.}
 \show\anticipation

  \ifx\undefined\LinoTeXPlusLoaded
     \let\temp\relax
 \else
     \message{ *** LinoTeX macros already loaded.}%
     \def\temp{\endinput}%
 \fi
 \temp

 \input MagicDefault.sty

 \catcode`\@=11
 \catcode`\!=12
 
 \newbox\Linobox
 \setbox\Linobox=\vbox{\offinterlineskip
         \hbox to \hsize{\tt LinoTeXPlus selection typeset:
               \hss[end of line\hbox to 1sp{}]}%
    \vskip3pt
    \hbox to \hsize{%
       \vrule height 0pt depth 5pt width.4pt\hss
       \vrule height .4pt width\hsize depth 0pt\hss
       \vrule height 0pt depth 5pt width.4pt}
    \vskip3pt
    }

 \def\LinoPlusExceptions{%
 \ms@g{}
 \ms@g{ !! I was expecting \string~ first off.}
 \ms@g{ !! So this is NOT a LinoTeXPlus selection!}
 \ms@g{ !! Hit  return  to stop.}
 \ms@g{ !   If you are an efficiency freak, you can}
 \ms@g{ !   go on by hitting  y  (or any key) plus  return.}
 \ms@g{ !   The test formatting will then be gone but not} 
 \ms@g{ !   the temporary macros.}
 \ms@g{}
   \def\temp{\par}
   \read16 to \YourChoice
   \ifx\YourChoice\temp
      \def\Temp{\csname bye\endcsname}
   \else
     \def\Temp{%
       \let\TestFormatting\endinput
       \input\TempMacros\relax
       }
   \fi
   \Temp
 }

 \def\LinoGobble#1{\ignorespaces}

 \def\LinoTeXMain{\input\TempMacros\relax
    \LinoRulerSpider{\copy\Linobox}%
    \noindent\leavevmode
    %\tracingmacros=0%%%%%%
    \LinoGobble
    }

  \let\LinoRulerSpider\relax
  \def\KillLinoRuler{\def\LinoRulerSpider##1{\relax}}

  \def\LinoPlusPrep{%
     \ifx\next~\relax%%%%
        \let\temp\LinoTeXMain
     \else
        \let\temp\LinoPlusExceptions
     \fi\temp}
 
  \everyjob{%\tracingmacros=1 %%%
     \futurelet\next\LinoPlusPrep}

  \tracingstats=0
 
  \let\LinoTeXPlusLoaded\relax
  \let\TestFormatting\relax

  %% for LaTeX provide a \bye
 \begingroup
   \ifx\undefined\@@end \global\let\@@end\end
   \fi
   \gdef\bye{\vfill\supereject\@@end}
 \endgroup

 \def\TempMacros{TempMacros.tex}
 \def\TexturesTest{!!!!!TexturesTest}
 \def\OzTest{OzTest.tex}

 \openin15 LinoCnfg.tex
 \ifeof15
    \closein15\let\temp\relax
 \else
    \closein15\def\temp{\input LinoCnfg.tex}%    
 \fi
 \temp


 \let\Temp\relax

   \ms@g{}
   \ms@g{ ** Hit return key to renew auxiliary files,}
   \ms@g{ ** (then all must currently be closed!)}
   \ms@g{ *  x or any key to leave existing files.}
   \def\temp{\par}
   \read16 to \YourChoice
   \ifx\YourChoice\temp
   \else
     \let\Temp\dump
   \fi

 \catcode`\!=\the\LinoEmark
 \catcode`\@=\the\LinoAtmark

 \Temp %% valve is \relax if we make new copy of TempMacros
       %% else is \dump

 \catcode`\@=11 %% back into programming
 \catcode`\!=12

 
 \openin15 \TexturesTest
 \ifeof 15
   \closein15
   \immediate\openout15 \TexturesTest
   \immediate\closeout15
 \else
   \closein15
 \fi

 \openin15 \OzTest
 \ifeof15\relax
   \closein15
   \immediate\openout15 \OzTest
   \immediate\closeout15
 \else
   \closein15
 \fi

 \immediate\openout15 \TempMacros

 \begingroup
 \catcode`\;=12\catcode`\?=12
 \catcode`\:=12\catcode`\!=12
 \catcode`\%=12
 \catcode`\_=12
 \catcode`\&=13
 \def&#1_{\immediate\write15{#1}}
 \catcode`\^^0d=14
 \catcode`\/=0
 \catcode`\\=12
 \catcode`/ =12

&%%%% TempMacros.tex %% see (1)(3) below_
&_
& \count255=\the\catcode`\@ % save to scratch register 255_
& \catcode`\@=11_
&  %%% macros here with @ in cs names!_
&_
&_
& \catcode`\@=\count255 % restore 12 or 13?_
&_
&_
& \TestFormatting %% see (2)_
& %%% format modifications here_
& \output{\shipout\box255} % most common one_
&_
&_
& \endinput_
&_
& %%%% COMMENTS on TempMacros.tex_
&   %_
& %%%%%% (1) from beginning to \TestFormatting_
& %% Macros in this segment are \input before each selection is composed _
& %% by LinoTeX+, and also when whole article is typeset normally._
& %% Be alert for required catcode changes_
& %% particularly of the form \catcode`\@=..._
&_
& %%%%%% (2) from \TestFormatting to \endinput_
& %% Some possible simplifications of output to consider_
& %% to enhance speed and clarity of tests. _
& %%  _
&  % \TestFormatting %% always include; _
&  %%     valve: possible values \relax and \endinput _
&  % \output{\shipout\box255} % most common one_
&  % \KillLinoRuler %% for big selections?_
&  % \nopagenumbers_
&  % \hsize=?? %% to fit preview to screen_
&  % \let\makeheadline=\relax_
&  % \let\makefootlineline=\relax_
&  % \output{\shipout\box255} % fast; some inserts will disappear_
&  % \errorcontextlines=0_
&  % \tracingstats=0_
&_
&  %% Alternative for LaTeX (only)_
&     % \def\bye{\end{document}} %% (b) _
&     %  This is more in the spirit of LaTeX, but it will require_
&     %  you to select the end of every environment of which _
&     %  you select the beginning._
&  % \endinput %% always include_
&_
& %%%%% (3) for improved speed delete all comments_
& %% and empty lines above \endinput_
&_
/endgroup

 \immediate\closeout15 
 \catcode`\@=\the\LinoAtmark
 \catcode`\!=\the\LinoEmark

 \dump





 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

COMPILATION INSTRUCTIONS

     Place this file LinoTeX.tex in the same directory as your 
TeX typescript and  compose LinoTeX.tex on top of your base
format It will ask for your style file, and then dump the
required format after creating auxiliary files

     !!!!!TexturesTest  
     OzTeXTest.tex
     TempMacros.tex

These are default names that you can change by setting out
a file LinoCfg.tex given as an Appendix. 

     Best use a conventional name such as "LT" for
the format since you do not want such bulky files to
accumulate. This "LT" is normally to be recompiled for every
work session, although, on single user machines, it can serve
longer.

    This format "LT" is designed for the compilation
of LinoTeX selections and NOT for the compilation of your whole
article.

    NB. LaTeX users should include in myart.sty the document-style 
and begin-document commands. An example of these is:

   \documentstyle[11pt]{article}
   \begin{document}


Appendix: 

  The configuration file LinoCnfg.tex if present at all
should be of the form:

 \def\TempMacros{TempMacros.tex}
 \def\TexturesTest{!!!!!TexturesTest}
 \def\OzTest{OzTest.tex}

where of course the names are to be changed.  For the last
two, the empty is empty name can be used to omit that file.