[Tex/LaTex] How to put section numbers and titles in margin

memoir

I have an example image here from Modern Physics textbook. I also like the chapter styles (I am thinking I could do them with the memoir document class, but that is for later). Right now, I am trying to figure out how to make the section numbers and titles show up in the margin of the chapter title pages. Also, does anyone think this could work in the book documentclass instead of memoir?

Best Answer

Having just recently worked on this question, Justify chapterstyle (Number) to the left, I took the OP's MWE from there as a starting point, and changed the width of this invocation, \makebox[3.2cm][r]{\usebox\feline@chapter} from 0pt to 3.2cm that you see here, which moved the red chapter number box to the right by that amount.

Then I created a \marginpar with a \parbox in it containing an enumerate list with the help of the enumitem package. It comes under the name \addtoc{} to which the \items of the enumeration are provided. Indeed, I had to manually insert the toc components, rather than use something automated like a minitoc, but the OP seemed OK with that in his comment.

\documentclass[11pt, a4paper, oneside]{memoir}
\usepackage{color,calc,graphicx,soul,fourier}
\definecolor{wine}{rgb}{.5,0,0}
\makeatletter
\newlength\dlf@normtxtw
\setlength\dlf@normtxtw{\textwidth}
\def\myhelvetfont{\def\sfdefault{mdput}}
\newsavebox{\feline@chapter}
\newcommand\feline@chapter@marker[1][4cm]{%
\sbox\feline@chapter{%
\resizebox{!}{#1}{\fboxsep=1pt%
  \colorbox{wine}{\color{white}\bfseries\thechapter}%
}}%
\rotatebox{90}{%
\resizebox{%
  \heightof{\usebox{\feline@chapter}}+\depthof{\usebox{\feline@chapter}}}%
{!}{\scshape\so\@chapapp}}\quad%
\raisebox{\depthof{\usebox{\feline@chapter}}}{\usebox{\feline@chapter}}%
 }
\newcommand\feline@chm[1][4cm]{%
\sbox\feline@chapter{\feline@chapter@marker[#1]}%
\makebox[0pt][l]{% 
\makebox[3.2cm][r]{\usebox\feline@chapter}%
}}
\makechapterstyle{daleif1}{
\renewcommand\chapnamefont{\normalfont\Large\scshape\raggedleft\so}
\renewcommand\chapternamenum{}
\renewcommand\printchaptername{}
\renewcommand\printchapternum{\null\hfill\feline@chm[2.5cm]\par}
\renewcommand\afterchapternum{\par\vskip\midchapskip}
\renewcommand\printchaptertitle[1]{\chaptitlefont ##1\par}
}
\makeatother
\chapterstyle{daleif1}

\usepackage{blindtext}

\newcommand\addtoc[1]{%
  \leavevmode\marginpar{%
    \parbox[t]{3.5cm}{\raggedright\footnotesize\sffamily%
    \vspace{-7pt}%
      \begin{enumerate}[leftmargin=.65cm, topsep=0pt, partopsep=0pt, 
            label=\textcolor{blue}{\thechapter-\arabic*}, nosep]%
        #1
      \end{enumerate}%
    }%
  }%
}

\usepackage{enumitem}
\begin{document}
\chapter{First Chapter}
\addtoc{
\item Newton's Laws
\item Work, Energy, and the Conservation of Energy
\item Rotations and the Center of Mass
\item Elastic Media and Waves
\item Thermal Phenomena
\item The Atomic Structure of Matter
\item Electricity and Magnetism
\item Electromagnetic Waves and Light
}
\blindtext

\blindtext
\end{document}

enter image description here

Related Question