[Tex/LaTex] How to highlight keywords

footnoteskeywords

I have an article with many keywords mixed throughout. I also have a list of those keywords and their definitions (this list needn't appear in the document, and I can put it in a CSV or any format as necessary). Is there any way to have LaTeX search for these keywords in the document and highlight them?

Two possible options:

  1. Place any keywords found in the document in italics.

  2. (preferred) Create a \footnote wherever the keywords appears in the document, with the definition or use some other form of automated cross-reference (for instance, against a glossary).

Best Answer

With XeLaTeX it's possible via the xesearch package.

\documentclass[border=1]{standalone}
\usepackage{fontspec}
\usepackage{xesearch}

\SearchList{list1}{\textit{#1}}{keyword,something}

\begin{document}\Huge
This is text that shows a keyword,\\
which is something special.
\end{document}

The result is shown below

here

Related Question