-
Notifications
You must be signed in to change notification settings - Fork 52
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
Upcasing in Greek no longer drops diacritics #581
Comments
Note that See ltnews36 which states how:
Now the question is whether it is planned to also detect the locale when % Roll a locale-aware \MakeUppercase version that handles diacritics correctly (#581)
% This employs the expl3 case changer
\ExplSyntaxOn
\cs_gset:Npn \MakeXPGGreekUppercase #1 { \text_uppercase:nn { el } {#1} }
\ExplSyntaxOff
% Save original \MakeUppercase definition
\let\xpg@save@MakeUppercase\MakeUppercase
\def\blockextras@greek{%
\let\MakeUppercase\MakeXPGGreekUppercase%
}
\def\noextras@greek{%
% restore original \MakeUppercase definition
\let\MakeUppercase\xpg@save@MakeUppercase%
} Of course I would very much prefer if we could avoid all the necessary ad hoc definitions in our gloss files. |
BTW @josephwright it looks like the following addition (ensuing the respective \@ifpackageloaded { polyglossia }
{
\@ifpackagelater { polyglossia } { 2020-01-29 }
{
\cs_gset_protected:Npn \@@text@case@aux@
{
\str_set:Nx \reserved@a
{ \csuse{bcp47id} }
}
}
{ }
}
{ } |
(I'm using |
It would be better if polyglossia would provide an expandable |
I don't understand why we would need to emulate the babel syntax (which is newer than polyglossia's) |
well Joseph asked last year for a common interface for the BCP-data. But Javier just reminded me that after this discussion babel added another interface. If polyglossia would implement that too, the kernel could use it in the next release.
|
Forget my request. I'll fix this in |
if you mean that you want to redefine \MakeUppercase: Apart from the fact that I think that patching kernel commands like this isn't a good idea, be aware that hyperref relies for the bookmarks on an expandable interface to the bcp tag too (currently it still uses \localeinfo, but I will switch soon to \BCPtag too). |
Fixed downstream. |
|
There's no intention to neglect The change of approach to case changing brought in the idea of locale to a kernel function for the first time. This raised the opportunity to have a fixed kernel definition and to then pick up the locale set by packages. However, as there is currently no generally-agreed kernel interface for the the locale data, we couldn't just 'make a change'. I therefore looked at what Ideally, the kernel shouldn't be checking for any packages at all, so we did have quite a lively discussion about whether adding code that is dependent on However, the aim remains to find a way toward an agreed single interface that both With a common interface, the kernel can then avoid having any package dependence at all: we set up the interface in the kernel, In terms of a common interface, I think many things are possible. One could for example imagine documenting What we really wanted to avoid is a set of 'if package loaded' tests in the kernel. The aim of the current temporary situation was to move forward somewhat whilst not simply putting in a set of patches that would be forgotten and bite all of us later. The current thread is in that sense what I was anticipating: coming back to the interface questions and trying to get to a position everyone can work with. |
I'm willing to support whatever syntax, but as Joseph wrote: we need one syntax that in the long term is not dependant on package tests. The need to query the locale will appear also in other places, e.g. in tagging structures where one sometimes have to set the language too, and it won't do if the kernel or hyperref has to plant everywhere tests about special package code.
Well I can't prevent you to go this way, but I doubt that these commands will stay forever in hyperref.
Yes, I agree with this. |
I completely agree with "a common interface would be ideal". However, devising such a common interface requires, in my opinion, that all involved parties sit down and talk about how this should look like. At least in the cases where I have been involved, this has not been the case. The babel maintainer did not show any interest in corporation but simply enforced his own approach (without even considering talking back with us). This is not how collaboration works, and my motivation to embark on this ship is consequently low. |
|
I have added a very basic (expandable) We can add subtags later if required. This requires a bit more work, as |
@josephwright @u-fischer @jspitz babel defines the following 4 fields whose names are (I think) obvious, because they are used in the BCP 47: Extensions are tentatively named |
I'll go with those as well for polyglossia (in the medium term), and probably |
@jbezos I am wondering whether it would make sense to add
|
Many thanks. I think we can work with this. Probably at some stage we might want to have |
I will look to adjust the kernel code for the next (2023-06-01) release: does this fit with everyone's thinking? |
If I got it right, then the kernel can already now make |
|
Why not, but |
That’s mostly fine, but I thinking of something like this: we load Polytonic Greek, whose tag is |
Wouldn't that be |
If it ‘just works’, great (actually, didn’t test). |
I did: this does work :) |
Should we open a kernel issue to hammer this out now we have broad agreement? The plan would be I think for the kernel to define the command and document the expected semantics, but itself do nothing, then leave it to |
But wouldn't you get in \MakeUppercase only |
Er, yes: what I meant is that |
@josephwright Making tests. I’m still not sure what to do wrt to the last part of my question:
Will the casing macros take the private area into account if the corresponding field is defined? (btw, I wonder if this discussion should take place in the LaTeX repository.) |
I wondered if an indirection would make sense. So that |
@u-fischer 👍 It’s my preferred option, indeed, which imo will make things easier for other packages (eg, |
I think that might be best: we are really talking about something separate from the thread here |
Works for me. |
I think it will be good if at least babel and polyglossia use the same arguments here (and then we both document it). |
As there is a kernel change in sight (and hopefully also |
I've opened latex3/latex2e#1035 as defining the interface really does need to be done at the kernel level. |
I suggest closing here at this point as the issue is being handled elsewhere |
I'll close as soon as I have implemented |
TODO: Add the proper subtags to the gloss files
Everything is done on polyglossia side now. Some subtags might need adjustment, but in general all data is in, and Closing this as "upstream" bug (for the record, this will be fixed with the next LaTeX kernel release, 2023/06). |
I have just committed poylglossia 1.61 to CTAN. This includes |
@u-fischer with the latest hyperref release, the following should work right? % !TeX TS-program = xelatex
\documentclass{article}
\usepackage{fontspec}
\setmainfont{DejaVu Serif}
\usepackage{polyglossia}
\setmainlanguage[variant=poly]{greek}
\usepackage[bookmarks]{hyperref}
\begin{document}
\section{\MakeUppercase{άδικος, κείμενο, ίριδα}}
άδικος, κείμενο, ίριδα → \MakeUppercase{άδικος, κείμενο, ίριδα}
\end{document} still get wrong casing in the bookmarks. Same with \usepackage[greek.polutoniko]{babel} |
No, sorry, |
@jspitz your
gives
In babel I get
hyperref needs expandable commands in the bookmarks (and the kernel needs an expandable |
Any advise how to make it expandable is welcome. |
I have reworked |
Greek letters drop diacritics (eccept dialytika and sub-iota) in UPPERCASE. This
is not cared for by the Unicode standard (except with a reference implementation for a Greek-specific upcasing algorithm https://icu.unicode.org/design/case/greek-upper).
Polyglossia uses the
\uccode
re-definitions from "xgreek.sty" to achieve this effect. However, since the new implementation in the 2022/06 LaTeX release, these re-definitions are ignored by\MakeUppercase
.Somehow a "locale setting" by the Babel core activates Greek
upcasing rules while by default the common upcasing rules from Unicode
are used for Greek literals.
Unfortunately, there is no documented API that I know of.
The text was updated successfully, but these errors were encountered: