4

I am trying to make a subsection heading with the memoir class. The problem is the following:

I want to have a displayed heading for my subsubsection. The text should begin right after the subsubsec heading as a new line, and NOT as a new paragraph.

Memoir sets as a vertikal space after the headings the lenghts afterskip + \parskip(of heading font) + \baselineskip(of text font). To solve the problem, it would be plausible to set afterskip to -parskip. But, if afterskip becomes a negative value, the heading will turn into a run-in style.

I made my tests with the following minimal example:

\documentclass[11pt]{memoir}
\parskip9pt
\parindent0pt

\setcounter{secnumdepth}{2}
\setbeforesubsubsecskip{9pt}
\setaftersubsubsecskip{1pt}

\setsubsubsecheadstyle{\scshape}
\begin{document}

\subsubsection{lorem ipsum}
lorem ipsum

lorem ipsum 
\end{document}

I used before the titlesec package, and it was excelent, till I not tried to use \titleref... This \titleref doesn't work with this package only for the chapters. If I dont't use titlesec, the references for sections working also good.

2 Answers 2

4

Here is a temp fix

\makeatletter
\renewcommand{\@startsection}[6]{%
  \@nameuse{#1block}%
  \ifraggedbottomsection\if@nobreak\else
    \vskip\z@\@plus\bottomsectionskip
    \penalty\z@
    \vskip\z@\@plus -\bottomsectionskip
  \fi\fi
  \def\m@msecn@me{#1}%
  \if@noskipsec \leavevmode \fi
  \par
  \@tempskipa #4\relax
  \@afterindenttrue
  \ifdim \@tempskipa <\z@
    \@tempskipa -\@tempskipa \@afterindentfalse
  \fi
  \if@nobreak
    \everypar{}%
  \else
    \addpenalty\@secpenalty%
    \addvspace\@tempskipa
    \addvspace{-\parskip}% <--- added
  \fi
  \@ifstar
    {\@ssect{#3}{#4}{#5}{#6}}%
    {\@trplargoom{\M@sect{#1}{#2}{#3}{#4}{#5}{#6}}}}

\def\@xsect#1{%
  \@tempskipa #1\relax
  \ifdim \@tempskipa>\z@
  \par
  \nobreak
  \vskip \@tempskipa
  \vskip-\parskip% <--- added
  \@afterheading
  \else
  \@nobreakfalse
  \global\@noskipsectrue
  \everypar{%
    \if@noskipsec
     \global\@noskipsecfalse
     {\setbox\z@\lastbox}%
     \clubpenalty\@M
     \begingroup \@svsechd \endgroup
     \unskip
     \@tempskipa #1\relax
     \hskip -\@tempskipa
     \else
    \clubpenalty \@clubpenalty
    \everypar{}%
     \fi}%
   \fi
  \ignorespaces}
\makeatother
2

I've just removed the \parskip influence on the chapter spacings, might be an idea to also introduce this inside sectional constructions

One reason why this has not already been done is that for the most part, documents with no parindent and non-zero parskip are not particularly good for communication, especially if the document has many lists or displayed math.

9
  • Pardon? I don't really understand you :-)
    – Daniel
    Mar 2, 2011 at 21:27
  • I maintain the memoir class
    – daleif
    Mar 2, 2011 at 21:28
  • how does one remove a comment?
    – daleif
    Mar 2, 2011 at 21:28
  • So you will make in the next time an update without parksip influence? If yes, when do you want to do it?
    – Daniel
    Mar 2, 2011 at 21:32
  • 2
    @daleif Welcome to tex.sx! It's good to see some more c.t.t. people here as well.
    – Alan Munn
    Mar 2, 2011 at 23:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .