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

Pagebreak in long verse (widow line) #101

Closed
tweh opened this issue Dec 19, 2012 · 25 comments
Closed

Pagebreak in long verse (widow line) #101

tweh opened this issue Dec 19, 2012 · 25 comments

Comments

@tweh
Copy link
Contributor

tweh commented Dec 19, 2012

If a verse is to long to fit in a single line it gets broken, which is ok but it seems that there is no test to prevent widows

widow in verse

Is it possible to fix this?

MWE

\documentclass{scrbook}

\usepackage{eledmac}
\setstanzaindents{1,0,0,0}

\begin{document}
\vspace*{41\baselineskip}
\beginnumbering
\stanza
   Short verse &
   Long verse long verse long verse long verse 
   long verse long verse long verse long verse 
   long verse long verse long verse long verse &
   Short verse
\&
\endnumbering
\end{document}

This problem happens too when using parallel typesetting with eledpar’s {pages}

@maieul
Copy link
Owner

maieul commented Dec 20, 2012

I will try tomorrow in my train

@maieul
Copy link
Owner

maieul commented Dec 21, 2012

ok, for ledmac, it must be solved in https://github.com/maieul/ledmac/tree/issue101. You should redefine the counter nopagebreakhanging to 4 : \setcounter{nopagebreakhanging}{4}

But for eledpar, the problem is quite more difficult, and I have to find the way...

@tweh
Copy link
Contributor Author

tweh commented Dec 22, 2012

Thank you! A fix for ledparwould be great, let me know if I can help some how …

Merry Christmas!

@maieul
Copy link
Owner

maieul commented Oct 27, 2013

Quelques notes perso pour résoudre le pb

  1. Stocker dans le fichier temporaire que le vers XXX n'est pas coupable, en fonction de la valeur de \ifhangingsymbol
  2. Lors de la seconde phase, lire ce fichier temporaire (comment ?)
  3. Si on est dans un vers non coupable (donc innocent !) choisir :
    a. Ou de couper la page AVANT le verse
    b. Ou de couper APRÈS le vers
    Le tout en jouant sur la commande \checkpageR

@maieul
Copy link
Owner

maieul commented Oct 28, 2013

So, I think have found the way. I have to:

  • clean the code
  • make documentation
  • make test
  • create version for eledmac

@tweh
Copy link
Contributor Author

tweh commented Oct 28, 2013

Sounds great.

@maieul
Copy link
Owner

maieul commented Nov 3, 2013

So, I added new features in the branch issue101 https://github.com/maieul/ledmac/tree/issue101.

This should help for #101, #143, #140 #62 and #6. Cela devrait également intéresser @Enimie.

Could you try, please ?
So dowload the file, run the .ins file, and put the .sty file above your file.

I added two new commands:

  • \ledpb, whick make a pagebreak at the second run.
  • \lednopb, which prevent a page break at the second run. That implies to add one new line on the page. So the number of line in the page will be standard number + 1.

The page break or the forbidden of the page break is made :

  • By default before the begining of the line which contain \ledpb or \lednopb
  • But if you use \ledpbsetting{after} it will be after the end of this line.

This API can be use manually. But you can also use it automatically to prevent pagebreak inside long verse (2 lines maximum). To do that, you have to write in your preamble : \lednopbinversetrue.

A long verse won't be broken by a page:

  • By default, or if you use \ledpbsetting{before}, the page break will be made before.
  • If you use \ledpbsetting{after} the page break will be made after, and the page will with a new line.

@maieul
Copy link
Owner

maieul commented Nov 3, 2013

Note: for \lednopbinversetrue we need at least 3 runs.

@tweh
Copy link
Contributor Author

tweh commented Nov 5, 2013

Some comments:

  • \ledpb works fine

  • \lednopg seems to work, but it can’t enlarge a page above \goalfraction*\textheight, right? I.e. it can’t solve issue Strange positioning of line numbers when using \enlargethispage #140 (see my second comment there)

  • \lednopbinversetrue dosn’t work in my document (I made at least 10 runs). I’ll try to make an MWE and post as a next comment.

  • I wonder why you don’t implement things like \lednopbinversetrue or \nonbreakableafternumber as package options …?

  • I’d use math mode in

    For example, if you call \verb+\lednopb+ at l. 444, the l. 443 will be at the p. $n$,
    and the l. 444 at the p. $n+1$. However you can change the behavior, and decide they
    will have effect after the end of the line, adding \verb+\ledpbsetting{after}+ at the
    begining of your file (better: in your preamble). With the previous example, the l.
    444 will be at the p. $n$ and the l. 445 will be at the p. $n+1$.
    

