[XeTeX] \XeTeXinterchartoks and \hbox

Vafa Khalighi simurgh12 at gmail.com
Sun May 6 10:20:14 CEST 2012


What is the problem with the following minimal example:

 \documentclass{article}

\usepackage{color}

\makeatletter

\newcount\n

\n=`\a \loop \XeTeXcharclass \n=4 \ifnum\n<`\z \advance\n by 1 \repeat

\XeTeXinterchartoks 0 4 {\startcolor}

\XeTeXinterchartoks 255 4 {\startcolor}

\XeTeXinterchartoks 255 0 {\finishcolor}

\XeTeXinterchartoks 4 0 {\finishcolor}

\newif\ifcolor

\newcommand{\startcolor}{\ifcolor\else\bgroup\color{red}\colortrue\fi}

\newcommand{\finishcolor}{\ifcolor\egroup\fi}

\makeatother

\XeTeXinterchartokenstate=1

\begin{document}

this is a test

\end{document}


It produces the following error:


! Missing } inserted.

<inserted text>

}

l.19 \end{document}

 ?


However if "this is a test" is replaced with "this is a test.", then I get
no error. How should I fix this?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/xetex/attachments/20120506/28a84d63/attachment.html>


More information about the XeTeX mailing list