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.

How can I use the Calibri font in LaTeX? I am using the following commands:

\usepackage{fontspec}
\setmainfont{Calibri}

I get the following error message:

!   Fatal fontspec error: "cannot-use-pdftex"
!   The fontspec package requires either XeTeX or LuaTeX to function.
!   You must change your typesetting engine to, e.g., "xelatex" or "lualatex"  
!   instead of plain "latex" or "pdflatex".
! 
!    See the fontspec documentation for further information.
share|improve this question
2  
The error message indicates that you should use XeTeX, LuaTeX or even XeLaTeX! I was once trying to do the same, but never managed to do so, without XeLaTeX. Which editor are you using? –  Thanos Feb 6 '13 at 7:46
    
i m using pdflatex. So far it is best for me. –  user15662 Feb 6 '13 at 8:36
3  
Then you can't use fontspec and can't select the fonts which are only installed on your system. You have to stick to the fonts you install in LaTeX. –  Juri Robl Feb 6 '13 at 8:38

1 Answer 1

up vote 15 down vote accepted

As others have pointed out in comments, to use system fonts (or any local .otf or .ttf font) easily, you need to use the fontspec package and compile your document with either xelatex or lualatex. pdflatex won't work, but switching to xelatex or lualatex shouldn't require any major change in your document other than converting to utf8 encoding and removing any \usepackage[...]{inputenc}.

FYI, lualatex is the official successor of pdflatex in LaTeX3, and I personally see very little reasons not to switch asap to lualatex. If you want to read more on the differences, these links might provide you some more background:

Now, if you really can't / do not want to switch to xelatex or lualatex, and if you are really brave, you can stay with pdflatex, convert your Calibri font to Type1 and make it available to TeX. The tedious process is explained here.

share|improve this answer
    
if i use lualtex, formatting gets changed. Everything looks unorganized and font still remain the same. –  user15662 Feb 8 '13 at 1:33
1  
lualatex (not lualtex) should not change the formatting, and should change the font properly with the 2 lines you wrote in your question. Have a look at the log file for errors, and post another question if there is something else you don't understand. It's nearly impossible to help you without a MWE or your log file... –  Xavier Feb 8 '13 at 4:09
    
i have posted my question tex.stackexchange.com/questions/97288/… –  user15662 Feb 8 '13 at 6:47
    
The error message here is different, even when I compile with lualatex, the font is not found. I've downloaded the Calibri font and installed on Ubuntu with a double-click. Any hint? –  juliohm Sep 20 '13 at 1:00
    
The link above has the answer, just create a folder in /usr/share/fonts/truetype with all *.ttf files for Calibri. –  juliohm Sep 20 '13 at 1:11

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.