XeTeXBeamer + Verdana

Information and discussion about XeTeX, an alternative for pdfTeX based on e-Tex
Post Reply
remusmp
Posts: 25
Joined: Sat Oct 17, 2009 8:37 pm

Beamer + Verdana

Post by remusmp »

Hej,

I would like to use Beamer + Verdana font. I have heard that it is easier to change fonts in xelatex so I did this:

Code: Select all

\usefonttheme{professionalfonts}
\usepackage[T1]{fontenc}
\usepackage{fontspec}
\setmainfont{Verdana}
Well... After recompiling and viewing the pdf file, it turns out that the font is not Verdana.

I also tried with pdflatex:

Code: Select all

\usefonttheme{professionalfonts}
\usepackage{textcomp}
\pdfmapfile{+winfonts.map}
Every time I wish to change the font I have to add this line:

Code: Select all

\fontfamily{verdana}\selectfont
Is there an easier way? I don't want to add \fontfamily{verdana} all the time. I want Beamer to use it as default font. So I did some \setbeamerfont commands for most of the beamerfonts but I don't know how to change the main text font. I've only managed to change the frametitle, title, slidenumber, author, insitution etc... not the text inside the frame - I don't know its name (normal text? - but it didn't work).

So, the font is alright now but I don't know how to make Beamer use it everywhere.

Please help me either with xelatex or pdflatex :) Thank you.

R.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

remusmp
Posts: 25
Joined: Sat Oct 17, 2009 8:37 pm

Beamer + Verdana

Post by remusmp »

This line solves the issue in pdflatex:

Code: Select all

\renewcommand{\familydefault}{verdana}
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Beamer + Verdana

Post by frabjous »

In the future please follow board rules and provide a complete, compiliable, minimal working example.

The \setmainfont command of XeLaTeX/fontspec sets the serif text font, but beamer uses the sans serif font by default.

Two ways to deal with this...

The most obvious way is to set Verdana as your sans font (since, after all, it is a sans serif font):

Code: Select all

\usepackage{fontspec}
\setsansfont{Verdana}
Or if you want to be tricky, you can change beamer to use serif fonts instead, but then, oddly, choose Verdana as if it were a serif font:

Code: Select all

\usepackage{fontspec}
\usefonttheme{serif}
\setmainfont{Verdana}
You should not use the fontenc package with XeLaTeX, nor (most likely) the professionalfonts beamer font theme, nor textcomp. However, I recommend putting in:

Code: Select all

\defaultfontfeatures{Mapping=tex-text} 
\usepackage{xunicode} 
\usepackage{xltxtra} 
The first line gives XeLaTeX support TeX conventions like ``---'' for the emdash, and `` for a double left quote, etc. xunicode gives XeLaTeX support for LaTeX character names for unicode characters (accents, international symbols, etc.) xltxtra improves odds and ends for XeLaTeX, but see the documentation, especially if you notice superscripts and subscripts having problems.
remusmp
Posts: 25
Joined: Sat Oct 17, 2009 8:37 pm

Re: Beamer + Verdana

Post by remusmp »

Thank you very much. It worked!

I will paste compilable code in the future - I am sorry for that.

Regards,
Remus.
Post Reply