我发现这种重新定义目录对于我两栏书中的超长目录非常有用。使用链接中命令的稍微修改版本,我得到了我想要的:
\makeatletter
\renewcommand\tableofcontents{%
\section*{\huge\contentsname
\@mkboth{%
\MakeUppercase\contentsname}{\MakeUppercase\contentsname}}
\@starttoc{toc}%
}
\makeatother
问题是我不知道如何对listoffigures
和做同样的事情listoftables
。有人知道怎么做吗?
我猜测了一下什么方法可以完成这项工作(如下),但那肯定行不通。如果有人能给我提供文档,那我也将不胜感激。我知道如何摆脱任何不必要的分页符;这不是问题。
\makeatletter
\renewcommand\listoffigures{%
\section*{\huge\contentsname
\@mkboth{%
\MakeUppercase\contentsname}{\MakeUppercase\contentsname}}
\@startlof{lof}%
}
\makeatother
一个最小的工作示例:
\documentclass[9pt,openany,twocolumn]{book}
\makeatletter
\renewcommand\tableofcontents{%
\section*{\huge\contentsname
\@mkboth{%
\MakeUppercase\contentsname}{\MakeUppercase\contentsname}}
\@starttoc{toc}%
}
\makeatother
\begin{document}
\let\cleardoublepage\relax
\frontmatter
\begingroup
\let\clearpage\relax
\tableofcontents
\listoffigures
\endgroup
\mainmatter
\chapter{Armadillo}
\section{Grubs}
\begin{figure}
\caption{Pink Fairy armadillo}
\label{fig1}
\end{figure}
\chapter{Beetle}
\section{Leaves}
\begin{figure}
\caption{Dung beetle}
\label{fig2}
\end{figure}
\chapter{Cat}
\section{Birds}
\begin{figure}
\caption{Siamese cat}
\label{fig3}
\end{figure}
I think I'm hungry??
\end{document}
答案1
正如评论中所述,您必须分别使用\listfigurename
和\listtablename
表示 LoF 和 LoT。
\@starttoc
在每种情况下生成它们的命令也是:
\makeatletter
\renewcommand\tableofcontents{%
\section*{\huge\contentsname
\@mkboth{%
\MakeUppercase\contentsname}{\MakeUppercase\contentsname}}
\@starttoc{toc}%
}
\renewcommand\listoffigures{%
\section*{\huge\listfigurename
\@mkboth{%
\MakeUppercase\listfigurename}{\MakeUppercase\listfigurename}}
\@starttoc{lof}%
}
\renewcommand\listoftables{%
\section*{\huge\listtablename
\@mkboth{%
\MakeUppercase\listtablename}{\MakeUppercase\listtablename}}
\@starttoc{lot}%
}
\makeatother
MWE(9pt
不是有效选项,最小值为 10):
\documentclass[openany,twocolumn]{book}
\makeatletter
\renewcommand\tableofcontents{%
\section*{\huge\contentsname
\@mkboth{%
\MakeUppercase\contentsname}{\MakeUppercase\contentsname}}
\@starttoc{toc}%
}
\renewcommand\listoffigures{%
\section*{\huge\listfigurename
\@mkboth{%
\MakeUppercase\listfigurename}{\MakeUppercase\listfigurename}}
\@starttoc{lof}%
}
\renewcommand\listoftables{%
\section*{\huge\listtablename
\@mkboth{%
\MakeUppercase\listtablename}{\MakeUppercase\listtablename}}
\@starttoc{lot}%
}
\makeatother
\begin{document}
\let\cleardoublepage\relax
\frontmatter
\begingroup
\let\clearpage\relax
\tableofcontents
\listoffigures
\endgroup
\mainmatter
\chapter{Armadillo}
\section{Grubs}
\begin{figure}
\caption{Pink Fairy armadillo}
\label{fig1}
\end{figure}
\chapter{Beetle}
\section{Leaves}
\begin{figure}
\caption{Dung beetle}
\label{fig2}
\end{figure}
\chapter{Cat}
\section{Birds}
\begin{figure}
\caption{Siamese cat}
\label{fig3}
\end{figure}
I think I'm hungry??
\end{document}