Skip to content
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

Hebrew error with polyglossia 1.47 and lualatex #389

Closed
gildasius opened this issue Feb 7, 2020 · 4 comments
Closed

Hebrew error with polyglossia 1.47 and lualatex #389

gildasius opened this issue Feb 7, 2020 · 4 comments

Comments

@gildasius
Copy link

When I use Hebrew with polyglossia 1.47 and LuaLaTeX on TeXLive 2019, I get an error message that I don't get with polyglossia 1.46. I got some answers from tex.stack.exchange, but I thought I would also report it here as a possible bug. Here is my MWE:

%!TEX TS-program = lualatex
%!TEX encoding = UTF-8 Unicode

\documentclass{article}
\usepackage{fontspec}
\newfontfamily\hebrewfont{SBL Hebrew}[Script=Hebrew]
\usepackage{polyglossia}
\setdefaultlanguage[variant=us]{english}
\setotherlanguage{hebrew}

\begin{document}
Text in English and \texthebrew{עברית}. Text...
\end{document}

The messages I get

Package polyglossia Warning: Hebrew is not supported with LuaTeX.
(polyglossia) I will proceed with the compilation, but
(polyglossia) the output is not guaranteed to be correct
(polyglossia) and may look very wrong. on input line 6.

(/usr/local/texlive/2019/texmf-dist/tex/lualatex/luabidi/luabidi.sty
(/usr/local/texlive/2019/texmf-dist/tex/lualatex/luabidi/luabidi-footnotes.def)
) (/usr/local/texlive/2019/texmf-dist/tex/latex/polyglossia/hebrewcal.sty
(/usr/local/texlive/2019/texmf-dist/tex/latex/polyglossia/cal-util.def))
Setting \if@calendar@hebrew
(/usr/local/texlive/2019/texmf-dist/tex/latex/polyglossia/babel-hebrewalph.def)

! Too many }'s.
l.120 \fi}
%
! Extra \fi.
l.121 \fi

@moewew
Copy link
Contributor

moewew commented Feb 8, 2020

I can't say I have understood \if... matching, but if I replace

\ifxetex
\newcommand\xpg@hebrew@DigitsDotDashInterCharToks{\if@nonlatin\char"200E \fi}
\fi

with

\ifxetex
  \expandafter\@firstoftwo
\else
  \expandafter\@secondoftwo
\fi
  {\newcommand\xpg@hebrew@DigitsDotDashInterCharToks{\if@nonlatin\char"200E \fi}}
  {}

things appear to work again.


I think there might be spurious spaces from

\XeTeXinterchartoks \bidi@sepmark@charclass \bidi@digits@charclass = {\xpg@hebrew@DigitsDotDashInterCharToks}

and

\XeTeXinterchartoks \bidi@sepmark@charclass \bidi@digits@charclass = {\DigitsDotDashInterCharToks}

with XeLaTeX.

@jspitz jspitz changed the title polyglossia 1.47 and lualatex in texlive 2019 Hebrew error with polyglossia 1.47 and lualatex in texlive 2019 Feb 8, 2020
@jspitz
Copy link
Collaborator

jspitz commented Feb 8, 2020

Thanks, @moewew. The problem here is that TeX stumbles over a \fi since it doesn't know an \if conditional (\if@nonlatin here), so \ifxetex is closed too early. See https://tex.stackexchange.com/questions/315749/

A solution (which I am going to take) is to use etoolbox's \ifbool rather than \if...\fi switches.

jspitz added a commit that referenced this issue Feb 8, 2020
@jspitz jspitz added the FIXED IN DEV This bug is fixed for the next release label Feb 8, 2020
@jspitz
Copy link
Collaborator

jspitz commented Feb 8, 2020

This is fixed now. @reutenauer I am using the FIXED IN DEV label rather than closing the ticket. This way, other people who encounter the same issue might more easily find this ticket. I propose we close all FIXED IN DEV tickets after the release has been done.

@jspitz
Copy link
Collaborator

jspitz commented Feb 8, 2020

I think there might be spurious spaces from

\XeTeXinterchartoks \bidi@sepmark@charclass \bidi@digits@charclass = {\xpg@hebrew@DigitsDotDashInterCharToks}

and

\XeTeXinterchartoks \bidi@sepmark@charclass \bidi@digits@charclass = {\DigitsDotDashInterCharToks}

with XeLaTeX.

Thanks, should be addressed at e8e31f8

@jspitz jspitz changed the title Hebrew error with polyglossia 1.47 and lualatex in texlive 2019 Hebrew error with polyglossia 1.47 and lualatex Feb 8, 2020
@jspitz jspitz removed the FIXED IN DEV This bug is fixed for the next release label Mar 25, 2020
@jspitz jspitz closed this as completed Mar 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants