[XeTeX] \XeTeXinterchartoks and \hbox

Susan Dittmar Susan.Dittmar at gmx.de
Mon May 7 11:49:50 CEST 2012


Quoting Vafa Khalighi (simurgh12 at gmail.com):
> 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}

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

> \makeatother
> \XeTeXinterchartokenstate=1
> \begin{document}
> this is a test
> \end{document}

Hope this helps,

	Susan


More information about the XeTeX mailing list