I'm trying to make a tabular which is able to highlight keywords inside a tabular in the same fashion as the listings package does. I want to give this as a column specification to the tabular, which is challenging since seems that the listings doesn't recognize LaTeX macroes inside it's enviroment. My attempt was like this
Code: Select all
\usepackage{listings}
\newsavebox{\boxname}
\lstset{keywords={ref, class, abstract}}
\begin{document}
\begin{tabular}{|c|>{\begin{lrbox}{\boxname}}c<{\end{lrbox}\lstinline{\unhbox\boxname}}|}
A & class c\\
\end{tabular}
\end{document}
Thanks,
Eimund