BTW: In your README in “(which will generate ledmac.sty)” an e is missing …

maieul added a commit that referenced this issue Nov 5, 2013
…a valeur de de \numpagelines pour faire fonctioner #101 (ping @Enimie)
@maieul
Copy link
Owner

maieul commented Nov 5, 2013

So, quick answer

  • Good !
  • could you please send to the exact message ? Normally, it should work, because the page goal test is made before the test of lednopb.
  • I think the problem was only when the option is set to before... I should be correct now
  • I add an option nopbinverse, but not for nonbreakableafternumber because this option can be enabled by series.
  • Ok.

@tweh
Copy link
Contributor Author

tweh commented Nov 5, 2013

I add an option nopbinverse, but not for nonbreakableafternumber because this option can be enabled by series.

I see, but there seems to be a mistake in the manual, I guess. In the text you type \afternumberinfootnote instead of \nonbreakableafternumber (p. 18)

I’ll try to create MWE for the other problems

@tweh
Copy link
Contributor Author

tweh commented Nov 5, 2013

Here nopbinverse doesn’t work:

\documentclass{scrbook}

\usepackage{eledmac,eledpar}
\setstanzaindents{1,0,0}
\setcounter{stanzaindentsrepetition}{2}

\lednopbinversetrue
\ledpbsetting{before}

\begin{document}
\begin{pages}
\begin{Leftside}
\beginnumbering
\stanza
   Short verse &   Short verse &   Short verse &
   Short verse &   Short verse &   Short verse &
   Short verse &   Short verse &   Short verse &
   Short verse &   Short verse &   Short verse &
   Short verse &   Short verse &   Short verse &
   Short verse &   Short verse &   Short verse &
   Short verse &   Short verse &   Short verse &
   Short verse &   Short verse &   Short verse &
   Short verse &   Short verse &   Short verse &
   Short verse &   Short verse &   Short verse &
   Short verse &   Short verse &   Short verse &
   Short verse &   Short verse &   Short verse &
   Short verse &   Short verse &   Short verse &
   Long vers on right side  &
   Short verse
\&
\endnumbering
\end{Leftside}
\begin{Rightside}
\beginnumbering
\stanza
   Short verse &   Short verse &   Short verse &
   Short verse &   Short verse &   Short verse &
   Short verse &   Short verse &   Short verse &
   Short verse &   Short verse &   Short verse &
   Short verse &   Short verse &   Short verse &
   Short verse &   Short verse &   Short verse &
   Short verse &   Short verse &   Short verse &
   Short verse &   Short verse &   Short verse &
   Short verse &   Short verse &   Short verse &
   Short verse &   Short verse &   Short verse &
   Short verse &   Short verse &   Short verse &
   Short verse &   Short verse &   Short verse &
   Short verse &   Short verse &   Short verse &
   Long verse  long verse long verse verse long verse
       long verse long verse long verse long verse &
   Short verse
\&
\endnumbering
\end{Rightside}
\Pages
\end{pages}

\end{document}

page break in mid verse

@maieul
Copy link
Owner

maieul commented Nov 5, 2013

thanks ! Corrected by 0d4930e

@maieul
Copy link
Owner

maieul commented Nov 5, 2013

Did you update your file ?
I have just tried now, and no problem

@tweh
Copy link
Contributor Author

tweh commented Nov 5, 2013

I can reproduce the error with the version from #101 branch and ledmac-mac1.7.0-par1.5.0, here are my file lists:

#101 branch:

 *File List*
 scrbook.cls    2012/07/29 v3.11b KOMA-Script document class (book)
