LaTeX技巧79:titletoc定制自己的目录样式示例
2009-11-19 14:45阅读:
QQ群:91940767/145316219/141877998/80300084/194770436
淘宝店:http://latexstudio.taobao.com
技巧续篇:http://latexstudio.net/
常见数学公式问题集下载
示例一:
\documentclass{article}
\usepackage{times}
\pag
estyle{empty}
\setcounter{page}{6}
\setlength\textwidth{135.0pt}
\usepackage{titletoc}
\titlecontents{section}[0pt]{\addvspace{2pt}\filright}
{\contentspush{\thecontentslabel\ }}
{}{\titlerule*[8pt]{.}\contentspage}
\begin{document}
\contentsline{section}{umberline{12.8}Some section that
is wrapped in the
TOC}{87}
\contentsline{section}{umberline{12.9}Another section}{88}
\contentsline{section}{umberline{12.10}And yet another
wrapping
section}{90}
\contentsline{section}{umberline{12.11}Final
section}{92}
\end{document}
效果图:
示例二:
\documentclass{article}
\pagestyle{empty}
\setcounter{page}{6}
\setlength\textwidth{135.0pt}
\makeatletter
\renewcommand\l@subsection{\@dottedtocline{2}{1.5em}{3em}}
\makeatother
\begin{document}
\contentsline{section}{umberline{10}A-Head}{3}
\contentsline{subsection}{umberline{10.9}B-Head}{4}
\contentsline{subsection}{umberline{10.10}B-Head}{4}
\end{document}
效果图:
示例三:
\documentclass{ttctexa}
\pagestyle{empty}
\setcounter{page}{6}
\setlength\textwidth{207.0pt}
\setlength\textheight{17\baselineskip}
% For the book examples we shorten the vertical spaces
% and make the headings smaller:
\makeatletter
\renewcommand\section{\@startsection
{section}{1}{\z@}%
{-2.5ex \@plus -1ex
\@minus -.2ex}%
{1.3ex}%
{ormalfont\large\bfseries}}
\makeatother
\setcounter{page}{1}
\makeatletter
\renewcommand\ext@table{lof}
\makeatother
\renewcommand\listfigurename
{Figures and Tables}
\begin{document}
\listoffigures
\section{A Section}
Some text \ldots
\begin{table}[b]
\centering
\fbox{\scriptsize A table}
\caption{Table-Caption}
\end{table}
Some text referencing
figure~\ref{fig} \ldots
\begin{figure}
\centering
\fbox{\scriptsize A figure}
\caption{Figure-Caption}\label{fig}
\end{figure}
\end{document}
效果图:
