bidi-tex / bidi

Bidirectional typesetting in plain TeX and LaTeX, using XeTeX
Other
3 stars 0 forks source link

Numbered equations: parenthesis not always displayed correctly #9

Open ouboub opened 5 years ago

ouboub commented 5 years ago

Brief outline of the issue

The latex file attached, shows that in a frame with hebrew text and an numbered equation the number is displayed as (1(, while adding one english word before the equation and after the \setLR command solves this problem bidi-bug.zip

Check/indicate

Minimal example showing the issue

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

\documentclass{article}            % or some other class

  % Any packages other than the bidi package must be loaded here

  % The bidi package must be loaded as the last package
\usepackage[%
    % Any bidi package option goes here
]{bidi}

  % Any preamble code goes here

\begin{document}

  % Demonstration of issue here

\end{document}

Expected behavior

Log and PDF files

jspitz commented 5 years ago

FWIW here is the missing MWE, stripped down from @ouboub's test file:

% !TeX TS-program = xelatex
\documentclass{beamer}
\usepackage{fontspec}
\usepackage{bidi}
\setmainfont{DejaVu Sans}
%\setsansfont{DejaVu Sans}
\setsansfont{Arial Unicode MS}

\begin{document}
\begin{frame}
\setRL

\begin{enumerate}
    \item שלאום
\end{enumerate}
\setLR

\begin{equation}
\int f dx =0
\end{equation}
\end{frame}
\end{document}

The interesting thing is that this seems font-dependend. I do not have Arial (as used in @ouboub's test file), but I can reproduce the problem with Arial Unicode MS. However, if I substitute the sans font with DejaVu Sans, the problem disappears. So maybe it is a bug in the font. @ouboub can you confirm that?

ouboub commented 5 years ago

No I can't. I run the following file

\documentclass{beamer}
\usepackage{fontspec}
\usepackage{bidi}
\setmainfont{DejaVu Sans}

\begin{document}
\begin{frame}
\setRL

\begin{enumerate}
    \item שלאום
\end{enumerate}
\setLR

\begin{equation}
\int f dx =0
\end{equation}
\end{frame}
\end{document}

However as the attached pdf file show, the brackets are still wrong test-eq.pdf

ouboub commented 5 years ago

Sorry hit the wrong button, did not want to close it

jspitz commented 5 years ago

@ouboub you also need

\setsansfont{DejaVu Sans}

in the document

ouboub commented 5 years ago

Ok, then I confirm, that it works! So its seems the font is the culprit, very very odd indeed.