Verbatim prostredi a \par
Ladislav Kasparek
platon at pf.jcu.cz
Tue Sep 19 10:12:55 CEST 2000
Dobry den,
jak pracuje verbatim prostredi je pekne popsano v TBN. Pokud
budu chtit nacis soubor pomoci \input do verb. prostredi, napr:
\def\setverb{\def\do##1{\catcode`##1=12}\dospecials}
{\obeyspaces \gdef\activespaces{\obeyspaces\let =\ }}
\def\listing{\bgroup\setverb\activespaces
\def\par##1{\endgraf \ifx##1\par\leavevmode\fi ##1}
\obeylines\tt\input plain.tex\relax\egroup}
\listing\end
na konci souboru (plain.tex) tex hlasi:
Runaway argument?
! File ended while scanning use of ^^M.
<inserted text>
\par
<to be read again>
\relax
\listing ...\obeylines \tt \input plain.tex\relax
\egroup
l.8 \listing
\end
?
Proc???
Problem jsem 'obesel' takto:
\def\setverb{\def\do##1{\catcode`##1=12}\dospecials}
{\obeyspaces \gdef\activespaces{\obeyspaces\let =\ }}
\def\listing{\bgroup\setverb\activespaces
\def\nextpar{\ifx\next\par\leavevmode\fi\next}
\def\par{\endgraf\afterassignment\nextpar\let\next=}
\obeylines\tt\input plain.tex\relax\egroup}
\listing\end
Predem dekuji za vysvetleni.
Ladislav Kasparek
More information about the csTeX
mailing list