在双列模式下书写时,\chapter 也排版为两列

在双列模式下书写时,\chapter 也排版为两列

我用

\documentclass[twocolumn]{scrreprt}

它产生了一个漂亮的布局,但是每一章都设置为单列模式,从而导致每一章都有一个新页面。我怎样才能告诉 Latex 在双列模式下设置章节。

最小示例:

\documentclass[twocolumn]{scrreprt}
\begin{document}
\chapter{Long one column chapter text which spans whole page}
\section{Section 1 in two column mode which breaks at some point}
\chapter{Long one column chapter text which spans whole page}
\section{Section 2 in two column mode which breaks at some point}
\end{document}

答案1

您可以使用该multicol包创建两列。然后它们也适用于章节标题。据我所知,在multicols如下所示的环境中包装整个文档是可以的,但我以前从未在更大的文档中使用过它。

\documentclass{scrreprt}
\usepackage{multicol}
\begin{document}
\begin{multicols}{2}
\chapter{Long one column chapter text which spans whole page}
\section{Section 1 in two column mode which breaks at some point}
\chapter{Long one column chapter text which spans whole page}
\section{Section 2 in two column mode which breaks at some point}
\end{multicols}
\end{document}

为了避免在每一章都出现分页符,您仍然需要在本地设置\clearpage(也可能是\cleardoublepage\relax如下所示。不过,我只需使用文章类别改为类似scrartcl。然后您将获得基本相同的格式,但以\section作为主级标题。

\documentclass{scrreprt}
\usepackage{multicol}
\usepackage{lipsum}% for dummy text only
\begin{document}
\begin{multicols}{2}

{\let\clearpage\relax
\chapter{Long one column chapter text which spans whole page}}
\section{Section 1 in two column mode which breaks at some point}
\lipsum

{\let\clearpage\relax
\chapter{Long one column chapter text which spans whole page}}
\section{Section 2 in two column mode which breaks at some point}
\lipsum

\end{multicols}
\end{document}

结果

答案2

\documentclass[twocolumn]{scrreprt}
\makeatletter
\renewcommand\chapter{\global\@topnum\z@
                    \@afterindentfalse
                    \secdef\@chapter\@schapter}
\def\@topnewpage[#1]{#1}
\makeatother
\begin{document}
\chapter{Long one column chapter text which spans whole page}
\section{Section 1 in two column mode which breaks at some point}
\chapter{Long one column chapter text which spans whole page}
\section{Section 2 in two column mode which breaks at some point}
\end{document}

在此处输入图片描述

相关内容