2

I'm pretty new to Latex and I just started to write my phd thesis (law, in german) using visual code. My professor has a standard for the structure as seen in the image following. I read some articles about how to change the numbers for chapter, section, subsection etc. but I have no idea how to handle this and if it is even possible. The document class I'm currently using is scrbook. First two pages of the structure

  • 1
    The only tricky bits are the centered titles. OTOH, KOMA has its own way of doing things, so most of what applies to LaTeX does not apply to scrbook. – John Kormylo Sep 03 '21 at 13:28
  • 2
    Do you have a specific aspect that you're trying to achieve? "As seen in the image" is a bit vague. – Teepeemm Sep 03 '21 at 13:51
  • 1
    Maybe your professor can connect you with previous students who used LaTeX and fulfilled his formatting requirements. – Dr. Manuel Kuehner Sep 03 '21 at 16:47

1 Answers1

5

Your decision to use scrbook is a good start.

I'm not an expert for KOMA-script, which really is a huge software package. So the code below may not be the best solution.

One thing I really can't solve is how to print the partentry in the table of contents centered and have a page number on the right.

Please ask specific questions for all your issues. This here is just to get you started!

\documentclass[ngerman]{scrbook}

\usepackage[T1]{fontenc} \usepackage{microtype} \usepackage{babel} \usepackage{libertine} \usepackage{blindtext}

\addtokomafont{part}{\normalfont\bfseries} \addtokomafont{partnumber}{\normalfont\itshape}

\setcounter{secnumdepth}{5} % fünf Ebenen \renewcommand{\thechapter}{§~\arabic{chapter}} \renewcommand{\thesection}{\Alph{section}} \renewcommand{\thesubsection}{\Roman{subsection}} \renewcommand{\thesubsubsection}{\arabic{subsubsection}} \renewcommand{\theparagraph}{\alph{paragraph})}%) \renewcommand*{\thesubparagraph}{\alph{subparagraph}\alph{subparagraph})}

\DeclareTOCStyleEntry[% indentfollows=chapter, numsep=2em, dynnumwidth=true ]{tocline}{chapter}

\title{Meine Diss} \author{Katharina H.} \date{}

\begin{document} \maketitle

\tableofcontents{}

\part{Das Phänomen des gutgläubigen Erwerbs} \label{part:das-phanomen-des}

\blindtext

\chapter{Grundfragen des gutgläubigen Erwerbs} \label{cha:grundfr-des-gutgl}

\blindtext{}

\section{Der Regelungsgegenstand} \label{sec:der-regel}

Etwas Text.

\subsection{Zusammenwirken von diesem und jenem} \label{sec:zusamm-von-dies}

zwei Worte.

\subsubsection{Abgrenzungskriterien} \label{sec:abgrenzungskriterien}

\end{document}

Writing a phd in law will take some time (I needed more than four years). So there is enough time to study the manual. Go and buy the book and just read. Get an introduction into LaTeX.

One more thing: Suppose you are in Part 2, § 14 B.III.2. and you would like to refer to § 14 B.III.1. I always found it ridiculous to give the full reference, instead of writing »see above 1.«. So with some help from this site here I finally developed an abbreviation system, see here: Abbreviated references: just the necessary references, no more

I wrote a package just for my own purposes, but I never could have done without much help, the code is way above my pay grade:

% TODO:
% Paket soll auf verschiedene Optionen hören:
% - "inactive" => \secref ist nur \ref;
% - "Roman" => es gibt nur die Ebenen I. 1. a) aa)
% - "Alph" => Default, die Ebenen A. I. 1. a) aa) 
% "inactive" ist am wichtigsten, weil damit die Laufzeit viel schneller wird. 
% "inactive" ist eingebaut. Ob dadurch irgendwas schneller wird, weiß ich aber
% nicht. 
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{abbrev-ref}[2016/08/22 LaTeX2e Package for abbreviated references]

\RequirePackage{zref-user, zref-counter} \RequirePackage{expl3, l3keys2e, xparse}

