Predefinovani pismene v makru
Jaromir Kuben
kuben at scova.vabo.cz
Tue Nov 19 14:05:12 CET 1996
> Mohl by mi nekdo rici, jak spravne predefinovat pismeno v makru? Ono totiz
> tohle jede:
>
> % Format: cslatex2e
> \documentclass{report}
> \begin{document} {
> \catcode`\o=\active \def o{XYZ}
> Kudrnovo kolo
> } \end{document}
>
> kdezto nize uvedene hlasi chybu Please don't say `\def cs{...}', say
> `\def\cs{...}'
>
> % Format: cslatex2e
> \documentclass{report}
> \def\NewKeyboard{
> \catcode`\o=\active \def o{XYZ}
> Kudrnovo kolo
> }
> \begin{document}
> \NewKeyboard
> \end{document}
>
>
Potiz je v tom, ze v okamziku uvedeni definice \NewKeyboad jiz
musi byt \catcode\`o=\active (aspon tak jsem to pochopil pri cteni
knihy V. Eijkhout: TeX by Topic - urcite to bude i v chystane knize
p. Olsaka). Takze trik by byl nasledujici:
% Format: cslatex2e
\documentclass{report}
{\catcode`\o=\active
\gdef\NewKeyboard{\catcode`\o=\active \def o{XYZ}
Kudrnovo kolo
}}
\begin{document}
{\NewKeyboard}
\end{document}
Ted ale vznikne potiz s tim, ze ve slovech NewKeyboard a catcode je o,
ktere ma zmenenou kategorii, takze to zase nefunguje. Vyresi to nasledujici
(urcite velice neohrabany) kod:
% Format: cslatex2e
\documentclass{report}
\let\catcde\catcode{\catcode`\o=\active
\gdef\NewKeyb{\catcde`\o=\active \def o{XYZ}
Kudrnovo kolo
}}
\let\NewKeyboard\NewKeyb
\begin{document}
{\NewKeyboard}
\end{document}
To mi fungovalo.
Jaromir Kuben
> Diky.
>
>
> *** Petr Mikulik, mikulik at polycnrs-gre.fr, tel. (04/33-4-)76.88.74.26
> *** Laboratoire Louis Neel, Grenoble, France
> *** Permanent address: mikulik at physics.muni.cz
> *** Dpt. of Solid State Physics, Masaryk University, Brno, Czech Republic
> *** http://www.sci.muni.cz/~mikulik/ (X-ray physics;OS/2,TeX,C++,freeware)
>
More information about the csTeX
mailing list