1

I am using the package fncychap (here) with scrbook and Sonny. Now I want to change the name of the word 'chapter' to a date which I can type by hand when I am creating a new chapter. I've experimented around with \ChNameVar{} but didn't get it. So how can you create this?

3
  • Like this? \documentclass{scrbook} \usepackage[Sonny]{fncychap} \newcommand\MyChap[1]{\renewcommand\chaptername{#1}} \begin{document} \MyChap{September 13} \chapter{Test} \end{document} Commented Jul 6, 2013 at 19:19
  • @GonzaloMedina yes, it looks very nice. but is there any possibility to delete the chapter number?
    – sheldoor
    Commented Jul 6, 2013 at 19:24
  • Please see the answer below. Commented Jul 6, 2013 at 19:33

1 Answer 1

2

Redefining \DOCH you can suppress the chapter numbering; the \MyChap command allows you to redefine \chaptername whenever needed:

\documentclass{scrbook}
\usepackage[Sonny]{fncychap}

\newcommand\MyChap[1]{%
 \renewcommand\chaptername{#1}}
\makeatletter
\renewcommand{\DOCH}{%
    \raggedleft
    \CNV\FmN{\@chapapp}\space \CNoV
    \par\nobreak
    \vskip 40\p@}
\makeatother

\begin{document}

\MyChap{September 13}
\chapter{Test title}

\end{document}

enter image description here

A new requirement has been made in a comment: to have the chapter title ragged right instead of ragged left; this can be accomplished with a redefinition of \DOTI and \DOTIS

\documentclass{scrbook}
\usepackage[Sonny]{fncychap}

\newcommand\MyChap[1]{%
 \renewcommand\chaptername{#1}}
\makeatletter
\renewcommand{\DOCH}{%
    \raggedleft
    \CNV\FmN{\@chapapp}\space \CNoV
    \par\nobreak
    \vskip 40\p@}
\renewcommand{\DOTI}[1]{%
    \CTV\raggedright\mghrulefill{\RW}\par\nobreak
    \vskip 5\p@
    \CTV\FmTi{#1}\par\nobreak
    \mghrulefill{\RW}\par\nobreak
    \vskip 40\p@}
  \renewcommand{\DOTIS}[1]{%
    \CTV\raggedright\mghrulefill{\RW}\par\nobreak
    \vskip 5\p@
    \CTV\FmTi{#1}\par\nobreak
    \mghrulefill{\RW}\par\nobreak
    \vskip 40\p@}
\makeatother

\begin{document}

\MyChap{September 13}
\chapter{Test title}

\end{document}

enter image description here

1
  • perfect! last question: is there any command to have 'Test title' on the right side and not on the left? I've tried some but all of them failed :/
    – sheldoor
    Commented Jul 6, 2013 at 20:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .