0

I'm writing a thesis and would like to have the pages on which a new chapter start look fancier than they currently do.

I like the example on this page: how can I create a chapter heading like this?

However, since the abstract is defined in the preamble, it appears the same in each chapter. Obviously, different chapters need different abstracts and I don't know how to correct this?

Secondly, for some reason, the contents of this preamble are changing the font style of the rest of my document and I'd like the bulk of what I'm writing (outside of chapter title and abstract) to stay in the standard font that LaTeX uses.

Thanks for any help.

  • Can you please ads a MWE? – user36296 Jan 25 '16 at 22:01
  • Just redefine the chapterabstract macro before every chapter: \def\chapterabstract{\textit{Chapter abstract: } Second Abstract} \chapter{Second Chapter} – Benjamin Jan 25 '16 at 22:22
1

Here is an improved solution to my previous solution in the abovementioned page. Now you have to declare a \chapterabstract[some text] before each chapter command to obtain an abstract:

\documentclass[11pt,a4paper]{book}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{fourier}
\usepackage{cabin}
\usepackage[nomarginpar]{geometry}
\usepackage{microtype}
\usepackage{lettrine}
\renewcommand{\LettrineFontHook}{\color{TFFrameColor}}
\renewcommand\LettrineTextFont{\color{TFFrameColor}\scshape}

\usepackage[x11names]{xcolor}
\newcommand*\ftsize[1]{\fontsize{#1pt}{\numexpr 1.2*#1\relax pt}\selectfont}
\usepackage{colortbl}
\usepackage{framed}
\colorlet{TFFrameColor}{DodgerBlue3}
\renewenvironment{leftbar}{%
\def\FrameCommand{{\color{TFFrameColor}\vrule width 3pt} \hspace{12pt}}%
\MakeFramed {\advance\hsize-\width \FrameRestore}}%
{\endMakeFramed}
\usepackage[explicit,newlinetospace, clearempty]{titlesec}%
\usepackage{xparse}
\DeclareDocumentCommand{\chapterabstract}{o}{\IfNoValueTF{#1}{\relax}{\def\chapterabstracttext{\textit{Chapter abstract: }#1}}}%

\chapterabstract[ In former days -- that is to say, once upon a time, there lived in the Land of Gramblamble, Seven Families. They lived by the side of the great Lake Pipple-popple (one of the Seven Families, indeed, lived in the Lake), and on the outskirts of the City of Tosh, which, excepting when it was quite dark, they could see plainly. The names of all these places you have probably heard of, and you have only not to look in your Geography books to find out all about them.]

\titleformat{\chapter}[hang]{\usefont{T1}{phv}{m}{n}}{%
\parbox[t]{\dimexpr0.12\linewidth-20pt\relax}{\fontsize{48}{48}\selectfont\raisebox{-1.25\height}{\color{TFFrameColor}\thechapter}}}
{1em}%
{\begin{minipage}[t]{0.9\linewidth}\begin{leftbar}{\bfseries\fontsize{24}{30}\selectfont\color{TFFrameColor}
\rule{0pt}{2ex}\strut#1\hfil\vskip2ex\break}\chapterabstracttext\rule[-1.5ex]{0pt}{1.5ex}\end{leftbar}\end{minipage}
\gdef\chapterabstracttext{}}
\titlespacing{\chapter}{0pt}{2\baselineskip}{6\baselineskip}

\begin{document}%


\chapter {Introductory}%

\lettrine[lines = 2,loversize =0.1]{I}{n} former days -- that is to say, once upon a time, there lived in the Land of Gramblamble, Seven Families. They lived by the side of the great Lake Pipple-popple (one of the Seven Families, indeed, lived in the Lake), and on the outskirts of the City of Tosh, which, excepting when it was quite dark, they could see plainly. The names of all these places you have probably heard of, and you have only not to look in your Geography books to find out all about them.

Now the Seven Families who lived on the borders of the great Lake Pipple-popple, were as follows in the next Chapter.

%%%%
%
\chapterabstract[%
  There was a Family of Two old Parrots and Seven young Parrots.\endgraf
  There was a Family of Two old Storks and Seven young Storks.\endgraf
  There was a Family of Two old Geese, and Seven young Geese.\endgraf
  There was a Family of Two old Owls, and Seven young Owls.\endgraf
  There was a Family of Two Old Guinea Pigs and Seven young Guinea Pigs.\endgraf
  There was a Family of Two old Cats and Seven young Cats.\endgraf
  And there was a Family of Two old Fishes and Seven young Fishes.
]

\chapter{The Seven Families}

\lettrine{O}{ne} day all the Seven Fathers and the Seven Mothers of the Seven Families agreed that they would send their children out to see the world.

So they called them all together, and gave them each eight shillings and some good advice, some chocolate drops, and a small green morocco pocket-book to set down their expenses in.

They then particularly entreated them not to quarrel, and all the parents sent off their children with a parting injunction.

\chapter{The Habits of the\\ Seven Families}

\lettrine{T}{he} Parrots lived upon the Soffsky-Poffsky trees, -- which were beautiful to behold, and covered with blue leaves, -- and they fed upon fruit, artichokes, and striped beetles.

The Storks walked in and out of the Lake Pipple-popple, and ate frogs for breakfast and buttered toast for tea, but on account of the extreme length of their legs, they could not sit down, and so they walked about continually.

\end{document} 

enter image description here enter image description here

enter image description here

  • This is excellent thanks. Two questions: (i) I should leave the Chapter 1 abstract in the preamble? (ii) How do I keep the standard latex font for everything underneath the chapter title and abstract? – user11128 Jan 26 '16 at 9:03
  • Also, I'd like to be able to suppress this chapter style for the introductory stuff e.g. thesis abstract, table of contents, list of figures etc. Is that a possibility? Thanks. – user11128 Jan 26 '16 at 18:15
  • I think so, because these are probably considered, in the class you use, as unnumbered chapters. You can set specifications for this type of chapters with \titleformat[name=\chapter, numberless]{…} and similarly for \titlespacing. Please let me know if you meet any difficulties in coding. – Bernard Jan 26 '16 at 18:52
  • For your previous questions: (i) No, the Chapter 1 abstract can as well go just before calling the chapter. (ii) To use use the standard latex font (Computer Modern ou Latin Modern), remove \usepackage{fourier}: this a maths font based on Adobe Utopia. You also can remove \usepackage{cabin}, which is a sans serif font which matches well fourier (furthermore, I didn't use it in titles, but helvetica (cf. \usefont{T1}{phv}…). – Bernard Jan 26 '16 at 19:00
  • Thanks for the reply. Got the fonts working ok. As for specifying e.g. abstract to just be normal, I don't quite follow. In the preamble, I should write "\titleformat[abstract=\chapter, numberless]{…}"? – user11128 Jan 26 '16 at 20:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.