Closed mrpiggi closed 1 year 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).
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.
I'll hold my breath ;)
@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).
The mark mechanism HAS been updated. With an up-to-date distribution, just call texdoc ltmarks-doc to read all about it.
@Rimole Yes, I know, but I’m not sure how the new ltmarks
is of help here. Do you have any suggestion?
\AddToHook{insertmark}
perhaps to always pass the current language to the mark?
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’.
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.
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.
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 thatkoma-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?