<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">% firstline
% from Jim Fox, C4328%UWARITA.BITNET
%
% \firstline &lt;paragraph tex&gt; sets the first line of the paragraph in
%   \Firstlinefont; the rest of the paragraph in normal font
% To use, define \Firstlinefont, e.g.
% \font\Firstlinefont=amcsc10
% for caps smallcaps, and then put \firstline before the text of
% the paragraph.
%
\def\firstline{\par\begingroup\Firstlinefont
  \def\zzz{}\dimen0\parindent
  \setbox0=\hbox{ }\advance\dimen0by-\wd0
  \x}
\def\x{\afterassignment\y\z}
\def\z#1 {\xdef\zz{#1\ }}
\def\y{\setbox0=\hbox{\zz}
  \advance\dimen0 by\wd0
  \ifdim\dimen0&lt;\hsize\let\next=\x
    \edef\zzz{\zzz\zz}
  \else\let\next=\endgroup
    \leavevmode\zzz\unskip\break\aftergroup\zz
  \fi
  \next}
 
***********************************************
% example to demonstrate \firstline
%
\def\uncatcodespecials{\catcode`@=12\def\do##1{\catcode`##1=12}\dospecials}
\def\setupverbatim{\tt\obeylines\uncatcodespecials\obeyspaces}
{\obeyspaces\global\let =\ }
\def\beginshowoff{\par\begingroup\setupverbatim\doverbatim}
{\catcode`\!=0 \catcode`\\=12
!obeylines!gdef!doverbatim^^M#1\endshowoff{#1!endgroup!medbreak!filbreak!smallskip}}
\magnification1095
\hsize5truein\hoffset.5truein
\baselineskip=1.2\normalbaselineskip
\font\Firstlinefont=amcsc10
\input firstline
%
\firstline The first line of this paragraph is set in fancy font
(caps small caps), while the remaining lines are set in normal type.
The method does not hyphenate, but otherwise works for most applications.
 
\bigskip
\let\Firstlinefont=\bf
\firstline This sentence is short---and has \TeX\ in it.
As before, only the first line of this paragraph
appears in the special font (in this case, bold face).
 
\vskip1truein
\parindent=0pt\hfuzz=50pt
\beginshowoff
\magnification1095
\hsize5truein\hoffset.5truein
\baselineskip=1.2\normalbaselineskip
\font\Firstlinefont=amcsc10
\input firstline
%
\firstline The first line of this paragraph is set in fancy font
(caps small caps), while the remaining lines are set in normal type.
The method does not hyphenate, but otherwise works for most 
applications.
 
\bigskip
\let\Firstlinefont=\bf
\firstline This sentence is short---and has \TeX\ in it.
As before, only the first line of this paragraph
appears in the special font (in this case, bold face).
\bye
\par
\endshowoff
\bye
</pre></body></html>