latex3 / babel

The babel system for LaTeX, LuaLaTeX and XeLaTeX
LaTeX Project Public License v1.3c
130 stars 35 forks source link

marks (\markleft as counterpart for \markright) #56

Closed mrpiggi closed 1 year ago

mrpiggi commented 4 years ago

I'm not quite sure, if this is an issue and if so, who is responsible for or should take care of it. As babel redefines \markright and \markboth in order to I just wanted to mention that koma-script additionally defines \markleft similiar to \markright. Would it be possible to pass the current language as well to \markleft or is this something, koma-script has to take care of? Maybe, \markleft could be provided by the kernel?

jbezos commented 4 years ago

Another option would be to provide in babel a general tool to redefine these macros, which could be used by package/class writers (or even users).

FrankMittelbach commented 4 years ago

I'm not sure an extension of that sort is really a good idea given that we want to extend/fix the mark mechanism fairly soon and it wouldn't fit that model so would be just another newly introduced legacy approach.

mrpiggi commented 4 years ago

I'll hold my breath ;)

jbezos commented 4 years ago

@FrankMittelbach Actually, this is the point: instead of patching directly the internal macros, a generic «patcher» can be adapted to any change in the kernel (including the possibility of doing nothing).

Rimole commented 1 year ago

The mark mechanism HAS been updated. With an up-to-date distribution, just call texdoc ltmarks-doc to read all about it.

jbezos commented 1 year ago

@Rimole Yes, I know, but I’m not sure how the new ltmarks is of help here. Do you have any suggestion?

FrankMittelbach commented 1 year ago

\AddToHook{insertmark} perhaps to always pass the current language to the mark?

jbezos commented 1 year ago

Basically what babel does is turning

\markright{foo}

into

\markright{\foreignlanguage{bar}{foo}}

where bar is the expansion of \languagename. (It does a little more, because a \bbl@restore@actives is inserted, but it’s not relevant here.) I can’t see how this can be done with insertmark.

Another approach is to store somehow the data for the current locale and move it at the same time as the text to be localized. Here \NewMarkClass can help, indeed, but we still need to patch \markright, even at a lower level, because a new \InsertMark should added. Maybe another hook?

Actually, a wrapping mechanism can be useful when ‘localized’ information is being moved around, not only marks. So I’m still considering the original idea of a ‘patcher’.

jbezos commented 1 year ago

I‘m closing this issue because it’s now listed in Enhancements requests. This doesn’t mean it’s rejected, just moved to a specific page for enhancements.

FrankMittelbach commented 1 year ago

Another approach is to store somehow the data for the current locale and move it at the same time as the text to be localized. Here \NewMarkClass can help, indeed, but we still need to patch \markright, even at a lower level, because a new \InsertMark should added. Maybe another hook?

maybe, but with the next release of LaTeX we will have hooks with arguments and they might just be the right thing for cases like this, this may need some experimentation though to see what works best

Actually, a wrapping mechanism can be useful when ‘localized’ information is being moved around, not only marks. So I’m still considering the original idea of a ‘patcher’.

maybe you should present your ideas on one of the next team meetings then.