[Tex/LaTex] Memoir Class, Madsen Style, Chapter Heading and Rule

chaptersmemoirsectioning

I would like to extend the chapter title and the rule above it to the left, so it is -0.75 in past the text block.

MWE:

\documentclass[oneside,12pt]{memoir}

\usepackage{graphicx}

\begin{document}

\chapterstyle{madsen}

\frontmatter

\tableofcontents

\mainmatter

\chapter{First chapter}

Text

\chapter{Second chapter}

More text

\end{document}

Best Answer

In the following example I defined a mymadsen chapter style with the required specifications:

\documentclass{memoir}
\usepackage{graphicx}
\usepackage{lipsum}

\makechapterstyle{mymadsen}{%
  \chapterstyle{default}
  \renewcommand*{\chapnamefont}{%
    \normalfont\large\scshape\raggedleft}
  \renewcommand*{\chaptitlefont}{%
    \normalfont\Huge\bfseries\sffamily\raggedleft}
  \renewcommand*{\chapternamenum}{}
  \setlength{\chapindent}{0.75in}
  \renewcommand*{\printchapternum}{%
    \makebox[0pt][l]{\hspace{0.4em}%
      \resizebox{!}{4ex}{%
        \chapnamefont\bfseries\sffamily\thechapter}%
    }%
  }%
  \renewcommand*{\printchapternonum}{%
    \chapnamefont \phantom{\printchaptername \chapternamenum%
      \makebox[0pt][l]{\hspace{0.4em}%
        \resizebox{!}{4ex}{%
          \chapnamefont\bfseries\sffamily 10}%
      }%
    }%
  }%
  \setlength\midchapskip{1ex}
  \renewcommand*{\printchaptertitle}[1]{%
    \begin{adjustwidth}{-\chapindent}{}
      \par\hrulefill\vskip\midchapskip
      \raggedleft \chaptitlefont ##1\par\nobreak
    \end{adjustwidth}}
}

\chapterstyle{mymadsen}

\begin{document}

\chapter*{Test unnumbered chapter and some textv}
\lipsum[4]
\chapter{Test numbered chapter and some textviiii}
\lipsum[4]

\end{document}

An image for an unnumbered chapter:

enter image description here

and one for a numbered chapter:

enter image description here

Related Question