章节标题正好位于以下段落上方

章节标题正好位于以下段落上方

我试图将章节标题放在下一段上方的行上。通过重新定义上方和下方的空间,我得到了两个截然不同的不良结果:

1:额外的空间将底线推到下一列

列底部有空行

2:标题与段落连接

标题与段落连接

\documentclass[landscape,a6paper,twocolumn,14pt]{memoir}
\usepackage{lipsum}

\setbeforesecskip% only applies when section is not starting the page
    {-0.99999\baselineskip}% outcome 1
    %{-1.00000\baselineskip}% outcome 2
\setaftersecskip%
    {0.00001\baselineskip}% outcome 1
    %{0.00000\baselineskip}% outcome 2
\makeatletter
    \setsecheadstyle{%
        \fontsize{\f@size pt}%
        {0.99999\baselineskip}% outcome 1
        %{1.00000\baselineskip}% outcome 2
        \bfseries%
    }
\makeatother

\pagestyle{empty}
\counterwithout{section}{chapter}
\setlength{\textheight}{10\baselineskip}
\setlength{\textwidth}{\dimexpr\paperwidth-2\columnsep}
\setlrmargins{*}{*}{1}
\setulmargins{*}{*}{1}
\checkandfixthelayout

\begin{document}
\section{Lorem ipsum}
\lipsum[1-5]
\end{document}

设置\aftersecskip1\baselineskip会在 之间留出一整行空白,而设置\secheadstyle行高似乎没有效果。\textheight甚至增加0.99999\baselineskip似乎也没有效果。有没有办法在某处偷偷插入某种\par/ \vspace/ \skip

答案1

您可以尝试添加一些收缩因素:

\documentclass[landscape,a6paper,twocolumn,14pt]{memoir}
\usepackage{lipsum}

\setbeforesecskip% only applies when section is not starting the page
    {-1.00000\baselineskip}% 
\setaftersecskip%
    {1sp minus 1sp}% 
\makeatletter
    \setsecheadstyle{%
        \normalsize
        \bfseries%
    }
\makeatother

\pagestyle{empty}
\counterwithout{section}{chapter}
\setlength{\textheight}{10\baselineskip} 
\setlength{\textwidth}{\dimexpr\paperwidth-2\columnsep}
\setlrmargins{*}{*}{1}
\setulmargins{*}{*}{1}
\checkandfixthelayout
\begin{document}
\section{Lorem ipsum}
\lipsum[1-5]
\end{document}

在此处输入图片描述

相关内容