到目前为止,我还不太清楚如何格式化目录,我使用的包是:
\documentclass[12pt,spanish,utf8,latin1]{report}
\usepackage{geometry}
\geometry{ansiapaper,left=1in,right=0.5in,top=0.5in,bottom=0.5in,footskip=.25in}
\usepackage{setspace}
\usepackage{parskip}
\setlength{\parskip}{0.2cm}
\setlength{\parindent}{0pt}
\usepackage{makeidx}
\usepackage{imakeidx}
\usepackage{tocloft}
\usepackage{tocbibind} %Includes "Bibliography" in the table of contents
\usepackage[toc,lof,lot]{multitoc} %Hacer la table of contents list of figures y list of tables en 2 columnas
\usepackage[toc, acronym, nonumberlist]{glossaries}
\usepackage{titlesec}
\titleformat{\chapter}[hang]{\huge\bfseries}{\thechapter\hsp{|}\hsp}{0pt}{\Huge\bfseries}
\titlespacing*{\chapter}{0pt}{-30pt}{40pt}
\makeatletter
\patchcmd{\chapter}{\if@openright\cleardoublepage\else\clearpage\fi}{}{}{}
\renewenvironment{theindex}
{\section*{\indexname}%
\@mkboth{\MakeUppercase\indexname}%
{\MakeUppercase\indexname}%
\thispagestyle{plain}\parindent\z@
\parskip\z@ \@plus .3\p@\relax
\columnseprule \z@
\columnsep 35\p@
\let\item\@idxitem}
{}
\makeatother
\addtocontents{toc}{\vskip -1.2cm}
\addtocontents{lof}{\vskip -1.2cm}
\begin{document}
\newgeometry{margin=1cm}
\vspace{-1cm}
\tableofcontents
\vspace{-1cm}
\listoftables
\vspace{-1cm}
\listoffigures
\restoregeometry
\newpage
\end{document}
然而,这似乎不起作用,由于文档的空间限制,我只是希望一切都尽可能紧凑。
答案1
为了照顾到 toc、lof 和 lot 标题前后的垂直空间,该包\titlesec
已足够。
请注意,各章节将采用相同的风格。
\documentclass[12pt]{report}
\usepackage{kantlipsum}% dummy text
\usepackage[utf8]{inputenc}
\usepackage[spanish]{babel}
\usepackage{geometry}
\geometry{ansiapaper,left=1in,right=0.5in,top=0.5in,bottom=0.5in,footskip=.25in}
\usepackage{setspace}
\usepackage{parskip}
\setlength{\parskip}{0.2cm}
\setlength{\parindent}{0pt}
\usepackage{makeidx}
\usepackage{imakeidx}
%%\usepackage{tocloft}% not used
\usepackage{tocbibind} %Includes "Bibliography" in the table of contents
\usepackage[toc,lof,lot]{multitoc} %Hacer la table of contents list of figures y list of tables en 2 columnas
\usepackage[toc, acronym, nonumberlist]{glossaries}
\usepackage{titlesec}
\titleformat{\chapter}[hang]{\huge\bfseries}{\chaptername\ \thechapter}{30pt}{} % changed
\titlespacing*{\chapter} % changed needs \titleformat{\chapter}
{0pt} %left
{0pt} % before separation
{0pt} % after separation
\makeatletter
\patchcmd{\chapter}{\if@openright\cleardoublepage\else\clearpage\fi}{}{}{}
\renewenvironment{theindex}
{\section*{\indexname}%
\@mkboth{\MakeUppercase\indexname}%
{\MakeUppercase\indexname}%
\thispagestyle{plain}\parindent\z@
\parskip\z@ \@plus .3\p@\relax
\columnseprule \z@
\columnsep 35\p@
\let\item\@idxitem}
{}
\makeatother
\begin{document}
\tableofcontents
\renewcommand{\listtablename}{Índice de Tablas}
\listoftables
\listoffigures
\newpage
\chapter{One}
1. \kant[1]
\newpage
\chapter{Two}
2. \kant[2]
\end{document}