I am having trouble with the following piece of code.
Code: Select all
\documentclass{article}
\usepackage[T1]{fontenc}
\newwrite\writekey
\immediate\openout\writekey=\jobname.key
\newcommand{\gap}[1]{
\def\temp{#1}
\immediate\write\writekey{\string\keyitem{\temp}}
\temp
}
\newcommand{\keyitem}[1]{
\def\temp{#1}
\temp
}
\begin{document}
\gap{Za\.z\'o\l{}\'c g\k{e}\'sl\k{a} ja\'z\'n}
\immediate\closeout\writekey
\input{\jobname.key}
\end{document}
Incredibly, the gibberish from the .key file is printed correctly in the .dvi file. However, I would like to keep all my files "pure" ASCII for the publisher's benefit, to preclude printing errors.
Can anyone here suggest a way to make LaTeX export to the .key file exactly what I give \gap in the .tex file? In other words, to make the .key file read
Code: Select all
\keyitem{Za\.z\'o\l{}\'c g\k{e}\'sl\k{a} ja\'z\'n}
I use Windows and MIKTeX 2.8.
Thank you for your time!
woj-k