[tex-eplain] Can't figure out this error
geolsoft at mail.ru
geolsoft at mail.ru
Wed Aug 24 19:39:39 CEST 2005
On Wed, Aug 24, 2005 at 12:22:44PM -0400, Arctic Fidelity wrote:
> \long\def\inserttool#1#2#3#4#5#6#7{%
> \dimen255=\parindent
> \parindent=0pt
> \begingroup\center
> \bigskip{\tooltitlefont #1}
> \smallskip{\toolmaker #2}
> \medskip{\toolurl #3}
> \smallskip
> \count10=#4
> \loop \ifnum{\count10}{>}{0} \star \repeat
> \bigskip
> \endgroup
> Initial Cost of Purchase: #5\par
> Estimated Cost of Use: #6\medskip
> \parindent=\dimen255
> #7\bigskip}
The justification macros (including \center) depend on
actual newlines present in the input, but in the definition
of the macro the newlines are replaced either by \par or by
spaces. Try setting catcode of ^^M to active before the
definition, like this:
\begingroup
\catcode`\^^M = \active %
\long\gdef\inserttool#1#2#3#4#5#6#7{%
[....]
}%
\endgroup
(Note the \gdef instead of \def). Also, since now newlines
are active, put a comment at the end of every line where you
don't want this active newline to be present (probably every
line except the line with the \center macro). See if it
helps.
Anyway, I think it's not a good idea to use \center here.
You might be better off with \raggedcenter from The TeXbook,
or even use \centerline, if the texts you center are never
longer than one line.
--
Best regards,
Oleg Katsitadze
More information about the tex-eplain
mailing list