<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">\chapter{è‡ªå®šä¹‰ \LaTeX{} å‘½ä»¤å’ŒåŠŸèƒ½}\label{chap:custom}
\addtocontents{los}{\protect\addvspace{10pt}}

\begin{intro}
è¯»åˆ°è¿™ä¸€ç«&nbsp;ä¹‹å‰ï¼Œå¦‚æžœä½&nbsp;ç¡®ä¿æŽŒæ¡äº†å‰å‡&nbsp;ç«&nbsp;çš„çŸ¥è¯†å¹¶ç†Ÿç»ƒè¿ç”¨ï¼Œä½&nbsp;å·²ç»èƒ½åˆ¶ä½œå‡ºå†…å®¹å’Œå½¢å¼éƒ½ç›¸å½“ä¸°å¯Œçš„æ–‡æ¡£äº†ã€‚
ä½†ä½&nbsp;å¯èƒ½è¿˜ä¸ä¼šæ»¡è¶³ï¼šæˆ‘è¦å¦‚ä½•åˆ¶ä½œä¸€ä¸ªç®€å•ä½†åƒæ&nbsp;·çš„æ¯•ä¸šè®ºæ–‡/ä¹¦ç±/ç®€åŽ†æ¨¡æ¿ï¼Œæ¯æ¬¡å¯ä»¥ç›´æŽ¥å¥—ç”¨ï¼Œ
è€Œä¸æ˜¯å†åœ¨å¯¼è¨€åŒºå†™ä¸€å&nbsp;†ä»£ç&nbsp;ï¼Ÿ

æœ¬ç«&nbsp;çš„å†…å®¹å°†æœ‰åŠ©äºŽä½&nbsp;å®žçŽ°è¿™ä¸€ä¸ªç›®æ&nbsp;‡ï¼Œè®©ä½&nbsp;èƒ½ç¼–å†™å¯é‡å¤åˆ©ç”¨çš„æ¨¡å—â€”â€”å®åŒ…å’Œæ–‡æ¡£ç±»ï¼Œå¹¶åœ¨å…¶ä¸­è‡ªå·±å®šä¹‰å‘½ä»¤å’ŒçŽ¯å¢ƒã€‚
ä¸è¿‡ä½œä¸ºå…¥é—¨æ‰‹å†Œï¼Œè¿™äº›çŸ¥è¯†ä»æ˜¯ä¸å…¨é¢çš„ã€‚å¦‚æžœä½&nbsp;ä¸æ»¡è¶³äºŽæ­¤ï¼Œéœ€è¦å‚è€ƒæ›´å¤šèµ„æ–™ï¼Œæ¯”å¦‚ \cite{companion,clsguide}ã€‚
\end{intro}

\section{è‡ªå®šä¹‰å‘½ä»¤å’ŒçŽ¯å¢ƒ}\label{sec:defs}

ä½&nbsp;ä¹Ÿè®¸å·²ç»æ„è¯†åˆ°äº†ï¼Œåœ¨æœ¬æ‰‹å†Œä¸­ä»‹ç»çš„æ‰€æœ‰å‘½ä»¤éƒ½è¢«åŒ…å«åœ¨ä¸€ä¸ªå¸¦é¢œè‰²çš„çŸ©å½¢èƒŒæ™¯æ¡†ä¸­ã€‚
æˆ‘ä»¬å¹¶æ²¡æœ‰ç›´æŽ¥ä½¿ç”¨åŸºç¡€çš„ \LaTeX{} å‘½ä»¤æ¥å®žçŽ°è¿™ä¸ªæ•ˆæžœï¼Œè€Œæ˜¯åˆ›å»ºäº†ä¸€ä¸ª\textbf{å®åŒ…}ï¼Œ
å¹¶åœ¨å…¶ä¸­å®šä¹‰äº†æ‰€éœ€è¦çš„å‘½ä»¤å’ŒçŽ¯å¢ƒã€‚çŽ°åœ¨åªéœ€å†™æˆè¿™æ&nbsp;·ç®€å•çš„å½¢å¼ï¼š

\begin{example}
\begin{command}
\cmd{dum}
\end{command}
\end{example}

è¿™ä¸ªä¾‹å­ä¸­ä½¿ç”¨äº†ä¸€ä¸ªæ–°çš„çŽ¯å¢ƒ \env{command}ã€‚è¿™ä¸ªçŽ¯å¢ƒè´Ÿè´£ç»™å‘½ä»¤ä»£ç&nbsp;åŠ&nbsp;ä¸Šä¸€ä¸ªå¸¦é¢œè‰²çš„çŸ©å½¢èƒŒæ™¯æ¡†ã€‚
åŒæ—¶è¿˜ä½¿ç”¨äº†ä¸€ä¸ªå‘½ä»¤ï¼š\cmd{cmd}ï¼Œ è¿™ä¸ªå‘½ä»¤è´Ÿè´£è¾“å‡ºå‘½ä»¤çš„åå­—ï¼ŒåŒ…æ‹¬å‰é¢çš„åæ–œçº¿ã€‚

ä¸€æ—¦æƒ³è¦ä¿®æ”¹å‘½ä»¤ä»£ç&nbsp;çš„æ&nbsp;·å¼ï¼Œæ¯”å¦‚æ›´æ¢é¢œè‰²ã€åŠ&nbsp;è¾¹æ¡†ç­‰ç­‰ï¼Œå¯ä»¥é€šè¿‡æ”¹å˜ \env{command} çŽ¯å¢ƒçš„å®šä¹‰æ¥å¾ˆå®¹æ˜“åœ°åˆ›å»ºæ–°çš„å¤–è§‚ï¼Œ
è€Œä¸æ˜¯æŒ¨ä¸ªä¿®æ”¹æ¯ä¸ªå‘½ä»¤ç¤ºä¾‹ã€‚

\subsection{å®šä¹‰æ–°å‘½ä»¤}\label{subsec:newcmd}

\cmdindex{newcommand}
ä½¿ç”¨å¦‚ä¸‹å‘½ä»¤å¯ä»¥å®šä¹‰ä½&nbsp;è‡ªå·±çš„å‘½ä»¤ï¼š
\begin{command}
\cmd{newcommand}\marg*{\cmd{\Arg{name}}}\oarg{num}\marg{definition}
\end{command}
\cmd{newcommand} çš„åŸºæœ¬ç”¨æ³•éœ€è¦ä¸¤ä¸ªå¿…é€‰å‚æ•°ï¼Œç¬¬ä¸€ä¸ªå‚æ•° \Arg{name} æ˜¯è¦å®šä¹‰çš„å‘½ä»¤åç§°ï¼ˆå¸¦åæ–œçº¿ï¼‰ï¼Œ
ç¬¬äºŒä¸ªå‚æ•° \Arg{definition} æ˜¯å‘½ä»¤çš„å…·ä½“å®šä¹‰ã€‚æ–¹æ‹¬å·é‡Œçš„å‚æ•° \Arg{num} æ˜¯å¯é€‰çš„ï¼Œ
ç”¨äºŽæŒ‡å®šæ–°å‘½ä»¤æ‰€éœ€çš„å‚æ•°æ•°ç›®ï¼ˆæœ€å¤š 9 ä¸ªï¼‰ã€‚å¦‚æžœç¼ºçœå¯é€‰å‚æ•°ï¼Œé»˜è®¤å°±æ˜¯ 0ï¼Œä¹Ÿå°±æ˜¯æ–°å®šä¹‰çš„å‘½ä»¤ä¸å¸¦ä»»ä½•å‚æ•°ã€‚

