If you want to reproduce the spacing from, say, the article
class, you could more or less copy the definitions of the sectioning commands from article.cls
, which use the LaTeX base macro \@startsection
internally for typesetting of the title and appropriate spacing.
\documentclass{dinbrief}
\usepackage{lipsum}
\makeatletter
\setcounter{secnumdepth}{2}
\newcounter{section}
\newcounter{subsection}[section]
\renewcommand\thesection{\@arabic\c@section}
\renewcommand\thesubsection{\thesection.\@arabic\c@subsection}
\newcommand*\section{\@startsection{section}{1}{\z@}%
{-3.5ex \@plus -1ex \@minus -.2ex}%
{2.3ex \@plus.2ex}%
{\normalfont\huge\bfseries}}
\newcommand*\subsection{\@startsection{subsection}{2}{\z@}%
{-3.25ex\@plus -1ex \@minus -.2ex}%
{1.5ex \@plus .2ex}%
{\normalfont\Large\bfseries}}
\makeatother
\signature{Mr.\ Happy}
\begin{document}
\begin{letter}{Mr.\ Grumpy}
\opening{Hello,}
\section{A Section}
\lipsum[1]
\subsection{A Subsection}
\lipsum[2-3]
\closing{Yours truly,}
\end{letter}
\end{document}
I wasn't sure whether you also want section numbering. If not, just leave out the counter definitions or set secnumdepth
to 0
.
The arguments of \@startsection
specify
- the counter to be used for this level
- the level of sectioning
- the indentation for the heading
- the vertical skip above the heading (a negative length means that the first paragraph of the section has no paragraph indentation, which doesn't make a difference in
dinbrief
)
- the skip after the heading (if positive it's the vertical skip, if negative it's a horizontal skip and there's no linebreak after the heading, e.g. for
\paragraph
-like section levels)
- and finally, the font used for the heading (here, I used the font sizes from your example, although it looks a bit huge IMO)
Of course, you can fiddle around with the lengths as you please. Also, I'm not sure whether dinbrief
flushes the bottom of the page, so you might not even require rubber lengths for your spacing.
Edit:
You may also have to adjust the lengths in order to compensate for dinbrief
's vertical paragraph spacing...