<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">\chapter{æ‚é¡¹}

\section{è¶…é“¾æŽ¥}
\label{sec:hyperlink}

\verb|hyperref|~å®åŒ…\citep{Rahtz_2006}æä¾›äº†ä¸€äº›è¶…é“¾æŽ¥åŠŸèƒ½ã€‚å®ƒç»™æ–‡æ¡£å†…éƒ¨çš„äº¤å‰å¼•ç”¨å’Œå‚è€ƒæ–‡çŒ®è‡ªåŠ¨åŠ&nbsp;ä¸Šäº†è¶…é“¾æŽ¥ï¼Œè¿˜æä¾›äº†å‡&nbsp;ä¸ªå‘½ä»¤ã€‚

\verb|\hyperref|~å‘½ä»¤å¯¹å·²ç»å®šä¹‰çš„labelè¿›è¡Œç®€å•åŒ…è£…ï¼ŒåŠ&nbsp;ä¸Šæ–‡å­—æè¿°ã€‚

\begin{code}
\usepackage{hyperref}
...
\label{sec:hyperlink}
...
ä¾‹å¦‚\ref{sec:hyperlink}æ˜¯ç¼–å·å½¢å¼çš„é“¾æŽ¥ï¼Œè€Œ\hyperref[sec:hyperlink]{è¿™ä¸ªé“¾æŽ¥}æ˜¯æ–‡å­—å½¢å¼çš„é“¾æŽ¥ï¼Œéƒ½æŒ‡å‘æœ¬èŠ‚å¼€å§‹ã€‚
\end{code}

\begin{out}
ä¾‹å¦‚\ref{sec:hyperlink}æ˜¯ç¼–å·å½¢å¼çš„è¶…é“¾æŽ¥ï¼Œè€Œ\hyperref[sec:hyperlink]{è¿™ä¸ªé“¾æŽ¥}åˆ™æ˜¯æ–‡å­—å½¢å¼ï¼Œéƒ½æŒ‡å‘æœ¬èŠ‚å¼€å§‹ã€‚
\end{out}

\verb|\url|~å’Œ~\verb|\href|~å‘½ä»¤å¯ä»¥ç”¨æ¥å®šä¹‰å¤–éƒ¨é“¾æŽ¥ï¼ŒåŽè€…æœ‰æ–‡å­—æè¿°ã€‚

