1

I would like to start each section on a new page and new geometry. For each section on a new page, \newcommand{\sectionbreak}{\clearpage} is used but I can't change the page geometry.

Normally, 2.5 cm should be inside, but for section pages, it should be 5cm.

enter image description here

enter image description here

Is there a general tuning?

1 Answers1

0

There is no need for separate geometries for section and non-section pages. Instead, override the sectional command to insert an appropriate \vspace* at the top of the page. The following implements that under the default article class:

enter image description here

\documentclass{article}

\usepackage[margin=25mm]{geometry} \usepackage{lipsum}

\let\oldsection\section \renewcommand{\section}{% \par \clearpage \vspace*{\dimexpr25mm-\baselineskip-3.5ex}% \section in article adds 3.5ex plus 1ex minus .2ex \oldsection }

% Add a vertical rule from the top of the page at lengths 25mm and 50mm, for reference \usepackage{eso-pic} \AddToShipoutPictureFG{% \AtPageUpperLeft{% \hspace{25mm}% \rule[-25mm]{1pt}{25mm}% \hspace{2mm}% \rule[-50mm]{1pt}{50mm}% }% }

\begin{document}

\section{First section}\lipsum[1-10] \section{Second section}\lipsum[1-20]

\end{document}

The removal of 3.5ex comes from the article class' definition of \section that adds a vertical skip of 3.5ex (+ 1ex - .2ex); see Where can I find help files or documentation for commands like \@startsection for LaTeX?:

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