LaTeX forum ⇒ 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).
cypherpunks
Posts: 6
Joined: Sat Dec 10, 2016 12:26 pm

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

Postby cypherpunks » Sun Oct 31, 2021 7:58 pm

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

\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:
\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 2021:

LaTeXguide.org • LaTeX-Cookbook.net
LaTeX Beginner's Guide LaTeX Cookbook

Return to “Page Layout”

Who is online

Users browsing this forum: Stefan Kottwitz and 3 guests