Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

XeLatex math font change when use \setmainfont

2,811 views
Skip to first unread message

chat

unread,
Nov 11, 2011, 12:49:02 AM11/11/11
to
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

unread,
Nov 11, 2011, 3:10:25 AM11/11/11
to
It should be

\usepackage[no-math]{fontspec}

Ciao
Enrico

chat

unread,
Nov 11, 2011, 4:31:45 AM11/11/11
to
Thank you very much Ciao Enrico. It really works.

Chat

chat

unread,
Nov 14, 2011, 12:22:10 AM11/14/11
to
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

unread,
Nov 14, 2011, 3:35:54 AM11/14/11
to
Am Sun, 13 Nov 2011 21:22:10 -0800 (PST) schrieb 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

unread,
Nov 14, 2011, 3:53:15 AM11/14/11
to
> 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




olsay...@gmail.com

unread,
Jan 6, 2015, 3:55:04 AM1/6/15
to
Dear all,

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