This is a follow-up to First paragraph indented after section title in margin, but I'm unable to vote, comment, or accept answers there because it's made under a guest account and not linked to this account.

Putting section titles in the outer margin when using the memoir class causes a tiny indent for the first paragraph, even with paragraph indent turned off and skipping lines between paragraphs turned on. Gonzalo Medina's answer (change \setaftersecskip to 1sp) fixes that problem, even without the negative indent trick, but it introduces another problem: the section titles no longer line up consistently with the first paragraph of the section. Sometimes the top of the title aligns with the top of the paragraph, sometimes the bottom lines up with the baseline of the first line of the paragraph, and sometimes it is between two paragraphs. Also, it looks like sometimes the line separating paragraphs is too narrow (not a full line height.)

Gonzalo also changed \marginpar in my example to \marginnotes and added that package to the preamble. That seems to fix the first part of the problem, but the line spacing between section/subsection changes still seems off. Is there another way to fix this?

(I don't have a way to edit questions/answers yet, but if someone could merge this question with the other question, that would be fine.)


\semiisopage%  a default margin layouts

% fix margin notes


%% No numbered sections


%% Section Names in margin

  \marginpar{\bfseries\centering #1}}

%% set section, subsection and subsubsection headers
%% all the same, small bold text



% etc.

%% Paragraph styles
%% no indent, skip line instead




\section{First Section}
\subsection{First Subsection}
\section{Second Section}


1 Answer 1


In my actual project, which is much longer than the MWE, the alignment issue was even worse, plus some of the section titles were getting put in the wrong margin and cut off by the page edge. But I seem to have found a solution, based on this other question, How to keep heading together with text.

What I did was I used both Gonsalo Medina's solution, including the \marginnote substitution, and \needspace, like this:

  \needspace{4em}\marginnote{\bfseries\centering #1}}


Etc., for subsection and subsubsection definitions. I had to test a couple values for \needspace before I found one that put the titles in the margin without mangling one or two.

Side Note: I also discovered that the solution didn't work when using \input for modular documents unless the section title is in the same file as the first paragraph in the section. So, I can have:

\section{Title One}
First paragraph goes here.


Or, I suppose, put the \section in module1.tex with the first paragraph, but separating them caused the title to be mangled if it was the first thing on a page.

You must log in to answer this question.

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