Another Memoir style I'm trying to create… I grabbed bits of code from here and there and I almost have it working, but the imported image isn't centered over the chapter title… spent many hours on this before coming to you…I'm trying! I would appreciate if someone could fix it and suggest any clean up to any blunders I've made.. Also, I would like to suppress all chapter numbers in the document (but keep them in the toc) is there a good way to do that, or do I just need to use the asterisk.
in brief… what I'm trying to do is get an image over centered text with some numbers in there that I can tweak to adjust the v spacing between the image and title and between the title and the first paragraph.
\makechapterstyle{test1}{%
\chapterstyle{default}
\chapterstyle{article}%
\renewcommand*{\printchapternonum}{%
% \vphantom{\printchaptername \chapnumfont 1}
\afterchapternum
}
\renewcommand*{\afterchapternum}{%
\vspace*{\beforechapskip}
\smash{%
\raisebox{0cm}{%
\includegraphics[width=2in]{chantheader.jpg}}}
\aliaspagestyle{chapter}{headings}
}%
}
Best Answer
You can try something like this (the code contains some explanatory comments):
The ToC:
The page containing the chapter heading:
CTAN lion drawing by Duane Bibby.
In a comment, a redefinition of
\chapter
has been requested, so as to have an additional mandatory argument to specify the image for each chapter. The code below shows this redefinition with the help of thexparse
package (I usedxparse
to easily handle the two optional arguments for\chapter
inmemoir
); the new syntax isopenany
was used only for the example.