Page LayoutGetting paragraph numbers in the margin when using the reledmac pkg (\linenummargin has no effect)

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
cypherpunks
Posts: 15
Joined: Sat Dec 10, 2016 12:26 pm

Getting paragraph numbers in the margin when using the reledmac pkg (\linenummargin has no effect)

Post by cypherpunks »

I want numbered paragraphs and I want the numbers to be in the left margin. Example:

Code: Select all

\documentclass{scrartcl}
\usepackage[noend]{reledmac} % needed for \pstart & \pend to number paragraphs
\renewcommand{\thepstart}{{\textsuperscript{\fbox{\arabic{pstart}}}}} % ← this puts a box around the paragraph numbers
\linenummargin{outer} % ← the default is "left" which should put the numbers in the left margin (it does not), so trying "outer"
\begin{document}
  \numberlinefalse\numberpstarttrue\beginnumbering
  \pstart
    yada yada lorem ipsum this is a paragraph
  \pend
  This is an unnumbered paragraph to show where the body is. Notice that the position of the number is not in the margin.
  \endnumbering  
\end{document}
No matter what value is passed to \linenummargin, it's ignored (left, right, center, inner, outer). My hack is to add a \hspace{-1.5em} in the redefinition of \thepstart. But that's flawed because the negative hspace needs to be bigger for single digit paragraph numbers than for double digit numbers.

(edit)
This hack gives the effect I'm after:

Code: Select all

\renewcommand{\thepstart}{\makebox[0pt][r]{\raisebox{2pt}{\scriptsize\fbox{\arabic{pstart}}}\hspace{1em}}}
The code is kind of ugly but I'm going to run with this.. unless someone knows a less hacky ledmac-devs-approved approach.

Recommended reading 2024:

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

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

Post Reply