无涯教程 - Latex 字体(Fonts)

Latex字体

我们通常在方括号[]中定义纸张大小和字体大小。

可以使用 [10pt] 来描述点的大小。其他字体大小为8pt,9pt,10pt,11pt,12pt,14pt,17pt,20pt。

Latex的默认字体大小为 10pt 

纸张类型及其尺寸如下:

  • letterpaper(11 x 8.5英寸)
  • legalpaper(14 x 8.5英寸)
  • a5paper(5.8 x 8.3英寸)
  • a4paper(8.3 x 11.7英寸)
  • executivepaper(10.5 x 7.25英寸)
  • b5paper(25 x 17.6厘米)

Latex尺寸

Tex生成的默认字体大小或类型大小为10pt。有一些声明用于更改类型大小。所有类型大小以及命令的表如下所示:

Latex Fonts Size and Styles

在上述顺序中,\tiny 最小,而\Huge 最大。为了理解,让我们考虑以下示例:

\documentclass[a4paper]{letter}
\begin{document}
    \begin{center}
        \begin{huge}
            \textbf{The \LaTeX\Technical Would}
        \end{huge}
        
        \begin{LARGE}
            \textsc{\\LearnFK} 
        \end{LARGE}  
        
    \end{center}
    \noindent learnfk is a tutorial network for programmers technology introduction, including PHP, Java, Latex, Linux and other related tutorials -- from google translate
    
    \begin{flushright}
        \textsf{The Director}\\
            Hello LearnFK Would
    \end{flushright} %右对齐

\end{document}

下图显示了此代码的输出:

Latex Fonts Size and Styles

同样,您可以根据要求更改字体和样式。

Latex风格

样式分为family,seriesshape。输出中的字体由这三个特征组成。

styles的表格如下:

样式 命令
Roman \textrm {roman}
Typewriter \texttt {typewriter}
Scans serif \textsf {sans serif}

series的表格如下:

样式 命令
黑体 \textbf {boldface}
中体 \textmd {medium}

shape的表格如下:

样式 命令
斜体 \textit {italic}
倾斜 \textsl {slanted}
竖立 \textup {upright}
小体大写 \textsc {small cap}

下面给出了使用这三种类别的方式或过程:

\documentclass[12pt]{article}
\begin{document}
     %textbf:加粗,textit:斜体
    \textit{\textbf{ Welcome LearnFk Would.}}
    \\ %我要换行,嘎嘎

    \textrm{\textsl{  learnfk is a tutorial network for programmers technology introduction }}
\end{document}

此代码的输出将是:

Latex Fonts Size and Styles

如果要在单独的行中显示以上文本,请使用\newline 命令,如下所示:

 
\documentclass[12pt]{article}
\begin{document}
     %textbf:加粗,textit:斜体
    \textit{\textbf{ Welcome LearnFk Would.}}\newline

    \textrm{\textsl{  learnfk is a tutorial network for programmers technology introduction }}\newline
\end{document}

输出:

Latex Fonts Size and Styles

还有另一个名为\emph 的命令,用于样式设置。它使用series和当前字体。

\emph 用于在普通(竖排)文本的中间产生斜体形状。如果当前形式为斜体,则将其切换为直立形状。

示例如下所示:

 
\documentclass[12pt]{article}
\begin{document}
    \textit{learnfk is a tutorial network for programmers technology including   \emph{hexagon} PHP, Java, Latex, Linux \emph{tutorials}.}
\end{document}

下图显示了以上代码的输出:

Latex Fonts Size and Styles

您可以看到使用\emph 命令的单词与其他单词之间的区别。

在另一个示例中,我们使用粗体代替了上面的斜体,如下所示:

 
\documentclass[12pt]{article}
\begin{document}
    \textbf{learnfk is a tutorial network for programmers technology including   \emph{hexagon} PHP, Java, Latex, Linux \emph{tutorials}.}
\end{document}

上面的代码的输出如下图所示:

Latex Fonts Size and Styles

Latex文档

它包括开始和结束时使用的基本命令。它还包括编写文本的过程。在此模块中,我们使用了 OVERLEAF 编写代码。Latex的概述如下:

 
\documentclass[a5paper, 12pt]{article}
\begin{document}
   LearnFk is a Tutorial network for programmers technology introduction, including PHP, Java, Latex, Linux and other related tutorials
\end{document}

上述文档文件的输出将是:

Latex Fonts Size and Styles

下面给出了常用的其他命令,这些命令将在本项目中进一步实现。

  • flushright和flushleft   -  这些命令写为\begin {flushright} \begin {flushleft} 。这些用于使文本在文档的左右对齐。
  • \noindent                        -  如果要在没有 indent 的情况下开始任何段落或在不中断的情况下继续该段落,则使用此命令。

故障排除

在Latex中,如果文档文件中有错误,那么它将在编译后在底部以红色显示所有错误。错误将得到详细说明。

错误看起来将如下图所示:

Latex Fonts Size and Styles

之后,转到特定的行并删除错误。保存文件,然后可以再次编译。

其他字体样式

其他使用的字体样式和相应的代码如下:

  • 如果您希望文档的大小不同,则可以使用extsizes包。命令是\documentclass [10pt] {extarticle} \documentclass [14pt] {extreport} 
  • 您还可以使用其他样式来设置文本样式。代码如下:
 
\documentclass[9pt]{extarticle}
\begin{document}
    This text can be arranged in a unique way as given below:\\\\
    {\fontsize{50}{60}\selectfont LearnFK}
    {\fontsize{5}{6}\selectfont TeX!}
    {\Huge LearnFK}{\tiny TeX!!!}
\end{document}

输出如下所示:

Latex Fonts Size and Styles

\fontsize \selectfont 命令用于修改文本的大小。您可以根据要求设置尺寸。

字体家族

下面列出了常见的字体系列:

字体家族 Full Form
cmm Computer Modern Italic
cmsy Computer Modern Symbols
cmex Computer Modern Extensions
cmr Computer Modern Roman
cmss Computer Modern Sans
cmtt Computer Modern Typewriter
ptm Adobe Times
phv Adobe Helvetica
pcr Adobe Courier

下表列出了字体系列的粗细和粗细支持的标准:

sb  -  Semi Bold

ub  -  Ultra Bold

b     -  Bold

eb   -  Extra Bold

ul     -  Ultra Light

el     -  Extra Light

l       -  Light

sl     -  Semi Light

m     -  Medium(normal)

标准 完整格式 %百分比
uc Ultra Condensed 50%
ec Extra Condensed 62.5%
c Condensed 75%
sc Semi Condensed 87.5%
x Expanded 125%
ex Extra Expanded 150%
ux Ultra Expanded 200%
m Medium 100%
sx Semi Expanded 112.5%

 https://www.learnfk.com/latex/latex-fonts-size-and-styles.html

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章