# format special words in text

Is it possible and furthermore constructive to make LaTeX automatically format specific words in specific way? Let's say, for example, I'd like to have every occurrence of the word "hello" in a bold cyan monospaced serif font (whereas the rest of the document remains normal, sans serif and black).

How can I achieve that without having to do a search&replace to place "hello" into a custom command everytime before I compile the .tex file?

-
You can, for example, run sed -i … by \write18 and modify text file before compiling it by latex. –  Eddy_Em Apr 5 '13 at 12:17
Wouldn't it be easier, if possible, to do that type of formatting in advance in the input file itself, by defining a custom \hello macro? –  Jubobs Apr 5 '13 at 12:25

Compile this with XeLaTeX

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

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

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


But don't use it. If you want to specially mark a word, use a macro.

Why? Relying on automatic procedures is always risky: if I have a choice, I prefer explicit mark up. Another reason is that xesearch is resource hungry and currently unmaintained.

There's nothing similar for pdflatex; something can possibly be done with LuaLaTeX. I tried chickenize but it doesn't seem to offer the feature.

-