Fonts & Character SetsVerdana Font

Information and discussion about fonts and character sets (e.g. how to use language specific characters)
Post Reply
nitrogen28
Posts: 12
Joined: Tue Dec 16, 2008 1:20 am

Verdana Font

Post by nitrogen28 »

I am writing my master thesis and since my faculty does not acknowledge the existence of any other writing environments except MS Word I have to reproduce their settings in my Latex editor.
I am still a beginner when it comes to Latex so be forgiving with stupid questions.

I already looked up a couple of resources on the internet about Verdana in Latex but I could never achieve the right results and got more questions after reading than before :?: :?: :?:

The aim is to have Verdana set as the default font for my document.

This is what I got so far:

Code: Select all

\documentclass[10pt]{article}
\usepackage[applemac]{inputenc}
\usepackage[a4paper,left=3.5cm,right=2.5cm,top=2.7cm,bottom=2.5cm,footskip=1.2cm,headsep=0.9cm,headheight=0.5cm]{geometry}

\usepackage{calc}

%\usepackage{fontspec} ???
%\setsansfont{Verdana} ???

\renewcommand{\rmdefault}{cmss} %sansserif fond default
\usepackage{sectsty}
\usepackage{txfonts}

\sectionfont{\fontsize{14pt}{17.5pt} \bfseries} %set font to headline
\subsectionfont{\fontsize{12pt}{15pt} \bfseries \itshape}
\subsubsectionfont{\fontsize{11pt}{13.75pt} \bfseries}
\paragraphfont{\fontsize{11pt}{13.75pt}}

\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{epstopdf}

...
Could you help me to set Verdana as the default font for my thesis and maybe clear my confusion?
I have the MacTeX 2010 distribution installed.

Cheers,
Last edited by nitrogen28 on Mon Sep 13, 2010 8:19 am, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Verdana Font

Post by frabjous »

Perhaps this is neither here nor there, but I find it rather surprising that your faculty would require you to typeset your thesis using the Verdana font. Firstly, Verdana is a sans serif font, and traditionally, body text is typeset in a serif font. Secondly, Verdana is a commercially owned proprietary font, and it seems odd to be that a university would require their students to use any particular commercial product (at least not unless they were supplying it to them for free; though perhaps they are.)

The easiest way to use an arbitrary TrueType font is to typeset using XeLaTeX. XeLaTeX is different from regular LaTeX or pdfLaTeX, though MacTeX 2010 comes with all of them, and like pdfLaTeX, XeLaTeX generates a PDF by default. But it does mean that you need to explicitly tell your editor to use XeLaTeX instead of pdfLaTeX to compile. How this is done would depend on your editor. What are you using?

Anyway, if you do use XeLaTeX you can use the fontspec package. It is a good idea to read its documentation. The right commands likely would be these:

Code: Select all

\usepackage{fontspec}
\defaultfontfeatures{Mapping=tex-text}
\setmainfont{Verdana}
or perhaps:

Code: Select all

\usepackage{fontspec}
\defaultfontfeatures{Mapping=text-text}
\setsansfont{Verdana}
\renewcommand*{\familydefault}{\sfdefault}
If you need Verdana in math mode too, you'll need to look at the mathspec package.

You'll need to have Verdana installed as a system font for any of this to work.

A lot of the rest can be left out. Let me say a word or two about some of the things in your document, and how they would need to be changed or omitted.

Code: Select all

\usepackage[applemac]{inputenc}
Leave this line out. You should only use inputenc package with latex or pdflatex; it is not compatible with xelatex, which expects UTF-8 (unicode) input by default. I'm also fairly sure that the applemac option is for pre-OS X versions of mac, which it's unlikely you're using. Most likely, you are using UTF-8/unicode, though it would depend on your editor, and you might want to check. Anyway, you shouldn't use this package with xelatex anyway.

Code: Select all

\renewcommand{\rmdefault}{cmss} %sansserif fond default
"cmss" stands for "Computer Modern Sans Serif", so this does set your default font to a sans-serif font, but not the sans serif font you wanted! Anyway, see my suggestions above for better ways to handle this.

Code: Select all

\usepackage{txfonts}
The txfonts package is for using clones of the Times (New) Roman fonts in your document. Loading this will undo everything else, so don't.

Code: Select all

\sectionfont{\fontsize{14pt}{17.5pt} \bfseries} %set font to headline
\subsectionfont{\fontsize{12pt}{15pt} \bfseries \itshape}
\subsubsectionfont{\fontsize{11pt}{13.75pt} \bfseries}
\paragraphfont{\fontsize{11pt}{13.75pt}}
These are options for sectsty; they probably will work OK like this, so you can leave them.

Code: Select all

\usepackage{epstopdf}
This package is not needed in XeLaTeX; for that matter it's not needed in the 2010 version of pdfLaTeX either.
nitrogen28
Posts: 12
Joined: Tue Dec 16, 2008 1:20 am

Re: Verdana Font

Post by nitrogen28 »

Thanks for the help. Just followed you advice and it works.

I am very aware of the problems with Verdana and I will discuss this with the head of my faculty as soon as i ll turn in my thesis.
For better understanding, my faculty is a very small engineering department. People who work there are very good in engineering but when it comes to other topics the results are mediocre (see my topic above).
It is hard to convince someone of LaTaX when the only thing they know and work with for long time is MS Office.

For the sake of completeness: I am using OS X and TeXShop.
I am using currently Western (Mac OS Roman), should I change it to UTF-8.
(I am also writing German documents)

Cheers,
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Re: Verdana Font

Post by frabjous »

Yes, I would switch to UTF-8/Unicode; that's what works best with XeLaTeX. It'll also allow you to use, e.g., ß, ö, Ü, and so on, etc. directly in your code if you so wish. (Not sure if the older mac encoding would allow that or not.)
Post Reply