# How to put a symbol always in the right margin, even in twoside mode, like line numbers of lineno?

I discovered the package lineno which in two side mode of the class article can force to put the line numbers on the right. I really like that because I want me QED symbol to do the same. Currently, mine is inside the page and lies a line below the last word of my paragraph but it is not so great when the paragraph finishes by a math formula finishing a page;sometimes the QED symbol is on a new page. I don't want the QED to be on the same line as my text unless it is actually in the margin outside the page and actually as close to the text as the numbers are from the package.

Lineno pdf is here http://texdoc.net/texmf-dist/doc/latex/lineno/ulineno.pdf but the new version is on CTAN which is down presently.

On page 10 bottom it says one can customize the command \makeLineNumber creating the line number

\begin{runninglinenumbers}
i
\renewcommand\makeLineNumber
ii
{\hss$\rightarrow$\ \rlap{\hskip\textwidth\ $\leftarrow$}}
iii
\end{runninglinenumbers}


On page 12 of http://www.putlocker.com/file/5FC5CB241A3E947F [the new version]

\def\MakeLineNo{%
56 \@LN@maybe@normalLineNumber % v4.31
57 \boxmaxdepth\maxdimen\setbox\z@\vbox{\unvbox\@cclv}%
58 \@tempdima\dp\z@ \unvbox\z@
59 \sbox\@tempboxa{\hb@xt@\z@{\makeLineNumber}}%


But I do not see the mechanism to force something to be on the right very close to the text.

• I don't understand exactly what the question is. The title asks one thing, but the main discussion in the post is about how lineno works... – Werner Sep 20 '13 at 4:13
• To prevent the end-mark from appearing too far below when finishing with an equation (though, the best is never to finish a proof with an equation (you can always add a closing remark, if necessary)), you can use \qedhere from the amsthm package. – Gonzalo Medina Sep 20 '13 at 4:27
• following on the comment of @GonzaloMedina, if you use amsthm and \qedhere, you can redefine \quesymbol to shift the box out into the margin: \renewcommand{\qedsymbol}{\rlap{\,\openbox}} where the \rlap causes the perceived (by tex) width to be zero, allowing whatever is defined as the shape to be shifted to the right. and of course, you can define the shape to be anything you want. – barbara beeton Sep 20 '13 at 12:52
• @barbarabeeton I have to be completely honest, i don't know if i understand the question right. Does any of you want to provide an answer in order to get it off the list? – Johannes_B Feb 26 '15 at 21:02
• @GonzaloMedina Please see above comment. – Johannes_B Feb 26 '15 at 21:02

if you use amsthm and \qedhere, you can redefine \qedsymbol to shift the box out into the margin:
\renewcommand{\qedsymbol}{\rlap{\,\openbox}}

where the \rlap causes the perceived (by tex) width to be zero, allowing whatever is defined as the shape to be shifted to the right. and of course, you can define the shape to be anything you want.