scrkbase.sty    2012/07/29 v3.11b KOMA-Script package (KOMA-Script-dependent ba
sics and keyval usage)
 scrbase.sty    2012/07/29 v3.11b KOMA-Script package (KOMA-Script-independent 
basics and keyval usage)
  keyval.sty    1999/03/16 v1.13 key=value parser (DPC)
scrlfile.sty    2012/06/15 v3.12 KOMA-Script package (loading files)
tocbasic.sty    2012/04/04 v3.10b KOMA-Script package (handling toc-files)
scrsize11pt.clo    2012/07/29 v3.11b KOMA-Script font size class option (11pt)
typearea.sty    2012/07/29 v3.11b KOMA-Script package (type area)
 eledmac.sty    2013/10/27 v1.6.1 LaTeX port of EDMAC
   xargs.sty    2008/03/22 v1.1  extended macro definitions  (mpg)
 xkeyval.sty    2012/10/14 v2.6b package option processing (HA)
 xkeyval.tex    2012/10/14 v2.6b key=value parser (HA)
etoolbox.sty    2011/01/03 v2.1 e-TeX tools for LaTeX
    etex.sty    1998/03/26 v2.0 eTeX basic definition package (PEB)
  suffix.sty    2006/07/15 1.5 Variant command support
 xstring.sty    2013/10/13  v1.7c  String manipulations (C Tellechea)
ifluatex.sty    2010/03/01 v1.3 Provides the ifluatex switch (HO)
 eledpar.sty    2013/10/27 v1.4.3 eledmac extension for parallel texts
issue101-pages.1
issue101-pages.1R
 ***********

ledmac-mac1.7.0-par1.5.0:

*File List*
 scrbook.cls    2012/07/29 v3.11b KOMA-Script document class (book)
scrkbase.sty    2012/07/29 v3.11b KOMA-Script package (KOMA-Script-dependent ba
sics and keyval usage)
 scrbase.sty    2012/07/29 v3.11b KOMA-Script package (KOMA-Script-independent 
basics and keyval usage)
  keyval.sty    1999/03/16 v1.13 key=value parser (DPC)
scrlfile.sty    2012/06/15 v3.12 KOMA-Script package (loading files)
tocbasic.sty    2012/04/04 v3.10b KOMA-Script package (handling toc-files)
scrsize11pt.clo    2012/07/29 v3.11b KOMA-Script font size class option (11pt)
typearea.sty    2012/07/29 v3.11b KOMA-Script package (type area)
 eledmac.sty    2013/11/04 v1.7.0 LaTeX port of EDMAC
   xargs.sty    2008/03/22 v1.1  extended macro definitions  (mpg)
 xkeyval.sty    2012/10/14 v2.6b package option processing (HA)
 xkeyval.tex    2012/10/14 v2.6b key=value parser (HA)
etoolbox.sty    2011/01/03 v2.1 e-TeX tools for LaTeX
    etex.sty    1998/03/26 v2.0 eTeX basic definition package (PEB)
  suffix.sty    2006/07/15 1.5 Variant command support
 xstring.sty    2013/10/13  v1.7c  String manipulations (C Tellechea)
ifluatex.sty    2010/03/01 v1.3 Provides the ifluatex switch (HO)
 eledpar.sty    2013/11/03 v1.5.0 eledmac extension for parallel texts
issue101-pages.1
issue101-pages.1R
 ***********

Am I using a wrong version?

maieul added a commit that referenced this issue Nov 5, 2013
@maieul
Copy link
Owner

maieul commented Nov 5, 2013

hum

as I have not changed the datetime when I made correction, I can't answer you ;-)

I think you should redowload file (one of the two branch, there are now the same)

For me, it's working in (I can't do more) 4 runs :

  1. The page break is after verse
  2. The page break is inside verse -> we wrote in the file
  3. The page break is after verse for the right side, but it is not synchronous with left side
  4. The left and right side are synchronous

@tweh
Copy link
Contributor Author

tweh commented Nov 5, 2013

as I have not changed the datetime when I made correction, I can't answer you ;-)

Could you point me to the version you’re using?!

@maieul
Copy link
Owner

maieul commented Nov 5, 2013

@tweh
Copy link
Contributor Author

tweh commented Nov 5, 2013

OK. Seems like I used a wrong version. It works with the new one :-)

