Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

page marks within a paragraph breaking eledmac's output #112

Closed
signinstranger opened this issue Jun 25, 2013 · 13 comments
Closed

page marks within a paragraph breaking eledmac's output #112

signinstranger opened this issue Jun 25, 2013 · 13 comments

Comments

@signinstranger
Copy link
Contributor

LaTeX's mechanism for page marks (e.g. \markboth, markright, etc.) currently breaks eledmac's output when used within a paragraph. Note the layout bug in the following example:

\documentclass{article}
\usepackage{eledmac}
\begin{document}
\beginnumbering
\pstart
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, \markboth{1}{2} sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
\pend
\endnumbering
\end{document}

@maieul
Copy link
Owner

maieul commented Jun 25, 2013

Hi, could you make a test ?

  1. Dowload the dev files in https://github.com/maieul/ledmac/tree/issue112 ("Download zip")
  2. run the file eledmac.ins
  3. take the file eledmac.sty, push it in the same folder as the file .tex
  4. test your file .tex (in particular, about the position of \markright \markboth

@signinstranger
Copy link
Contributor Author

This seems to help with the funny spacing in the layout, but now the page marks don't work like they should. It seems as if only the last \markboth has an effect on the verse range.

Here's an example:

\documentclass[11pt, a4paper,twoside]{article}
\usepackage{eledmac}

\makeatletter
\def\ps@myheadings{\let@mkboth@gobbletwo
\def@evenhead{\hfil\rightmark--\leftmark\hfil}
\def@oddhead{\hfil\rightmark--\leftmark\hfil}
}
\makeatother

\newcounter{ch}
\setcounter{ch}{1}

\newcommand{\startledbibleverse}{%
\startlock
\setcounter{firstlinenum}{999}
}
\newcommand{\ledbibleverse}[1]{%
\markboth{\arabic{ch},#1}{\arabic{ch},#1}%
\textsuperscript{#1}%
\sidenotemargin{left}\ledsidenote{#1}%
\setline{#1}%
}
\newcommand{\stopledbibleverse}{%
\endlock
\setcounter{firstlinenum}{5}
}

\newcommand{\ledbiblechapter}[1]{%
\setcounter{ch}{#1}%
{\textsf{\textbf{#1}}~}%
}

\numberonlyfirstinline[A]
\footparagraph{A}

\begin{document}
\markboth{1,1}{1,1}
\pagestyle{myheadings}

\beginnumbering
\startledbibleverse
\pstart
\ledbiblechapter{1}\ledbibleverse{1} Lorem ipsum dolor \edtext{sit}{\Afootnote{ABC om. D}} amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. \ledbibleverse{2}At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. \ledbibleverse{3} Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. \ledbibleverse{4} Lorem \edtext{ipsum}{\Afootnote{ABC om. D}} dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. \ledbibleverse{5}At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. \ledbibleverse{6} Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. \ledbibleverse{7} Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. \ledbibleverse{8} Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.

\ledbiblechapter{2}\ledbibleverse{1} Lorem ipsum dolor \edtext{sit}{\Afootnote{ABC om. D}} amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. \ledbibleverse{2}At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. \ledbibleverse{3} Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. \ledbibleverse{4} Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. \ledbibleverse{5}At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. \ledbibleverse{6} Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.

\ledbiblechapter{3}\ledbibleverse{1} Lorem ipsum dolor \edtext{sit}{\Afootnote{ABC om. D}} amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. \ledbibleverse{2}At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. \ledbibleverse{3} Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. \ledbibleverse{4} Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. \ledbibleverse{5}At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. \ledbibleverse{6} Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, \edtext{sed}{\Afootnote{ABC om. D}} diam voluptua. \ledbibleverse{7} Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. \ledbibleverse{8} Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
\pend
\stopledbibleverse
\endnumbering
\end{document}

@maieul
Copy link
Owner

maieul commented Jun 26, 2013

yes, it is what i was afraid this night. I will try to correct it next
night, but without garantees (I'm afraid it's not possible)

@signinstranger
Copy link
Contributor Author

Thanks again for looking into this. I stumbled on a thread in comp.text.tex where former ledmac maintainer Peter Wilson essentially gave up on the problem:

https://groups.google.com/forum/#!msg/comp.text.tex/w8EdqXDt0RE/sjqB15Z2jIoJ

Maybe it can't be helped? OTOH, verse ranges are a prerequisite for editions of biblical texts. Are there any alternatives to the page mark hack?

@maieul
Copy link
Owner

maieul commented Jun 27, 2013

I don't think it's possible to correct the system. But I have found a
method to do what you want.
I will send you an email this (French) night.

@maieul
Copy link
Owner

maieul commented Jun 27, 2013

Ok
so what is the problem :

  1. a \mark command break a vertical list (one of interne objet of LaTeX) -> it's why you have this space command.
  2. my previous test was
    a) to write the value send to \markboth in some commands (\led@markleft and \led@markright).
    b) to call these commands when the line cutting is done
  3. It did'nt work because the line cutting, with eledmac, is done at the end of \pstart \pend. So it was the last values written in commands which was put to \markboth.

So this system can't work.

But I have add a feature, which allow you to add commands at the begining of ALL ledmac lines. I think, it could solve your problem (my test with your little example was OK). Could you test more ?

The first thing you have to do is to re-download the files of dev, and to run again the .ins file, to have the .sty file.
You could see the example issue112.tex.

As you have said a verse number = a line number, we can use it.

The most important line is inside the \makeatletter...\makeatother.
It is the line \renewcommand*{\do@insidelinehook}{\numdef{\v}{\line@num+1}\markboth{\thech,\v}{\thech,\v}}.

This command will be call at the begining of each line, during the time of line splitting.

So the content :

  • \numdef{\v}{\line@num+1} -> the \v command will stock the verse number. It's the line number (line@num) + 1. I don't know exactly why the +1 is needed, but I think it's because of time the line number is changed.
  • after that, the \markboth command is call, with the chapter and verse number.

I hope you understand the problem and the solution (and my English !)

@signinstranger
Copy link
Contributor Author

Hurray! I think it's almost working, at least for the verse numbers. The chapters, however, in your example issue112.tex are still not working correctly. The chapter count goes immediately to the last chapter number in the .tex file. For instance, If I add two more more chapters to your example (e.g. \ledbiblechapter{4} ... and so on), the chapter numbers in the header will go out of sync (e.g. 1,1--5,3; 5,4--5,5; 5,6--5,8). The verse counter seems to be correct for each page, though.

@maieul
Copy link
Owner

maieul commented Jun 27, 2013

could you send your example working bad ? I must have it to test

@signinstranger
Copy link
Contributor Author

The file is issue112-long.tex in my fork of ledmac

https://github.com/signinstranger/ledmac/blob/master/issue112-long.tex

@maieul
Copy link
Owner

maieul commented Jun 28, 2013

I will try this weekend

@maieul
Copy link
Owner

maieul commented Jun 28, 2013

Hi,

the problem is that you had only one pstart. And so, as the line splitting is made at the end of each pstart ... you line splitting was made only with the ultimate value...

See
f336695 to solve the problem.

The \autopar is used to have \pstart\pend at each paragraph. But it coulnd't work with your previous l. 30

@signinstranger
Copy link
Contributor Author

Thank you Maïeul! This is great! I wish I could start a new paragraph in the apparatus for each chapter, but this is not possible with \footparagraph, right?

maieul added a commit that referenced this issue Jul 1, 2013
@maieul
Copy link
Owner

maieul commented Jul 1, 2013

Actually, I think't it's not possible.
But I hope this to become possible. Please open a new issue.

maieul added a commit that referenced this issue Jul 1, 2013
@maieul maieul closed this as completed Jul 1, 2013
maieul added a commit that referenced this issue Aug 14, 2014
maieul added a commit that referenced this issue Aug 14, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants