3

I'm using the memoir class with the madsen style to write my thesis and I need help to move leftward the text "chapter" and the chapter number, in such a way that the right end of the number would coincide with the text margin.

In other words I get this:

enter image description here

and I would like to obtain somethig like:

enter image description here

  • Please provide your (MWE) code. – AML Jun 18 '18 at 16:09
  • Are you using the Madsen style? – AML Jun 18 '18 at 16:21
  • I made use of the pure madsen style. – gilgauge Jun 18 '18 at 16:54
1

A revamping of the madsen style:

\documentclass{memoir}
\usepackage{lmodern}

\makechapterstyle{gilgauge}{%
  \chapterstyle{default}%
  \renewcommand*{\chapnamefont}{%
    \normalfont\Large\bfseries\sffamily\raggedleft
  }%
  \renewcommand*{\chaptitlefont}{%
    \normalfont\fontsize{24}{30}\bfseries\sffamily\raggedleft
  }%
  \renewcommand*{\chapternamenum}{}%
  \renewcommand*{\printchapternum}{%
    \hspace{0.4em}%
    {\chaptitlefont\thechapter}%
  }%
  \renewcommand*{\printchapternonum}{%
    \leavevmode\chapnamefont\vphantom{\chaptitlefont 1}%
    \afterchapternum
  }%
  \renewcommand*{\afterchapternum}{%
    \par\hspace{1.5cm}\hrule\vskip\midchapskip
  }%
}

\chapterstyle{gilgauge}

\begin{document}

\chapter{Conclusions and Perspectives for the Future}

\end{document}

I removed the small caps that seem out of place in an all sans serif context. Also scaling boxes can (and should) be avoided.

The “for the Future” bit is just for checking the output is right for a multiline title.

enter image description here

  • I decided to remodify your code in order to put the word "Chapter" in small caps again in the following way \renewcommand*{\chapnamefont}{% \normalfont\Large\scshape\raggedleft } – gilgauge Jun 18 '18 at 17:41
  • @gilgauge Just change \normalfont\Large\bfseries\sffamily\raggedleft into \normalfont\Large\scshape\raggedleft. But the result is far from being pretty; on the other hand, beauty is in the eye of the beholder. – egreg Jun 18 '18 at 17:43
1

Here is a solution that gets the job done (change the makebox value) and is inspired by this answer.

enter image description here

\documentclass{memoir}

\usepackage{graphicx}

\makechapterstyle{mymadsen}{% requires graphicx package
  \chapterstyle{default}
  \renewcommand*{\chapnamefont}{%
    \normalfont\Large\scshape\raggedleft}
  \renewcommand*{\chaptitlefont}{%
    \normalfont\Huge\bfseries\sffamily\raggedleft}
  \renewcommand*{\chapternamenum}{}
  \renewcommand*{\printchapternum}{%
    \makebox[18pt][l]{\hspace{0.4em}% <--- altered makebox value
      \resizebox{!}{4ex}{%
        \chapnamefont\bfseries\sffamily\thechapter}%
    }%
  }%
  \renewcommand*{\printchapternonum}{%
    \chapnamefont \phantom{\printchaptername \chapternamenum%
      \makebox[0pt][l]{\hspace{0.4em}%
        \resizebox{!}{4ex}{%
          \chapnamefont\bfseries\sffamily 1}%
      }%
    }%
    \afterchapternum %
  }% 
  \renewcommand*{\afterchapternum}{%
    \par\hspace{1.5cm}\hrule\vskip\midchapskip}}

\chapterstyle{mymadsen}

\begin{document}

\chapter{Conclusions and Perspectives}

\end{document}
  • Thank you! It worked "almost" fine for me. However, i would like to further move the whole towards left. Indeed, the number is by half beyond the margin (see ibb.co/cfW1Sy) – gilgauge Jun 18 '18 at 17:05
  • Just adjust the makebox that I pointed out. Change it to 20 or whatever works with your code. – AML Jun 18 '18 at 17:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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