LaTeX forum ⇒ Document ClassesBeamer incorrectly displays formulas Topic is solved

Information and discussion about specific document classes and how to create your own document classes.
kostao
Posts: 16
Joined: Tue Jan 10, 2017 8:48 pm

Beamer incorrectly displays formulas

Postby kostao » Mon Feb 06, 2017 10:47 pm

Beamer incorrectly displays formulas. If \documentclass{beamer}- formulas incorrectly displays. If \documentclass{article} formulas correctly displays.

  1. \documentclass{beamer}
  2.  
  3. \usepackage{mathtools,amssymb}
  4.  
  5. \usepackage{fontspec}
  6. \newcommand*{\myfont}{Georgia}
  7. \setmainfont{\myfont}[Ligatures=TeX]
  8. \setsansfont{\myfont}[Scale=0.975]
  9. \setmonofont{\myfont}
  10.  
  11. \usepackage{unicode-math}
  12. \setmathfont{Latin Modern Math}
  13. \setmathfont[range={"0030-"0039}]{\myfont}
  14. \setmathfont[range={\varnothing}]{Asana Math}
  15.  
  16. \AtBeginDocument{
  17. \renewcommand*{\setminus}{\smallsetminus}
  18. }
  19.  
  20. \usepackage[english,russian]{babel}
  21.  
  22. \begin{document}
  23.  
  24. \noindent
  25. $0123456789AaBbCcfi$\\
  26. $\textnormal{0123456789}\textit{AaBbCcfi}$
  27.  
  28. \begin{gather}
  29. \int_{0}^{1}x^{-x}\mathrm{d}x=\sum_{n=1}^{\infty}n^{-n}\\
  30. A\setminus A=\varnothing=\emptyset
  31. \end{gather}
  32.  
  33. \begin{equation}G(\theta)= \begin{cases}
  34. & 29 - 25\lg(\theta)\text{ при } 1^{\circ}<\theta\leq20^{\circ}; \\
  35. & -3,5\text{ при } 20^{\circ}<\theta\leq26,3^{\circ}; \\
  36. & 32 - 25\lg(\theta)\text{ при } 26,3^{\circ}<\theta\leq48^{\circ}; \\
  37. & -10\text{ при } 48^{\circ}<\theta\leq180^{\circ}. \\
  38. \end{cases}\end{equation}
  39.  
  40. \end{document}


How display formulas correctly in beamer?

Tags:

User avatar
Stefan Kottwitz
Site Admin
Posts: 8075
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Tue Feb 07, 2017 2:19 am

What is incorrect? What is it that you think it's not ok?

beamer is different, and you did not make it yet in the beamer way - beamer pages are slides within a frame environment. There is no frame here.

Stefan
Site admin

kostao
Posts: 16
Joined: Tue Jan 10, 2017 8:48 pm

Postby kostao » Tue Feb 07, 2017 6:36 am

Correct

  1. \documentclass{article}
  2. \usepackage{mathtools,amssymb}
  3. \usepackage{fontspec}
  4. \newcommand*{\myfont}{Georgia}
  5. \setmainfont{\myfont}[Ligatures=TeX]
  6. \setsansfont{\myfont}[Scale=0.975]
  7. \setmonofont{\myfont}
  8. \usepackage{unicode-math}
  9. \setmathfont{Latin Modern Math}
  10. \setmathfont[range={"0030-"0039}]{\myfont}
  11. \setmathfont[range={\varnothing}]{Asana Math}
  12. \AtBeginDocument{
  13. \renewcommand*{\setminus}{\smallsetminus}
  14. }
  15. \usepackage[english,russian]{babel}
  16. \begin{document}
  17. %\begin{frame}
  18. \noindent
  19. $0123456789AaBbCcfi$\\
  20. $\textnormal{0123456789}\textit{AaBbCcfi}$
  21. \begin{gather}
  22. \int_{0}^{1}x^{-x}\mathrm{d}x=\sum_{n=1}^{\infty}n^{-n}\\
  23. A\setminus A=\varnothing=\emptyset
  24. \end{gather}
  25. \begin{equation}G(\theta)= \begin{cases}
  26. & 29 - 25\lg(\theta)\text{ при } 1^{\circ}<\theta\leq20^{\circ}; \\
  27. & -3,5\text{ при } 20^{\circ}<\theta\leq26,3^{\circ}; \\
  28. & 32 - 25\lg(\theta)\text{ при } 26,3^{\circ}<\theta\leq48^{\circ}; \\
  29. & -10\text{ при } 48^{\circ}<\theta\leq180^{\circ}. \\
  30. \end{cases}\end{equation}
  31. %\end{frame}
  32. \end{document}
Attachments
font2.png
Correct
font2.png (81.21 KiB) Viewed 566 times

kostao
Posts: 16
Joined: Tue Jan 10, 2017 8:48 pm

Postby kostao » Tue Feb 07, 2017 6:39 am

Incorrect

  1. \documentclass{beamer}
  2. \usepackage{mathtools,amssymb}
  3. \usepackage{fontspec}
  4. \newcommand*{\myfont}{Georgia}
  5. \setmainfont{\myfont}[Ligatures=TeX]
  6. \setsansfont{\myfont}[Scale=0.975]
  7. \setmonofont{\myfont}
  8. \usepackage{unicode-math}
  9. \setmathfont{Latin Modern Math}
  10. \setmathfont[range={"0030-"0039}]{\myfont}
  11. \setmathfont[range={\varnothing}]{Asana Math}
  12. \AtBeginDocument{
  13. \renewcommand*{\setminus}{\smallsetminus}
  14. }
  15. \usepackage[english,russian]{babel}
  16. \begin{document}
  17. \begin{frame}
  18. \noindent
  19. $0123456789AaBbCcfi$\\
  20. $\textnormal{0123456789}\textit{AaBbCcfi}$
  21. \begin{gather}
  22. \int_{0}^{1}x^{-x}\mathrm{d}x=\sum_{n=1}^{\infty}n^{-n}\\
  23. A\setminus A=\varnothing=\emptyset
  24. \end{gather}
  25. \begin{equation}G(\theta)= \begin{cases}
  26. & 29 - 25\lg(\theta)\text{ при } 1^{\circ}<\theta\leq20^{\circ}; \\
  27. & -3,5\text{ при } 20^{\circ}<\theta\leq26,3^{\circ}; \\
  28. & 32 - 25\lg(\theta)\text{ при } 26,3^{\circ}<\theta\leq48^{\circ}; \\
  29. & -10\text{ при } 48^{\circ}<\theta\leq180^{\circ}. \\
  30. \end{cases}\end{equation}
  31. \end{frame}
  32. \end{document}
Attachments
font1.png
font1.png (84.91 KiB) Viewed 566 times

User avatar
Stefan Kottwitz
Site Admin
Posts: 8075
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Tue Feb 07, 2017 1:41 pm

beamer displays math formulas with a sans serif font. You can switch to serif math, like article does, by choosing the serif font theme:

\usefonttheme[onlymath]{serif}

Then you can see the missing integrals, sum signs and further symbols again.

Stefan
Site admin

kostao
Posts: 16
Joined: Tue Jan 10, 2017 8:48 pm

Postby kostao » Tue Feb 07, 2017 5:16 pm

thanks


Return to “Document Classes”

Who is online

Users browsing this forum: No registered users and 4 guests