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
Incompatibility between Latin and unicode-math #394
Comments
For the record,
and
The problem seems to emerge from gloss-latin making |
Respective |
A workaround mentioned in the @wehro I suppose we need to make sure shorthands are really only activated in the respective language and if |
@jspitz |
A fix is in preparation. Please have some patience. |
Sure, we're not in a hurry. |
I have a solution which works as long as no primes appear within a math formula within a Latin language section (#397). Compare the output of the following document with and without the
And look the following document after the merge of #397:
A similar problem is occurring here, but only within the Latin language environment. |
Fix incompatiblity between Latin and unicode-math (#394), but only partly
PR merged. @wspr do you have an idea about the remaining problem? |
@jspitz Sorry, I'm not able to spend much time on this at the moment. What would unicode-math need to add for this to work most easily? I could add a "text mode" command to unicode-math like the following:
I almost think that definitions for active catcodes is something that needs kernel support to avoid conflicts... (Ping back for latex3/unicode-math#462) |
@wspr I don't know if that's possible, but the best solution seems to be that unicode-math activates what ever it does with the prime character only in math mode and restores the previous definition/cat code when math mode is left. |
@jspitz That's not really possible at the moment — I'm not currently hooking deep enough into the way that LaTeX2e handles maths to make that happen. The solution I'm outlining above is essentially:
but it needs coordination where that original definition is set up and what we call the internal components. This could even be a (tiny) 3rd party package, or even the 2e kernel itself... |
I see. This could work for us. |
On the other hand, I now learned that we have this in \shorthandon {'}
\bbl@activate {'}
\declare@shorthand {latin} {'}
{
\mode_if_math:TF
{
\active@math@prime % defined in "latex.ltx"
% This definition is differing from the primes of the unicode-math package.
% TO DO: Make sure that the appearance of primes is the same as with the
% unicode-math package if this package is loaded.
}
{
\polyglossia_latin_put_acute:N
}
} So if |
@wspr the ifmmode test is already present in the babel.polyglossia shorthand if it can be coordinated the latin prime ends up being
so |
@jspitz was 4 seconds quicker:-) |
This command is already existing: Line 3406 of It is possible to replace |
Yes, but I figure it's possible to define a command that is able to do such (self-)scanning, |
If I change |
I still think best would be if |
@wspr taking up @wehro's idea, the following fixes the issue for me with XeTeX without having to change polyglossia: --- /tmp/meld-tmp7x7cbuxl
+++ /home/juergen/texmf/tex/latex/testen/unicode-math-xetex.sty
@@ -3240,7 +3240,7 @@
\cs_new:Nn \__um_scanprime_collect:N
{
\int_incr:N \l__um_primecount_int
- \peek_meaning_remove:NTF '
+ \peek_charcode_remove:NTF '
{ \__um_scanprime_collect:N #1 }
{
\peek_meaning_remove:NTF \__um_scan_prime:
@@ -3403,6 +3403,7 @@
\char_set_catcode_active:n {"2037}
\cs_gset:Nn \__um_define_prime_chars:
{
+ \cs_set_eq:NN \active@math@prime \__um_scan_sup_prime:
\cs_set_eq:NN ' \__um_scan_sup_prime:
\cs_set_eq:NN ^^^^2032 \__um_scan_sup_prime:
\cs_set_eq:NN ^^^^2033 \__um_scan_sup_dprime:
I don't know whether --- /tmp/meld-tmp7x7cbuxl
+++ /home/juergen/texmf/tex/latex/testen/unicode-math-xetex.sty
@@ -3243,9 +3243,12 @@
\peek_meaning_remove:NTF '
{ \__um_scanprime_collect:N #1 }
{
- \peek_meaning_remove:NTF \__um_scan_prime:
- { \__um_scanprime_collect:N #1 }
- {
+ \peek_charcode_remove:NTF '
+ { \__um_scanprime_collect:N #1 }
+ {
+ \peek_meaning_remove:NTF \__um_scan_prime:
+ { \__um_scanprime_collect:N #1 }
+ {
\peek_meaning_remove:NTF ^^^^2032
{ \__um_scanprime_collect:N #1 }
{
@@ -3295,6 +3298,7 @@
}
}
}
+ }
}
\cs_new:Npn \__um_scan_backprime:
{
@@ -3403,6 +3407,7 @@
\char_set_catcode_active:n {"2037}
\cs_gset:Nn \__um_define_prime_chars:
{
+ \cs_set_eq:NN \active@math@prime \__um_scan_sup_prime:
\cs_set_eq:NN ' \__um_scan_sup_prime:
\cs_set_eq:NN ^^^^2032 \__um_scan_sup_prime:
\cs_set_eq:NN ^^^^2033 \__um_scan_sup_dprime:
The fix in |
Thank you! I’ll try to merge this in over the weekend. Sorry for the delay, it’s been a crazy time...
|
Crazy as crazy can be, indeed. |
Dear Devs,
I can't know when this issue arose, but I can confidently say it wasn't there on August 1, 2019, when I last compiled a project of mine that I took up again today after months.
This MWE is working fine:
It works also if I write
but the latter option cannot coexist with the package
unicode-math
, namely if I haveThere are no issues with English.
The problem seems to be related to character
'
(U+0027): in fact, if I replace it with the character’
(U+2019), my document runs fine.I hope I was clear! :-)
Many thanks in advance,
Domenico
The text was updated successfully, but these errors were encountered: