maieul / ledmac

package reledmac for latex
http://www.ctan.org/tex-archive/macros/latex/contrib/reledmac
54 stars 28 forks source link

Incompatibility with memoir v. 3.8 #955

Closed Doc73 closed 1 year ago

Doc73 commented 1 year ago

Version

reledmac 2023/07/21 v2.39.5

TeX Engine

I made tests with XeLateX and pdfLaTeX. XeLateX produces the pdf, pdfLaTeX not.

Regression

The issue is surely related with v. 3.8 of memoir, arrived on CTAN yesterday

Description

I'm sorry to always bother you with new errors, but I think that, at least in this case, the error is easy to fix.

Here is the pertinent log:

! Undefined control sequence.
<argument> \led@error@fail@patch@@mempnum 

l.6496     {\led@error@fail@patch@@mempnum}
                                           %
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

Minimal Working Example

% !TeX program = xelatex
% !TeX encoding = UTF-8
% !TeX spellcheck = it_IT

\documentclass[b5paper]{memoir}
\usepackage[noledgroup,noeledsec,series={A,B,C}]{reledmac}

\begin{document}
\beginnumbering
\numberpstarttrue

\pstart Quel ramo del lago di Como, che volge a mezzogiorno, tra due catene non interrotte di monti, tutto a seni e a golfi, a seconda dello sporgere e del rientrare di quelli, vien, quasi a un tratto, a ristringersi
\pend

\pstart Quel ramo del lago di Como, che volge a mezzogiorno, tra due catene non interrotte di monti, tutto a seni e a golfi, a seconda dello sporgere e del rientrare di quelli, vien, quasi a un tratto, a ristringersi
\pend

\pstart Quel ramo del lago di Como, che volge a mezzogiorno, tra due catene non interrotte di monti, tutto a seni e a golfi, a seconda dello sporgere e del rientrare di quelli, vien, quasi a un tratto, a ristringersi
\pend

\pstart Quel ramo del lago di Como, che volge a mezzogiorno, tra due catene non interrotte di monti, tutto a seni e a golfi, a seconda dello sporgere e del rientrare di quelli, vien, quasi a un tratto, a ristringersi
\pend

\pstart Quel ramo del lago di Como, che volge a mezzogiorno, tra due catene non interrotte di monti, tutto a seni e a golfi, a seconda dello sporgere e del rientrare di quelli, vien, quasi a un tratto, a ristringersi
\pend

\pstart Quel ramo del lago di Como, che volge a mezzogiorno, tra due catene non interrotte di monti, tutto a seni e a golfi, a seconda dello sporgere e del rientrare di quelli, vien, quasi a un tratto, a ristringersi
\pend

\pstart Quel ramo del lago di Como, che volge a mezzogiorno, tra due catene non interrotte di monti, tutto a seni e a golfi, a seconda dello sporgere e del rientrare di quelli, vien, quasi a un tratto, a ristringersi
\pend

\numberpstartfalse
\endnumbering
\end{document}

Workaround

I don't know.

Doc73 commented 1 year ago

Here is the changelog of Memoir v. 3.8. I hope it can be useful:

Changes (2023/08/08)

o memoir v3.8

-- now requires a LaTeX format from 2021/06/01 or newer.

   The class will halt compilation (in all interaction modes) if the
   format is too old.

-- \titleref is now an alias for \nameref (autoloaded).
   The class have been adjusted to provide info for sectionals and
   normal captions.

   The titleref package will remain marked as being emulated
   as it shouldn't be used with the class (and haven't been updated in
   20+ years).

-- nameref paches in the class are no longer needed

-- label handling for subcaptions and friends have been reimplemented.

-- no longer re-defines \label as per request of the LaTeX Team.

-- booktabs is now loaded as a required package instead of being
   embedded

-- Fixed typo in the caption of figure 2.13. Thanks to Vladimir
   G. Ivanović for the report.

-- removed etex loading (was only loaded for kernels from before
   2015). The noetex class option removed as well.

-- reimplemented \pagenumbering(*) as a single macro

-- additions to \@xfloat is now done via a cmd/after hook if the
   format version supports it.

-- Definition of \theHpoem changed to \providecommand

-- The \theH<counter> macros defined in memoir was modified to use
   \the\value{counter} instead of just \arabic{counter} as some
   packages change \arabic.

