\documentclass[14pt]{extarticle}
\usepackage{xcolor}
\definecolor{deepblue}{rgb}{0,0,0.5}
\definecolor{deepred}{rgb}{0.6,0,0}
\definecolor{deepgreen}{rgb}{0,0.5,0}
\usepackage{listings}
\lstloadlanguages{[LaTeX]TeX}
\lstdefinestyle{listLaTeX}{
language={[LaTeX]TeX},
extendedchars=true,
belowcaptionskip=5pt,
xleftmargin=0.5cm,
numbers=left,
numberstyle=\scriptsize\ttfamily\bf,
frame=single,
breaklines=true,
breakatwhitespace=true,
breakindent=0pt,
basicstyle=\small\ttfamily,
keywordstyle=\color{deepblue}\ttfamily,
identifierstyle=\color{deepred}\ttfamily,
commentstyle=\color{deepgreen}\ttfamily,
morekeywords={},
emphstyle=\color{red},
emph={},
columns=fullflexible,
showstringspaces=false
}
\begin{document}
Test -- \lstinline[style=listLaTeX]!\Huge!!
\begin{tabular}{|p{0.29\linewidth}|p{0.29\linewidth}|p{0.29\linewidth}|}
\hline
1&2&3\\
\lstinline[style=listLaTeX]!\Huge!&2&3\\%This line has an error!!!!
\hline
\end{tabular}
\end{document}
[Tex/LaTex] Why doesn’t \lstinline work in table column
listingstables
Best Answer
The answer by egreg didn't work for me, so her is an example how I do it:
notice that I've used '$$' instead of brackets '{}' it results in: