4

While passing parskip=half to scrbook removes all indentation, I (unfortunately) should indent everything by 10 mm, excluding chapter/section/... titles. How can this be achieved easiest? I was considering toying around with bcor and putting section numbers into the (fake) margin, but that seems pretty complicated...

edit It's a bit late to add this, but ideally the titles' texts (not the numbering) would also start at that indentation and be aligned, i.e.

+----------¦-----------+------¦---------------+
|    1     A chapter   |    3 Another chapter |
|    1.1   A section   |      some text       |
|    1.1.1 A subsection|  3.1 another section |
...

That should be answered in this question though.

  • 1
    You should “outdent” titles, instead. – egreg Nov 30 '15 at 13:03
  • @egreg How? And will this work correctly for a twoside layout? – Tobias Kienzler Nov 30 '15 at 13:05
  • What do you mean? What should happen to titles in left-hand and right-hand pages? – egreg Nov 30 '15 at 13:08
  • @egreg "outdenting" titles would mean I should increase the margin, right? But in a twoside layout and using \usepackage[inner=10mm, outer=20mm]{geometry} how could I increase only the "left" margin no matter whether the page is odd or even? Would bcor work here? – Tobias Kienzler Nov 30 '15 at 13:16
  • I think you just want 2cm on either side, with titles sticking in the margin (inner on odd pages, outer on even pages) by 1cm. – egreg Nov 30 '15 at 13:22
  • @egreg No, on a left / even side that would increase the inner margin (i.e. on the right side of text) and put the title stuck too far out on the left – Tobias Kienzler Nov 30 '15 at 13:24

3 Answers3

7

Second Update: If the chapter and section titles etc. should be aligned to the indented text you can use:

\documentclass[
  paper=a4,
  %chapterprefix
]{scrbook}[2015/10/03]

\newcommand\secnumwidth{1.5cm}

\makeatletter
\renewcommand\chapterlinesformat[3]{%
  \IfArgIsEmpty{#2}
    {#3}
    {\@hangfrom{\hspace{-\secnumwidth}\makebox[\secnumwidth][l]{#2}}{#3}}%
}

\renewcommand\sectionlinesformat[4]{%
  \IfArgIsEmpty{#3}
    {#4}
    {\@hangfrom{\hspace{-\secnumwidth}\makebox[\secnumwidth][l]{#3}}{#4}}%    
}
\makeatother

\usepackage[
  layoutsize={\dimexpr\paperwidth-\secnumwidth\relax,\paperheight},
  layoutoffset={\secnumwidth,0cm},
  inner=1cm,
  outer=2cm,
  showframe,
]{geometry}

\usepackage{blindtext}% dummy text

\begin{document}
\tableofcontents
\chapter{Kapitel}
\blindtext
\section{Abschnitt}
\subsection{Unterabschnitt}
\subsubsection{Unterunterabschnitt}
\blindtext
\addsec{Abschnitt ohne Nummer}
\blindtext
\end{document}

Result:

enter image description here


Update: It is better to use only the geometry options like @egreg showed in his answer. But the following code works also if the KOMA-Script option chapterprefix is used.

\documentclass[
  paper=a4,
  chapterprefix
]{scrbook}[2015/10/03]

\RedeclareSectionCommands[indent=-10mm]{section,subsection,subsubsection}

\renewcommand*{\chapterformat}{%
  \hspace{-10mm}\mbox{\chapappifchapterprefix{\nobreakspace}\thechapter
  \autodot\IfUsePrefixLine{}{\enskip}}%
}

\renewcommand{\chapterlineswithprefixformat}[3]{%
  #2\hspace{-10mm}\parbox[t]{\dimexpr\textwidth+10mm}{\raggedchapter#3}%
}

\usepackage[
  layoutsize={20cm,27.9cm},% cut 1cm from the width
  layoutoffset={1cm,0cm},% put it in the offset
  inner=1cm,
  outer=2cm,
  showframe,
]{geometry}% from http://tex.stackexchange.com/a/280792/43317


\usepackage{blindtext}% dummy text

\begin{document}
\tableofcontents
\Blinddocument
\end{document}

enter image description here

Original answer:

Maybe something like that

\documentclass[
  chapterprefix
]{scrbook}[2015/10/03]

\RedeclareSectionCommands[indent=-10mm]{section,subsection,subsubsection}
\renewcommand*{\chapterformat}{%
  \hskip -10mm\mbox{\chapappifchapterprefix{\nobreakspace}\thechapter
  \autodot\IfUsePrefixLine{}{\enskip}}%
}

\renewcommand{\chapterlineswithprefixformat}[3]{%
  #2\hskip -10mm\parbox[t]{\dimexpr\textwidth+10mm}{\raggedchapter#3}%
}

\usepackage[inner=10mm,outer=20mm,nomarginpar
  ,showframe% shows the page layout
]{geometry}
\addtolength\hoffset{10mm}
\addtolength\textwidth{-10mm}

\usepackage{blindtext}% dummy text

\begin{document}
\tableofcontents
\chapter{Kapitel}
\parbox{\linewidth}{\blindtext}
\section{Abschnitt}
\begin{center}
\blindtext
\end{center}
\Blinddocument
\end{document}

enter image description here

esdd
  • 85,675
7

You can use a trick I learnt some time ago: using the layout feature of geometry

\documentclass{scrbook}
\usepackage{geometry}
\usepackage{kantlipsum}

\geometry{
  a4paper,
  layoutsize={20cm,27.9cm},% cut 1cm from the width
  layoutoffset={1cm,0cm},% put it in the offset
  inner=1cm,
  outer=2cm,
  showframe,
}

\renewcommand{\chapterformat}{%
  \hspace*{-1cm}%
  \mbox{\chapappifchapterprefix{\nobreakspace}\thechapter \autodot\IfUsePrefixLine{}{\enskip}}%
}

\renewcommand{\sectionformat}{\hspace*{-1cm}\thesection\autodot\enskip}
\renewcommand{\subsectionformat}{\hspace*{-1cm}\thesubsection\autodot\enskip}
\renewcommand{\subsubsectionformat}{\hspace*{-1cm}\thesubsubsection\autodot\enskip}

\setcounter{secnumdepth}{3}

\begin{document}

\chapter{Title}

\kant[1]

\section{A title}

\subsection{A subtitle}

\subsubsection{A subsubtitle}

\kant[2-4]

\section{A title}

\subsection{A subtitle}

\subsubsection{A subsubtitle}

\kant[5-6]

\section{A title}

\subsection{A subtitle}

\subsubsection{A subsubtitle}

\kant[7-15]

\end{document}

enter image description here

egreg
  • 1,121,712
2

Setting \leftskip works for normal paragraphs, but not for lists, which require additional tweaking:

\RequirePackage{enumitem}  % If using a custom class, else replace with \usepackage{enumitem}
\AtBeginDocument{  % Or put this after \begin{document}
    \setlength{\leftskip}{10mm}
    \setlist[1]{leftmargin=15mm,labelwidth=5mm}
}

This is probably incomplete, e.g. I haven't tested tables and figures with this yet.