\newcommand{\leveldot}{.} \setcounter{secnumdepth}{5} % fünf Ebenen

\renewcommand{\thesection}{\Alph{section}\leveldot} \renewcommand{\thesubsection}{\Roman{subsection}\leveldot} \renewcommand{\thesubsubsection}{\arabic{subsubsection}\leveldot} \renewcommand{\theparagraph}{\alph{paragraph})}%) \renewcommand*{\thesubparagraph}{\alph{subparagraph}\alph{subparagraph})}

%\makeatletter \KOMAoptions{numbers=noenddot}

\zref@newprop{section}[1]{\the\c@section} \zref@newprop{subsection}[1]{\the\c@subsection} \zref@newprop{subsubsection}[1]{\the\c@subsubsection} \zref@newprop{paragraph}[1]{\the\c@paragraph} \zref@newprop{subparagraph}[1]{\the\c@subparagraph}

\zref@addprop{main}{section} \zref@addprop{main}{subsection} \zref@addprop{main}{subsubsection} \zref@addprop{main}{paragraph} \zref@addprop{main}{subparagraph}

\ExplSyntaxOn

\keys_define:nn { abbref-ref-experimental } { inactive .code:n = \renewcommand{\leveldot}{.} \renewcommand{\p@subsection}{\thesection} \renewcommand{\p@subsubsection}{\thesection\thesubsection} \renewcommand{\p@paragraph}{\thesection\thesubsection\thesubsubsection} \renewcommand{\p@subparagraph}{\thesection\thesubsection\thesubsubsection\theparagraph,} \cs_set_eq:NN \secref \ref }

\keys_set:nn {abbref-ref} {} \ProcessKeysOptions {abbref-ref-experimental}

\ProvideDocumentCommand{\secref}{ m }{% %\newcommand\secref[1]{% \hyperref[#1]{% \int_compare:nTF {% A.-Ebene prüfen: sind wir auf dem gleichen Zweig? \zref@extractdefault {#1} {section} {0} = \the\c@section } { % Ja, wir sind auf dem gleichen Zweig % Existiert eine weitere Ebene? \int_compare:nTF {\zref@extractdefault {#1} {subsection} {0} = 0} % Wenn subsection 0 ist, also nicht existiert, dann muss section ausgegeben % werden. { % \emph{Fehlerhafter Verweis} \int_to_Alph:n {\zref@extractdefault {#1} {section} {0}}.% } % Wenn dagegen subsection existiert, dann geht die Prüfung weiter: { % OK, weitere ebene existiert. \int_compare:nTF % I.-Ebene { \zref@extractdefault {#1} {subsection} {0} = \the\c@subsection }% Sind wir auf der gleichen I.-Ebene? {% I.-Ebene: Gleiche Ebene % Prüfung: gibt es eine weitere Ebene? \int_compare:nTF {\zref@extractdefault {#1} {subsubsection} {0} = 0} {% Wenn 0, dann keine weitere Ebene und subsection ausgeben: \int_to_Roman:n {\zref@extractdefault {#1} {subsection} {0}}.% } {% OK, weitere Ebene existiert \int_compare:nTF % subsubsection-Ebene {% 1.-Ebene prüfen \zref@extractdefault {#1} {subsubsection} {0} = \the\c@subsubsection
} {% 1.-Ebene ist gleich %Prüfung: gibt es eine weitere Ebene? \int_compare:nTF % Gibt es eine a-Ebene? {\zref@extractdefault {#1} {paragraph} {0} = 0} {% Wenn 0, dann keine weitere Ebene und subsubsection ausgeben: \int_to_arabic:n { \zref@extractdefault {#1} {subsubsection} {0}}.% } {% Paragraph existiert: \int_compare:nTF % a-Ebene prüfen { \zref@extractdefault {#1} {paragraph} {0} = \the\c@paragraph } {% a-Ebene ist gleich % Prüfung: aa-Ebene vorhanden? \int_compare:nTF % { \zref@extractdefault {#1} {subparagraph} {0} = 0} % {%( damit emacs happy ist \int_to_alph:n {\zref@extractdefault {#1} {paragraph} {0} }),% } {% aa-Ebene vorhanden \int_compare:nTF {\zref@extractdefault {#1} {subparagraph} {0} = \the\c@subparagraph} {\emph{Fehlerhafter VERWEIS}} %( make emacs happy {\int_to_alph:n { \zref@extractdefault {#1} {subparagraph} {0} }% \int_to_alph:n { \zref@extractdefault {#1} {subparagraph} {0} })% } } } {% a-Ebene ist unterschiedlich ( \int_to_alph:n{\zref@extractdefault {#1} {paragraph} {0}})% } } } {% 1.-Ebene ist unterschiedlich \int_to_arabic:n{\zref@extractdefault {#1} {subsubsection} {0}}.% } }% 3. Klammer Prüfung, ob subsection existiert (also wenn ja) }
{% I.-Ebene: ungleich % Also römische Nummer ausgeben \int_to_Roman:n{\zref@extractdefault {#1} {subsection} {0}}.% \int_compare:nTF%existiert die nächste Ebene? { \zref@extractdefault {#1} {subsubsection} {0} = 0 } {}% = 0, subsubsection nicht vorhanden {% ungleich 0 % also arabische Zahl ausgeben \int_to_arabic:n { \zref@extractdefault {#1} {subsubsection} {0}}.% \int_compare:nTF%existiert die nächste Ebene paragraph? { \zref@extractdefault {#1} {paragraph} {0} = 0 } {}% = 0, subsubsection nicht vorhanden {% ungleich 0 ( \int_to_alph:n { \zref@extractdefault {#1} {paragraph} {0}}),% } % subpar Ebene vorhanden? \int_compare:nTF { \zref@extractdefault {#1} {subparagraph} {0} = 0} {}% ja, also existiert subpar nicht { %( \int_to_alph:n {\zref@extractdefault {#1} {subparagraph} {0}}% \int_to_alph:n {\zref@extractdefault {#1} {subparagraph} {0}})% } } }% 3. Klammer I.-Ebene }% 3. Klammer Prüfung, ob I. Ebene besteht. }% 2. Klammer A.-Ebene {% A.-Ebene: Ungleich %ref is from other section \int_to_Alph:n {\zref@extractdefault {#1} {section} {0}}.% \int_compare:nTF%existiert die nächste Ebene? { \zref@extractdefault {#1} {subsection} {0} = 0 } {}% ja, erfüllt, keine subsection {% subsection existiert: \int_to_Roman:n {\zref@extractdefault {#1} {subsection} {0}}.% \int_compare:nTF%existiert die nächste Ebene? { \zref@extractdefault {#1} {subsubsection} {0} = 0 } {}% = 0, subsubsection nicht vorhanden {% ungleich 0 \int_to_arabic:n { \zref@extractdefault {#1} {subsubsection} {0} }.% \int_compare:nTF%existiert die nächste Ebene paragraph? { \zref@extractdefault {#1} {paragraph} {0} = 0 } {}% = 0, paragraph nicht vorhanden {% ungleich 0 ( \int_to_alph:n { \zref@extractdefault {#1} {paragraph} {0} }),% \int_compare:nTF { \zref@extractdefault {#1} {subparagraph} {0} = 0} {}% ja, also existiert subpar nicht {% ( \int_to_alph:n {\zref@extractdefault {#1} {subparagraph} {0}}% \int_to_alph:n {\zref@extractdefault {#1} {subparagraph} {0}})% } } } } }% 3. Klammer A.-Ebene }% hyperref Klammer zu }%Ende Befehlsdefinition myref

\ExplSyntaxOff

\usepackage{bookmark} \newcommand\seclabel[1]{\zlabel{#1}\label{#1}}

\endinput

Keks Dose
  • 30,892
  • 1
    Thank you very much for your help and for sharing your package!

    I'm glad I found someone who wrote a german phd in law with latex and that it actually worked out. I will definitely look into some books, but I wanted to be able to structure it in a proper way from the begining.

    – Katharina H. Sep 08 '21 at 13:02