📄 custom.tex
字号:
\ci{tiny} & \tiny tiny font \\
\ci{scriptsize} & \scriptsize very small font\\
\ci{footnotesize} & \footnotesize quite small font \\
\ci{small} & \small small font \\
\ci{normalsize} & \normalsize normal font \\
\ci{large} & \large large font
\end{tabular}%
\qquad\begin{tabular}{ll@{}}
\ci{Large} & \Large larger font \\[5pt]
\ci{LARGE} & \LARGE very large font \\[5pt]
\ci{huge} & \huge huge \\[5pt]
\ci{Huge} & \Huge largest
\end{tabular}
\bigskip
\end{lined}
\end{table}
\begin{table}[!tbp]
\caption{标准文档类型中字体的绝对大小}\label{tab:pointsizes}
\label{tab:sizes}
\begin{lined}{12cm}
\begin{tabular}{lrrr}
\multicolumn{1}{c}{size} &
\multicolumn{1}{c}{10pt (default) } &
\multicolumn{1}{c}{11pt option} &
\multicolumn{1}{c}{12pt option}\\
\verb|\tiny| & 5pt & 6pt & 6pt\\
\verb|\scriptsize| & 7pt & 8pt & 8pt\\
\verb|\footnotesize| & 8pt & 9pt & 10pt \\
\verb|\small| & 9pt & 10pt & 11pt \\
\verb|\normalsize| & 10pt & 11pt & 12pt \\
\verb|\large| & 12pt & 12pt & 14pt \\
\verb|\Large| & 14pt & 14pt & 17pt \\
\verb|\LARGE| & 17pt & 17pt & 20pt\\
\verb|\huge| & 20pt & 20pt & 25pt\\
\verb|\Huge| & 25pt & 25pt & 25pt\\
\end{tabular}
\bigskip
\end{lined}
\end{table}
\begin{table}[!bp]
\caption{数学字体} \label{mathfonts}
\begin{lined}{\textwidth}
\begin{tabular}{@{}lll@{}}
\textit{Command}&\textit{Example}& \textit{Output}\\[6pt]
\ci{mathcal}\verb|{...}|& \verb|$\mathcal{B}=c$|& $\mathcal{B}=c$\\
\ci{mathrm}\verb|{...}|& \verb|$\mathrm{K}_2$|& $\mathrm{K}_2$\\
\ci{mathbf}\verb|{...}|& \verb|$\sum x=\mathbf{v}$|& $\sum x=\mathbf{v}$\\
\ci{mathsf}\verb|{...}|& \verb|$\mathsf{G\times R}$|& $\mathsf{G\times R}$\\
\ci{mathtt}\verb|{...}|& \verb|$\mathtt{L}(b,c)$|& $\mathtt{L}(b,c)$\\
\ci{mathnormal}\verb|{...}|& \verb|$\mathnormal{R_{19}}\neq R_{19}$|&
$\mathnormal{R_{19}}\neq R_{19}$\\
\ci{mathit}\verb|{...}|& \verb|$\mathit{ffi}\neq ffi$|& $\mathit{ffi}\neq ffi$
\end{tabular}
\bigskip
\end{lined}
\end{table}
使用字体命令的时候,大括号(\wi{curly braces})扮演了一个重要角色。它们被用于
建立所谓的\emph{组}。组限制了大多数~\LaTeX{}~命令的作用范畴。\index{grouping}
\begin{example}
He likes {\LARGE large and
{\small small} letters}.
\end{example}
如果段落在字体的作用范畴中结束,那么字体尺寸命令还将改变段落中行的距离。因此
用于分组的反向大括号~\verb|}|~不应该太早结束。注意随后~\ci{par}~命令的两个例子
\footnote{\texttt{\bs{}par}相当于一个空行}。
\begin{example}
{\Large Don't read this! It is not
true. You can believe me!\par}
\end{example}
\begin{example}
{\Large This is not true either.
But remember I am a liar.}\par
\end{example}
如果你希望改变整段甚至更多文本的字体,你可能应该使用变换字体的一些环境。
\begin{example}
\begin{Large}
This is not true.
But then again, what is these
days \ldots
\end{Large}
\end{example}
\noindent 这将使你从众多的大括号中解脱出来。
\subsection{Danger, Will Robinson, Danger}
正如本章开头曾经说过的那样,在你的文档中运用这些明确的命令修改格式是非常
危险的事情,因为这种方式和~\LaTeX{}~的基础理念矛盾。在编写~\LaTeX{}~文档
的时候,要始终注意分离文章的逻辑结构和实际的格式。这也就意味着如果你在文
章的多个地方采用了某种特殊的格式来修饰一个经常使用的信息,你就应该使用
~\verb|\newcommand|~来定义一个逻辑封装命令,并通过这个命令来修改信息的表达格式。
\begin{example}
\newcommand{\oops}[1]{\textbf{#1}}
Do not \oops{enter} this room,
it's occupied by a \oops{machine}
of unknown origin and purpose.
\end{example}
这种方法具有一个明显的优点,如果你以后决定采用不同于~\verb|\textbf|~的
格式来表达危险信息,那么你不需要在你的整个文章中查找~\verb|\textbf|~命令,
也不需要将用于表达危险信息的~\verb|\texbf|~命令与表达其他信息用到的同一
个命令区分开来。
\subsection{建议}
总结这一章中关于字体和字体尺寸的命令,下面是一个简短的建议:\nopagebreak
\begin{quote}
\underline{\textbf{Remember\Huge!}} \textit{The}
\textsf{M\textbf{\LARGE O} \texttt{R}\textsl{E}} fonts \Huge you
\tiny use \footnotesize \textbf{in} a \small \texttt{document},
\large \textit{the} \normalsize more \textsc{readable} and
\textsl{\textsf{beautiful} it bec\large o\Large m\LARGE e\huge s}.
你在文章中使用的字体越多,文章看起来就越美观。
\end{quote}
\section{文档对象之间的间隔}
\subsection{行距}
\index{line spacing}如果你想在文档中使用更大的行距,你可以在导言中使用
如下命令进行设定:
\begin{lscommand}
\ci{linespread}\verb|{|\emph{factor}\verb|}|
\end{lscommand}
例如命令~\verb|\linespread{1.3}|~将产生~$1.5$~倍行距,而命令~\verb|\linespread{1.6}|~
则产生双倍行距。缺省情况下的行距为~$1$。 \index{double line spacing}
\subsection{段落格式}\label{parsp}
在~\LaTeX{}~中,有两个命令可以影响段落的布局。在文档的导言部分,可以通过
如下的定义来改变段落的布局。
\begin{code}
\ci{setlength}\verb|{|\ci{parindent}\verb|}{0pt}| \\
\verb|\setlength{|\ci{parskip}\verb|}{1ex plus 0.5ex minus 0.2ex}|
\end{code}
这两个命令增加了段落之间的距离,并将首行缩进设置为~$0$。
例子中,长度设定中的~\texttt{plus}~和~\texttt{minus}~部分将使得~\TeX{}~在
一个范围之内设定行距。为了使得段落正确的显示在页面之上,\TeX{}~将在~0.8ex~
到~1.5ex~之间调整段落之间的距离。
在欧洲,段落通常用一些空格分隔并且一般不进行首行缩进。值得注意的是,上面
提到的命令对于表格中的内容也会造成影响。表格的行距会变得非常疏松,这通常
不是想要的结果。为了避免这种情况,你可能需要将上面的命令从导言中移到文档
中适合的位置。或者根本不要使用这些,因为一般来说专业的书籍都是用缩进并且
通常不用空格来分离段落。
如果你想缩进一个本来没有缩进的段落\footnote{为了缩进章节标题之后的第一个
段落,可以使用\pai{indentfirst}包。},可以在段落的开始使用命令:
\begin{lscommand}
\ci{indent}
\end{lscommand}
当然,这个命令只有在~\verb|\parindent|~不为零的情况下才有效果。
为了创建一个不缩进的段落,你可以在段落的开始部分使用命令:
\begin{lscommand}
\ci{noindent}
\end{lscommand}
\subsection{水平距离}
\label{sec:hspace}
\LaTeX{}~系统自动决定单词和句子之间的距离。为了增加水平距离,
使用命令:\index{horizontal!space}
\begin{lscommand}
\ci{hspace}\verb|{|\emph{length}\verb|}|
\end{lscommand}
如果这个水平距离在行首或者行末应该消失的话,用命令~\verb|\hspace*|~代替
~\verb|\hspace|。命令的~\emph{length}~参数在简单的情况下只是一个带有单位
的数字。较为重要的长度单元在表\nbs\ref{units}~中列了出来。
\index{units}\index{dimensions}
%\begin{example}
%This\hspace{1.5cm}is a space
%of 1.5 cm.
%\end{example}
\begin{example}
这是\hspace{1.5cm}一段长为
1.5 厘米的空白。
\end{example}
\suppressfloats
\begin{table}[tbp]
\caption{\TeX{}的长度单位} \label{units}\index{units}
\begin{lined}{9.5cm}
\begin{tabular}{@{}ll@{}}
\texttt{mm} & millimetre $\approx 1/25$~inch \quad \demowidth{1mm} \\
\texttt{cm} & centimetre = 10~mm \quad \demowidth{1cm} \\
\texttt{in} & inch $=$ 25.4~mm \quad \demowidth{1in} \\
\texttt{pt} & point $\approx 1/72$~inch $\approx \frac{1}{3}$~mm \quad\demowidth{1pt}\\
\texttt{em} & approx width of an `M' in the current font \quad \demowidth{1em}\\
\texttt{ex} & approx height of an `x' in the current font \quad \demowidth{1ex}
\end{tabular}
\bigskip
\end{lined}
\end{table}
\label{cmd:stretch}
下面的命令将产生一个特殊的橡皮长度:
\begin{lscommand}
\ci{stretch}\verb|{|\emph{n}\verb|}|
\end{lscommand}
它将产生一个将一行的宽度充满的长度。如果两个~\verb|\hspace{\stretch{|\emph{n}\verb|}}|~
命令位于同一行,那么它们将根据伸缩因子分配空间。
\begin{example}
x\hspace{\stretch{1}}
x\hspace{\stretch{3}}x
\end{example}
\subsection{垂直距离}
在段落、节、小节…… 之间的距离是由~\LaTeX{}~系统自动决定的。如果必要的话,可以在两段之间
增加额外的距离,使用的命令如下所示:
\begin{lscommand}
\ci{vspace}\verb|{|\emph{length}\verb|}|
\end{lscommand}
这个命令通常用于两个空行之间。如果这个额外的行距不应该存在于页的顶部和末尾,那么使用
命令~\verb|\vspace*|~来代替~\verb|\vspace|。
\index{vertical space}
命令~\verb|\stretch|~和~\verb|\pagebreak|~结合使用可以在页的最后一行输出文本,也可以
用来保证文本在页面上垂直居中。
\begin{code}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -