[texhax] Using fontspec in a .sty

Ulrike Fischer news3 at nililand.de
Mon Aug 7 17:41:51 CEST 2017


Am Sun, 06 Aug 2017 17:47:40 -0400 schrieb James Cloos:


> How do I use fontspec to specify a font just for ps at firstpage's @oddhead?

Define the font with \newfontfamily

\documentclass{article}
\usepackage{fontspec}  

\newfontfamily\myheaderfont{TeX Gyre Pagella}

\begin{document}
 \itshape \bfseries blblblb 
 

{\myheaderfont\fontseries{m}\fontshape{n}\fontsize{20pt}{23pt}\selectfont
Header}

\end{document}


You can also use \newfontface. See the documentation.


-- 
Ulrike Fischer 
http://www.troubleshooting-tex.de/



More information about the texhax mailing list