latex3 / unicode-math

XeLaTeX/LuaLaTeX package for using unicode/OpenType maths fonts
http://ctan.org/pkg/unicode-math
LaTeX Project Public License v1.3c
245 stars 29 forks source link

Problem with beamer class with lualatex and trigonometric functions #450

Closed ghost closed 6 years ago

ghost commented 6 years ago

Dear developers,

I stumbled over the following problem:

Description

The beamer class has problems with the printing trigonometric functions when the package unicode-math is activated.

The following code compiles NOT with LuaLaTeX:

\documentclass[ngerman]{beamer}
\usepackage{fontspec}
\usepackage{unicode-math}
\usepackage{polyglossia}
\setdefaultlanguage[variant=german,spelling=new,babelshorthands=true]{german}

\begin{document}

\begin{frame}
  $\cos$  \\
  $\tan$  \\
  $\sin$
\end{frame}

\end{document}

whereas the following code compiles with LuaLaTeX.

\documentclass[ngerman]{beamer}
\usepackage{fontspec}
\usepackage{polyglossia}
\setdefaultlanguage[variant=german,spelling=new,babelshorthands=true]{german}

\begin{document}

\begin{frame}
  $\cos$  \\
  $\tan$  \\
  $\sin$
\end{frame}

\end{document}

As the only difference between the code snippets is the line usepackage{unicode-math} I suspected that it's a unicode-math bug.

If not, could you give me a hint where I should report it?

Regards in advance.

ghost commented 6 years ago

A further comment:

The code examples

\documentclass[ngerman]{beamer}
\usepackage{fontspec}

\usepackage{unicode-math}
\usepackage{polyglossia}
\setdefaultlanguage[variant=german,spelling=new,babelshorthands=true]{german}

\setmathfont{XITS Math} % \usepackage{SITX Math} does also work

\begin{document}

\begin{frame}
  $\cos$  \\
  $\tan$  \\
  $\sin$
\end{frame}

\end{document}

compiles with LuaLaTeX even though apparently it falls back to the font "LMSans" for rendering/printing.

Also the option \usefonttheme{professionalfonts} helps also as it is shown in the following example.

\documentclass[ngerman]{beamer}
\usepackage{fontspec}

\usepackage{unicode-math}
\usepackage{polyglossia}
\setdefaultlanguage[variant=german,spelling=new,babelshorthands=true]{german}
\usefonttheme{professionalfonts}

\begin{document}

%\begin{frame}
  $\cos$  \\
  $\tan$  \\
  $\sin$
%\end{frame}

\end{document}

As setting the beamer option \usefonttheme{professionalfonts} helps to fix this issue it can be probably closed as it is an beamer issue and moved to the beamer bug tracker.

wspr commented 6 years ago

I also can't reproduce the problem on my end. There have been a couple of recent updates recently (last night being the latest) to address a couple of issues with "math operator" commands like these. Let me know if you continue to see the problem, though.