0

With the memoir package, I can set up the section heading to have a blank line before with the command \setbeforesecskip{-1\onelineskip}. But how do I set it up to have no blank line after the section heading? I can use the command \setaftersecskip{.0001ex} to kind of get the right result.

Example:

\documentclass[12pt]{memoir}
\usepackage{lipsum}
\setbeforesecskip{-1\onelineskip}%set a blank line before section heading.
\setaftersecskip{ .0001ex}%"kind of" set no blank line after section heading.

\begin{document}
\lipsum[1]
\section{Section}
\lipsum[2]
\end{document}
8
  • Your question countering it self. You both want a blank line below the heading and not a blank line below the heading? What exactly do you want? – daleif Oct 2 '17 at 20:52
  • 1
    In addition, as always on this site: it us much much easier to help if you provide a full but minimal example – daleif Oct 2 '17 at 20:54
  • @daleif I thought the question is clear enough as is. I want a blank line above the heading, and no blank line below the heading. – dietz Oct 3 '17 at 4:18
  • 1
    Then use 1sp below. It just have to be explicitly larger than zero – daleif Oct 3 '17 at 4:41
  • Ok, thanks. What confused me was that this would seem to not place the following line exactly one line under the heading. I guess I don't quite understand the logic behind this, although I've been doing this intuitively. – dietz Oct 3 '17 at 4:56
2

Use 1sp as the space below. It just has to be strictly larger than zero. 1sp is super small.

For fun, here is a demo of where the baselines are (the tikz part needs a few compilations)

\documentclass[12pt,a4paper]{memoir}
\usepackage{lipsum}
\setbeforesecskip{-1\onelineskip}
\setaftersecskip{1sp}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\lipsum[1]
\section{Section}
\lipsum[2]

\begin{tikzpicture}[remember picture,overlay,opacity=0.5]
  \draw[red] ($(current page.west)+(0,2)$) coordinate (A) -- ++(10,0);
  \draw[red] ($(A)+(0,\onelineskip)$) coordinate (A) -- ++(10,0);
  \draw[red] ($(A)+(0,\onelineskip)$) coordinate (A) -- ++(10,0);
\end{tikzpicture}
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.