\begin{code}
\url{http://www.dralpha.com/}
\href{http://www.dralpha.com/}{åŒ…è€å¸ˆçš„ä¸»é¡µ}
\end{code}

\begin{out}
\url{http://www.dralpha.com/}

\href{http://www.dralpha.com/}{åŒ…è€å¸ˆçš„ä¸»é¡µ}
\end{out}

%hyperrefé€‰é¡¹

\section{é•¿æ–‡æ¡£}
å½“æ–‡æ¡£å¾ˆé•¿æ—¶ï¼Œæˆ‘ä»¬å¯ä»¥æŠŠå®ƒåˆ†ä¸ºå¤šä¸ªæ–‡ä»¶ï¼Œç„¶åŽåœ¨ä¸»æŽ§æ–‡æ¡£çš„æ­£æ–‡ä¸­å¼•ç”¨å®ƒä»¬ã€‚æ³¨æ„~\verb|\include|~å‘½ä»¤ä¼šæ–°èµ·ä¸€é¡µï¼Œå¦‚æžœä¸æƒ³è¦æ–°é¡µå¯ä»¥æ”¹ç”¨~\verb|\input|~å‘½ä»¤ã€‚
\begin{code}
%master.tex
\begin{document}
\include{chapter1.tex}
\include{chapter2.tex}
...
\end{document}
\end{code}

å½“æ–‡æ¡£å¾ˆé•¿æ—¶ï¼Œç¼–è¯‘ä¸€éä¹Ÿä¼šå¾ˆèŠ±æ—¶é—´ï¼Œæˆ‘ä»¬å¯ä»¥ç”¨~\verb|syntonly|~å®åŒ…ã€‚è¿™æ&nbsp;·ç¼–è¯‘æ—¶å°±åªæ£€æŸ¥è¯­æ³•ï¼Œè€Œä¸ç”Ÿæˆç»“æžœæ–‡ä»¶ã€‚
\begin{code}
\usepackage{syntonly}
...
\syntaxonly
\end{code}

\section{å‚è€ƒæ–‡çŒ®}
åœ¨æ–‡æ¡£ä¸­ï¼Œæˆ‘ä»¬ç»å¸¸è¦å¼•ç”¨å‚è€ƒæ–‡çŒ®ï¼ˆbibliographyï¼‰ã€‚\LaTeX~æä¾›çš„~\verb|thebibliography|~çŽ¯å¢ƒå’Œ~\verb|\bibtem|~å‘½ä»¤å¯ä»¥ç”¨æ¥å®šä¹‰å‚è€ƒæ–‡çŒ®æ¡ç›®åŠå…¶åˆ—è¡¨æ˜¾ç¤ºæ&nbsp;¼å¼ï¼Œ\verb|cite|~å‘½ä»¤ç”¨æ¥åœ¨æ­£æ–‡ä¸­å¼•ç”¨å‚è€ƒæ–‡çŒ®æ¡ç›®ã€‚è¿™ç§æ–¹æ³•æŠŠå†…å®¹å’Œæ&nbsp;¼å¼æ··åœ¨ä¸€èµ·ï¼Œç”¨æˆ·éœ€è¦ä¸ºæ¯ä¸ªæ¡ç›®è®¾ç½®æ&nbsp;¼å¼ï¼Œå¾ˆç¹çä¸”æ˜“å‡ºé”™ã€‚

\subsection{BibTeX}
1985å¹´ï¼Œ~Oren Patashnik\footnote{Wiki~ä¸Šè¯´ä»–æ˜¯~Knuth~çš„å­¦ç”Ÿï¼Œæˆ‘å‘çŽ°ä»–ä¸åœ¨~Knuth~çš„åšå£«ç”Ÿåˆ—è¡¨ä¸Šï¼Œè€Œåœ¨å§šæœŸæ™ºçš„åšå£«ç”Ÿåˆ—è¡¨ä¸Šï¼Œä¹Ÿè®¸ä»–æ˜¯~Knuth~çš„ç¡•å£«ç”Ÿã€‚}å’Œ~Lamport~å¼€å‘äº†~\BibTeX\citep{Patashnik_1988}ï¼Œå…¶è¯¦ç»†ä½¿ç”¨æ–¹æ³•è¯·å‚é˜…~Nicolas Markey~çš„ã€ŠTame the BeaST: The B to X of BibTeXã€‹\citep{Markey_2005}

\BibTeX~æŠŠå‚è€ƒæ–‡çŒ®çš„æ•°æ®æ”¾åœ¨ä¸€ä¸ª~\verb|.bib|~æ–‡ä»¶ä¸­ï¼Œæ˜¾ç¤ºæ&nbsp;¼å¼æ”¾åœ¨~\verb|.bst|~æ–‡ä»¶ä¸­ã€‚æ™®é€šç”¨æˆ·ä¸€èˆ¬ä¸éœ€è¦æ”¹åŠ¨~\verb|.bst|ï¼Œåªé¡»ç»´æŠ¤~\verb|.bib|~æ•°æ®åº“ã€‚

ä¸€ä¸ª~\verb|.bib|~æ–‡ä»¶å¯ä»¥åŒ…å«å¤šä¸ªå‚è€ƒæ–‡çŒ®æ¡ç›®ï¼ˆentryï¼‰ï¼Œæ¯ä¸ªæ¡ç›®æœ‰ç±»åž‹ã€å…³é”®å­—ï¼Œä»¥åŠé¢˜ç›®ã€ä½œè€…ã€å¹´ä»½ç­‰å­—æ®µã€‚å¸¸ç”¨æ¡ç›®ç±»åž‹æœ‰~articleã€~bookã€conferenceã€manualã€miscã€techreport~ç­‰ã€‚æ¯ç§ç±»åž‹éƒ½æœ‰ä¸€äº›è‡ªå·±çš„è§„å®šå­—æ®µå’Œå¯é€‰å­—æ®µï¼Œå­—æ®µä¹‹é—´ç”¨é€—å·åˆ†å¼€ã€‚æ•°æ®åº“ä¸­æ¯ä¸ªæ¡ç›®çš„å…³é”®å­—è¦ä¿æŒå”¯ä¸€ï¼Œå›&nbsp;ä¸ºå¼•ç”¨æ—¶è¦ç”¨åˆ°å®ƒä»¬ã€‚

ä¸‹ä¾‹æ˜¾ç¤ºäº†ä¸€ä¸ªæ¡ç›®ï¼Œå®ƒçš„ç±»åž‹æ˜¯~\verb|manual|ï¼Œå…³é”®å­—æ˜¯~\verb|Markey_2005|ã€‚~\verb|.bib|~æ–‡ä»¶å¯ä»¥ç”¨æ™®é€šæ–‡æœ¬ç¼–è¾‘å™¨æ¥ç¼–è¾‘ï¼Œä¹Ÿå¯ä»¥ç”¨ä¸“é—¨çš„æ–‡çŒ®ç®¡ç†è½¯ä»¶æ¥æé«˜æ•ˆçŽ‡ã€‚åŒ…è€å¸ˆæŽ¨è~\href{http://jabref.sourceforge.net/}{JabRef}ã€‚

\begin{code}
@MANUAL{Markey_2005,
  title = {Tame the BeaST: The B to X of BibTeX},
  author = {Nicolas Markey},
  year = {2005},
  url = {http://www.ctan.org/tex-archive/info/bibtex/
    tamethebeast/}
}
\end{code}

æœ‰äº†æ•°æ®åº“ï¼Œæˆ‘ä»¬å¯ä»¥è±¡ä¸‹é¢è¿™æ&nbsp;·å¼•ç”¨ä¸€ä¸ªæ¡ç›®ã€‚
\begin{demo}
è¯·å‚é˜…\cite{Markey_2005}ã€‚
\end{demo}

å‰æ–‡ä¸­æˆ‘ä»¬æåˆ°å«æœ‰äº¤å‰å¼•ç”¨çš„æ–‡æ¡£éœ€è¦ç¼–è¯‘ä¸¤éã€‚å«æœ‰å‚è€ƒæ–‡çŒ®çš„æ–‡æ¡£æ›´éº»çƒ¦ï¼Œå®ƒéœ€è¦ä¾æ¬¡æ‰§è¡Œ~\verb|latexã€bibtexã€latexã€latex|~ç­‰å››æ¬¡ç¼–è¯‘æ“ä½œã€‚

\begin{enumerate}
    \item ç¬¬ä¸€é~\verb|latex|~åªæŠŠæ¡ç›®çš„å…³é”®å­—å†™åˆ°ä¸­é—´æ–‡ä»¶~\verb|.aux|~ä¸­åŽ»ã€‚
    \item \verb|bibtex|~æ&nbsp;¹æ®\verb|.auxã€.bibã€.bst|~ç”Ÿæˆä¸€ä¸ª~\verb|.bbl|~æ–‡ä»¶ï¼Œå³å‚è€ƒæ–‡çŒ®åˆ—è¡¨ã€‚å®ƒçš„å†…å®¹å°±æ˜¯~\verb|thebibliography|~çŽ¯å¢ƒå’Œä¸€äº›~\verb|\bibtem|~å‘½ä»¤ã€‚
    \item ç¬¬äºŒé~\verb|latex|~æŠŠäº¤å‰å¼•ç”¨å†™åˆ°~\verb|.aux|~ä¸­åŽ»ã€‚
    \item ç¬¬ä¸‰é~\verb|latex|~åˆ™åœ¨æ­£æ–‡ä¸­æ­£ç¡®åœ°æ˜¾ç¤ºå¼•ç”¨ã€‚
\end{enumerate}

\begin{figure}[htbp]
\centering
\begin{tikzpicture}
    \node[box] (tex) {.tex};
    \node[box, right=4 of tex] (aux) {.aux};
    \node[box, right=6 of aux] (bbl) {.bbl};
    \node[box, above=1.5 of aux] (bib) {.bib};
    \node[box, below=1.5 of aux] (bst) {.bst};
    \path (tex) edge [arrow] node[auto] {latex} (aux)
        (aux) edge [arrow] node[auto] {bibtex} (bbl)
        (bib.east) edge [rloop] (bst);
\end{tikzpicture}
\caption{\BibTeX~çš„ç¼–è¯‘}
\label{fig:bibtex}
\end{figure}

æ³¨æ„åœ¨é•¿æ–‡æ¡£ä¸­ä½¿ç”¨å‚è€ƒæ–‡çŒ®æ—¶ï¼Œåº”è¯¥ç”¨~\verb|latex|~ç¼–è¯‘ä¸»æŽ§æ–‡æ¡£ï¼Œè€Œç”¨~\verb|bibtex|~ç¼–è¯‘å­æ–‡æ¡£ã€‚

\begin{code}
latex master(.tex)
bibtex chapter1(.tex)
latex master(.tex)
latex master(.tex)
\end{code}

\subsection{natbib}
å‚è€ƒæ–‡çŒ®çš„å¼•ç”¨é€šå¸¸æœ‰ä¸¤ç§æ&nbsp;·å¼ï¼šä½œè€…-å¹´ä»½å’Œæ•°å­—ã€‚\LaTeX~æœ¬èº«åªæ”¯æŒæ•°å­—æ&nbsp;·å¼ï¼Œè€Œ~\verb|natbib|~å®åŒ…\citep{Daly_2007}åˆ™åŒæ—¶æ”¯æŒè¿™ä¸¤ç§æ&nbsp;·å¼ã€‚

ä½¿ç”¨~\verb|natbib|~å®åŒ…æ—¶ï¼Œæˆ‘ä»¬é¦–å…ˆè¦å¼•ç”¨å®åŒ…ï¼›å…¶æ¬¡è®¾ç½®æ–‡çŒ®åˆ—è¡¨æ&nbsp;·å¼å’Œå¼•ç”¨æ&nbsp;·å¼ï¼Œæ¯ç§åˆ—è¡¨æ&nbsp;·å¼éƒ½æœ‰è‡ªå·±çš„ç¼ºçœå¼•ç”¨æ&nbsp;·å¼ï¼Œæ‰€ä»¥åŽè€…å¯é€‰ï¼›ç„¶åŽæŒ‡å®šå‚è€ƒæ–‡çŒ®æ•°æ®åº“ã€‚
\begin{code}
\usepackage{natbib}
...
\begin{document}
\bibliographystyle{plainnat}
\setcitestyle{square,aysep={},yysep={;}}
\bibliography{mybib.bib}
...
\end{document}
\end{code}

\verb|natbib|~æä¾›äº†ä¸‰ç§åˆ—è¡¨æ&nbsp;·å¼ï¼šplainnatã€abbrvnatã€unsrtnatã€‚å‰ä¸¤ç§éƒ½æ˜¯ä½œè€…-å¹´ä»½æ&nbsp;·å¼ï¼Œæ–‡çŒ®åˆ—è¡¨æŒ‰ä½œè€…-å¹´ä»½æŽ’åºï¼ŒåŽè€…ä¼šä½¿ç”¨ä¸€äº›ç¼©å†™ï¼ˆæ¯”å¦‚ä½œè€…çš„~first nameï¼‰ï¼›unsrtnat~æ˜¯æ•°å­—æ&nbsp;·å¼ï¼Œæ–‡çŒ®åˆ—è¡¨æŒ‰å¼•ç”¨é¡ºåºæŽ’åºã€‚

\verb|\setcitestyle|~å‘½ä»¤å¯ä»¥ç”¨æ¥æ”¹å˜å¼•ç”¨æ&nbsp;·å¼çš„è®¾ç½®ï¼Œå…¶é€‰é¡¹è§~\Fref{tab:citestyle}ã€‚

\begin{table}[htbp]
\caption{å‚è€ƒæ–‡çŒ®å¼•ç”¨æ&nbsp;·å¼é€‰é¡¹}
\label{tab:citestyle}
\centering
\begin{tabular}{ll}
    \toprule
    å¼•ç”¨æ¨¡å¼            &amp; authoryearã€numbersã€super \\
    æ‹¬å·                &amp; roundã€squareã€open={char},close={char} \\
    å¼•ç”¨æ¡ç›®åˆ†éš”ç¬¦      &amp; åˆ†å·ã€é€—å·ã€citesep={char} \\
    ä½œè€…å¹´ä»½åˆ†éš”ç¬¦      &amp; aysep={char} \\
    å…±åŒä½œè€…å¹´ä»½åˆ†éš”ç¬¦  &amp; yysep={char} \\
    æ³¨è§£åˆ†éš”ç¬¦          &amp; notesep={text} \\
    \bottomrule
\end{tabular}
\end{table}

æ³¨æ„åœ¨é•¿æ–‡æ¡£ä¸­ï¼Œæ¯ä¸ªå«å‚è€ƒæ–‡çŒ®çš„å­æ–‡æ¡£éƒ½éœ€è¦åˆ†åˆ«è®¾ç½®åˆ—è¡¨æ&nbsp;·å¼ï¼Œå¹¶æŒ‡å®šæ•°æ®åº“ã€‚

\verb|natbib|~æä¾›äº†å¤šç§å¼•ç”¨å‘½ä»¤ï¼Œå…¶ä¸­æœ€åŸºæœ¬çš„æ˜¯~\verb|\citet|~å’Œ~\verb|\citep|~ï¼Œå®ƒä»¬åœ¨ä¸åŒå¼•ç”¨æ¨¡å¼ä¸‹æ•ˆæžœä¸åŒã€‚ä¸€èˆ¬ä¸æŽ¨èä½¿ç”¨~\LaTeX~æœ¬èº«æä¾›çš„~\verb|\cite|ï¼Œå›&nbsp;ä¸ºå®ƒåœ¨ä½œè€…-å¹´ä»½æ¨¡å¼ä¸‹å’Œ~\verb|\citet|~ä¸€æ&nbsp;·ï¼Œåœ¨æ•°å­—æ¨¡å¼ä¸‹å’Œ~\verb|\citep|~ä¸€æ&nbsp;·ã€‚

ä½œè€…-å¹´ä»½æ¨¡å¼ä¸‹å¼•ç”¨å‘½ä»¤çš„æ•ˆæžœå¦‚ä¸‹ã€‚
\setcitestyle{authoryear}
\begin{demo}
å‚é˜…\cite{Daly_2007}\\
å‚é˜…\citet{Daly_2007}\\
å‚é˜…\citep{Daly_2007}
\end{demo}

æ•°å­—æ¨¡å¼ä¸‹å¼•ç”¨å‘½ä»¤çš„æ•ˆæžœå¦‚ä¸‹ã€‚
\setcitestyle{numbers}
\begin{demo}
å‚é˜…\cite{Daly_2007}\\
å‚é˜…\citet{Daly_2007}\\
å‚é˜…\citep{Daly_2007}
\end{demo}

ä¸Šæ&nbsp;‡æ¨¡å¼ä¸‹å¼•ç”¨å‘½ä»¤çš„æ•ˆæžœå¦‚ä¸‹ã€‚
\setcitestyle{super}
\begin{demo}
å‚é˜…\cite{Daly_2007}\\
å‚é˜…\citet{Daly_2007}\\
å‚é˜…\citep{Daly_2007}
\end{demo}

å¦å¤–è¿˜æœ‰ä¸€äº›å¼•ç”¨å‘½ä»¤ï¼Œå¦‚~\verb|\citetextã€\citenumã€\citeauthor|ã€~\verb|\citeyear|~ç­‰ï¼Œæ­¤å¤„ä¸èµ˜è¿°ã€‚

\section{ç´¢å¼•}
\verb|makeidx|~å®åŒ…æä¾›äº†ç´¢å¼•åŠŸèƒ½ã€‚åº”ç”¨å®ƒæ—¶ï¼Œæˆ‘ä»¬é¦–å…ˆéœ€è¦åœ¨æ–‡æ¡£åºè¨€éƒ¨åˆ†å¼•ç”¨å®åŒ…ï¼Œå¹¶ä½¿ç”¨~\verb|makeindex|~å‘½ä»¤ï¼›å…¶æ¬¡åœ¨æ­£æ–‡ä¸­éœ€è¦ç´¢å¼•çš„åœ°æ–¹å®šä¹‰ç´¢å¼•ï¼Œæ³¨æ„ç´¢å¼•å…³é”®å­—åœ¨å…¨æ–‡ä¸­é¡»ä¿æŒå”¯ä¸€ï¼›æœ€åŽåœ¨åˆé€‚çš„åœ°æ–¹ï¼ˆä¸€èˆ¬æ˜¯æ–‡æ¡£æœ«å°¾ï¼‰æ‰“å°ç´¢å¼•ã€‚

\begin{code}
\usepackage{makeidx}
\makeindex
...
\begin{document}
\index{ç´¢å¼•å…³é”®å­—}
...
\printindex
\end{document}
\end{code}

å½“ç¼–è¯‘å«ç´¢å¼•çš„æ–‡æ¡£æ—¶ï¼Œç”¨æˆ·éœ€è¦æ‰§è¡Œ~\verb|latexã€makeindexã€latex|~ç­‰ä¸‰æ¬¡ç¼–è¯‘æ“ä½œã€‚

\begin{enumerate}
    \item ç¬¬ä¸€é~\verb|latex|~æŠŠç´¢å¼•æ¡ç›®å†™åˆ°ä¸€ä¸ª~\verb|.idx|~æ–‡ä»¶ä¸­åŽ»ã€‚
    \item \verb|makeindex|~æŠŠ~\verb|.idx|~æŽ’åºåŽå†™åˆ°ä¸€ä¸ª~\verb|.ind|~æ–‡ä»¶ä¸­åŽ»ã€‚
    \item ç¬¬äºŒé~\verb|latex|~åœ¨~\verb|\printindex|~å‘½ä»¤çš„åœ°æ–¹å¼•ç”¨~\verb|.ind|~çš„å†…å®¹ï¼Œç”Ÿæˆæ­£ç¡®çš„DVIã€‚
\end{enumerate}

\begin{figure}[htbp]
\centering
\begin{tikzpicture}
    \node[box] (tex) {.tex};
    \node[box, right=4 of tex] (idx) {.idx};
    \node[box, right=7 of idx] (ind) {.ind};
    \node[box, right=6 of ind] (dvi) {.dvi};
    \node[box, above=1.5 of ind] (tex1) {.tex};
    \node[right=1 of ind] (point) {};
    \path (tex) edge [arrow] node[auto] {latex} (idx)
        (idx) edge [arrow] node[auto] {makeindex} (ind)
        (ind) edge [arrow] node[auto] {latex} (dvi)
        (tex1.east) edge [rloop] (point);
\end{tikzpicture}
\caption{ç´¢å¼•çš„ç¼–è¯‘}
\label{fig:makeidx}
\end{figure}

\section{é¡µé¢å¸ƒå±€}
åœ¨~\LaTeX~ä¸­ç”¨æˆ·å¯ä»¥é€šè¿‡~\verb|\pagestyle|~å’Œ~\verb|\pagenumbering|~å‘½ä»¤æ¥è®¾ç½®é¡µçœ‰ï¼ˆheaderï¼‰ã€é¡µè„šï¼ˆfooterï¼‰çš„æ&nbsp;·å¼å’Œå†…å®¹ã€‚é¡µé¢æ&nbsp;·å¼æœ‰ä»¥ä¸‹å››ç§ã€‚

\begin{table}[htbp]
\caption{\LaTeX~é¡µé¢æ&nbsp;·å¼}
\centering
\begin{tabular}{ll}
    \toprule
    \texttt{empty} &amp; é¡µçœ‰ã€é¡µè„šç©ºç™½ \\
    \texttt{plain} &amp; é¡µçœ‰ç©ºç™½ï¼Œé¡µè„šå«å±…ä¸­é¡µç&nbsp; \\
    \texttt{headings} &amp; é¡µè„šç©ºç™½ï¼Œé¡µçœ‰å«ç«&nbsp;èŠ‚åå’Œé¡µç&nbsp; \\
    \texttt{myheadings} &amp; é¡µè„šç©ºç™½ï¼Œé¡µçœ‰å«é¡µç&nbsp;å’Œç”¨æˆ·è‡ªå®šä¹‰ä¿¡æ¯ \\
    \bottomrule
\end{tabular}
\end{table}

\verb|fancyhdr|\citep{Oostrum_2004}å®åŒ…æä¾›äº†æ›´çµæ´»çš„æŽ§åˆ¶ã€‚æˆ‘ä»¬å¯ä»¥ç”¨ä»¥ä¸‹ä»£ç&nbsp;å®šåˆ¶é¡µçœ‰ã€é¡µè„šçš„å†…å®¹ï¼Œä»¥åŠé¡µçœ‰ä¸‹æ–¹ã€é¡µè„šä¸Šæ–¹çš„æ¨ªçº¿ã€‚

\begin{code}
\usepackage{fancyhdr}
...
\pagestyle{fancy} %fancyhdrå®åŒ…æ–°å¢žçš„é¡µé¢é£Žæ&nbsp;¼
\lhead{å·¦æ“Žè‹}
\chead{ä¸‰ä¸ªä»£è¡¨}
\rhead{å³ç‰µé»„}
\lfoot{å·¦é’é¾™}
\cfoot{å…«è£å…«è€»}
\rfoot{å³ç™½è™Ž}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}
\end{code}

\ \\
\begin{tikzpicture}
\draw (0,0) rectangle (36,10);
\node at(2,9) {å·¦æ“Žè‹};
\node at(18,9) {ä¸‰ä¸ªä»£è¡¨};
\node at(34,9) {å³ç‰µé»„};
\draw (.5,8)--(35.5,8);
\node at(18,5) {å’Œè°ç¤¾ä¼š};
\draw (.5,2)--(35.5,2);
\node at(2,1) {å·¦é’é¾™};
\node at(18,1) {å…«è£å…«è€»};
\node at(34,1) {å³ç™½è™Ž};
\end{tikzpicture}

ç”¨æˆ·å¯ä»¥åœ¨é¡µçœ‰ã€é¡µè„šä¸­ä½¿ç”¨ä¸€äº›~\LaTeX~å˜é‡ï¼Œæ¯”å¦‚åˆ†åˆ«ä»£è¡¨é¡µç&nbsp;å’Œç«&nbsp;èŠ‚ç¼–å·çš„~\verb|\thepageã€\thechapterã€\thesection|ï¼›ä»£è¡¨ç«&nbsp;èŠ‚èµ·å§‹å•è¯ï¼ˆChapterã€Sectionç­‰ï¼‰çš„~\verb|\chapternameã€\sectionname|~ç­‰ã€‚

è¿™äº›å˜é‡ç»„åˆèµ·æ¥å¯ä»¥æž„æˆå¤åˆæ&nbsp;‡è®°~\verb|\leftmark|~å’Œ~\verb|\rightmark|~ã€‚å½“æ–‡æ¡£å¥‡å¶é¡µé¢å¸ƒå±€ä¸åŒæ—¶ï¼Œæˆ‘ä»¬å¯ä»¥ä½¿ç”¨ä»¥ä¸‹æ–¹æ³•ä¸ºå¥‡å¶é¡µåˆ†åˆ«è®¾ç½®é¡µçœ‰ã€é¡µè„šã€‚\verb|fancyhdr|~å®åŒ…ä¼šè‡ªåŠ¨æŠŠæ¯ç«&nbsp;èµ·å§‹é¡µçš„æ&nbsp;·å¼è®¾ä¸º~\verb|plain|ï¼Œè‹¥æƒ³åŽ»æŽ‰é¡µè„šä¸­é—´çš„é¡µç&nbsp;ï¼Œå¯ä»¥é‡å®šä¹‰~\verb|plain|~æ&nbsp;·å¼ã€‚

\begin{code}
\pagestyle{fancy}
\fancyhf{}                  %æ¸…ç©ºé¡µçœ‰é¡µè„š
\fancyhead[LE,RO]{\thepage} %å¶æ•°é¡µå·¦ï¼Œå¥‡æ•°é¡µå³
\fancyhead[RE]{\leftmark}   %å¶æ•°é¡µå³
\fancyhead[LO]{\rightmark}  %å¥‡æ•°é¡µå·¦
\fancypagestyle{plain}{     %é‡å®šä¹‰plainé¡µé¢æ&nbsp;·å¼
    \fancyhf{}
    \renewcommand{\headrulewidth}{0pt}
}
\end{code}

\ \\
\begin{tikzpicture}
\draw (0,0) rectangle (36,10);
\node at(2.5,9) {3.2 èŠ‚å};
\node at(35,9) {17};
\draw (.5,8)--(35.5,8);
\node at(18,5) {å¥‡æ•°é¡µ};
\end{tikzpicture}

\ \\
\begin{tikzpicture}
\draw (0,0) rectangle (36,10);
\node at(1,9) {18};
\node at(32,9) {Chapter 3 ç«&nbsp;å};
\draw (.5,8)--(35.5,8);
\node at(18,5) {å¶æ•°é¡µ};
\end{tikzpicture}

Lamportå½“åˆè®¾è®¡~\LaTeX~æ—¶æŠŠé¡µé¢å¸ƒå±€å˜é‡çš„å®šä¹‰æ–¹å¼æžå¾—æ¯”è¾ƒæ™¦æ¶©ï¼Œç”¨æˆ·åœ¨é‡å®šä¹‰~\verb|\leftmark|~å’Œ~\verb|\rightmark|~æ—¶ï¼Œä¸èƒ½ç›´æŽ¥ç”¨~\verb|\renewcommand|~çš„æ–¹æ³•ï¼Œè€Œè¦ç”¨å¦å¤–ä¸¤ä¸ªå‘½ä»¤ã€‚

\begin{code}
\markboth{main-mark}{sub-mark}
\markright{sub-mark}
\end{code}

\verb|\leftmark|~å³~main-markï¼Œæ˜¯ä¸€ç§é«˜å±‚æ¬¡æ&nbsp;‡è®°ï¼Œåœ¨~article~æ–‡æ¡£ç±»ä¸­å®ƒåŒ…å«~section~çš„ä¿¡æ¯ï¼Œåœ¨~report~å’Œ~book~åˆ™åŒ…å«~chapter~çš„ä¿¡æ¯ï¼›\verb|rightmark|~åˆ™æ˜¯ä¸€ç§ä½Žå±‚æ¬¡æ&nbsp;‡è®°ï¼Œåœ¨~article~ä¸­åŒ…å«~subsection~ä¿¡æ¯ï¼Œåœ¨~report~å’Œ~book~ä¸­åŒ…å«~section~ä¿¡æ¯ã€‚

æ¯”å¦‚åœ¨~\verb|book|~æ–‡æ¡£ç±»ä¸­ï¼Œç«&nbsp;èŠ‚æ&nbsp;‡è®°æ˜¯é€šè¿‡ä¸‹é¢çš„æ–¹æ³•å®šä¹‰çš„ï¼Œå…¶ä¸­çš„~\verb|#1|~æŒ‡çš„æ˜¯ç«&nbsp;èŠ‚çš„åå­—ã€‚

\begin{code}
\renewcommand\chaptermark[1]{\markboth{\chaptername \thechapter. 
    #1}{}}
\renewcommand\sectionmark[1]{\markright{\thesection. #1}}
\end{code}

%\section{æ¼”ç¤ºæ–‡æ¡£}

\bibliographystyle{unsrtnat}
\bibliography{reading}
\newpage
</pre></body></html>