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 an absolute beginner with Latex. I have Texnic Centre and MikTex 2.8. I just want to be able to use the truetpe or opentype fonts from my C:/Windows/Fonts folder. How hard can it be? Very apparently.

I have found a page that says I can use Xetex, but I have absolutely no idea how to use Xetex. I think it's installed - it came with MikTex, but I don't know how to get it working. I'd really appreciate some "baby steps" on how I can get this working.

Thanks

Edit

I have tried konrad's suggestion below and got a fontsec.cfg error. However, using the following:

\usepackage{xltxtra}
\setmainfont[Mapping=tex-text]{Tahoma}

I got it to work. I don't know why the first failed and this one worked, but it does appear to be using system fonts :)

share|improve this question
1  
The first probably failed because you don't have the font. –  Ulrike Fischer Sep 15 '10 at 14:44
add comment

1 Answer 1

A minimal document that uses an OTF font from your PC can look like this:

\documentclass{article}

\usepackage{fontspec}
\setmainfont{Constantia}

\begin{document}
This is a text.
\end{document}

Assuming that you have the font “Constantia” installed (included in current versions of Windows and Microsoft Office). You can of course use any other font.

To build the document, all you need to do is change the build command from latex (or pdflatex) to xelatex.

I don’t know how to do this in TeXnicCenter but it should be very straightforward – consult the help file.

Finally, have a look at the documentation of fontspec. This is the package that controls loading of TTF and OTF fonts.

There is one rather important caveat: XeTeX assumes that your document is saved using the character encoding UTF-8. This controls how extended characters (á, ö, ß …) are represented in the file. Unfortunately, TeXnicCenter still has no support for UTF-8, which is a crying shame. However, as long as you only use the normal American alphabet, there should be no problems. If you need extended characters, you must unfortunately switch to a better editor.

share|improve this answer
2  
You mean he/she should change the build command to xelatex (not xetex). –  Ulrike Fischer Sep 15 '10 at 9:14
    
@Ulrike: Oops. Thanks. –  Konrad Rudolph Sep 15 '10 at 12:18
add comment

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.