josephwright / beamer

A LaTeX class for producing presentations and slides
Other
1.4k stars 141 forks source link

Overlays are not working with with Hebrew+polyglossia #801

Open idanpa opened 1 year ago

idanpa commented 1 year ago
\documentclass{beamer}

\usepackage{libertine}
\usepackage{polyglossia}
\setdefaultlanguage{hebrew}

\begin{document}
\begin{frame}
Text 0

\visible<2>{Text 1}
\end{frame}
\end{document}

Overlay specification on text is broken. On the example above Text 1 should appear only on the second slide. Could be related to polyglossia but maybe here is a good start.

Using most updated MikTex on Windows 10, beamer 3.68.

samcarter commented 1 year ago

I do get Text 1 on the second slide.

Screenshot 2022-10-11 at 10 25 58

Can you show a screenshot of your output? And show your .log file?

idanpa commented 1 year ago

image

Forgot to mention, this was compiled in xetex.

Log file: example_beamer_bug.log

samcarter commented 1 year ago

Ah, xelatex. It works fine in lualatex

idanpa commented 1 year ago

On lualatex, the overlay works as expected, but there are problems with the positioning of blocks etc.:

\documentclass{beamer}
\usetheme{Darmstadt}
\usepackage{libertine}
\usepackage{polyglossia}
\setdefaultlanguage{Hebrew}

\begin{document}
\begin{frame}
\begin{block}{Block}
Text 0
\end{block}
\end{frame}
\end{document}

image

(with xetex it looks fine)

I think that in general xetex is more stable for RTL languages, would be nice if it would be supported. Thank you for your help.

samcarter commented 1 year ago

This is what I get for lualatex:

document

idanpa commented 1 year ago

Are you using Hebrew as default?

\usepackage{libertine}
\usepackage{polyglossia}
\setdefaultlanguage{Hebrew}

Because I think text should be aligned to the right if you do so (in the first picture you sent here it is aligned to the right).

samcarter commented 1 year ago

I used the very same code as in your comment https://github.com/josephwright/beamer/issues/801#issuecomment-1274428833 , but I get warnings about missing files, so maybe a full texlive installation is not enough.

kvafa commented 1 year ago

Please note that the beamer project have never done anything to support the right to left typesetting. If anything in beamer works for right to left text, it is because the bidi package fixes all these issues and supports beamer in its recent release as demonstrated in my TUG 2022 talk. There, I mentioned that overlays are in my todo list and I have not had time to look at it yet sadly but they should be supported sooner or later.

The fact that luatex does not have this issue is simply due to the fact that luatex has a different bidirectional model than XeTeX; more specifically, it does not reverse whatsits. Therefore, it is no big deal if something works for right to left text in luatex; it is an art when you make it work under XeTeX.

kvafa commented 1 year ago

801 (comment)

You are probably only using \pardir and \textdir primitives. Add \pagedir and \bodydir with the same directionality too.

seloumi commented 1 year ago

For luatex you can use beamer-rl class just define your font with \babelfont{sf}{Hebrew-font} https://www.ctan.org/pkg/beamer-rl

kvafa commented 1 year ago

For luatex you can use beamer-rl class just define your font with \babelfont{sf}{Hebrew-font} https://www.ctan.org/pkg/beamer-rl

This is not fit for serious mainly right to left document as it has way too many issues;sorry!

scottkosty commented 1 year ago

Nice package, seloumi! Thanks for your work on it.

ouboub commented 1 year ago

For luatex you can use beamer-rl class just define your font with \babelfont{sf}{Hebrew-font} https://www.ctan.org/pkg/beamer-rl

This is not fit for serious mainly right to left document as it has way too many issues;sorry!

There is also beamerbidi, that however is quite old it works for me in an old texlive 2019 installation to some extend. out of curiosity the beamerbidi author is Vafa Khalighi, any change that is the same as kvafa?