Discussion:
XeLatex math font change when use \setmainfont
(too old to reply)
chat
2011-11-11 05:49:02 UTC
Permalink
Hi all,

I am using Xelatex. My problem is that when I include the command
\setmainfont[Scale=1.23]{TH Sarabun New}
(TH Sarabun New is my native language font) the font used to display
\sin function is different from not including the command
\setmainfont. How to prevent changing font used to display \sin
function
in math mode if I include the command \setmainfont? (As I understand,
\setmainfont should not effect font used in math mode). Here is the
minimal latex code.

\documentclass[a4paper, 12pt]{article}
\usepackage{amssymb,amsmath,amsthm,amsfonts}
\usepackage{fontspec}
\usepackage{xunicode}
\usepackage{xltxtra}
\defaultfontfeatures{Scale=1.0, Mapping=tex-text}
\XeTeXlinebreaklocale "th_TH"
\setmainfont[Scale=1.23]{TH Sarabun New}
\begin{document}
\[
\sin x
\]
\end{document}

Thank you very much for any helps.

Chat
Enrico Gregorio
2011-11-11 08:10:25 UTC
Permalink
Post by chat
Hi all,
I am using Xelatex. My problem is that when I include the command
\setmainfont[Scale=1.23]{TH Sarabun New}
(TH Sarabun New is my native language font) the font used to display
\sin function is different from not including the command
\setmainfont. How to prevent changing font used to display \sin
function
in math mode if I include the command \setmainfont? (As I understand,
\setmainfont should not effect font used in math mode). Here is the
minimal latex code.
\documentclass[a4paper, 12pt]{article}
\usepackage{amssymb,amsmath,amsthm,amsfonts}
\usepackage{fontspec}
\usepackage{xunicode}
\usepackage{xltxtra}
\defaultfontfeatures{Scale=1.0, Mapping=tex-text}
\XeTeXlinebreaklocale "th_TH"
\setmainfont[Scale=1.23]{TH Sarabun New}
\begin{document}
\[
\sin x
\]
\end{document}
It should be

\usepackage[no-math]{fontspec}

Ciao
Enrico
chat
2011-11-11 09:31:45 UTC
Permalink
Thank you very much Ciao Enrico. It really works.

Chat
chat
2011-11-14 05:22:10 UTC
Permalink
One more question, this problem also occur when I use beamer. That is
math font change when I use \setmainfont command.
The method above (\usepackage[no-math]{fontspec} ) can not solve this
problem. Here is the code

\documentclass[xelatex,serif]{beamer}
\usepackage{amssymb,amsmath,amsthm,amsfonts}
\usepackage[no-math]{fontspec}
\usepackage{xunicode}
\usepackage{xltxtra}
\defaultfontfeatures{Scale=1.0, Mapping=tex-text}
\XeTeXlinebreaklocale "th_TH"
\setmainfont[Scale=1.23]{TH Sarabun New}
\begin{document}
\begin{frame}
\[
\sin x
\]
\end{frame}
\end{document}

How to solve this problem when using beamer class?

Thank you in advance.

Chat
Ulrike Fischer
2011-11-14 08:35:54 UTC
Permalink
Post by chat
One more question, this problem also occur when I use beamer. That is
math font change when I use \setmainfont command.
The method above (\usepackage[no-math]{fontspec} ) can not solve this
problem. Here is the code
How to solve this problem when using beamer class?
You can try \usefonttheme{professionalfonts}. Then beamer will not
adjust the math mode.

(I don't have your font and also you are a bit unclear about how you
want the math setup so I don't know if this gives the result you
want.)
--
Ulrike Fischer
chat
2011-11-14 08:53:15 UTC
Permalink
Post by Ulrike Fischer
You can try \usefonttheme{professionalfonts}. Then beamer will not
adjust the math mode.
Thank you very much Ulrike Fischer. Your suggestion solve my problem.
I want math font to be Computer Modern (default font). By using
\usefonttheme{professionalfonts}
command, the desirous result is obtained.

Thank you again.

Chat
o***@gmail.com
2015-01-06 08:54:58 UTC
Permalink
Post by chat
Hi all,
I am using Xelatex. My problem is that when I include the command
\setmainfont[Scale=1.23]{TH Sarabun New}
(TH Sarabun New is my native language font) the font used to display
\sin function is different from not including the command
\setmainfont. How to prevent changing font used to display \sin
function
in math mode if I include the command \setmainfont? (As I understand,
\setmainfont should not effect font used in math mode). Here is the
minimal latex code.
\documentclass[a4paper, 12pt]{article}
\usepackage{amssymb,amsmath,amsthm,amsfonts}
\usepackage{fontspec}
\usepackage{xunicode}
\usepackage{xltxtra}
\defaultfontfeatures{Scale=1.0, Mapping=tex-text}
\XeTeXlinebreaklocale "th_TH"
\setmainfont[Scale=1.23]{TH Sarabun New}
\begin{document}
\[
\sin x
\]
\end{document}
Thank you very much for any helps.
Chat
Dear all,

It is good question, Chat! I also face this problem.
Great solution, Ulrike Fischer! It works fine :)

Loading...