How do you change the document font in LaTeX?

如何将整个文档的字体更改为无衬线字体(或其他)?


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).


As second says, most of the "design" decisions made for TeX documents are backed up by well researched usability studies, so changing them should be undertaken with care. It is, however, relatively common to replace Computer Modern with Times (also a serif face).

Try usepackage{times} .

链接地址: http://www.djcxy.com/p/33408.html

上一篇: TeX字体映射

下一篇: 如何更改LaTeX中的文档字体?