0

I made a code lisitng:

\begin{lstlisting}[language=C,caption={ This is the caption, reproduced from []},captionpos=b,  frame=single,   numbers=left,label={lst:code}] 
if ....%% code goes here
\end{lstlisting}

The caption has a '['. I don't know where it comes from or how to remove it.

Rafa
  • 101
  • 1
    Welcome to TeX.SE! Please make your code snippet be compilable, resulting in your issue. Then we can copy and test your code on our computers to find the error ... – Mensch Feb 21 '22 at 15:22
  • 2
    The listings manual lists that the caption syntax is caption={[hshorti]hcaption texti} the parsing of that might be a bit fragile. It worked for me to use caption={This is the caption, reproduced from {[]}} – daleif Feb 21 '22 at 15:35
  • 1
    @daleif Indeed, the errant [ goes away with caption={[]This is the caption, reproduced from []} as well. – cslstr Feb 21 '22 at 15:59
  • 1
    Note that that choice might have consequences. – daleif Feb 21 '22 at 17:08
  • thanks. Problem solved it works. – Rafa Feb 21 '22 at 18:19

0 Answers0