Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am new in LaTex. However, I am using document class Beamer with mode as presentation. I tried to change the main font. But do not find anyway! Can I use Cambria font in TexStudio? please help.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

If you have the ttf (TrueType) Cambria font, you can use XeLaTeX:

\documentclass{beamer}
\usepackage{fontspec}
\usepackage{lipsum}

\setmainfont[Ligatures=TeX]{Cambria}
\usefonttheme{serif}
\usefonttheme{professionalfonts}

\begin{document}

\begin{frame}
\lipsum[4]
\end{frame}

\end{document}

enter image description here

Notice that since the default font theme in beamer switches to sans serif, one has to explicitly ask for a serif font using

\usefonttheme{serif}

or one of its variants (refer to the beamer manual).

share|improve this answer
    
Sorry, I am new in LaTex. Do I have to download and install XeLaTex? –  overwhelmed Apr 17 at 1:00
    
@overwhelmed No; it should come with your LaTeX system (if its relatively updated). Your editor TeXstudio should have an option to choose which engine to use (there must be a menu showing things like pdflatex, lualatex, xelatex); choose xelatex to compile. All you need is to have the TrueType Cambria font; if your system doesn't already have it, there are numerous places in the web where you can download it. –  Gonzalo Medina Apr 17 at 1:02
    
For the record, I believe your screenshot is incorrect: it looks like Latin Modern Sans (a sans-serif font) instead of Cambria (a serif font). –  hftf Apr 17 at 1:28
    
@hftf You're right. Since the default font theme in beamer switches to sans serif, one has to explicitly ask for a serif font. I've updated my answer. Thanks for noticing it! –  Gonzalo Medina Apr 17 at 1:34
    
@GonzaloMedina Got it. It is in Option>Configure TexStudio>Build>Default Compiler. Now changed to XeLaTex. However, now I see new problem: ** WARNING ** Couldn't open font map file "kanjix.map". By the way, I am using Windows 7, and I have Cambria font at C:\Windows\Fonts. But no change of font to Cambria in my current document after using your codes. What should I do now? –  overwhelmed Apr 17 at 1:35

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.