[Tex/LaTex] lineno not showing line numbers on proofs using the llncs class

line-numberinglncstheorems

Line numbers are not properly rendered on the last paragraph of a proof when using the lecture notes in computer science class llncs.

Here's a minimal working example.

\documentclass[oribibl]{llncs}
\usepackage [pagewise]{lineno}

% Halmos box at the end of proofs.
\let\doendproof\endproof
\renewcommand\endproof{~\hfill\qed\doendproof}

\linenumbers

\title{testing}
\author{tester}
\institute{University of Breaking Things}
\begin{document}
\maketitle
\begin{abstract}

\end{abstract}

\pagestyle{plain}

\section{Introduction}
Some lines of text

more text

\begin{lemma}
Here lies a meaty lemma.
\end{lemma}
\begin{proof}
Bacon ipsum dolor sit amet hamburger flank enim, ut filet mignon beef meatloaf tempor chicken frankfurter tri-tip occaecat consequat dolor. Reprehenderit consequat tongue est, duis prosciutto voluptate ham hock ut chicken ribeye. Sint consectetur bacon tenderloin. Fatback nisi pork loin excepteur sed ut turducken cow pastrami. Labore adipisicing laboris fugiat short loin.

Sunt boudin et shankle esse. Sint in ut esse tempor tongue tri-tip chicken strip steak biltong ullamco consectetur. Sed ex magna voluptate esse. Meatball sirloin ea pariatur short loin pig sint shoulder. Fugiat doner qui ea ribeye shankle ex tri-tip deserunt ullamco nulla jowl. Bresaola sint brisket andouille. Dolore in aliqua labore in mollit boudin corned beef officia fugiat incididunt sirloin.
\end{proof}

And now some more text.

\end{document}

Best Answer

I'm not entirely sure why, but it's the \qed that breaks the line numbers. Here's an easy fix: just wrap it in math mode, i.e. $\qed$.

Replacing the lines as follows fixes it:

\let\doendproof\endproof
\renewcommand\endproof{~\hfill$\qed$\doendproof}