Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question

2 Answers 2

up vote 4 down vote accepted

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
share|improve this answer

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.

share|improve this answer
    
Pardon? I don't really understand you :-) –  Daniel Mar 2 '11 at 21:27
    
I maintain the memoir class –  daleif Mar 2 '11 at 21:28
    
how does one remove a comment? –  daleif Mar 2 '11 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 '11 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 '11 at 23:54

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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