[Tex/LaTex] Different fonts with single commands

fonts

There are several questions posted here on fonts in latex, but for many of them, one has to use several commands.

But there are also some simple commands to change fonts, such as:

\sffamily, \rmfamily, \ttfamily 

Can I get to know some more such commands for different fonts? Usually, I had seen different answers for such questions on fonts, but as soon as see so many commands there and copy-paste it, then some errors usually comes, and then I think like this: "lets remove this command and see what happens" It was difficult to understand also what a command does there?

So I thought there could be simple commands to change fonts.

For example, this is typing in a book, I don't know which is this font:

enter image description here

The following two are other examples which came as output in my typing

 \documentclass[a4paper,12pt]{article}
 \usepackage[utf8]{inputenc}
 \usepackage{tgbonum}

 \begin{center} 
 {\Large 1.3    Relations with Lie groups} 
 \end{center}
 We discuss only the beginning of this topic. First we look at the ....

 \ttfamily
 \begin{center} 
 {\Large 1.3    Relations with Lie groups} \end{center}
 We discuss only the beginning of this topic. First we look at the  ....

enter image description here

Best Answer

The LaTeX2e font switching commands come in three broad groups: \xxfamily, \yyseries, and \zzshape, where xx, yy, and zz represent two-letter

Combinations are allowed across family/series/shape groups. Assuming the font family you're interested in provides lots of possible combinations, you could write things such as

{\ttfamily\bfseries\slshape Hello World}

or

{\rmfamily\bfseries\itshape Goodbye World}

Some font packages, e.g., lmodern, may feature most of the possible combinations of family, series, and shape attributes; however, other fonts may be more restrictive. In fact, most packages in general provide only a few of all possible combinations.

Related Question