I have a 60 page document with numbered Sections, subsections and paragraphs. All the paragraphs are numbered. I want all the text to be indented evenly after the numbered paras, such as the following example shows:
1. Section
1.1 Subsection
1.1.1 Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Donec rhoncus non ante faucibus tempus. Quisque ex orci,
faucibus vitae magna sed, blandit fermentum massa.
1.1.2 Some numbered paras interrupted by lists:
* Item 1
* Item 2
* Item 3
and some text to finish the paragraph
1.1.2 Some numbered paras interrupted by sets of equations using AMSmath:
A = B
C = D
and some text to finish the paragraph
Currently, I have some 60 pages of text (including lots of equations), built around the following koma-script class:
% -*- program: xelatex -*-
\documentclass[english, parskip=full, fontsize=11, DIV12, toc=left, numbers=noenddot]{scrartcl}
\usepackage{babel}
\usepackage{amsmath}
% just so we can see what is going on for now
\usepackage{showframe}
\usepackage{blindtext}
% tighten up spacing of lists
\usepackage{enumitem}
\setlist{noitemsep}
\setcounter{secnumdepth}{4}
\renewcommand\theparagraph{\thesubsection.\arabic{paragraph}}
\newcommand\p{\paragraph{}}
%
%
% make sure paragraphs reset counting at section and subsections
%
\makeatletter
\@addtoreset{paragraph}{subsection}
\@addtoreset{paragraph}{section}
\makeatother
%
% AND NOW WE BEGIN
%
\begin{document}
\section{Section}
\subsection {Subsection}
\p \blindtext
% an example numbered paragraph with an embedded list
\p \blindtext
\begin{itemize}
\item Item 1
\item Item 2
\item Item 3
\end{itemize}
and some words at the end of this para
% an example numbered paragraph with a simple equation
\p The period is defined by a pair of days ($D_l$, $D_u$) where
\begin{align*}
D^_{l} & = \text{the lower date} \\
D^_{u} & = \text{the upper date}
\end{align*}
and things happen for all days $d$ where $D_l <= d< D_u$.
\end{document}
so, all the text returns to the left hand margin. It would be ideal if I could use something like the koma-script \addmargin
command to indent lists and maths from the left; but adjust the \p
numbered paragraph command so that its numbering started flush on the left, but with a box round the number to give it a standard size, and then a hanging command for the remainder of the \p para to even it up with the rest of the indented text.
Or, something else ….
But so far, this is beyond my LaTeX skill set.
Best Answer
Update: KOMA-script version 3.17 (or newer)
With KOMA-Script version the command
\othersectionlevelsformat
is depreciated. You have to use instead\sectionformat
,\subsectionformat
etc. So the code changes toThe result is the same as in the picture below.
If this should be compilable with versions 3.15 and 3.16 too insert
just before redefining
\sectionformat
etc.KOMA-script version 3.15 and 3.16
You can use the new commands
\RedeclareSectionCommand
or\RedeclareSectionCommands
and redefine\othersectionlevelsformat
. So it is still possible to refer to a section number by\ref
:To reset the original headwidth and footwidth you can use
Code:
KOMA-Script version 3.14 (or older)
Here is another suggestion using the answer by @Steven but redefining
\othersectionlevelsformat
instead of\thesection
. So it is still possible to refer to a section number by\ref
:Code: