2

I'm using fncychap Glenn and I would like to have the chaptername, chapternumber as well as the title in the same color and only the box should have another color.

It tried with:

\documentclass[a4paper,11pt,twoside,fleqn,parskip=half,chapterprefix]{scrbook}
\usepackage{xcolor}
\usepackage[Glenn]{fncychap}
  \ChTitleVar{\bfseries\Large\rm\selectfont\scshape\color{blue}}
    \ChNumVar{\Huge\selectfont\color{blue}}
    \ChNameVar{\bfseries\Large\sf\selectfont\color{blue}}
\begin{document}
\chapter{Hello World!}
xbxbxbxbxbxbxbx
\end{document}

but the \ChNumVar changes the color of the box AND of the chapternumber...

I have tried: \ChRuleWidth{1pt\selectfont\color{red}}, but this changed the color of the main text in document.

Any idea, how to change the color only of the box?

PS: my document class is scrbook and I use the package xcolor.

Best!

1
  • Welcome to TeX.SX! Please make your example compilable (MWE).
    – TeXnician
    Dec 9, 2017 at 13:06

1 Answer 1

3

Do not use the old font commands like \rm and \sf! Since KOMA-Script version 3.20 you will get error messages.

You could patch the fncychap commands \DOCH, \DOTI and \DOTIS to use a different color for the rules:

\documentclass[fleqn,parskip=half,chapterprefix]{scrbook}
\usepackage[english]{babel}
\usepackage{blindtext}% only for dummy text

\usepackage{xcolor}
\usepackage[Glenn]{fncychap}
  \ChTitleVar{\bfseries\Large\rmfamily\scshape\color{blue}}
  \ChNumVar{\Huge\selectfont\color{blue}}
  \ChNameVar{\bfseries\Large\sffamily\color{blue}}
\usepackage{xpatch}
\xpatchcmd\DOCH
  {\mghrulefill}{\color{red}\mghrulefill}
  {}{\PatchFailed}
\xpatchcmd\DOTI
  {\mghrulefill}{\color{red}\mghrulefill}
  {}{\PatchFailed}
\xpatchcmd\DOTIS
  {\mghrulefill}{\color{red}\mghrulefill}
  {}{\PatchFailed}

\begin{document}
\tableofcontents
\blinddocument
\end{document}

enter image description here

enter image description here

1
  • @NoName If it works for you, you can upvote the answer and maybe accept it.
    – esdd
    Dec 9, 2017 at 15:23

You must log in to answer this question.

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