For my text document with the book
class I start each new chapter with an abstract. The format of this abstract section is designed such that the abstract header is indented with respect to the abstract text, like:
Abstract
Insert text here
The abstract is designed as an environment with the NewDocumentEnvironment
command.
However when the titlesec
package is included in the document, the indent of the abstract header is removed.
How can I keep the indent in the abstract header, or how can I tell the titlesec
package to not touch the section header formatting?
The titlesec
package is included because I want to customize the chapter title (and only the chapter titles).
A MWE (toggle the titlesec
package to check the indentation):
\documentclass{book}
\usepackage{titlesec}
\usepackage{xparse}
\usepackage{changepage}
\usepackage{blindtext}
\usepackage[T1]{fontenc} % Output font encoding for international characters
\NewDocumentEnvironment{ChapterAbstract}{}
{
% Change the margins of the abstract relative to the regular text
\begin{adjustwidth}{15pt}{15pt}
\nointerlineskip\leavevmode % Necessary addition due to the macro expansion of adjustwidth. Solves the 'missing item' error
\section*{\indent\scshape\large abstract} % Smallcaps abstract title in \large fontsize with an indentation
\itshape
}
{
\end{adjustwidth}
}
\begin{document}
\chapter{Chapter title test here}
\begin{ChapterAbstract}
\blindtext
\end{ChapterAbstract}
\section{Test section}
\blindtext
\end{document}