0

Consider this script:

\documentclass{report}
\makeatletter
\renewcommand\chapter{\if@openright\cleardoublepage\else\clearpage\fi                                                                                                                                       
                    \thispagestyle{plain}%                                                                                                                                                                  
                    \global\@topnum\z@                                                                                                                                                                      
%                    \@afterindentfalse                                                                                                                                                                     
                    \secdef\@chapter\@schapter}


\makeatother

\begin{document}
\chapter{firstchapter}
first paragraph

second paragraph
\section{Some section}
first section paragraph

second section paragraph

\chapter{secondchapter}
first   paragraph

second paragraph
\end{document}

The first paragraph of chapter "firstchapter" gets indented if I comment the line

\@afterindentfalse

However, this behaviour gets unset in "secondhapter". Why?

The definition of \section is more obscure:

\newcommand\section{\@startsection {section}{1}{\z@}%                                                                                                                                                       
                                   {-3.5ex \@plus -1ex \@minus -.2ex}%                                                                                                                                      
                                   {2.3ex \@plus.2ex}%                                                                                                                                                      
                                   {\normalfont\Large\bfseries}}

What and how do I need to redefine to automatically indent the first paragraph in a chapter and a section.

As I develop my own class I am interested in what to modify in the source code rather than import packages.

  • 5
    First up, why even indent threre? The section and chapter start already tells you something new has started, so why add indentation as well? See the indentfirst package – daleif Apr 2 at 8:56
  • 2
    If you are developing your own class and does not want to use packages, then you need to look up what "obscure" constructions mean. Have a look in texdoc source2e. – daleif Apr 2 at 9:54

Your Answer

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

Browse other questions tagged or ask your own question.