0

This question already has an answer here:

I need to color a specific word in my document compiled with XeLaTeX engine, following this answer automatically apply special formatting to selected words in text.

\documentclass{article}
\usepackage{color,xesearch}

\SearchList*{redwords}{\textcolor{red}{#1}}{hello}

\begin{document}
This is hello and this is hellow.
\end{document}

I have Error

! Undefined control sequence. \xdef \xs@String {\xs@String h}\xs@LearnLetter l.7 Thi s is hello and this is hellow. The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., '\hobx'), type 'I' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined.

marked as duplicate by egreg errors Feb 26 '17 at 21:21

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2

Same problem as in your other question. xesearch hasn't be adapted to the new number of classes.

\documentclass{article}
\usepackage{color}
\usepackage{xesearch}
\makeatletter
\chardef\xs@NatDel=4095
\XeTeXinterchartoks\xs@lrDel\xs@Classless={\xs@LearnLetter}
\XeTeXinterchartoks 4095 \xs@Classless={\xs@LearnLetter}
\XeTeXinterchartoks 4095 \xs@lrDel{\xs@EndString}
\makeatletter
\SearchList*{redwords}{\textcolor{red}{#1}}{hello}

\begin{document}
This is hello and this is hellow.
\end{document}

enter image description here

Not the answer you're looking for? Browse other questions tagged or ask your own question.