TransWikia.com

Extra endgroup inexplicably in XeLaTeX interchartoks

TeX - LaTeX Asked by tex_user_7 on July 24, 2021

This minimal code is throwing me an extra endgroup error in XeLaTeX and I can’t for the life of me understand why! Does anyone have a solution to this error?

documentclass{article}
usepackage{xcolor}
XeTeXinterchartokenstate = 1
newXeTeXintercharclass mydigitsclass 

XeTeXcharclass `Q mydigitsclass


XeTeXinterchartoks 0 mydigitsclass = {begingroupcolor{green}}
XeTeXinterchartoks mydigitsclass 0  = {endgroup}
XeTeXinterchartoks 255 mydigitsclass = {begingroupcolor{green}}
XeTeXinterchartoks mydigitsclass 255  = {endgroup}

begin{document}

Qa a Q

end{document}

2 Answers

The boundary has been raised from 255 to 4095 with the TeX Live release of 2019,

XeTeX 3.14159265-2.6-0.999991

If I apply the change to your code I get

enter image description here

Correct answer by egreg on July 24, 2021

The boundary class hass been 4095 not 255 for some years:

enter image description here

documentclass{article}
usepackage{xcolor}
XeTeXinterchartokenstate = 1
newXeTeXintercharclass mydigitsclass 

XeTeXcharclass `Q mydigitsclass


XeTeXinterchartoks 0 mydigitsclass = {1begingroupcolor{green}}
XeTeXinterchartoks mydigitsclass 0  = {2endgroup}
XeTeXinterchartoks 4095 mydigitsclass = {3begingroupcolor{green}}
XeTeXinterchartoks mydigitsclass 4095  = {4endgroup}

begin{document}

Qa a Q

end{document}

The digits just to make it easier to see where the tokens are added.

Answered by David Carlisle on July 24, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP