# changing chapterstyle in memoir

I have the following MWE

\documentclass[a4paper, 10pt]{memoir}
\usepackage[ansinew]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath, amsthm, amssymb}

\usepackage[per-mode=symbol, exponent-product = \cdot, alsoload=hep, range-units=single, tophrase={--}, separate-uncertainty]{siunitx}

\begin{document}

\chapter{Test 1}
Test 1

{\let\clearpage\relax\chapter{Test 2}}
Test 2

\end{document}


Due to the chapterstyle, a second horizontal line appears in the middle of the page. Is there a way to remove this?

-
I have added a backslash before end{document} to make your code compilable. I hope you don't mind. :) –  hpesoj626 Jan 1 '13 at 1:15

This is the default behavior of the madsen chapter style. So if you have two chapters in one page, you will get two horizontal lines in one page. You can break the page between chapters (which is the default behavior).

## Case 1

If you want to totally remove the line between Chapter number and title, write

\renewcommand*{\afterchapternum}{%
\par\hspace{1.5cm}\hrule\vskip\midchapskip}


after \chapterstyle{madsen}.

## Case 2

To remove just the line in chapter two, write

{\renewcommand*{\afterchapternum}{%
\par\vskip\midchapskip}
\let\clearpage\relax\chapter{Test 2}}


Here is the full code for the second case.

\documentclass[a4paper,10pt]{memoir}
\usepackage[ansinew]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath, amsthm, amssymb}
\usepackage[per-mode=symbol, exponent-product = \cdot, alsoload=hep, range-units=single, tophrase={--}, separate-uncertainty]{siunitx}

\begin{document}

\chapter{Test 1}
Test 1

{\renewcommand*{\afterchapternum}{%
\par\vskip\midchapskip}
\let\clearpage\relax\chapter{Test 2}}
Test 2

\end{document}

-
is there really no way for me to get my desired behavior for just a single page, even though I'm using this chapter style? Perhaps by making one chapter and the second one can be something mimicking the graphical design of a chapter-title? –  BillyJean Jan 1 '13 at 1:25
@Niles1710373 See my edit –  hpesoj626 Jan 1 '13 at 1:37