
¿Hay alguna forma de mostrar todas las palabras coloreadas al final de un documento?
Digamos que estoy marcando las definiciones en rojo y los teoremas en azul.
¿Es posible hacer una lista de "palabras clave" donde aparezcan todas las palabras rojas y otra lista con todas las palabras azules?
Algo como esto
\documentclass[12pt,a4paper]{article}
\usepackage{color}
\newcommand{\RC}{\textcolor{red}}
\newcommand{\BC}{\textcolor{blue}}
\begin{document}
\RC{red1} test
\BC{blue1} test
\BC{blue2} test
\RC{red2} test
\vfill
\RC{Definitions:}
\begin{itemize}
\item red1
\item red2
\end{itemize}
\bigskip
\BC{Theorems:}
\begin{itemize}
\item blue1
\item blue2
\end{itemize}
\end{document}
Respuesta1
Puede utilizar, por ejemplo, esta definición de \RC
:\BC
\documentclass[12pt,a4paper]{article}
\usepackage{color}
\long\def\addto#1#2{\expandafter\def\expandafter#1\expandafter{#1#2}}
\def\RC#1{\addto\RClist{\item#1}\textcolor{red}{#1}}
\def\BC#1{\addto\BClist{\item#1}\textcolor{blue}{#1}}
\def\RClist{}
\def\BClist{}
\begin{document}
\RC{red1} test
\BC{blue1} test
\BC{blue2} test
\RC{red2} test
\vfill
\textcolor{red}{Definitions:}
\begin{itemize}
\RClist
\end{itemize}
\bigskip
\textcolor{blue}{Theorems:}
\begin{itemize}
\BClist
\end{itemize}
\end{document}