Komascript ToC:防止多列 ToC 中的各部分之间出现列中断

Komascript ToC:防止多列 ToC 中的各部分之间出现列中断

当使用多列目录时,列中断通常发生在小节之间,这非常难看。

esdd 提供的解决方案允许多种排列,如下所示:

%Two column ToC: comment lines to get combination of v.kern and column break you want
\usepackage{multicol}
\BeforeStartingTOC[toc]{\begin{multicols}{2} }  %this keeps heading "Contents" out of two column block
%\AfterStartingTOC[toc]{\end{multicols}} %keep cols equal i.e. vertical kern
\AfterStartingTOC[toc]{\null\end{multicols}} %2nd column is shorter, no v.kern
\RedeclareSectionCommand[toconstartsamelevel={}]{subsection} %Only break Column at Section,not sub-section.

看:防止多列索引中的列中断,除非我尝试为目录执行此操作......

在此处输入图片描述

我正在尝试将目录放在第一页的底部,因此)...

\begin{table}[!b]
\rule[0.5ex]{1\columnwidth}{0.5pt}
\BeforeStartingTOC[toc]{\begin{multicols}{2}} %could be in preamble...
\AfterStartingTOC[toc]{\end{multicols}}
\tableofcontents{}
\end{table}

有没有直接的方法可以让目录浮动在页面底部(即不使用表格)?

注意:\BeforeStartingTOC 将标题“内容”置于两列部分之上,因此看起来比上面的示例更好。

平均能量损失

\documentclass[english]{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}

\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
%Two column ToC: comment lines to get combination of v.kern and column break you want
\usepackage{multicol}

\BeforeStartingTOC[toc]{\begin{multicols}{2} }  %this keeps heading "Contents" out of two column block
%\AfterStartingTOC[toc]{\end{multicols}} %keep cols equal  vertical kerns
\AfterStartingTOC[toc]{\null\end{multicols}} %2nd column is shorter, no v.kern
\RedeclareSectionCommand[toconstartsamelevel={}]{subsection} %Only break Column at Section,not sub-section.


\makeatother

 \usepackage{babel}
 \begin{document}

 \title{A Koma Article}

 \maketitle
 \tableofcontents{}

 \section{First}
 \subsection{F1}
 \subsection{F2}
 \section{Second}
 \subsection{S1}
 \subsection{S2}
 \subsection{S3}
 \subsection{S4}
 \section{Third}
 \section{Fourth}

 \end{document}

答案1

您的 MWE 结果是

在此处输入图片描述

scrartcl避免节条目与其第一个子节条目之间的中断。

我不确定你是否真的希望子节条目之间不间断。结果可能非常丑陋:

\RedeclareSectionCommand[
    toconstartsamelevel={}
]{subsection}

在此处输入图片描述

或者

\RedeclareSectionCommand[
    toconstartsamelevel={},
    tocbeforeskip=0pt
]{subsection}

在此处输入图片描述

代码:

\documentclass[english]{scrartcl}[2016/05/10]
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
%Two column ToC
\usepackage{multicol}
\BeforeStartingTOC[toc]{\begin{multicols}{2} }
\AfterStartingTOC[toc]{\end{multicols}}

\RedeclareSectionCommand[
    toconstartsamelevel={},
    tocbeforeskip=0pt
]{subsection}

 \usepackage{babel}
 \begin{document}
 \title{A Koma Article}
 \maketitle
 \tableofcontents
 \section{First}
 \subsection{F1}
 \subsection{F2}
 \section{Second}
 \subsection{S1}
 \subsection{S2}
 \subsection{S3}
 \subsection{S4}
 \section{Third}
 \section{Fourth}
 \end{document}

或者

在此处输入图片描述

代码:

\documentclass[english]{scrartcl}[2016/05/10]
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
%Two column ToC
\usepackage{multicol}
\BeforeStartingTOC[toc]{\begin{multicols}{2} }
\AfterStartingTOC[toc]{\null\end{multicols}}

\RedeclareSectionCommand[
    toconstartsamelevel={},
]{subsection}

 \usepackage{babel}
 \begin{document}
 \title{A Koma Article}
 \maketitle
 \tableofcontents
 \section{First}
 \subsection{F1}
 \subsection{F2}
 \section{Second}
 \subsection{S1}
 \subsection{S2}
 \subsection{S3}
 \subsection{S4}
 \section{Third}
 \section{Fourth}
 \end{document}

相关内容