Generalfirst label gets lost when enumerate enclosing LTXexample

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
yoyoimut
Posts: 120
Joined: Mon Oct 19, 2009 6:58 am

first label gets lost when enumerate enclosing LTXexample

Post by yoyoimut »

EnumGetLost.jpg
EnumGetLost.jpg (20.26 KiB) Viewed 2325 times

Code: Select all

\documentclass{article}
\usepackage{showexpl}

\begin{document}
\begin{enumerate}
\item%
\begin{LTXexample}
one one one
\end{LTXexample}
\item%
\begin{LTXexample}
two two two
\end{LTXexample}
\end{enumerate}
\end{document}

I have no idea about this bug.


Thank you.


regards,


Yuko.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

first label gets lost when enumerate enclosing LTXexample

Post by localghost »

yoyoimut wrote:[…] I have no idea about this bug. […]
Perhaps the package maintainer has.


Best regards
Thorsten
yoyoimut
Posts: 120
Joined: Mon Oct 19, 2009 6:58 am

first label gets lost when enumerate enclosing LTXexample

Post by yoyoimut »

Accidently, I found the solution of this bug.
Just wrap the previous with minipage and the bug vanishes.

Code: Select all

\documentclass{article}
\usepackage{showexpl}

\begin{document}
\begin{enumerate}
\item%
\begin{minipage}{\linewidth}
\begin{LTXexample}
Something
\end{LTXexample}
\end{minipage}
\item%
\begin{minipage}{\linewidth}
\begin{LTXexample}
Something
\end{LTXexample}
\end{minipage}
\end{enumerate}
\end{document}
Post Reply