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'm using KOMA-Script and I would like to know how can I change the default font to FreeSans, or any other font-family? Also, how can I change all text to sans-serif?

share|improve this question
1  
I don't know about FreeSans. With regard to your second question: This should be of help. –  lockstep Jun 14 '11 at 19:54

2 Answers 2

up vote 5 down vote accepted

For fonts that are packaged for use with LaTeX, the Font Catalogue usually tells you how to use them.

If you specifically want to use FreeSans (which, as far as I know, has not been packaged for LaTeX), the easiest way is to use the fontspec package and XeLaTeX or LuaLaTeX.

% Compile with xelatex or lualatex.
\documentclass{article}
\usepackage{lipsum}% for testing

\usepackage{fontspec}
\setmainfont{FreeSans}

\begin{document}
\lipsum
\end{document}

example

share|improve this answer

I don't know about FreeSans, but if somebody has built a LaTeX package for your font, just loading the package should make that font the default sans-serif font. For example, add \usepackage{helvet} to the preamble of your document to change the default sans-serif font to Helvetica. To make the default sans-serif font the default font in your document, you need to additionally add \renewcommand{\familydefault}{\sfdefault} to the preamble.

In the rare case that there exists an .fd-file for your font but no LaTeX package, you need to look into that file for the LaTeX family name of this font and set the family manually by redefining \sfdefault. For example, the LaTeX family name for Helvetica is phv, so you can make Helvetica the default sans-serif font using \renewcommand*{\sfdefault}{phv}. (Additionally, it might be necessary to change the default font encoding.)

Finally, if there is no LaTeX support for your font and you do not want to switch to XeTeX or LuaTeX, there is the possibility to employ a tool such as autoinst to generate the necessary files.

share|improve this answer

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.