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 set my monospace font using \setmonofont. I'd like to be able to change the size of this font for my entire document, rather than use \fontsize everywhere. How can I do that?

share|improve this question

2 Answers 2

up vote 6 down vote accepted

In manual of fontspec: 8.2 Scale

http://www.ctan.org/tex-archive/macros/latex/contrib/fontspec

share|improve this answer
    
Can you please also here say a bit more? Thanks! –  Hendrik Vogt Jan 17 '11 at 17:49
    
It is exactly the answer, isn't it? Further more, it isn't a normal link, but manual of fontspec. IMHO, everyone who want to use fontspec should have a look at it. –  Leo Liu Jan 18 '11 at 5:17
6  
You are right on two counts: One should use the manual, and you gave the precise location in the manual. However, the link to meta.SO I gave before still applies: It's best to have the answers here. Who knows what the section number in the fontspec manual will be in a year from now; then it'll be more difficult to find. It's always best to give a short example. Here, just one line of code would be great! –  Hendrik Vogt Jan 18 '11 at 15:08
1  
@HendrikVogt I agree. The link in this answer is not working anymore at this point which made it more difficult for me to find an actual answer. Here's another link to the manual: ftp.tu-chemnitz.de/pub/tex/macros/latex/contrib/fontspec/… –  Manuzor Mar 10 '13 at 21:35

Use the Scale attribute on \setmonofont, e.g:

\setmonofont[Scale=MatchLowercase]{Droid Sans Mono}
\setmonofont[Scale=0.9]{Droid Sans Mono}

The scale can be:

  • a number: 1 is the original size, 2 is twice as big, 0.5 is twice as small...
  • MatchLowercase or MatchUppercase: this scales the font to the height of either the lowercase or the uppercase letters in the current roman font.

Source: Section 8.2 in the manual of the fontspec package (PDF)

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.