Latex font attributes

Source: Internet
Author: User

Latex fonts have five attributes: encoding, family, series, size, and shape. Generally, the font encoding attributes are not involved. You can customize font attributes. The command for defining attributes is called declaration. It declares no parameters and is directly used in the document.
1. Family attributes: 3 races provided by latex: Rome font (\ rmfamily), Unlined font (\ sffamily), and typewriter font (\ ttfamily ). If you define a family in the environment, remove the \ before the attribute declaration. The command format is as follows:

\ Begin {rmfamily}
This is Line 1.
\ End {rmfamily}

The family property page can be directly defined. In this way, the declared text will always use the font property defined by the current declaration until a new declaration is encountered. The command format is as follows:

\ Sffamily this is line 4.

To limit the scope defined by the Declaration, the family attributes can also be defined as follows:
{\ Sffamily this is line 5 .}


2. shape attributes: defines the skew and height of the font. Commands include upstanding, upshape, and italic) \ itshape, slanted italic \ slshape, small uppercase (small caps) \ scshape.

The method of definition is the same as that of family attributes.

 

3. Series attributes: Define the font blackness and width: medium weight (\ mdseries) and bold (\ bfseries ).

The definition method is the same as that of the family property.

 

4. The font attribute can also be defined by command without declaration. The command parameter is the text that needs to be defined for the font attribute. The corresponding command format is as follows:
Family: \ textrm {}, \ textsf {}, and \ texttt {} (Rome, Unlined, and printer fonts in sequence)
Shape: \ textup {}, \ textit {}, \ textsl {}, \ textsc {} (in sequence: upright, italic, italic, and uppercase font)
Series: \ textmd {} And \ textbf {} (medium weight and bold font respectively)
Default Value: \ textnormal {} (default value of the font attribute, that is, the moderate-weight upright Rome font)
Emphasis; \ emph {} (emphasis font)

 

5. Size: the font size is defined in the form of commands (with 10 pt as the reference size), and the commands from small to large are:

\ Tiny \ scriptsize \ footnotesize \ small \ normalsize \ large \ huge

 

Source file:

1 \ documentclass [12pt] {Article} 2 3 \ begin {document} 4 5 This Is A \ latex {} document. \ 6 7 \ begin {rmfamily} 8 This is Line 1. \ 9 \ end {rmfamily} 10 11 \ begin {sffamily} 12 This is Line 2. \ 13 \ end {sffamily} 14 15 \ begin {ttfamily} 16 This is Line 3. \ 17 \ end {ttfamily} 18 19% % can also be directly defined: in this way, the declared text will always use the font attribute defined by the current declaration, 20 \ rmfamily this is Line 4 until a new declaration is encountered. \ 21 22% % to restrict the scope defined by the Declaration, you can also define it as 23 {\ sffamily this is line 5 .} \ 24 25% % shape, which defines the skew and height of the font: upstanding \ upshape, italic) \ itshape, slanted italic \ slshape, small uppercase (small caps) \ scshape26 \ begin {upshape} 27 This Is A \ latex {} document. \ 28 \ end {upshape} 29 30 \ itshape this is a \ latex {} document. \ 31 32 \ slshape this is a \ latex {} document. \ 33 34 \ scshape this is a \ latex {} document. \ 35 36% % series, which defines the font blackness and width: medium weight (\ mdseries), bold (\ bfseries) 37 \ begin {bfseries} 38 This Is a bold face series document.39 \ end {bfseries} 40 41 \ mdseries this is a medium series document.42 43% % declaration \ normalfont: defines the default font attribute, that is, the moderate-weight upright Roman font. 44 45% % font attributes can also be defined using commands. The command parameter is the text of the font attribute to be defined: 46% % family: \ textrm {}, \ textsf {}, \ texttt {} 47% % shape: \ textup {}, \ textit {}, \ textsl {}, \ textsc {} 48% % series: \ textmd {}, \ textbf {} 49% % default value: \ textnormal {} 50% % emphasized; \ emph {} 51 \ textnormal {This Is A \ textrm {\ latex {} \ textit {document .}}} \ 52 53 \ normalfont to be \ emph {left}, \ textsl {or \ emph {right }}. 54 55 56% % font size command (base size of 10 pt ): from small to large 57% % \ tiny \ scriptsize \ footnotesize \ small \ normalsize \ large \ huge \ huge58 59 \ tiny this \ scriptsize is \ footnotesize A \ small latex \ normalsize document \ large which \ large show \ large how \ huge latex \ huge works.60 61 \ end {document}
View code

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.