-- \toclevel@part was actually never fixed in v3.7.19, now it is

-- added \@currentcounter in various places that manually
   set \@currentlabel (primarily footnote constructions). Reported by
   Gustavo Barros.

-- replaced hardcoded \footnotesize in \verbfootnote by \foottextfont 

-- made a small change to footnote formatting. Now one can use
   \raggedright in \footnotetext to get raggedright footnotes. Use
   with care as \raggedright does change various paragraph settings

-- replaced etoolbox loading by xpatch (which loads etoolbox) as it
   can patch more.

-- Added a Hook named memoir/subcaption/aftercounter which is executed
   after \refstepcounter in \subcaption, \subbottom, \subtop
   etc. Requested by Gustavo Barros.

-- Redefinition of \@setsize removed, was copied from setspace.sty
   which states that it was only needed for some 209 packages.

The following macros have been disabled (to either give a warning or
an error).

-- \namerefon and \namerefoff => warning (now always on)

-- \currenttitle => error (given that many things are now "titled",
   relying on this to get the current "title" is too risky, use proper
   \label+\titleref instead)

-- \theTitleReference => warning (was used in the old implementation
   of \titleref and \currenttitle)   

o memhfixc v1.21

-- All nameref patches have been removed
-- provided \subfigureautorefname
Doc73 commented 1 year ago

I did some tests. Removing these lines from reledmac.dtx apparently solves the issues:

\ifl@dmemoir%
  \apptocmd{\@mempnum}%
    {\par@patch@pagenumbering}%
    {}%%
    {\led@error@fail@patch@@mempnum}%

\else%
  \apptocmd{\pagenumbering}%
    {\par@patch@pagenumbering}%
    {}%
    {\led@error@fail@patch@pagenumbering}%
\fi%

But I don't understand why and I don't know if there are contraindications. :smile:

Doc73 commented 1 year ago

Dear @maieul , I tested this change on a 400+ page book and found no problems. However, I have no techical skills and I don't understand the meaning of this modification.

maieul commented 1 year ago

Well, that is because you don't use the feature that need to patch memoir internal macro...

Doc73 commented 1 year ago

As far as I understand, memoir has redefined \pagenumbering(*). Maybe that patch is not necessary anymore?

maieul commented 1 year ago

Well, I am coming back from holiday. I have prepared some regression test. Now I need to get the new version of memoir, but my internet connexion is not good here.

maieul commented 1 year ago

The patch is done, in order to be compatible with both old and new version of reledmac.

I will release tomorrow.

Doc73 commented 1 year ago

The above code works fine, but in my book there are errors that I can't understand, related to an absent } in a chapter title. Obviously, there is no error in the text, which hasn't been changed recently. I will try to do further tests and let you know. For now I'm back to my patch.

maieul commented 1 year ago

Well, in this case please open a new issue. There is actually no reason that a feature regarding pagenumber has consquences on chapter.

Doc73 commented 1 year ago

I do not believe it! This problem depends on the new version of reledmac, while the version with my patch is fine.

Frankly, I can't isolate the problem.

Meanwhile, I can only tell you that I get lots of errors like this, related to multiple places in the text, which is completely unchanged.

build//Scholia2.toc:31: Argument of \@secondoftwo has an extra }.
<inserted text> 
                \par 
l.31 ...umberline {12}In Timaeum}{161}{chapter.12}
                                                  %
I've run across a `}' that doesn't seem to match anything.
For example, `\def\a#1{...}' and `\a}' would produce
this error. If you simply proceed now, the `\par' that
I've just inserted will cause me to report a runaway
argument that might be the root of the problem. But if
your `}' was spurious, just type `2' and it will go away.

But the mentioned line is so:

\contentsline {chapter}{\chapternumberline {12}In Timaeum}{161}{chapter.12}%

I'll try to study it better.

maieul commented 1 year ago

I do not believe it! This problem depends on the new version of reledmac, while the version with my patch is fine.

Well, I do not believe that a a change regarding pagenumber could provocate that. I can also use many exclamation mark :P

But did you really do only one version step ? Because I send also new version on july...

Doc73 commented 1 year ago

Yes! I update my latex system every day.

During these holidays I worked a lot on my book and the problem arose immediately after the update to v. 3.8 of memoir and still continues with 3.8a, arrived today.