æŽ¥ä¸‹æ¥çš„ä¸¤ä¸ªä¾‹å­æœ‰åŠ©äºŽç†è§£ã€‚ç¬¬ä¸€ä¸ªä¾‹å­å®šä¹‰äº†ä¸€ä¸ªæ–°çš„å‘½ä»¤ \cmd{tnss}ã€‚
è¿™ä¸ªå‘½ä»¤æ˜¯æœ¬æ‰‹å†Œè‹±æ–‡åç§°â€œThe Not So Short Introduction to \LaTeXeâ€ çš„ç®€å†™ã€‚
å¦‚æžœéœ€è¦åœ¨æ–‡æ¡£ä¸­å¤šæ¬¡ä½¿ç”¨æœ¬æ‰‹å†Œçš„åç§°ï¼Œé‚£ä¹ˆä½¿ç”¨è¿™ä¸ªå‘½ä»¤æ˜¯ä¸€ä¸ªéžå¸¸æ–¹ä¾¿çš„åŠžæ³•ã€‚

\begin{example}
\newcommand{\tnss}{The not so Short
  Introduction to \LaTeXe}
This is ``\tnss'' \ldots{} ``\tnss''
\end{example}

ç¬¬äºŒä¸ªä¾‹å­æ¼”ç¤ºäº†å¦‚ä½•å®šä¹‰ä¸€ä¸ªå¸¦å‚æ•°çš„å‘½ä»¤ã€‚åœ¨å‘½ä»¤çš„å®šä¹‰ä¸­ï¼Œæ&nbsp;‡è®° \verb|#1|
ä»£è¡¨æŒ‡å®šçš„å‚æ•°ã€‚å¦‚æžœæƒ³ä½¿ç”¨å¤šä¸ªå‚æ•°ï¼Œå¯ä»¥ä¾æ¬¡ä½¿ç”¨ \verb|#2|ã€â€¦â€¦ã€\verb|#9| ç­‰æ&nbsp;‡è®°ã€‚

