[Tex/LaTex] changing chapter name in fncychap

chaptersfncychap

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?

Best Answer

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

Related Question