2

I receive annoying warnings about multiply defined labels when I use \ifthispageodd and addmargin in the same document. I've made the following minimal test case to demonstrate this:

\documentclass[twoside]{article}
\usepackage{scrextend}

\begin{document}
\ifthispageodd{odd}{even}
\begin{addmargin}{1pt}
Foo
\end{addmargin}
\end{document}

Starting with the second latex run, I get the following warning:

LaTeX Warning: Label `1' multiply defined.

Looking at the aux file, this warning comes as no surprise:

\relax 
\new@tpo@label{1}{1}
\new@tpo@label{1}{1}

Since it is only a warning, I could choose to ignore it but I'm wondering what's at fault here. It seems that the addmargin environment is the perpetrator, because when I remove it, the warning vanishes and if I add another one, I get two warnings (and three \new@tpo@label lines in the aux file).

But then again, when I remove the \ifthispageodd line, the addmargin environment stops emitting any \new@tpo@label lines into the aux file.

Am I using these commands wrong or is this a bug in KOMA/scrextend?

3

After reporting this, the KOMA-Script author fixed the bug. Since KOMA-Script prerelease 3.23.2605 the aux file of your example has only one \new@tpo@label{1}{1}. The warning about multiply defined labels does not longer occur.

  • Awesome! The commit you mentioned in your comment fixed it not only for this toy example but also for my actual document. – hc_ Feb 23 '17 at 19:46
  • 1
    @hc_ Yes, reporting bugs can be a very useful thing. ;-) – Schweinebacke Feb 23 '17 at 20:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.