@tweh
Copy link
Contributor Author

tweh commented Nov 5, 2013

Another question/error:

It seems like one must use \lednopb on both pages to get the right verses on the page. If this is the intended behaviour it should be mentioned in the manual.

\documentclass{scrbook}

\usepackage{eledmac,eledpar}
\setstanzaindents{1,0,0}
\setcounter{stanzaindentsrepetition}{2}

\ledpbsetting{after}

\usepackage{geometry}
\geometry{showframe}

\begin{document}
\begin{pages}
\begin{Leftside}
\beginnumbering
\stanza
   Short verse &   Short verse &   Short verse &
   Short verse &   Short verse &   Short verse &
   Short verse &   Short verse &   Short verse &
   Short verse &   Short verse &
   Long vers on right side  &
   Short verse &   Short verse &   Short verse &
   Short verse &   Short verse &   Short verse &
   Short verse &   Short verse &   Short verse &
   Short verse &   Short verse &
   Long vers on right side  &
   Short verse &   Short verse &   Short verse &
   Short verse &   Short verse &   Short verse &
   Short verse &   Short verse &   Short verse &
   Short verse &   Short verse &   Short verse &
   Short verse &   No break here\lednopb &   Short verse &
   Long vers on right side  &
   Short verse
\&
\endnumbering
\end{Leftside}
\begin{Rightside}
\beginnumbering
\stanza
   Short verse &   Short verse &   Short verse &
   Short verse &   Short verse &   Short verse &
   Short verse &   Short verse &   Short verse &
   Short verse &   Short verse &
   Long verse  long verse long verse verse long verse long
       verse long verse long verse long verse long verse &
   Short verse &   Short verse &   Short verse &
   Short verse &   Short verse &   Short verse &
   Short verse &   Short verse &   Short verse &
   Short verse &   Short verse &
   Long verse  long verse long verse verse long verse long
       verse long verse long verse long verse long verse &
   Short verse &   Short verse &   Short verse &
   Short verse &   Short verse &   Short verse &
   Short verse &   Short verse &   Short verse &
   Short verse &   Short verse &   Short verse &
   Short verse &   No break here &   Short verse &
   Long verse  long verse long verse verse long verse long
       verse long verse long verse long verse long verse &
   Short verse
\&
\endnumbering
\end{Rightside}
\Pages
\end{pages}

\end{document}

In “For example, if you call \lednopb at l. 444, the l. 443 will be at the p. n, …” (p. 32 in ledmac.pdf) \lednopb must be \ledpb?!

@maieul
Copy link
Owner

maieul commented Nov 5, 2013

thanks for the correct.

Yes, it can't work automatically for both side, because we can't determine what is the corresponding line in the other side (it could be ok for verse, but not for prose)

Could you please write a little text to add in the documentation ?

@tweh
Copy link
Contributor Author

tweh commented Nov 5, 2013

Sure :-)

I’d add this as the last paragraph in section 16 in eledmac.dtx (~ line 2737):

% If you are using \texttt{eledpar} to typeset parallel pages you must use \verb+\lednopb+ on
% both sides in the two corresponding lines. This is especially important when you are using
% stanzas; otherwise the pages will run out of sync.

And this as the last paragraph in section 7 in eledpar.dtx (~ line 694):

% When you use \verb+\lednopb+ make sure to use it on both sides in the correcsponding
% verses to keep the pages in sync.

@maieul
Copy link
Owner

maieul commented Nov 5, 2013

hop 7a54063.

Do you see anything else ? If not, I will ask to Rebecca to check english, and publish after her corrections

@tweh
Copy link
Contributor Author

tweh commented Nov 5, 2013

Do you see anything else ?

Not yet … I’d say you can publish it.

When I find the time to read the full manual I’ll make a list and let you know ;-)

@maieul
Copy link
Owner

maieul commented Nov 5, 2013

in this case, I will prefer you fork the manual, send commit, and send pull request. It will be more easy…

@maieul maieul closed this as completed in c7b9d3e Nov 8, 2013
maieul added a commit that referenced this issue Aug 14, 2014
…a valeur de de \numpagelines pour faire fonctioner #101 (ping @Enimie)
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