\begin{example}
\newcommand{\txsit}[1]{This is the
  \emph{#1} Short Introduction
  to \LaTeXe}
% in the document body:
\begin{itemize}
\item \txsit{not so}
\item \txsit{very}
\end{itemize}
\end{example}

\cmdindex{renewcommand}
\LaTeX{} ä¸å…è®¸ä½¿ç”¨ \cmd{newcommand} å®šä¹‰ä¸€ä¸ªä¸ŽçŽ°æœ‰å‘½ä»¤é‡åçš„å‘½ä»¤ã€‚å¦‚æžœéœ€è¦ä¿®æ”¹å‘½ä»¤å®šä¹‰çš„è¯ï¼Œ
ä½¿ç”¨ \cmd{re\-new\-comm\-and} å‘½ä»¤ã€‚å®ƒä½¿ç”¨ä¸Žå‘½ä»¤ \cmd{new\-comm\-and} ç›¸åŒçš„è¯­æ³•ã€‚

\cmdindex{providecommand}
åœ¨æŸäº›æƒ…å†µä¹‹ä¸‹ï¼Œä½¿ç”¨ \cmd{providecommand} å‘½ä»¤æ˜¯ä¸€ç§æ¯”è¾ƒç†æƒ³çš„æ–¹æ¡ˆï¼šåœ¨å‘½ä»¤æœªå®šä¹‰æ—¶ï¼Œ
å®ƒç›¸å½“äºŽ \cmd{new\-comm\-and}ï¼›åœ¨å‘½ä»¤å·²å®šä¹‰æ—¶ï¼Œæ²¿ç”¨å·²æœ‰çš„å®šä¹‰ã€‚

\subsection{å®šä¹‰çŽ¯å¢ƒ}\label{subsec:newenv}

\cmdindex{newenvironment}
ä¸Ž \cmd{new\-comm\-and} å‘½ä»¤ç±»ä¼¼ï¼Œå¯ä»¥ç”¨ \cmd{new\-environ\-ment} å®šä¹‰æ–°çš„çŽ¯å¢ƒã€‚å®ƒçš„è¯­æ³•å¦‚ä¸‹æ‰€ç¤ºï¼š

\begin{command}
\cmd{newenvironment}\marg{name}\oarg{num}\marg{before}\marg{after}
\end{command}

åŒæ&nbsp;·åœ°ï¼Œ\cmd{newenvironment} å‘½ä»¤æœ‰ä¸€ä¸ªå¯é€‰çš„å‚æ•°ã€‚åœ¨ \Arg{before} ä¸­çš„å†…å®¹å°†åœ¨æ­¤çŽ¯å¢ƒåŒ…å«
çš„æ–‡æœ¬ä¹‹å‰å¤„ç†ï¼Œè€Œåœ¨ \Arg{after} ä¸­çš„å†…å®¹å°†åœ¨é‡åˆ° \cmd{end\marg{name}} å‘½ä»¤æ—¶å¤„ç†ã€‚

ä¸‹é¢çš„ä¾‹å­æ¼”ç¤ºäº† \cmd{newenvironment} å‘½ä»¤çš„ç”¨æ³•ï¼š
\begin{example}
\newenvironment{king}
{\rule{1ex}{1ex}%
     \hspace{\stretch{1}}}
{\hspace{\stretch{1}}%
     \rule{1ex}{1ex}}

\begin{king}
My humble subjects \ldots
\end{king}
\end{example}

\cmdindex{renewenvironment}
å‚æ•° \Arg{num} çš„ä½¿ç”¨æ–¹å¼ä¸Ž \cmd{new\-comm\-and} å‘½ä»¤ç›¸åŒã€‚\LaTeX{} è¿˜åŒæ&nbsp;·ä¿è¯ä½&nbsp;
ä¸ä¼šä¸å°å¿ƒæ–°å»ºé‡åçš„çŽ¯å¢ƒã€‚å¦‚æžœä½&nbsp;ç¡®å®žå¸Œæœ›æ”¹å˜ä¸€ä¸ªçŽ°æœ‰çš„çŽ¯å¢ƒï¼Œä½&nbsp;å¯ä»¥ä½¿ç”¨å‘½ä»¤
 \cmd{re\-new\-environ\-ment}ï¼Œå®ƒä½¿ç”¨å’Œå‘½ä»¤ \cmd{new\-environ\-ment} ç›¸åŒçš„è¯­æ³•ã€‚

\subsection{\pkg{xparse} å®åŒ…ç®€ä»‹}\label{subsec:xparse}

\pkgindex{xparse}
\cmdindex[xparse]{NewDocumentCommand,NewDocumentEnvironment}
é€šè¿‡ \cmd{newcommand} å’Œ \cmd{newenvironment} å®šä¹‰çš„å‘½ä»¤æˆ–çŽ¯å¢ƒæ&nbsp;¼å¼æ¯”è¾ƒå›ºå®šã€‚å¦‚æžœéœ€è¦å®šä¹‰å¸¦æœ‰å¤šä¸ª
å¯é€‰å‚æ•°ã€æˆ–è€…å¸¦æ˜Ÿå·çš„å‘½ä»¤æˆ–çŽ¯å¢ƒï¼Œå¯ä»¥ä½¿ç”¨ \pkg{xparse} å®åŒ…%
\footnote{\LaTeX{} 2020-10-01 ç‰ˆæœ¬ä¹‹åŽï¼Œ\pkg{xparse} å®åŒ…å·²é›†æˆåœ¨äº†æ&nbsp;¼å¼ä¹‹ä¸­ï¼Œä¸éœ€è¦æ˜¾å¼è°ƒç”¨ã€‚}ã€‚
å®ƒæä¾›äº† \cmd{New\-Document\-Command} å’Œ \cmd{New\-Document\-Environment} ç­‰å‘½ä»¤ï¼Œå…·ä½“è¯­æ³•å¦‚ä¸‹ï¼š

\begin{command}
\cmd{NewDocumentCommand}\cmd{\Arg{name}}\marg{arg spec}\marg{definition} \\
\cmd{NewDocumentEnvironment}\marg{name}\marg{arg spec}\marg{before}\marg{after}
\end{command}

ç›¸æ¯” \cmd{newcommand} å’Œ \cmd{newenvironment}ï¼Œ\pkg{xparse} é€šè¿‡ \marg{arg spec} æ¥æŒ‡å®šå‚æ•°çš„ä¸ªæ•°
å’Œæ&nbsp;¼å¼ã€‚åŸºæœ¬çš„å‚æ•°æ&nbsp;¼å¼è§è¡¨~\ref{tbl:xparse-arg-spec}ã€‚æ³¨æ„ \marg{arg spec} ä¸­çš„ç©ºæ&nbsp;¼å¯ä»¥å¿½ç•¥ã€‚

\begin{table}[htp]
\centering
\caption{\pkg{xparse} å‚æ•°æ&nbsp;¼å¼}\label{tbl:xparse-arg-spec}
\begin{tabular}{cl}
 \toprule
 \textbf{å‚æ•°æ&nbsp;¼å¼} &amp; \textbf{è¯´æ˜Ž} \\
 \midrule
 \verb|m|               &amp; å¿…é€‰å‚æ•°ï¼Œç”± \verb|{...}| ç»™å‡º \\
 \verb|o|               &amp; å¯é€‰å‚æ•°ï¼Œç”± \verb|[...]| ç»™å‡ºï¼›æœªç»™å‡ºæ—¶è¿”å›ž \verb|-NoValue-| æ&nbsp;‡è®° \\
 \verb|O|\marg{default} &amp; å¯é€‰å‚æ•°ï¼Œä½†åœ¨æœªç»™å‡ºæ—¶åˆ™è¿”å›žé»˜è®¤å€¼ \Arg{default} \\
 \verb|s|               &amp; å¯é€‰çš„æ˜Ÿå· \verb|*| \\
 \verb|+|               &amp; ä¿®é¥°åŽé¢çš„ \verb|m|ã€\verb|o| ç­‰ï¼Œè¡¨ç¤ºå…è®¸åœ¨å‚æ•°ä¸­åˆ†æ®µ \\
 \bottomrule
\end{tabular}
\end{table}

ä¸åŒè¾“å…¥å€¼åœ¨è§£æžåŽçš„ç»“æžœå¯ä»¥è§è¡¨~\ref{tbl:xparse-arg-input} ä¸­çš„ç¤ºä¾‹ã€‚

\begin{table}[htp]
\centering
\caption{\pkg{xparse} å‚æ•°ç¤ºä¾‹}\label{tbl:xparse-arg-input}
\begin{tabular}{ccccc}
 \toprule
 \textbf{å‚æ•°æ&nbsp;¼å¼} &amp; \textbf{è¾“å…¥å€¼} &amp; \verb|#1| &amp; \verb|#2| &amp; \verb|#3| \\
 \midrule
 \verb|m m|            &amp; \verb|{foo}{bar}|  &amp; \verb|foo|         &amp; \verb|bar|       &amp;                \\
 \verb|o m|            &amp; \verb|{foo}|       &amp; \verb|-NoValue-|   &amp; \verb|foo|       &amp;                \\
 \verb|o o m|          &amp; \verb|[foo]{bar}|  &amp; \verb|foo|         &amp; \verb|-NoValue-| &amp; \verb|bar|     \\
 \verb|m O{default}|   &amp; \verb|{foo}|       &amp; \verb|foo|         &amp; \verb|default|   &amp;                \\
 \verb|m O{default}|   &amp; \verb|{foo}[bar]|  &amp; \verb|foo|         &amp; \verb|bar|       &amp;                \\
 \verb|m O{default}|   &amp; \verb|[bar]|       &amp; æŠ¥é”™               &amp;                  &amp;                \\
 \verb|s o m|          &amp; \verb|*[foo]{bar}| &amp; \cmd{BooleanTrue}  &amp; \verb|foo|       &amp; \verb|bar|     \\
 \verb|s m O{default}| &amp; \verb|{foo}|       &amp; \cmd{BooleanFalse} &amp; \verb|foo|       &amp; \verb|default| \\
 \bottomrule
\end{tabular}
\end{table}

\cmdindex[xparse]{IfNoValueTF,IfNoValueT,IfNoValueF}
\verb|-NoValue-| æ&nbsp;‡è®°å¯ä»¥ç”¨ \cmd{IfNoValueTF} ç­‰å‘½ä»¤æ¥åˆ¤æ–­ï¼š

\begin{command}
\cmd{IfNoValueTF}\marg{argument}\marg{true code}\marg{false code} \\
\cmd{IfNoValueT}\marg{argument}\marg{true code} \\
\cmd{IfNoValueF}\marg{argument}\marg{false code}
\end{command}

ä¸¾ä¾‹å¦‚ä¸‹ï¼š

\begin{example}
% ç™¾åˆ†å·ç”¨äºŽæ³¨é‡ŠæŽ‰ä¸å¿…è¦çš„ç©ºæ&nbsp;¼å’Œæ¢è¡Œç¬¦
\NewDocumentCommand\hello{om}
  {%
    \IfNoValueTF{#1}%
      {Hello, #2!}%
      {Hello, #1 and #2!}%
  }
\hello{Alice}
\hello[Bob]{Alice}
\end{example}

\cmdindex[xparse]{BooleanTrue,BooleanFalse,IfBooleanTF,IfBooleanT,IfBooleanF}
\cmd{BooleanTrue} å’Œ \cmd{BooleanFalse} åˆ™å¯ä»¥ç”¨ \cmd{IfBooleanTF} ç­‰å‘½ä»¤æ¥åˆ¤æ–­ï¼š

\begin{command}
\cmd{IfBooleanTF}\marg{argument}\marg{true code}\marg{false code} \\
\cmd{IfBooleanT}\marg{argument}\marg{true code} \\
\cmd{IfBooleanF}\marg{argument}\marg{false code}
\end{command}

ä¸¾ä¾‹å¦‚ä¸‹ï¼š

\begin{example}
\NewDocumentCommand\hereis{sm}
  {Here is \IfBooleanTF{#1}{an}{a} #2.}
\hereis{banana}
\hereis*{apple}
\end{example}

éœ€è¦æ³¨æ„çš„æ˜¯ï¼Œä¸Žå‘½ä»¤ä¸åŒï¼ŒçŽ¯å¢ƒåœ¨å®šä¹‰æ—¶åå­—é‡Œé¢å¯ä»¥åŒ…å« \verb|*|ï¼š
\begin{verbatim}
\NewDocumentEnvironment {mytabular}  { o +m } {...} {...}
\NewDocumentEnvironment {mytabular*} { m o +m } {...} {...}
\end{verbatim}
ç”¨ \verb|s| æ&nbsp;‡è®°çš„ \verb|*| åˆ™åº”è¯¥æ”¾åœ¨ \cmd{begin}\marg{env} çš„åŽé¢ï¼š
\begin{verbatim}
\NewDocumentEnvironment { envstar } { s }
  {\IfBooleanTF {#1} {star} {no star}} {}
\begin{envstar}*
\end{envstar}
\end{verbatim}

\cmdindex[xparse]{RenewDocumentCommand,ProvideDocumentCommand,DeclareDocumentCommand}
\cmdindex[xparse]{RenewDocumentEnvironment,ProvideDocumentEnvironment,DeclareDocumentEnvironment}
ä¸Ž \cmd{renewcommand}ã€\cmd{providecommand} ç­‰å‘½ä»¤ç±»ä¼¼ï¼Œ\pkg{xparse} å®åŒ…ä¹Ÿå…è®¸åœ¨å‘½ä»¤æˆ–çŽ¯å¢ƒ
å·²æœ‰å®šä¹‰æ—¶åšå‡ºç›¸åº”çš„å¤„ç†ï¼Œå…·ä½“è§è¡¨~\ref{tbl:xparse-renew}ã€‚

\begin{table}[htp]
\centering
\caption{\pkg{xparse} æä¾›çš„å…¶ä»–å‘½ä»¤}\label{tbl:xparse-renew}
\begin{tabular}{cccc}
 \toprule
 \textbf{å®šä¹‰å‘½ä»¤} &amp; \textbf{å®šä¹‰çŽ¯å¢ƒ} &amp; \textbf{å·²å®šä¹‰} &amp; \textbf{æœªå®šä¹‰} \\
 \midrule
 \cmd{NewDocumentCommand}     &amp; \cmd{NewDocumentEnvironment}     &amp; æŠ¥é”™       &amp; ç»™å‡ºå®šä¹‰ \\
 \cmd{RenewDocumentCommand}   &amp; \cmd{RenewDocumentEnvironment}   &amp; é‡æ–°å®šä¹‰   &amp; æŠ¥é”™     \\
 \cmd{ProvideDocumentCommand} &amp; \cmd{ProvideDocumentEnvironment} &amp; ä»€ä¹ˆä¹Ÿä¸åš &amp; ç»™å‡ºå®šä¹‰ \\
 \cmd{DeclareDocumentCommand} &amp; \cmd{DeclareDocumentEnvironment} &amp; é‡æ–°å®šä¹‰   &amp; ç»™å‡ºå®šä¹‰ \\
 \bottomrule
\end{tabular}
\end{table}

\section{ç¼–å†™è‡ªå·±çš„å®åŒ…å’Œæ–‡æ¡£ç±»}\label{sec:packages}

\subsection{ç¼–å†™ç®€å•çš„å®åŒ…}\label{subsec:provide-pkg}

\cmdindex{usepackage}
å¦‚æžœå®šä¹‰äº†å¾ˆå¤šæ–°çš„çŽ¯å¢ƒå’Œå‘½ä»¤ï¼Œæ–‡æ¡£çš„å¯¼è¨€åŒºå°†å˜å¾—å¾ˆé•¿ï¼Œåœ¨è¿™ç§æƒ…å†µä¸‹ï¼Œå¯ä»¥å»ºç«‹ä¸€ä¸ªæ–°çš„ \LaTeX{} å®åŒ…
æ¥å­˜æ”¾æ‰€æœ‰ä½&nbsp;è‡ªå·±å®šä¹‰çš„å‘½ä»¤å’ŒçŽ¯å¢ƒï¼Œç„¶åŽåœ¨æ–‡æ¡£ä¸­ä½¿ç”¨ \cmd{use\-package} å‘½ä»¤æ¥è°ƒç”¨è‡ªå®šä¹‰çš„å®åŒ…ã€‚

\begin{sourcecode}[htp]
\begin{Verbatim}
% Demo Package by Tobias Oetiker
\ProvidesPackage{demopack}
\newcommand{\tnss}{The not so Short Introduction
                   to \LaTeXe}
\newcommand{\txsit}[1]{The \emph{#1} Short
                       Introduction to \LaTeXe}
\newenvironment{king}{\begin{quote}}{\end{quote}}
\end{Verbatim}
\caption{å®åŒ…çš„ä¸€ä¸ªæœ€ç®€ç¤ºä¾‹ã€‚}\label{code:package}
\end{sourcecode}

\cmdindex{ProvidesPackage}
å†™ä¸€ä¸ªå®åŒ…çš„åŸºæœ¬å·¥ä½œå°±æ˜¯å°†åŽŸæœ¬åœ¨ä½&nbsp;çš„æ–‡æ¡£å¯¼è¨€åŒºé‡Œå¾ˆé•¿çš„å†…å®¹æ‹·è´åˆ°å¦ä¸€ä¸ªæ–‡ä»¶ä¸­åŽ»ï¼Œ
 è¿™ä¸ªæ–‡ä»¶éœ€è¦ä»¥ \texttt{.sty} ä½œæ‰©å±•åã€‚ä½&nbsp;è¿˜éœ€è¦åŠ&nbsp;å…¥ä¸€ä¸ªå®åŒ…ä¸“ç”¨çš„å‘½ä»¤ï¼š
\begin{command}
\cmd{ProvidesPackage}\marg{package name}
\end{command}
è¿™ä¸ªå‘½ä»¤åº”è¯¥æ”¾åœ¨ä½&nbsp;çš„å®åŒ…çš„æœ€å‰é¢ï¼Œå¹¶ä¸”ä¸€å®šè¦æ³¨æ„ï¼š\textbf{\Arg{package name} éœ€è¦å’Œå®åŒ…çš„æ–‡ä»¶åä¸€è‡´ã€‚}
\cmd{Provides\-Package} è®© \LaTeX{} è®°å½•å®åŒ…çš„åç§°ï¼Œä»Žè€Œåœ¨ \cmd{usepackage} å‘½ä»¤å†æ¬¡è°ƒç”¨åŒä¸€ä¸ªå®åŒ…çš„æ—¶å€™å¿½ç•¥ä¹‹%
\footnote{ä½†å¦‚æžœä½&nbsp;ä»¥\emph{ä¸åŒçš„é€‰é¡¹}å¤šæ¬¡å¼•å…¥å®åŒ…ï¼Œåˆ™æœ‰å¯èƒ½ä¼šå¼•èµ·é”™è¯¯ï¼Œè§é™„å½• \ref{sec:errors}ã€‚}ã€‚
æºä»£ç&nbsp; \ref{code:package} ç»™å‡ºäº†ä¸€ä¸ªå°çš„å®åŒ…ç¤ºä¾‹ï¼Œå…¶ä¸­åŒ…å«äº†æˆ‘ä»¬ä¹‹å‰å®šä¹‰çš„ä¸€äº›å‘½ä»¤ã€‚

\subsection{åœ¨å®åŒ…ä¸­è°ƒç”¨å…¶å®ƒå®åŒ…}\label{subsec:require-pkg}

\cmdindex{RequirePackage}
å¦‚æžœä½&nbsp;æƒ³è¿›ä¸€æ­¥æŠŠå„ç§å®åŒ…çš„åŠŸèƒ½æ±‡æ€»åˆ°ä¸€ä¸ªæ–‡ä»¶é‡Œï¼Œè€Œä¸æ˜¯åœ¨æ–‡æ¡£çš„å¯¼è¨€åŒºç½—åˆ—ä¸€å¤§å&nbsp;†å®åŒ…çš„è¯ï¼Œ
\LaTeX{} å…è®¸ä½&nbsp;åœ¨è‡ªå·±ç¼–å†™çš„å®åŒ…ä¸­è°ƒç”¨å…¶å®ƒå®åŒ…ï¼Œå‘½ä»¤ä¸º \cmd{RequirePackage}ï¼Œç”¨æ³•å’Œ \cmd{usepackage}
ä¸€è‡´ï¼š
\begin{command}
\cmd{RequirePackage}\oarg{options}\marg{package name}
\end{command}

\subsection{ç¼–å†™è‡ªå·±çš„æ–‡æ¡£ç±»}\label{subsec:provide-cls}

\cmdindex{ProvidesClass}
å½“ä½&nbsp;æ›´è¿›ä¸€æ­¥ï¼Œéœ€è¦ç¼–å†™è‡ªå·±çš„æ–‡æ¡£ç±»ï¼Œå¦‚è®ºæ–‡æ¨¡æ¿ç­‰ï¼Œé—®é¢˜å°±ç¨ç¨éº»çƒ¦äº†ä¸€äº›ã€‚é¦–å…ˆï¼Œè‡ªå·±çš„æ–‡æ¡£ç±»ä»¥ \texttt{.cls} ä½œæ‰©å±•åï¼Œå¼€å¤´ä½¿ç”¨
\cmd{ProvidesClass} å‘½ä»¤ï¼š
\begin{command}
\cmd{ProvidesClass}\marg{class name}
\end{command}
å½“ç„¶äº†ï¼Œ\marg{class name}ä¹Ÿéœ€è¦å’Œæ–‡æ¡£ç±»çš„æ–‡ä»¶åä¸€è‡´ã€‚

\cmdindex{LoadClass}
ä½†æ˜¯æœ‰äº†ä¸Šè¿°å‘½ä»¤å’Œå’Œä½&nbsp;ä¹‹å‰å­¦åˆ°çš„ \cmd{newcommand} ç­‰ï¼Œè¿˜å¹¶ä¸èƒ½å®Œæˆä¸€ä¸ªæ–‡æ¡£ç±»çš„ç¼–å†™ï¼Œå›&nbsp;ä¸ºè¯¸å¦‚ \cmd{chapter}ã€
\cmd{section} ç­‰ç­‰è®¸å¤šå¸¸ç”¨çš„å‘½ä»¤éƒ½æ˜¯åœ¨æ–‡æ¡£ç±»ä¸­å®šä¹‰çš„ã€‚äº‹å®žä¸Šï¼Œè®¸å¤šæ—¶å€™æˆ‘ä»¬åªéœ€è¦åƒè°ƒç”¨å®åŒ…é‚£æ&nbsp;·è°ƒç”¨ä¸€ä¸ªåŸºæœ¬çš„æ–‡æ¡£ç±»ï¼Œ
çœåŽ»è®¸å¤šä¸å¿…è¦çš„éº»çƒ¦ã€‚åœ¨ä½&nbsp;çš„æ–‡æ¡£ç±»ä¸­è°ƒç”¨å…¶å®ƒæ–‡æ¡£ç±»çš„å‘½ä»¤æ˜¯ \cmd{LoadClass}ï¼Œç”¨æ³•å’Œ \cmd{documentclass} ååˆ†ç›¸åƒï¼š
\begin{command}
\cmd{LoadClass}\oarg{options}\marg{package name}
\end{command}

\section{è®¡æ•°å™¨}\label{sec:counters}

\pinyinindex{jishuqi}{è®¡æ•°å™¨}
æˆ‘ä»¬æ—©å°±è§è¯†åˆ°äº† \LaTeX{} å¯¹æ–‡æ¡£å…ƒç´&nbsp;è‡ªåŠ¨è®¡æ•°çš„èƒ½åŠ›ï¼šç«&nbsp;èŠ‚ç¬¦å·ã€åˆ—è¡¨ã€å›¾è¡¨â€¦â€¦å®ƒä»¬éƒ½æ˜¯ä¾é&nbsp; \LaTeX{} æä¾›çš„è®¡æ•°å™¨åŠŸèƒ½å®Œæˆçš„ã€‚

\subsection{å®šä¹‰å’Œä¿®æ”¹è®¡æ•°å™¨}\label{subsec:count-defs}

\cmdindex{newcounter}
å®šä¹‰ä¸€ä¸ªè®¡æ•°å™¨çš„æ–¹æ³•ä¸ºï¼š
\begin{command}
\cmd{newcounter}\marg{counter name}\oarg{parent counter name}
\end{command}

\Arg{counter name} ä¸ºè®¡æ•°å™¨çš„åç§°ã€‚è®¡æ•°å™¨å¯ä»¥æœ‰ä¸Šä¸‹çº§çš„å…³ç³»ï¼Œå¯é€‰å‚æ•° \Arg{parent counter name} å®šä¹‰ä¸º \Arg{counter name} çš„ä¸Šçº§è®¡æ•°å™¨ã€‚

\cmdindex{setcounter,addtocounter,stepcounter}
ä»¥ä¸‹å‘½ä»¤ä¿®æ”¹è®¡æ•°å™¨çš„æ•°å€¼ï¼Œ\cmd{set\-counter} å°†æ•°å€¼è®¾ä¸º \Arg{number}ï¼›\cmd{add\-to\-counter} å°†æ•°å€¼åŠ&nbsp;ä¸Š \Arg{number}ï¼›
\cmd{step\-counter} å°†æ•°å€¼åŠ&nbsp;ä¸€ï¼Œå¹¶\textbf{å°†æ‰€æœ‰ä¸‹çº§è®¡æ•°å™¨å½’é›¶}ã€‚
\begin{command}
\cmd{setcounter}\marg{counter name}\marg{number} \\
\cmd{addtocounter}\marg{counter name}\marg{number} \\
\cmd{stepcounter}\marg{counter name}
\end{command}

\subsection{è®¡æ•°å™¨çš„è¾“å‡ºæ&nbsp;¼å¼}\label{subsec:count-value}

è®¡æ•°å™¨ \Arg{counter} çš„è¾“å‡ºæ&nbsp;¼å¼ç”± \cmd{the\Arg{counter}} è¡¨ç¤ºï¼Œå¦‚æˆ‘ä»¬åœ¨ \ref{sec:pagestyle} ä¸€èŠ‚è§è¿‡çš„ \cmd{thechapter} ç­‰ã€‚
è¿™ä¸ªå€¼é»˜è®¤ä»¥é˜¿æ‹‰ä¼¯æ•°å­—å½¢å¼è¾“å‡ºï¼Œå¦‚æžœæƒ³æ”¹æˆå…¶å®ƒå½¢å¼ï¼Œéœ€è¦é‡å®šä¹‰ \cmd{the\Arg{counter}}ï¼Œå¦‚å°† equation è®¡æ•°å™¨çš„æ&nbsp;¼å¼å®šä¹‰ä¸ºå¤§å†™å­—æ¯ï¼š
\begin{verbatim}
\renewcommand\theequation{\Alph{equation}}
\end{verbatim}

\cmdindex{arabic,alph,Alph,roman,Roman,fnsymbol}
å‘½ä»¤ \cmd{Alph} æŽ§åˆ¶è®¡æ•°å™¨ \Arg{counter} çš„å€¼ä»¥å¤§å†™å­—æ¯å½¢å¼æ˜¾ç¤ºã€‚ä¸‹è¡¨åˆ—å‡ºæ‰€æœ‰å¯ç”¨äºŽä¿®æ”¹è®¡æ•°å™¨æ&nbsp;¼å¼çš„å‘½ä»¤ã€‚
æ³¨æ„ï¼šè¿™äº›å‘½ä»¤\textbf{åªèƒ½ç”¨äºŽè®¡æ•°å™¨ï¼Œä¸èƒ½ç›´æŽ¥ç”¨äºŽæ•°å­—}ï¼Œå¦‚ \cmd{roman}\marg*{1} è¿™æ&nbsp;·çš„å‘½ä»¤ä¼šå‡ºé”™ã€‚
\begin{table}[htp]
\centering
\caption{è®¡æ•°å™¨è¾“å‡ºæ&nbsp;¼å¼ç›¸å…³å‘½ä»¤}\label{tbl:counter-commands}
\begin{tabular}{lp{22em}l}
 \hline
 \textbf{å‘½ä»¤} &amp; \textbf{æ&nbsp;·å¼} &amp; \textbf{èŒƒå›´} \\
 \hline
 \cmd{arabic} &amp; é˜¿æ‹‰ä¼¯æ•°å­—ï¼ˆé»˜è®¤ï¼‰ &amp; \\
 \cmd{alph}  &amp; å°å†™å­—æ¯ &amp; é™ 0--26 \\
 \cmd{Alph}  &amp; å¤§å†™å­—æ¯ &amp; é™ 0--26 \\
 \cmd{roman} &amp; å°å†™ç½—é©¬æ•°å­— &amp; é™éžè´Ÿæ•´æ•° \\
 \cmd{Roman} &amp; å¤§å†™ç½—é©¬æ•°å­— &amp; é™éžè´Ÿæ•´æ•° \\
 \cmd{fnsymbol} &amp; ä¸€ç³»åˆ—ç¬¦å·ï¼Œç”¨äºŽ \cmd{thanks} å‘½ä»¤ç”Ÿæˆçš„è„šæ³¨ &amp; é™ 0--9 \\
 \hline
\end{tabular}
\begin{quotation}
\small
\makeatletter
æ³¨ï¼š\cmd{fnsymbol} ä½¿ç”¨çš„ç¬¦å·é¡ºæ¬¡ä¸ºï¼š
\@fnsymbol{1} \@fnsymbol{2} \@fnsymbol{3}
\@fnsymbol{4} \@fnsymbol{5} \@fnsymbol{6}
\@fnsymbol{7} \@fnsymbol{8} \@fnsymbol{9}
\makeatother
\end{quotation}
\end{table}

è®¡æ•°å™¨çš„è¾“å‡ºæ&nbsp;¼å¼è¿˜å¯ä»¥åˆ©ç”¨å…¶å®ƒå­—ç¬¦ï¼Œç”šè‡³å…¶å®ƒè®¡æ•°å™¨çš„è¾“å‡ºæ&nbsp;¼å¼ä¸Žä¹‹ç»„åˆã€‚å¦‚æ&nbsp;‡å‡†æ–‡æ¡£ç±»é‡Œå¯¹ \cmd{sub\-section} ç›¸å…³çš„è®¡æ•°å™¨çš„è¾“å‡ºæ&nbsp;¼å¼çš„å®šä¹‰ç›¸å½“äºŽï¼š
\begin{verbatim}
\renewcommand\thesubsection{\thesection.\arabic{subsection}}
\end{verbatim}

\subsection{\LaTeX{} ä¸­çš„è®¡æ•°å™¨}\label{subsec:latex-counts}

\begin{itemize}
  \item æ‰€æœ‰ç«&nbsp;èŠ‚å‘½ä»¤ \cmd{chapter}ã€\cmd{section} ç­‰åˆ†åˆ«å¯¹åº”è®¡æ•°å™¨ chapterã€section ç­‰ç­‰ï¼Œè€Œä¸”æœ‰ä¸Šä¸‹çº§çš„å…³ç³»ã€‚
        è€Œè®¡æ•°å™¨ part æ˜¯ç‹¬ç«‹çš„ã€‚
  \item æœ‰åºåˆ—è¡¨ \env{enumerate} çš„å„çº§è®¡æ•°å™¨ä¸º enumi, enumii, enumiii, enumivï¼Œä¹Ÿæœ‰ä¸Šä¸‹çº§çš„å…³ç³»ã€‚
  \item å›¾è¡¨æµ®åŠ¨ä½“çš„è®¡æ•°å™¨å°±æ˜¯ table å’Œ figureï¼›å…¬å¼çš„è®¡æ•°å™¨ä¸º equationã€‚
        è¿™äº›è®¡æ•°å™¨åœ¨ \cls{article} æ–‡æ¡£ç±»ä¸­æ˜¯ç‹¬ç«‹çš„ï¼Œè€Œåœ¨ \cls{report} å’Œ \cls{book} ä¸­ä»¥ chapter ä¸ºä¸Šçº§è®¡æ•°å™¨ã€‚
  \item é¡µç&nbsp;ã€è„šæ³¨çš„è®¡æ•°å™¨åˆ†åˆ«æ˜¯ page å’Œ footnoteã€‚
\end{itemize}

æˆ‘ä»¬å¯ä»¥åˆ©ç”¨å‰é¢ä»‹ç»è¿‡çš„å‘½ä»¤ï¼Œä¿®æ”¹è®¡æ•°å™¨çš„æ&nbsp;·å¼ä»¥è¾¾åˆ°æƒ³è¦çš„æ•ˆæžœï¼Œæ¯”å¦‚æŠŠé¡µç&nbsp;ä¿®æ”¹æˆå¤§å†™ç½—é©¬æ•°å­—ï¼Œå·¦å³åŠ&nbsp;æ¨ªçº¿ï¼Œæˆ–æ˜¯ç»™è„šæ³¨åŠ&nbsp;ä¸Šæ–¹æ‹¬å·ï¼š
\begin{verbatim}
\renewcommand\thepage{--~\Roman{page}~--}
\renewcommand\thefootnote{[\arabic{footnote}]}
\end{verbatim}

\cmdindex{pagenumbering}
æˆ‘ä»¬åœ¨ \ref{subsec:basic-pagesyle} å°èŠ‚ä¸­è§è¿‡å‘½ä»¤ \cmd{pagenum\-bering}ã€‚
å®ƒçš„å†…éƒ¨æœºåˆ¶æ˜¯ä¿®æ”¹ page è®¡æ•°å™¨çš„æ&nbsp;¼å¼ \cmd{thepage}ï¼Œå¹¶å°†è®¡æ•°å™¨çš„å€¼é‡ç½®ä¸º 1ã€‚

æœ€åŽä»‹ç»ä¸¤ä¸ªæœ‰ç”¨çš„è®¡æ•°å™¨ï¼š

\subsubsection{secnumdepth}

\index{secnumdepth@secnumdepth (\textit{è®¡æ•°å™¨})}
\LaTeX{} æ&nbsp;‡å‡†æ–‡æ¡£ç±»å¯¹ç«&nbsp;èŠ‚åˆ’åˆ†äº†å±‚çº§ï¼š
\begin{itemize}
  \item åœ¨ \cls{article} æ–‡æ¡£ç±»é‡Œ part ä¸º 0ï¼Œsection ä¸º 1ï¼Œä¾æ­¤ç±»æŽ¨ï¼›
  \item åœ¨ \cls{report} å’Œ \cls{book} æ–‡æ¡£ç±»é‡Œ part ä¸º -1ï¼Œchapter ä¸º 0ï¼Œsection ä¸º 1ï¼Œç­‰ç­‰ã€‚
\end{itemize}

secnumdepth è®¡æ•°å™¨æŽ§åˆ¶ç«&nbsp;èŠ‚ç¼–å·çš„æ·±åº¦ï¼Œå¦‚æžœç«&nbsp;èŠ‚çš„å±‚çº§å¤§äºŽ secnumdepthï¼Œé‚£ä¹ˆç«&nbsp;èŠ‚çš„æ&nbsp;‡é¢˜ã€åœ¨ç›®å½•å’Œé¡µçœ‰é¡µè„šçš„æ&nbsp;‡é¢˜éƒ½ä¸ç¼–å·
ï¼ˆç…§å¸¸ç”Ÿæˆç›®å½•å’Œé¡µçœ‰é¡µè„šï¼‰ï¼Œç«&nbsp;èŠ‚è®¡æ•°å™¨ä¹Ÿä¸è®¡æ•°ã€‚

å¯ä»¥ç”¨ \cmd{setcounter} å‘½ä»¤è®¾ç½® secnumdepth ä¸ºè¾ƒå¤§çš„æ•°ä½¿å¾—å±‚çº§æ¯”è¾ƒæ·±çš„ç«&nbsp;èŠ‚ä¹Ÿç¼–å·ï¼Œ
å¦‚è®¾ç½®ä¸º 4 ä»¤ \cmd{paragraph} ä¹Ÿç¼–å·ï¼›æˆ–è€…è®¾ç½®ä¸€ä¸ªè¾ƒå°çš„æ•°ä»¥å–æ¶ˆç¼–å·ï¼Œå¦‚è®¾ç½®ä¸º -1 ä»¤ \cmd{chapter} ä¸ç¼–å·ã€‚
åŽè€…æ˜¯ç”Ÿæˆä¸ç¼–å·çš„ç«&nbsp;èŠ‚çš„ä¸€ä¸ªå¦™æ‹›ï¼Œå…åŽ»äº†æ‰‹åŠ¨ä½¿ç”¨ \cmd{add\-contents\-line} å’Œ \cmd{mark\-both} çš„éº»çƒ¦ã€‚

secnumdepth è®¡æ•°å™¨åœ¨ \cls{article} æ–‡æ¡£ç±»é‡Œé»˜è®¤ä¸º 3ï¼ˆsubsubsection ä¸€çº§ï¼‰ï¼›åœ¨ \cls{report} å’Œ \cls{book} æ–‡æ¡£ç±»é‡Œé»˜è®¤ä¸º 2ï¼ˆsubsection ä¸€çº§ï¼‰ã€‚

\subsubsection{tocdepth}

\index{tocdepth@tocdepth (\textit{è®¡æ•°å™¨})}
tocdepth è®¡æ•°å™¨æŽ§åˆ¶ç›®å½•çš„æ·±åº¦ï¼Œå¦‚æžœç«&nbsp;èŠ‚çš„å±‚çº§å¤§äºŽ tocdepthï¼Œé‚£ä¹ˆç«&nbsp;èŠ‚å°†ä¸ä¼šè‡ªåŠ¨å†™å…¥ç›®å½•é¡¹ã€‚é»˜è®¤å€¼åŒ secnumdepthã€‚

\section{\LaTeX{} å¯å®šåˆ¶çš„ä¸€äº›å‘½ä»¤å’Œå‚æ•°}\label{sec:latex-settings}

\LaTeX{} äº‹å®žä¸Šæœ‰ç›¸å½“ä¸€äº›å¯ä»¥å®šåˆ¶çš„å‘½ä»¤å’Œå‚æ•°ï¼Œä¸è¿‡å¯¹äºŽä¿®æ”¹æ&nbsp;·å¼æˆ–è€…å¼€å‘å®åŒ…æ¥è¯´ï¼Œè¿™äº›å®šåˆ¶é¡¹è¿˜è¿œè¿œä¸å¤Ÿã€‚

å¯¹äºŽç”¨æˆ·æ¥è®²ï¼Œå®¹æ˜“å®šåˆ¶çš„æ˜¯è¿™ä¸€äº›é¡¹ç›®ï¼š

\begin{itemize}
  \item æ&nbsp;‡é¢˜åç§°/å‰åŽç¼€ç­‰ã€‚è¡¨ \ref{tbl:latex-settings-names} åˆ—å‡ºäº†æ&nbsp;‡å‡†æ–‡æ¡£ç±»é‡Œå¯å®šåˆ¶çš„é¡¹ç›®ï¼Œ
  è¡¨ä¸­æ‰€æœ‰çš„ \LaTeX{} å‘½ä»¤éƒ½å¯ä»¥ç”¨ \cmd{re\-new\-comm\-and} æ¥ä¿®æ”¹ã€‚
  \item é•¿åº¦ã€‚å‰æ–‡åœ¨å™è¿°å„ç§æŽ’ç‰ˆå…ƒç´&nbsp;æ—¶å·²ç»ä»‹ç»è¿‡ä¸€äº›ï¼ŒçŽ°å½’çº³äºŽè¡¨ \ref{tbl:latex-settings-lengths}ã€‚
  è¡¨ä¸­æ‰€æœ‰çš„é•¿åº¦å‘½ä»¤å¯ç”¨ \cmd{setlength} æ¥ä¿®æ”¹ã€‚
  å¤§å¤šæ•°æŽ§åˆ¶é¡µé¢å°ºå¯¸çš„é•¿åº¦å‚æ•°åœ¨å›¾ \ref{fig:layouts} ç»™å‡ºï¼Œæ­¤å¤„ä¸å†èµ˜è¿°ã€‚
\end{itemize}

\begin{table}[htp]
\centering
\caption{\LaTeX{} å¯å®šåˆ¶çš„æ&nbsp;‡é¢˜åç§°/å‰åŽç¼€}\label{tbl:latex-settings-names}
\small
\begin{tabular}{llp{24em}}
 \hline
 \textbf{å‘½ä»¤} &amp; \textbf{é»˜è®¤å€¼} &amp; \textbf{å«ä¹‰} \\
 \hline
 \cmd{partname}       &amp; Part            &amp; \cmd{part} å‘½ä»¤ç”Ÿæˆçš„æ&nbsp;‡é¢˜å‰ç¼€ \\
 \cmd{chaptername}    &amp; Chapter         &amp; \cmd{chapter} å‘½ä»¤ç”Ÿæˆçš„æ&nbsp;‡é¢˜å‰ç¼€ \\
 \cmd{appendixname}   &amp; Appendix        &amp; ä½¿ç”¨ \cmd{appendix} å‘½ä»¤ç”Ÿæˆçš„é™„å½•éƒ¨åˆ†çš„ç«&nbsp;æ&nbsp;‡é¢˜å‰ç¼€ \\
 \cmd{abstractname}   &amp; Abstract        &amp; æ‘˜è¦çŽ¯å¢ƒ \env{abstract} çš„æ&nbsp;‡é¢˜åç§° \\[1ex]
 \cmd{contentsname}   &amp; Contents        &amp; \cmd{tableofcontents} å‘½ä»¤ç”Ÿæˆçš„ç›®å½•æ&nbsp;‡é¢˜ \\
 \cmd{listfigurename} &amp; List of Figures &amp; \cmd{listoffigures} å‘½ä»¤ç”Ÿæˆçš„æ’å›¾ç›®å½•æ&nbsp;‡é¢˜ \\
 \cmd{listtablename}  &amp; List of Tables  &amp; \cmd{listoftables} å‘½ä»¤ç”Ÿæˆçš„è¡¨æ&nbsp;¼ç›®å½•æ&nbsp;‡é¢˜ \\[1ex]
 \cmd{tablename}      &amp; Table           &amp; \env{table} æµ®åŠ¨ä½“ä¸­ \cmd{caption} å‘½ä»¤ç”Ÿæˆçš„æ&nbsp;‡é¢˜å‰ç¼€ \\
 \cmd{figurename}     &amp; Figure          &amp; \env{figure} æµ®åŠ¨ä½“ä¸­ \cmd{caption} å‘½ä»¤ç”Ÿæˆçš„æ&nbsp;‡é¢˜å‰ç¼€ \\[1ex]
 \cmd{refname}        &amp; References      &amp; \env{thebibliography} çŽ¯å¢ƒæˆ– \cmd{biblio\-graphy}
                                          å‘½ä»¤ç”Ÿæˆçš„å‚è€ƒæ–‡çŒ®æ&nbsp;‡é¢˜ï¼ˆ\cls{article} æ–‡æ¡£ç±»ï¼‰ \\
 \cmd{bibname}        &amp; Bibliography    &amp; \env{thebibliography} çŽ¯å¢ƒæˆ– \cmd{biblio\-graphy}
                                          å‘½ä»¤ç”Ÿæˆçš„å‚è€ƒæ–‡çŒ®æ&nbsp;‡é¢˜ï¼ˆ\cls{report} å’Œ \cls{book} æ–‡æ¡£ç±»ï¼‰\\
 \cmd{indexname}      &amp; Index           &amp; \cmd{printindex} å‘½ä»¤ç”Ÿæˆçš„ç´¢å¼•æ&nbsp;‡é¢˜ \\
 \hline
\end{tabular}
\begin{quotation}\footnotesize%
æ³¨ï¼šå½¢å¦‚â€œç¬¬ X ç«&nbsp;â€å’Œâ€œç¬¬ X éƒ¨åˆ†â€çš„ä¸­æ–‡ç«&nbsp;èŠ‚æ&nbsp;‡é¢˜ä¸èƒ½ç›´æŽ¥ç”±ä¿®æ”¹æœ¬è¡¨çš„å‘½ä»¤å¾—åˆ°ï¼Œéœ€è¦ä½¿ç”¨ \pkg{titlesec} ç­‰å®åŒ…å®šåˆ¶ã€‚
å¦‚æžœä½¿ç”¨ \pkg{ctex} å®åŒ…æˆ–æ–‡æ¡£ç±»ï¼Œé‚£ä¹ˆæ&nbsp;‡é¢˜é»˜è®¤è¢«ä¿®æ”¹æˆâ€œç¬¬ X ç«&nbsp;â€å’Œâ€œç¬¬ X éƒ¨åˆ†â€çš„å½¢å¼ï¼Œæœ¬è¡¨ä¸­çš„å…¶å®ƒæ&nbsp;‡é¢˜ä¹Ÿä¿®æ”¹ä¸ºä¸­æ–‡æ&nbsp;‡é¢˜ã€‚è¯¦è§ \pkg{ctex} å®åŒ…çš„å¸®åŠ©æ–‡æ¡£ã€‚
\end{quotation}
\end{table}

\begin{table}[htp]
\centering
\caption{\LaTeX{} å¯å®šåˆ¶çš„é•¿åº¦å‚æ•°}\label{tbl:latex-settings-lengths}
\small
\begin{tabular}{lll}
 \hline
 \textbf{å‘½ä»¤} &amp; \textbf{é»˜è®¤å€¼} &amp; \textbf{å«ä¹‰} \\
 \hline
 \cmd{fboxrule}     &amp; 0.4pt &amp; \cmd{fbox} æˆ– \cmd{framebox} ç­‰å¸¦æ¡†ç›’å­çš„çº¿å®½ \\
 \cmd{fboxsep}      &amp; 3pt   &amp; \cmd{fbox} æˆ– \cmd{framebox} ç­‰å¸¦æ¡†ç›’å­çš„å†…è¾¹è· \\[1ex]
 \cmd{arraycolsep}  &amp; 5pt   &amp; \env{array} çŽ¯å¢ƒçš„è¡¨æ&nbsp;¼é¡¹å‰åŽçš„é—´è·\textsuperscript{æ³¨ 1} \\
 \cmd{tabcolsep}    &amp; 6pt   &amp; \env{tabular} çŽ¯å¢ƒçš„è¡¨æ&nbsp;¼é¡¹å‰åŽçš„é—´è·\textsuperscript{æ³¨ 1} \\
 \cmd{arrayrulewidth}     &amp;  0.4pt  &amp; è¡¨æ&nbsp;¼çº¿å®½ \\
 \cmd{doublerulesep}      &amp;  2pt    &amp; è¿žç»­ä¸¤æ&nbsp;¹è¡¨æ&nbsp;¼çº¿ä¹‹é—´çš„é—´è· \\[1ex]
 \cmd{abovecaptionskip}   &amp;  10pt   &amp; \cmd{caption} å‘½ä»¤ä¸Šæ–¹çš„é—´è·\textsuperscript{æ³¨ 2} \\
 \cmd{belowcaptionskip}   &amp;  0pt    &amp; \cmd{caption} å‘½ä»¤ä¸‹æ–¹çš„é—´è·\textsuperscript{æ³¨ 2} \\[1ex]
 \cmd{columnsep}          &amp;  10pt   &amp; åŒæ&nbsp;æŽ’ç‰ˆä¸‹ä¸¤æ&nbsp;çš„é—´è· \\
 \cmd{columnseprule}      &amp;  0pt    &amp; åŒæ&nbsp;æŽ’ç‰ˆä¸‹ä¸¤æ&nbsp;ä¹‹é—´ç«–çº¿çš„å®½åº¦ \\
 \hline
\end{tabular}
\begin{quotation}\footnotesize%
æ³¨ 1ï¼š\cmd{arraycolsep} å’Œ \cmd{tabcolsep} æ˜¯æ¯ä¸ªè¡¨æ&nbsp;¼é¡¹æœ¬èº«å‰åŽçš„é—´è·ï¼ˆè¡¨æ&nbsp;¼çº¿å‰åŽæ—&nbsp;é—´è·ï¼›\texttt{@} åˆ—æ&nbsp;¼å¼ä¼šæ¶ˆé™¤ä¸Žå‰åŽè¡¨æ&nbsp;¼é¡¹çš„é—´è·ï¼‰ã€‚
ä¸¤ä¸ªè¡¨æ&nbsp;¼é¡¹ä¹‹é—´çš„é—´è·ç›¸å½“äºŽ 2\cmd{arraycolsep} æˆ– 2\cmd{tabcolsep}ã€‚\par
æ³¨ 2ï¼šåœ¨é»˜è®¤è®¾ç½®ä¸‹ï¼Œ\cmd{caption} å‘½ä»¤å’Œä½äºŽå®ƒä¸‹æ–¹çš„å›¾è¡¨ä¹‹é—´æ—&nbsp;é—´è·ã€‚å®åŒ… \pkg{caption} æ”¹å–„äº†è¿™ä¸ªé—®é¢˜ã€‚
\end{quotation}
\end{table}

\endinput
</pre></body></html>