Luckily with the correction I proposed above (https://github.com/maieul/ledmac/issues/955#issuecomment-1673413067) I can continue to work without issues.

maieul commented 1 year ago

Yes, but it is not a correction, just a workaround ! What I don't understand: is the problem related to to the upgrade of reledmac, or to the upgrade of memoir ?

Doc73 commented 1 year ago

Memoir, surely memoir. Until the upgrade of memoir all was fine!

maieul commented 1 year ago

But does the problem happens when you disable reledmac ?

Doc73 commented 1 year ago

I have this issue only in Tex files with reledmac

Il gio 17 ago 2023, 14:08 Maïeul Rouquette @.***> ha scritto:

But does the problem happens when you disable reledmac ?

— Reply to this email directly, view it on GitHub https://github.com/maieul/ledmac/issues/955#issuecomment-1682170798, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJ65FHRID7VFEKISLTC2D3XVYCTDANCNFSM6AAAAAA3LOCVPY . You are receiving this because you authored the thread.Message ID: @.***>

maieul commented 1 year ago

Yes, but does it happens also when reledmac features are not used inside your code.

Do you use eledchapter?

Doc73 commented 1 year ago

No, no! Indeed, I load the package with the following main options:

\usepackage[noeledsec,noledgroup,series={A,B,C}]{reledmac}
maieul commented 1 year ago

The questions are :

Doc73 commented 1 year ago
  1. Same error in a file with reledmac without options (I can't remove reledmac at all in a code of a critical text)
  2. I didn't have any problems until the day before the memoir update, released in August 4th, I think
maieul commented 1 year ago

do you use hyperref ? the nature of the message could show this possibility.

Doc73 commented 1 year ago

Ah, yes!

maieul commented 1 year ago

And so disabling hyperref change something ?

Doc73 commented 1 year ago

Same issue disabling hyperref. :-(

Doc73 commented 1 year ago

I did another test with the sample code of first post, but with ALL the packages and ALL the settings I use in my book: no errors! :cry:

I'll do other tests and inform you.

Doc73 commented 1 year ago

FOUND! This bug is related to sectioning commands like \frontmatter etc.

MWE:

% !TeX program = xelatex
% !TeX encoding = UTF-8
% !TeX spellcheck = it_IT
% --------------------------------------
\DocumentMetadata{backend=xetex}
\documentclass[b5paper,11pt,twoside]{memoir}
% --------------------------------------
\usepackage[noeledsec,noledgroup,series={A,B,C}]{reledmac}
% --------------------------------------
\begin{document}
%\frontmatter
\tableofcontents*

\chapter{lkjlkjl}

\chapter{lkjlj} 

%\mainmatter
\chapter{capitolo 1}
\beginnumbering
\numberpstarttrue

\pstart\ledsidenote{lkjlkjl} Quel ramo del lago di Como, che volge a mezzogiorno, tra due catene non interrotte di monti, tutto a seni e a golfi, a seconda dello sporgere e del rientrare di quelli, vien, quasi a un tratto, a ristringersi
\pend

\pstart Quel ramo del lago di Como, che volge a mezzogiorno, tra due catene non interrotte di monti, tutto a seni e a golfi, a seconda dello sporgere e del rientrare di quelli, vien, quasi a un tratto, a ristringersi
\pend

\pstart Quel ramo del lago di Como, che volge a mezzogiorno, tra due catene non interrotte di monti, tutto a seni e a golfi, a seconda dello sporgere e del rientrare di quelli, vien, quasi a un tratto, a ristringersi
\pend

\pstart Quel ramo del lago di Como, che volge a mezzogiorno, tra due catene non interrotte di monti, tutto a seni e a golfi, a seconda dello sporgere e del rientrare di quelli, vien, quasi a un tratto, a ristringersi
\pend

\pstart Quel ramo del lago di Como, che volge a mezzogiorno, tra due catene non interrotte di monti, tutto a seni e a golfi, a seconda dello sporgere e del rientrare di quelli, vien, quasi a un tratto, a ristringersi
\pend

\pstart Quel ramo del lago di Como, che volge a mezzogiorno, tra due catene non interrotte di monti, tutto a seni e a golfi, a seconda dello sporgere e del rientrare di quelli, vien, quasi a un tratto, a ristringersi
\pend

\pstart Quel ramo del lago di Como, che volge a mezzogiorno, tra due catene non interrotte di monti, tutto a seni e a golfi, a seconda dello sporgere e del rientrare di quelli, vien, quasi a un tratto, a ristringersi
\pend

\numberpstartfalse
\endnumbering

\chapter{capitolo 2}
\beginnumbering
\numberpstarttrue

\pstart Quel ramo del lago di Como, che volge a mezzogiorno, tra due catene non interrotte di monti, tutto a seni e a golfi, a seconda dello sporgere e del rientrare di quelli, vien, quasi a un tratto, a ristringersi
\pend

\pstart Quel ramo del lago di Como, che volge a mezzogiorno, tra due catene non interrotte di monti, tutto a seni e a golfi, a seconda dello sporgere e del rientrare di quelli, vien, quasi a un tratto, a ristringersi
\pend

\pstart Quel ramo del lago di Como, che volge a mezzogiorno, tra due catene non interrotte di monti, tutto a seni e a golfi, a seconda dello sporgere e del rientrare di quelli, vien, quasi a un tratto, a ristringersi
\pend

\pstart Quel ramo del lago di Como, che volge a mezzogiorno, tra due catene non interrotte di monti, tutto a seni e a golfi, a seconda dello sporgere e del rientrare di quelli, vien, quasi a un tratto, a ristringersi
\pend

\pstart Quel ramo del lago di Como, che volge a mezzogiorno, tra due catene non interrotte di monti, tutto a seni e a golfi, a seconda dello sporgere e del rientrare di quelli, vien, quasi a un tratto, a ristringersi
\pend

\pstart Quel ramo del lago di Como, che volge a mezzogiorno, tra due catene non interrotte di monti, tutto a seni e a golfi, a seconda dello sporgere e del rientrare di quelli, vien, quasi a un tratto, a ristringersi
\pend

\pstart Quel \edtext{ramo}{\Cfootnote[]{blablabla}} del lago di Como, che volge a mezzogiorno, tra due catene non interrotte di monti, tutto a seni e a golfi, a seconda dello sporgere e del rientrare di quelli, vien, quasi a un tratto, a ristringersi
\pend

\numberpstartfalse
\endnumbering
\end{document}

If you enable \frontmatter or \mainmatter the system crashes.

maieul commented 1 year ago

Oki, I reopen the issue. It is more clear than chapter, as the problematic is linked to page.

maieul commented 1 year ago

I asked you many time, but please next time provide a really MWE. As in 547af73c.

maieul commented 1 year ago

or better dcb9eb0f

maieul commented 1 year ago

So memoir has it's own \pagenumbering schemes, and so the patch of reledmac makes fail.

maieul commented 1 year ago

SO please try branch issue955 bis.

Doc73 commented 1 year ago

Works very well! Thank you so much!

maieul commented 1 year ago

you have one week-end to find other bug, then I will release.

maieul commented 1 year ago

In order to be ready for tomorrow release, I removed the issue955_branch, but pushed a 2.39.7-2.25.5 branch.

Doc73 commented 1 year ago

@maieul I did no further tests, as I am enjoying the last few days of my holidays 😭 , but with this branch I found no bugs.

heinrichffleck commented 1 year ago

Chère Maieul, juste une précision : tous mes documents utilisent (depuis 2006) la classe memoir, et les commandes \mainmatter et \setcounter{page}{1} sont présentes partout. Le bloc de compilation ne se produit que lorsque reledmac est présent, pas autrement. Cordialement, Enrico

maieul commented 1 year ago

CHer Heinrick. Certes. Mais c'est memoir qui a changé en v3.8 ca manière de gérer mainmatter, pas reledmac. Donc la faute en incombe à memoir, pas à reledmac.

Quoi qu'il en soit, avez vous testé la branch 2.39.7-2.25.5 ? normalement cela devrait résoudre cela.

Doc73 commented 1 year ago

Just arrived latest reledmac and memoir 3.8.1: all is fine! Thanks!

heinrichffleck commented 1 year ago

Cher Maieul, aujourd'hui, j'ai mis à jour TeXlive (package reledmac et class memoir) et tout va bien pendant la compilation. Il y a aussi un nouveau problème (pour moi) car G. Miede a mis à jour babel-greek qui a maintenant quelque petit problèm avec le package teubner : j'essaye de le résoudre avec l'autor. Salutations e merci de tout, Enrico.