How do you change the font for the whole document to sans-serif (or anything else)?
Set the font size of the whole document by adding an option to the \documentclass command. (10pt, 11pt, and 12pt are available on most classes.) Extsizes package makes more sizes from 8pt to 20pt available for the whole document. Moresize package adds two more size commands: \HUGE and \ssmall.
If you want a different size for your document, you can use extsizes packages. The command used are \documentclass[10pt]{extarticle} and \documentclass[14pt]{extreport}. You can also style the text differently.
To open the menu, click the menu button in the top-left-hand corner of the screen. From here, scroll down to find the 'Font Size' option to change the font size in the editor.
LaTeX's default font is Computer Modern, but the editor also supports a number of other font types.
I found the solution thanks to the link in Vincent's answer.
\renewcommand{\familydefault}{\sfdefault}
This changes the default font family to sans-serif.
For a different approach, I would suggest using the XeTeX or LuaTex system. They allow you to access system fonts (TrueType, OpenType, etc) and set font features. In a typical LaTeX document, you just need to include this in your headers:
\usepackage{fontspec} \defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase} \setmainfont{Times} \setmonofont{Lucida Sans Typewriter}
It's the fontspec
package that allows for \setmainfont
and \setmonofont
. The ability to choose a multitude of font features is beyond my expertise, but I would suggest looking up some examples and seeing if this would suit your needs.
Just don't forget to replace your favorite latex compiler by the appropriate one (xelatex or lualatex).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With