# Package showexpl throws “Label … multiply defined” [closed]

With the following MWE you will get a warning

Label lst:HalloWelt multiply defined.


In the MWE I have added the calls for packages showlabels and refcheck to show the used labels and to check unused labels. Please just uncomment.

As I see package showexpl (version 2012/09/22 v0.3j) causes this warning. How can I get rid of this warning?

MWE:

\listfiles
\RequirePackage{filecontents}
\begin{filecontents*}{HalloWelt.ltx}
\documentclass{scrartcl}
\begin{document}
Hallo Welt!
\end{document}
\end{filecontents*}

\documentclass{scrartcl}
%\usepackage{showlabels}   % To check the used label
%\usepackage{refcheck}     % to check unused labels
\usepackage{varioref}     % difference with ref automaismn?
\usepackage{listings}

\usepackage[rframe=single]{showexpl}

\begin{document}

%\section{Test1}\section{Test2}              % no change of warning
%\subsection{subtest1}\subsection{subtest2}  % with or with not sections

The following macro throws the warning:
LaTeX Warning: Label lst:HalloWelt multiply defined.

\LTXinputExample[%
caption={Datei \texttt{HalloWelt.ltx}}
,label={lst:HalloWelt}
]{HalloWelt.ltx}

How to get rid of that warning?
This is a reference to listing~\ref{lst:HalloWelt}
and with varioref~\vref{lst:HalloWelt}.

\end{document}

-

## closed as too localized by Kurt, Speravir, Werner, Qrrbrbirlbel, ThorstenMar 7 '13 at 6:03

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

Sent the author a bug report. – Ulrike Fischer Mar 1 '13 at 9:14
@UlrikeFischer I sent a bug report but got til now no reaction :-( – Kurt Mar 4 '13 at 20:06
Before another non-English native complains about: The word “multiply” seemed dubious to me, but it’s correct: Multiply - Definition and More from the Free Merriam-Webster Dictionary (scroll down for second meaning). – Speravir Mar 7 '13 at 3:48
@Speravir: You should also consider the pronunciation. In this context, multiply is pronounced like multipli in multiplication, and not the same as multiply in multiply these fractions. – Werner Mar 7 '13 at 4:01
@Werner Yes, but this cannot be seen or heard ;-) in writing. – Speravir Mar 7 '13 at 4:25

When looking for the reason for the warning, that also results in special causes with an wrong reference number (for example listing 2.3 instead of listing 2.1) I found some older versions of showexpl, tried them and get the following result:

• with version 0.3j (current) the warning occurs
• with version 0.3i the warning disappears.

The difference between both versions are, that the lines 230-231

\let\SX@MakeCaption\lst@MakeCaption
\let\lst@MakeCaption\@gobble


and line 242

\let\lst@MakeCaption\SX@MakeCaption


(line numbers from version 0.3i) are deleted in version 0.3j.

I Do not know why the maintainer has removed this lines. If you use version 0.3i or copy the deleted lines into version 0.3j the referencing numbers are right and the warnings disappear.

Edit:

The author of showexpl sent me a corrected version of the package and everything works well with my document. It will be uploaded soon on CTAN ...

-
Great finding BTW. Should help others! – Speravir Mar 7 '13 at 3:32
@Speravir Thanks. I hope it helps others also using captions with showexpl. – Kurt Mar 7 '13 at 11:58