[tex-eplain] replace final comma with period

Oleg Katsitadze olegkat at gmail.com
Wed May 10 18:21:32 CEST 2006


On Wed, May 10, 2006 at 02:32:28PM +0000, Adam Fenn wrote:
> Is there an eplain way to automatically end the paragraph with a period
> rather than a semi-colon?

Do you accept a non-Eplain solution :) ?  The following does
not use Eplain and works as long as you don't have any text
after the final \form in a paragraph:

====================CUT====================
% Punctuation between two \form's.
\def\formpunct{; }

% Finish off with a period and reset \par.
\def\newpar{.\endgraf\let\par\endgraf}

\def\form#1#2#3{%
  \leavevmode % Ensure \everypar takes effect.
  \punct
  {\it#1\/ }#2 #3%
  \let\punct\formpunct
  \let\par\newpar
  \ignorespaces
}

\everypar={\let\punct\empty}% No punctuation before the first \form.


\form{name}{year}{source}
\form{name}{year}{source}
\form{name}{year}{source}

Some other paragraph.

\form{name}{year}{source}
\form{name}{year}{source}
\form{name}{year}{source}

\form{name}{year}{source}
\form{name}{year}{source}

Some other paragraph.

\bye
====================CUT====================

HTH,
Oleg


More information about the tex-eplain mailing list