

Changing Font Weightįont families usually come in at least two weight options, and bold is the most common weight option. There are also text switch equivalents of these commands: \upshape for the upright shape, \itshape for italic shape, \slshape for slanted shape and \scshape for small capitals shape. It’s the same for small capitals: If that font family doesn’t have a small caps form, it will use another font family belonging the same font that has the small caps form. In this case, italic command copied the form of the slanted command.

If that is the case, these commands produce the form that is available. Some font families don’t have a slanted or an italic form. Notice that in the sans serif font family, italic and slanted fonts are the same. Below, we show the effects of these commands in various font families of Computer Modern. If we need to use it in the scope of a different shape, we can use it with \textup command. The last form we have is the most common and default way of writing: it’s the upright form. We can activate this form using \textsc command. Another option we can create is the small capitals form, which uses small forms of capital letters instead of lowercase letters. Basically, it is a non-cursive slanted font, and we can use \textsl command to create it. We also have a slanted option, which has the similar slant to the right as an italic font, but it keeps the same lettering as the normal font family. We can create this font shape using \textit command. The most used shape option is italic, which is a cursive font that is normally slanted slightly to the right. There are four different shape options we can use in LaTeX. Monospaced Font Family Changing Font Shape The same result can be achieved with switches by using the next piece of code. Instead of commands, we can also use text switches: \rmfamily, \sffamily and \ttfamily for serif, sans serif and monospaced font families, respectively. In the following piece of code, we demonstrated the effects of the commands. In a similar fashion to the default font family commands, \textrm is for serif font family, \textsf is for sans serif font family, and \texttt is for monospaced for family. If we need to use a certain font family only for a part of our document, we can write it in a text command. For instance, we can change the default font family for the whole document by using the command below with \rmdefault for serif font family, \sfdefault for sans serif font family and \ttdefault for monospaced font family. In LaTeX, serif font families are shortened as rm (for roman font), sans serif font families are shortened as sf, and monospaced font families are shortened as tt (for teletype font family). Courier and Consolas are examples of monospaced fonts.
#Latin modern roman caps font code#
They are mostly used for source code listings, or well-aligned contents. Lastly, a monospaced font use the same fixed-width for each of their characters. Famous examples of sans serif fonts are Helvetica, Futura, etc. A sans serif font doesn’t have any serif in its characters.

A serif is a small line or taper regularly added to the end of a character’s stem, like we see in fonts such as Times New Roman, Garamond, etc. This font comes with three different font families: serif, which is the default setting, sans serif, and monospaced.

In this article, we will walk through the commands that changes the style of fonts in LaTeX. We can change the look of this font by changing its font family, font weight or font shape. (Slightly cheating because it uses Computer Modern Unicode for the bold smallcaps.The standard font we are seeing on LaTeX documents is called Computer Modern. The following is what I've put together as a way of making sure the full(est) range of fonts/styles are available when using Latin Modern as the mainfont using fontspec, including bold smallcaps, italics smallcaps, etc.: \setmainfont[
