On request, I have two different layouts for chapters for a book. The first one is exclusive to the Chapter 1 and the other one is for the others. The layout affect how the sections, definitions and paragraphs are displayed. I have the code to handle this in a little class file. This is a MWE:
\documentclass[12pt,letterpaper]{book}
\usepackage{amsmath,amsfonts,amssymb,amsthm}
\usepackage{thmtools}
\usepackage{ifthen,calc}
\usepackage{blindtext}
\parindent=0mm
\newtheorem{teo}{Theorem}[section]
\newtheorem{axi}{Axiom}
\newtheorem{lem}{Lemma}
\newcounter{definition}
\declaretheoremstyle[%
spaceabove=6pt,%
spacebelow=6pt,%
headfont=\normalfont\bf,%
notefont=\normalfont\bf,
notebraces={{}{}},
bodyfont=\itshape,
headpunct={.}]{defistyle}
\declaretheorem[
name={Definition},
numberlike=definition,
style=defistyle]{defi}
\renewcommand\thesection
{\arabic{chapter}.\arabic{section}}
\makeatletter
\renewcommand\@seccntformat[1]{
{\csname the#1\endcsname}.\hspace{0.5em}}
\renewcommand\section{\@startsection
{section}{1}{0mm}
{6pt}
{1pt}
{\bfseries}}
\renewcommand\paragraph{\@startsection
{paragraph}{3}{0cm}
{6pt}
{1pt}
{\bfseries}}
\makeatother
\makeatletter
\newcommand{\capi}[1]{
\chapter{#1}
\ifthenelse{\value{chapter}=2}{
\renewcommand\section{\@startsection
{section}{1}{0mm}
{0pt}
{1pt}
{\Large}}
\@addtoreset{definition}{section}
\renewcommand{\thedefi}{\thesection.\arabic{definition}}
}{}}
\makeatother
\begin{document}
\capi{Some preliminaries}
\blindtext
\section{the first thing}
\blindtext[1]
\begin{defi}
The thing $1$ is real number. If $x$ is real then $x+1$ is real.
\end{defi}
\blindtext
\capi{Cool stuff}
\blindtext
\section{Complex things}
bla bla bla
\begin{defi}
We say that a number $x$ is complex if it is not really a number.
\end{defi}
\blindtext
\end{document}
As you can see, my actual way to handle the different style for each chapter is not so elegant. I have the book splitted in several files, one per chapter. When I'm reviewing the book I'm select the chapters I want to see via the \includeonly command. The problem is that in order to get the proper look of the sections, paragraphs and definitions I always have to include the chapter 2. Also, I'll would like to avoid to define a new command to the chapters. My question is: is there a way to improve this?
\value{chapter}>0instead of\value{chapter}>1? – leo May 09 '12 at 07:54\includeonlyand it seems to do what's requested. The condition on\value{chapter}is because I put the test before the counter is incremented. So for the first\capithe counter value is 0. – egreg May 09 '12 at 07:57