I got very bad caption when using LTXexample in conjuction with its caption option.
Here is the minimal code snippet.
Code: Select all
\documentclass[10pt]{article} % Because the minimal class does NOT define figure environment I use article class instead.
\usepackage{showexpl}
\lstset{%necessary settings
explpreset={},
breaklines=true,
frame=single,
numbers=left,pos=b}
\begin{document}
\begin{lstlisting}[caption={Using lstlisting. No problem in caption.}]
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
\end{lstlisting}
\vspace{1cm}
\begin{LTXexample}[caption={Using LTXexample. Caption looks ugly.}]
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
\end{LTXexample}
\end{document}
Note : only above caption has this problem, bottom caption works well.
Thank you in advance.
regards,
LATEXIAN