这是我的问题的最小示例:
\documentclass[twocolumn]{book}
\begin{document}
\chapter{Test}
This is a paragraph of text, which is hopefully long enough for the text to wrap on the next line and thus show the paragraph indent problem.
\end{document}
当我编译它时,它会缩进之后的段落,而每个、等\chapter
之后的第一个段落都没有正确地缩进。\section
\subsection
在这种情况下,如何才能禁用缩进,而不必\noindent
每次都手动书写?我尝试过这个noindentafter
包,但无济于事。
编辑:以下 David Carlisle 的回答对于最小的例子很有效,但是与 xcolor 包不符:
\documentclass[twocolumn]{book}
\usepackage[table]{xcolor}
\makeatletter
\let\zzchapterhead\@makechapterhead
\def\@makechapterhead#1{\zzchapterhead{#1}\aftergroup\@afterheading}
\makeatother
\begin{document}
\chapter{Test}
This is a paragraph of text, which is hopefully long enough for the text to wrap on the next line and thus show the paragraph indent problem.
\end{document}
编辑2:我使用 xcolor 修复了这个问题,通过将一次调用替换为\aftergroup
七次调用:
\makeatletter
\let\zzchapterhead\@makechapterhead
\def\@makechapterhead#1{\zzchapterhead{#1}\aftergroup\aftergroup\aftergroup\aftergroup\aftergroup\aftergroup\aftergroup\@afterheading}
\makeatother
答案1
我认为这是一个错误,尽管我怀疑经过这么长时间我们是否能够改变它。
\documentclass[twocolumn]{book}
\makeatletter
\let\zzchapterhead\@makechapterhead
\def\@makechapterhead#1{\zzchapterhead{#1}\aftergroup\@afterheading}
\makeatletter
\begin{document}
\chapter{Test}
This is a paragraph of text, which is hopefully long enough for the text to wrap on the next line and thus show the paragraph indent problem.
\end{document}