I have the problem that automatic hyphenation in listings caption doesn't work if automatic linebreaking is activated. It works if I set breaklines=false
or captionpos=t
, which is weird. Is there a workaround? I want to have captions at the bottom and I need automatic line-breaking.
\documentclass{article}
\usepackage[english]{babel}
\usepackage{listings}
\lstset{
breaklines=true,
captionpos=b
}
\begin{document}
\begin{lstlisting}[caption={information information information information information information information}]
A = B
C = D
\end{lstlisting}
\end{document}
captionpos=b
(WRONG):
captionpos=t
(correct):