# Place chapter heading in margin

I'm using the memoir class.

I would like the \chapter{xxx} command to place the chapter heading in the margin instead of above the text. Like this:

This question is somewhat similar, but in that question the person wanted the chapter title in the margin of every page. My request is simpler (I hope). I want the chapter title in the margin of the first page instead of above the text.

Do I need to use a similar complex mechanism, or is there a simpler way to achieve what I want?

• Will a new chapter always begin at the top of a page? Another way of asking this is "what document class are you intending to use?" – Steven B. Segletes Jun 18 '14 at 13:47
• Yes, a chapter always starts a new page. (The default for the memoir class, I believe.) – oz1cz Jun 18 '14 at 13:48
• Will the title always be short? From your example, it does not take much before it runs out of space. – daleif Jun 18 '14 at 13:58
• @daleif, In my case, there will always be room for the title on a single (vertical) line. – oz1cz Jun 18 '14 at 14:00
• is the width of the text block the same on all pages, or is it narrowed for the first page of a chapter to accommodate the title? – barbara beeton Jun 18 '14 at 14:16

Here is something that might be used as a building block so see it as a proof of concept.

\documentclass[a4paper]{memoir}
\usepackage{kantlipsum,graphicx}

% picture syntax with std units
\usepackage{picture,calc,xcolor}

\usepackage{eso-pic}

\makeatletter

\makechapterstyle{hmm}{%
\renewcommand\printchaptername{}
\renewcommand\printchapternum{}
\renewcommand\afterchapternum{}
\renewcommand\printchapternonum{}
\renewcommand\chaptitlefont{\normalfont\Large\bfseries\sffamily}
\renewcommand\printchaptertitle[1]{%
\begingroup%
\put(\paperwidth-\foremargin+15mm,
\paperheight-\textheight-\uppermargin
){\rotatebox{90}{\parbox[t]{\textheight}{%
\makebox[\textheight-\topsep][l]{\hfill
\chaptitlefont
\@chapapp~\thechapter\ --
##1}
}%
}%
}%
}%
\endgroup%
}
\renewcommand\afterchaptertitle{}
}
\chapterstyle{hmm}
\makeatother

\begin{document}

\chapter{Lorem Ipsum}

\kant

\end{document}

• That looks very promising, @daleif. I can probably get this to work with my document. (I'll just wait a few hours before I acknowledge this as an answer.) – oz1cz Jun 18 '14 at 14:37
• I successfully got this to work with my document. Wonderful. Thank you very much. – oz1cz Jun 18 '14 at 15:43