1

I manage to use graphical images in both text and tables as if they were letters:

\documentclass{article}
\usepackage{graphicx}
\newcommand{\inspictext}{  \includegraphics[width=0.04\textwidth]{example-image-b}}

\begin{document}

Some text \inspictext \begin{table} \newcommand{\inspic}{ \includegraphics[width=0.04\textwidth]{example-image-a}} \begin{tabular}{llc} A &\inspic \ B &\inspic \ \end{tabular} % \caption{the symbol \inspictext is ..}
\end{table} \end{document}

This is confirmed in the output:

enter image description here

I would like to use an image also in the table caption. Therefore, I uncomment the line

   %  \caption{the symbol \inspictext is ..}   

I get an error:

! Argument of \@caption has an extra }.
<inserted text> 
                \par 
l.14     \caption{the symbol \inspictext is ..}

How to fix?

Viesturs
  • 7,895

0 Answers0