Sometimes, it is convenient to change the font temporarily within a paragraph in LaTeX. This can be achieved quite simply by using the fontspec
package (which requires XeLaTex or LuaLaTeX.)
In order to change the font for a small section of text, delimit the text and call the font you wish to use with fontspec
. For example,
This text will be in the default document font, but {\fontspec{Tahoma} this text is in Tahoma}.
There are also several options that can be passed to fontspec
. For instance to make the font a little large or smaller, the Scale
option can be passed thus,
This text will be in the default document font, but {\fontspec{Tahoma}[Scale=1.2] this text is set in Tahoma and is 20 percent larger.}.
And, yes, the Scale
option is capitalized.
Leave a Reply