Friday, December 11, 2020

Setting up Font For Bold and Italic in LaTeX

 To Set up font for bold and italic in LaTeX, one has to load the Fontspec package. But first make sure the font you are using has both the bold and italic glyphs or make sure the fonts you are going to use matches else it would be very awkward and look very unprofessional. Most of the time  the fontspec package can load a font with its given name such as Times New Roman or Noto Sans. If you mentioned a font by its file name then make sure you mention the Bold and Italic fonts.In This you can also set the default typewriter font, For example if you want to load the courier as the default typewriter font all you had to is load the package Here is the Minimal Working example.

\Requirepackage[orthodox]{nag}                    \documentclass{article}                       \usepackage{fontspec}               \setmainfont{texgyrepagella-regular.otf}[BoldFont= texgyrepagella-bold.otf ,ItalicFont= texgyrepagella-italic.otf , BoldItalicFont = texgyrepagella-bolditalic.otf]          \usepackage{courier}                                \begin{ document}                                  \end{document}

 

Reference:

https://tug.org/FontCatalogue/courier/

https://www.ctan.org/search?phrase=fontspec

https://tex.stackexchange.com/a/31743/229186 


No comments:

Post a Comment

Popular Posts