# Title with the header in critical edition

i'am a newbie and this is my first question about latex! I would like to know if it was possible to create, in a critical edition, a sort of chapter counter, sections etc. of the text and print them in fancyhdr. I do not know I was clear. The closest thing I found is the solution of user35641 in this question, but the problem is that the header is printed over the width of the text in a page layout of 15cm (width) and 23cm (height) in book class.

Thank you

MWE

\documentclass{book}

\usepacakge[utf8]{inputenc}

\usepackage[T1]{fontenc}

\usepackage[latin]{babel}

\usepackage{fancyhdr}

\usepackage[noeledmac]{ledmac} % I know it is obsolete package but, for me, it's working well

\footparagraph{A} % textual variants of apparatus in paragraph

\begin{document}

\beginnumbering % begin line numeration

\pstart

\begin{center}
LIBER I % I would like this to be the first counter to print in fancyhdr

\end{center}

1. %(second type of counter, i.e "chapter")

Dummy text Dummy text Dummy text Dummy text

1.1  %(third type of counter, i.e "section")

Dummy text Dummy text Dummy text Dummy text Dummy text
\pend
\endnumbering

\end{document}


Example of what I mean (not the actual result of compiling)

I think i found the way

MWE

\documentclass{book}

\usepacakge[latin]{babel}

\usepackage[latin]{babel}
\usepackage{fancyhdr} % self explaining
\usepackage{reledmac}
\linenummargin{inner}
\sidenotemargin{outer} % thanks to djdekker.net
\newcounter{libro}% book
\newcounter{capitolo} %chapter bold
\newcounter{sezione} %section  italic
\pagestyle{fancy}

\begin{center}
% number of book in normal text
\end{center}
\beginnumbering
\pstart

\refstepcounter{libro} % book reference

\ledsidenote{\textbf{X}} \refstepcounter{capitolo}  Text
Text

\ledsidenote{\texit{X}} \refstepcounter{sezione} Text Text

\pend

\endnumbering

\end{document}


In other words: i create three counters (libro, capitolo, sezione). I print a ledsidenote bold if capitolo (so \refstrepcounter{capitolo}) if sezione italic (so \refstepcounter{sezione})

The problem is: the ledsidenote sezione 3 is on page 2 but the header print it even onpage 1. The header is "static"; it doesn't print the actual capitolo/ sezione of the actual page.

Any solutions?

• Welcome to TeX.SE! What do you mean by "critical edition"? By the way, you should provide a minimal working example showing what you have tried, as well as a sketch or a clear description showing what you want -- all that help us a lot! – JouleV Jan 25 at 7:53
• Sorry, in my country the closest translation is "Critical Edition". I think it is more understandable to use "scholarly edition" or those texts that show the textual variations of the manuscripts like the Novum Testamentum Graece. – Zezzo Jan 25 at 7:59
• ‘Critical edition’ is indeed the name for this in English. If you read French, you’ll be interested in geekographie.maieul.net/225 – Thérèse Jan 25 at 11:52
• @Thérèse I already know that book but i didn't find the solution. Thak you anyway! – Zezzo Jan 25 at 12:11
• I think the most problematic thing is your title, which is not very explicit, and make JouleV asking for it. Indeed, now, you already make critical edition. The most important thing in your question is "title with the header in critical edition". I will answer about your problem soon. – Maïeul Jan 25 at 15:50

Ok, first I will try to resume your need, as you did't be very explicit.

1. You need to typeset critical edition. Perfect, that is why ledmac and its successor is made for

1. The chapter number
2. The starting and ending verse number, depending of the current page To manage header, you need fancyhdr, that is perfect.

The problem is double

1. To get the correct mark in you header (problem with fancyhdr )
2. To manage it with (re)ledmac (problem connex).

# Chapter and verse number in the header

So, starting with fancyhdr. As you may have read, or you should have read, running header work with marks system:

Two commands to be called in the text

• \markboth{<l>}{<r>}
• \markright{<r>}

Two commands to be called in the header

