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've used Alex Hirzel's code to enable code snippets in LaTex articles:

enter image description here

The problem is that I can't set the font to a fixed-width one. Whenever this line is commented out:

%\fontspec{Courier New}

I get the following error:

./code3.tex:33: Undefined control sequence.
\codefont -> \fontspec 
                       {Courier New} \fontsize {9pt}{11pt}\selectfont 
l.33 \begin{code}

Any idea how can I set the font type? I'm using TexShop on Mac, if it matters.

share|improve this question
1  
Load the fontspec package (and naturally compile then with xelatex or lualatex. –  Ulrike Fischer Aug 26 '12 at 10:56
    
@UlrikeFischer Thanks! Care to post it as an answer so I can accept? –  Adam Matan Aug 26 '12 at 11:16

1 Answer 1

up vote 2 down vote accepted

Load the fontspec package (and naturally compile then with xelatex or lualatex).

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.