% Macros for dealing with Fortran code in TEX files
%-----------------------------------------------------------------------
%;  Copyright (C) 1995
%;  Associated Universities, Inc. Washington DC, USA.
%;
%;  This program is free software; you can redistribute it and/or
%;  modify it under the terms of the GNU General Public License as
%;  published by the Free Software Foundation; either version 2 of
%;  the License, or (at your option) any later version.
%;
%;  This program is distributed in the hope that it will be useful,
%;  but WITHOUT ANY WARRANTY; without even the implied warranty of
%;  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%;  GNU General Public License for more details.
%;
%;  You should have received a copy of the GNU General Public
%;  License along with this program; if not, write to the Free
%;  Software Foundation, Inc., 675 Massachusetts Ave, Cambridge,
%;  MA 02139, USA.
%;
%;  Correspondence concerning AIPS should be addressed as follows:
%;          Internet email: aipsmail@nrao.edu.
%;          Postal address: AIPS Project Office
%;                          National Radio Astronomy Observatory
%;                          520 Edgemont Road
%;                          Charlottesville, VA 22903-2475 USA
%-----------------------------------------------------------------------
% 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}}