• \leftmark gives you the value of the <l> of the immediatly previous markboth
• \rightmark gives you the value of the <r> of the first \markright or \markboth of the current page, or the last \markright or \markboth of the previous page.

The problem, in your case, is that you need to deal with 3 marks

• chapter
• starting verse
• ending verse

I think, indeed, that there is some packages which will allow to have more mark. But, for the present case, we will simplify the example, and will consider that you start a chapter with page break.

I will simplify the example, to have only two levels of numbering. We could look for complexer problem later, when you will have understood the mechanism of mark.

So a simplified example would be

\documentclass{book}

\usepackage[latin]{babel}

\usepackage{fancyhdr}

\usepackage{reledmac} % Really, use reledmac, not ledmac
\pagestyle{fancy}%Calling fancy style
\fancyfoot[C]{\thepage}%Page number in foot

\fancyhead[C]{\theliber, \rightmark-\leftmark}% In the center, print liber number + division
\newcounter{liber}%a spectific counter for liber

\newcommand{\division}[1]{#1.\markboth{#1}{#1}}%uste a shortup for divison
\begin{document}

\newpage
\refstepcounter{liber}
\begin{center}
LIBER \theliber
\end{center}

\division{1} Dummy text Dummy text Dummy text Dummy text

\division{2} Dummy text Dummy text Dummy text Dummy text Dummy text
\newpage % Juste for the example
s

\division{3}
s

\division{4}
s

\newpage
\refstepcounter{liber}
\begin{center}
LIBER \theliber
\end{center}

\division{1} Dummy text Dummy text Dummy text Dummy text

\division{2} Dummy text Dummy text Dummy text Dummy text Dummy text
\newpage % Juste for the example
s

\division{3}
s

\division{4}
s

\end{document}


I am not at all a specialist of \mark, and I think you could need more complex case to manage. But my point is that, this problem, is not directly related with ledmac. You just need to explain clearly what type of divisions you need in your header, and the fact that you need ranges.

# Now, dealing with ledmac

First of all, I am sorry to tell you that you will need to switch to reledmac. Why ? because dealing with \mark is not possible directly in ledmac, and that you will need feature from reledmac.

Here, a basic rule to be remembered with ledmac: between \pstart...\pend, do not use:

• size font change
• justification modification
• marking command.

So, how to deal

1. You center environnement could be used inside a optional argument of \pstart
2. You can use \doinsidethislinehook to incluse sentive command like \marking. Look at http://mirrors.ctan.org/macros/latex/contrib/reledmac/examples/2-subdivision-number-in-header.tex for an example

So, here an adapted code for reledmac

\documentclass{book}

\usepackage[latin]{babel}

\usepackage{fancyhdr}

\usepackage{reledmac} % Really, use reledmac, not ledmac
\pagestyle{fancy}%Calling fancy style
\fancyfoot[C]{\thepage}%Page number in foot

\fancyhead[C]{\theliber, \rightmark-\leftmark}% In the center, print liber number + division
\newcounter{liber}%a spectific counter for liber

\newcommand{\division}[1]{#1.\doinsidethislinehook{\markboth{#1}{#1}}}%uste a shortup for divison
\begin{document}

\beginnumbering
\pstart[\newpage
\refstepcounter{liber}
\begin{center}
LIBER \theliber
\end{center}]
\division{1} Dummy text Dummy text Dummy text Dummy text
\pend
\pstart
\division{2} Dummy text Dummy text Dummy text Dummy text Dummy text
\pend
\newpage % Juste for the example
\pstart
s
\pend
\pstart
\division{3}
s
\pend
\pstart
\division{4}
s
\pend
\newpage
\pstart[
\refstepcounter{liber}
\begin{center}
LIBER \theliber
\end{center}
]
\division{1} Dummy text Dummy text Dummy text Dummy text
\pend
\pstart
\division{2} Dummy text Dummy text Dummy text Dummy text Dummy text
\pend
\newpage % Juste for the example
\pstart
s
\pend
\pstart
\division{3}
s
\pend
\pstart
\division{4}
s
\pend
\endnumbering
\end{document}


# Genral conclusion

1. First, think without reledmac