0

I like the \usepackage[Conny]{fncychap} which makes nice chapter headings. But it only does the chapters. Not sections and not subsections and so on.

Is it possible to use this package or similar one to obtain same style used by this package but also for rest of sectioning? Now it looks a little strange to have only the chapter heading this nice, but the rest of the title using different style.

I know I can use different document classes and so on. But I just needed to change the style of all sections to match the chapter style.

enter image description here

Would the above be consider OK, to have chapters heading with such drastic different style than the rest of the section titles in the document, or is it considered bad styling?

MWE

\documentclass[12pt]{book}
\usepackage[Conny]{fncychap}
\setcounter{secnumdepth}{4}
\begin{document}
\tableofcontents
\chapter{My discovery of the year}
This chapter will give all my results.

\section{Initial results} Here is some results found.

\subsection{More results} And more results found. \subsubsection{And yet more results} And yet more results found.

\chapter{Conclusion} We see that the discovery is real. \end{document}

TL 2022

Nasser
  • 20,220
  • 1
    Match how? I guess you do not want the horisontal lines. – mickep Jun 17 '23 at 10:18
  • @mickep I guess it is a matter of style. But I meant it does look now to be off, isn't? It does not match. The chapter heading is way too fancy, while the rest are too boring. May be have the lower level sections match the style but (with section number on top of the section title) but be ofcourse of smaller font and the horizontal likes may be not needed there. I guess it is styling issue. But my point now they look too different. – Nasser Jun 17 '23 at 10:25

1 Answers1

1

You can do a lot using packages like titlesec or redefining commands like \@startsection, \@makechapter etc. or using configurable classes like memoir or KOMA-Script. Here an example using scrbook:

\documentclass[12pt,letterpaper,chapterprefix]{scrbook}
\setcounter{secnumdepth}{\paragraphnumdepth}% Really???

\setkomafont{disposition}{} \RedeclareSectionCommand[innerskip=0pt]{chapter}

\renewcommand{\raggedchapter}{\centering} \setkomafont{chapterprefix}{\bfseries} \renewcommand{\chapterformat}{% \rule{\textwidth}{.8\dp\strutbox}% \makebox[0pt][r]{% \rule[-.8\dp\strutbox]{\textwidth}{.2\dp\strutbox}% }\ \MakeUppercase{\chapapp}~\thechapter\ } \renewcommand{\chapterlineswithprefixformat}[3]{% #2 \rule[\ht\strutbox]{\textwidth}{.2\dp\strutbox}\[-\dimexpr\ht\strutbox+.6\dp\strutbox\relax] \MakeUppercase{#3}% } \renewcommand{\raggedsection}{\centering} \renewcommand{\sectionformat}{\thesection\autodot} \renewcommand{\sectionlinesformat}[4]{% \Ifstr{#1}{section}{% \IfArgIsEmpty{#1}{}{% \rule[.9ex]{2em}{.2ex}% \makebox[0pt][r]{% \rule[.7ex]{2em}{.1ex}% }% \enskip #3\enskip \rule[.9ex]{2em}{.2ex}% \makebox[0pt][r]{% \rule[.7ex]{2em}{.1ex}% }% \* #4% }% }{% \Ifstr{#1}{subsection}{% \rule[.9ex]{2em}{.2ex}% \makebox[0pt][r]{% \rule[.7ex]{2em}{.1ex}% }% \enskip #3#4\enskip \rule[.9ex]{2em}{.2ex}% \makebox[0pt][r]{% \rule[.7ex]{2em}{.1ex}% }% }{% \rule[.7ex]{2em}{.2ex}% \enskip #3#4\enskip \rule[.7ex]{2em}{.2ex}% }% }% } \begin{document} \tableofcontents \chapter{My discovery of the year} This chapter will give all my results.

\section{Initial results} Here is some results found.

\subsection{More results} And more results found. \subsubsection{And yet more results} And yet more results found.

\chapter{Conclusion} We see that the discovery is real. \end{document}

fancy title for the ToC

fancy titles for chapter, section, subsection and subsubsection

Instead of using \rule, \makebox etc. you could even use TikZ or tcolorbox to make more fancy titles. Personally, I dislike titles like this because there are always problems with special cases, e.g. when the title of a subsection is too long to fit on one line. And because I'm a fan of less is more.

cabohah
  • 11,455