Matnlarga ishlov berish LaTex text Formatting


Download 0.75 Mb.
bet4/18
Sana09.04.2023
Hajmi0.75 Mb.
#1344635
1   2   3   4   5   6   7   8   9   ...   18
Bog'liq
Matnlarga ishlov berish

Changing Font Shape
There are four different shape options we can use in LaTeX. The most used shape option is italic, which is a cursive font that is normally slanted slightly to the right. We can create this font shape using \textit command. 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. Basically, it is a non-cursive slanted font, and we can use \textsl command to create it. Another option we can create is the small capitals form, which uses small forms of capital letters instead of lowercase letters. We can activate this form using \textsc command. The last form we have is the most common and default way of writing: it’s the upright form. If we need to use it in the scope of a different shape, we can use it with \textup command. Below, we show the effects of these commands in various font families of Computer Modern.
\textup{Upright} \textit{Italic} \textsl{Slanted}
\textsf{Upright \textit{Italic} \textsl{Slanted}}
\texttt{Upright \textit{Italic} \textsl{Slanted}}
\textsc{Small Capitals}

Notice that in the sans serif font family, italic and slanted fonts are the same. Some font families don’t have a slanted or an italic form. If that is the case, these commands produce the form that is available. In this case, italic command copied the form of the slanted command. 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.
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.

Changing Font Weight
Font families usually come in at least two weight options, and bold is the most common weight option. We can use \textbf command to produce a bold text, and if we need to go back to the normal weight, which is also known as medium weight, we can use \textmd command. (It is also the default font weight, so the text will be printed in medium weight if it’s not in the scope of another font weight changing command.) Below, we demonstrated these options on serif and sans serif font family types.
\textbf{Bold} \textmd{Medium}
\textsf{\textbf{Bold} \textmd{Medium}}

There are monospaced fonts that has weight options, but the default LaTeX font doesn’t have any weight options. However, we can introduce a bold form for the monospaced font family with bold-extra package . It also adds a bold weight option to the small capitals shape.
\usepackage{bold-extra}
\begin{document}
\texttt{\textbf{Bold} Monospace}
\textsc{\textbf{Bold} Small Capitals}
\end{document}

In LaTeX, we can also select a light weight font, only if it’s supported by the font family. We can use \textlf to produce a text with a light weight version of the font.
There are also text switch versions of these commands: \bfseries can be used to print bold characters, \mdseries is for medium weight characters and \lfseries is the switch for light weight characters.

Download 0.75 Mb.

Do'stlaringiz bilan baham:
1   2   3   4   5   6   7   8   9   ...   18




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling