% Macros for dealing with Fortran code in TEX files
% Written by Tim Cornwell, NRAO/VLA, 86/10/07
% Inserted in TEX$INPUTS same date by Pat Murphy
% Extracted and modified 88/01/07 by Pat Murphy - no line numbers, ten point
%
% \fortranfile reads a FORTRAN file and outputs it as is. The use is
%
% 		\fortranfile{APCLN.FOR}
%
% \fortran takes a piece of FORTRAN text and outputs it as is. The use is
% 
% 	\fortran
%	      DO 10 I=1,100
%	        X(I) = SQRT(I)
%	   10 CONTINUE
%	\endfortran
%
\font\tentt=cmtt10
\def\uncatcodespecials{\def\do##1{\catcode`##1=12 }\dospecials}
{\catcode`\`=\active \gdef`{\relax\lq}}
\def\setupfortran{\tentt 
  \def\par{\leavevmode\endgraf} \catcode`\`=\active
  \obeylines \uncatcodespecials \obeyspaces \parskip=1pt}
{\obeyspaces\global\let =\ }
\def\fortranfile#1{\par\begingroup\setupfortran\input#1 \endgroup}
%
\def\fortran{\par\begingroup\setupfortran\dofortran}
{\catcode`\|=0 \catcode`\\=12
 |obeylines|gdef|dofortran^^M#1\endfortran{#1|endgroup}}
