我正在写论文,我希望 ToC、LoF、LoT、首字母缩略词和符号这些元素具有相同的布局。对于首字母缩略词和符号,我希望使用可以acro
灵活地定义不同列表类型的包。
我可以定义一个列表,在其中acro
设置行与行之间的距离和其他内容。但我不知道如何为 ToC、LoF、LoT 做到这一点。此外,我可能有机会使用leaders
(点)或避免使用它们,但有页码。
我的 MWE 如下:
\documentclass[oneside]{book}
\usepackage{acro}
\usepackage{mfirstuc}% provides \makefirstuc
\usepackage{enumitem}
\newlist{acronyms}{description}{1}
\setlist[acronyms]{labelwidth = 4em, leftmargin = 4.5em, noitemsep, itemindent = 0pt}
\acsetup{%
index = false,
list-long-format = \makefirstuc,
list-type = acronyms,
hyperref = true,
extra-style = comma,
page-ref = comma,
}
\DeclareAcronym{TV}
{%
short={TV},
long={Television},
short-plural={},
long-plural={},
class={general},
short-format=\scshape,
index={TV}
}
\begin{document}
\tableofcontents
\listoftables
\listoffigures
\printacronyms[heading=chapter*]
\chapter{AAAA}
\section{CCC}
\ac{TV}
\chapter{AAAA}
\begin{figure}
\caption{Figure test}
\label{fig:test}
\end{figure}
\begin{table}
\caption{Table test}
\label{tab:test}
\end{table}
\end{document}
答案1
acro
现在(自 2015/09/05 起)具有 list-styletoc
和 list-style 。使用带有类和以下设置的lof
示例:book
acro
\acsetup{
list-long-format = \makefirstuc ,
list-style = lof ,
list-heading = chapter* ,
extra-style = comma
}
图片列表:
缩写列表如下:
\documentclass[oneside]{book}
\usepackage{acro}
\usepackage{mfirstuc}% provides \makefirstuc
\acsetup{
index = false,
list-long-format = \makefirstuc ,
list-style = lof ,
list-heading = chapter* ,
extra-style = comma
}
\DeclareAcronym{TV}{
short = TV ,
long = Television ,
short-plural = ,
long-plural = ,
class = general ,
short-format = \scshape ,
index = TV
}
\begin{document}
\tableofcontents
\listoftables
\listoffigures
\printacronyms
\chapter{AAAA}
\section{CCC}
\ac{TV}
\chapter{AAAA}
\begin{figure}
\caption{Figure test}
\label{fig:test}
\end{figure}
\begin{table}
\caption{Table test}
\label{tab:test}
\end{table}
\end{document}
答案2
ToC、LoF、LoT 和 LoA 的一致接口:
\documentclass[10pt,oneside]{book}
\usepackage[a4paper]{geometry}
\usepackage[titles]{tocloft} % this package styles ToC, LoT and LoF (this
% package is necessary)
\usepackage{longtable} % to use longtable in acro (necessary package)
\usepackage[T1]{fontenc} % T1 encoding
\usepackage{lmodern} % using Latin Modern font
%========= Customizing ToC
% increasing right margin which makes width available for titles smaller
% hence grater the value smaller the title width
\cftsetrmarg{3cm}
% Removing leaders from all ToC, LoF and LoT to make these consistent with
% List of Acronyms because it doesn't support such design
\renewcommand{\cftpartdotsep}{\cftnodots}
\renewcommand{\cftchapdotsep}{\cftnodots} % if a class article or similar to
% article is used remove this command or it will produce an error
\renewcommand{\cftsecdotsep}{\cftnodots}
\renewcommand{\cftsubsecdotsep}{\cftnodots}
\renewcommand{\cftsubsubsecdotsep}{\cftnodots}
\renewcommand{\cftparadotsep}{\cftnodots}
\renewcommand{\cftsubparadotsep}{\cftnodots}
\renewcommand{\cftfigdotsep}{\cftnodots}
%\renewcommand{\cftsubfigdotsep}{\cftnodots} % if sub figures are used then
% uncomment this command
\renewcommand{\cfttabdotsep}{\cftnodots}
%\renewcommand{\cftsubtabdotsep}{\cftnodots} % if sub tables are used then
% uncomment this command
\usepackage[messages=silent,only-used=true,sort=false]{acro} % To use acronyms
\DeclareAcronym{cd}{
short = CD,
long = Compact Disc
}
\DeclareAcronym{ny}{
short = NY ,
short-plural = ,
long = New York ,
long-plural =
}
\DeclareAcronym{sw}{
short = SW ,
long = Sammelwerk ,
long-plural = e
}
\DeclareAcronym{MP}{
short = MP ,
long = Member of Parliament ,
long-plural-form = Members of Parliament
}
\DeclareAcronym{unesco}{
short = UNESCO,
long = {United Nations Educational, Scientific and Cultural Organization}
}
\begin{document}
\tableofcontents
\clearpage
\listoffigures
\clearpage
\listoftables
\clearpage
\acsetup{
page-ref=plain,
page-name={\@ },
pages-name={\@\,},
list-name={List of Acronyms}, % List name
list-heading=chapter*, % formatting of heading
list-type=table, % list-style, this enables the following option
list-style=extra-longtable-rev, % style of list used don't change
list-table-width=0.7\linewidth % width of second + third column in list
}
\printacronyms
\clearpage
\part{Part One}
\chapter{A very very very very very very very very very very very very very very very very very long chapter title}
\section{Section 1}
\subsection{Subection A}
\subsection{Subection B}
\subsection{Subection C}
\begin{figure*}[h!]
\caption{Figure caption 1}
\end{figure*}
\section{Section 1}
\subsection{Subection A}
\subsection{Subection B}
\begin{figure}[h!]
\caption{Figure caption}
\end{figure}
\subsection{Subection C}
\section{Section 1}
\subsection{Subection A}
\begin{figure}[h!]
\caption{Figure caption}
\end{figure}
\subsection{Subection B}
\subsection{Subection C}
\begin{table}[h!]
\caption{Table Caption}
\end{table}
\ac{cd}
\ac{sw}
\ac{ny}
\ac{MP}
\ac{unesco}
\clearpage
\ac{cd}
\ac{sw}
\ac{ny}
\ac{MP}
\ac{unesco}
\clearpage
\ac{cd}
\ac{sw}
\ac{ny}
\ac{MP}
\ac{unesco}
\clearpage
\ac{cd}
\ac{sw}
\ac{ny}
\ac{MP}
\ac{unesco}
\clearpage
\ac{cd}
\ac{sw}
\ac{ny}
\ac{MP}
\ac{unesco}
\part{Appendix}
% Use starred version of chapters, section etc which do not appear in table of contents
\chapter*{A}
\chapter*{B}
\part{Index}
\end{document}