Scrbook headings style

1,735

As per the comments to the question, removing the titlesec and classicthesis packages solved the problem. In retrospect, it is advisable to choose a complete class earlier, like the suggested KOMA-script, as this will save time with the final product - as opposed to hacking together solutions along the way.

As it happened, I did not have the time to switch classes at the point I was with writing and rewriting content, as well as the formatting which was already much in place, so I went with the suggested solution; and it produced an acceptable final product.

Share:
1,735

Related videos on Youtube

OleVik
Author by

OleVik

Updated on October 24, 2020

Comments

  • OleVik
    OleVik about 3 years

    I am trying to simplify the heading styles of the scrbook-class for use in my thesis, but am unable to find a way to stop the headings from being underlined and chapters being marked by their numbers. Here is the class-specification I am using:

    \documentclass[
    12pt,
    a4paper,
    oneside,
    headinclude,
    footinclude,
    headnosepline,
    BCOR5mm,
    ]{scrbook}
    

    Below is an example of the current output. What I essentially want to achieve is get rid of the line underneath the chapter title, and the number to the right.

    Scrbook Example

    Any thoughts on doing this would be greatly appreciated.

    Added MWE:

    main.tex

    \documentclass[
    12pt,
    a4paper,
    oneside,
    headinclude,
    footinclude,
    headnosepline,
    BCOR5mm,
    ]{scrbook}
    \input{structure.tex}
    \hyphenation{Fortran hy-phen-ation}
    
    \begin{document}
    
    \makeatletter
    \begin{titlepage}
    \pagenumbering{gobble}
    \thispagestyle{empty}
    \title{Title}
    \author{Author}
    \date{Spring \the\year}
    \end{titlepage}
    \makeatother
    
    \newpage\pagestyle{scrheadings}\pagenumbering{Roman}
    \chapter*{Contents}\singlespacing
    \tableofcontents
    \onehalfspacing
    \pagestyle{plain}
    \newpage\chapter{Introduction} \label{part:Introduction}
    \end{document}
    

    structure.tex

    \usepackage[parts,beramono,eulermath,pdfspacing,dottedtoc]{classicthesis}
    \usepackage[english]{babel}
    \usepackage[round, longnamesfirst]{natbib}
    \setcitestyle{aysep={}}
    \bibliographystyle{plainnat}
    \setcitestyle{notesep={: }}
    
    \setlength{\parindent}{0em}
    \setlength{\parskip}{1em}
    \renewcommand{\baselinestretch}{1.3}
    \usepackage{titlesec}
    \titlespacing\section{0pt}{12pt plus 4pt minus 2pt}{0pt plus 2pt minus 2pt}
    \titlespacing\subsection{0pt}{12pt plus 4pt minus 2pt}{0pt plus 2pt minus 2pt}
    \titlespacing\subsubsection{0pt}{12pt plus 4pt minus 2pt}{0pt plus 2pt minus 2pt}
    \titlespacing*{\paragraph} {0pt}{3.25ex plus 1ex minus .2ex}{1em}
    \titlespacing*{\subparagraph} {\parindent}{3.25ex plus 1ex minus .2ex}{1em}
    
    \usepackage{geometry}
    \usepackage[T1]{fontenc}
    \usepackage[utf8]{inputenc}
    \usepackage{graphicx}
    \usepackage{tikz}
    \usetikzlibrary{arrows}
    \usepackage{grffile}
    \usepackage{pgfplots}
    \usepackage{gnuplottex}%[miktex]%[shell]
    \usepackage{pgfplotstable}
    \pgfplotstableset{col sep = comma}
    \pgfplotsset{width=\textwidth,compat=1.9}
    \usetikzlibrary{pgfplots.groupplots}
    \usepackage{filecontents}
    \graphicspath{{Figures/}}
    \usepackage{enumitem}
    \usepackage{subfig}
    \usepackage{amsmath,amssymb,amsthm}
    \makeatletter
    \def\thmhead@plain#1#2#3{%
      \thmname{#1}\thmnumber{\@ifnotempty{#1}{ }\@upn{#2}}%
      \thmnote{: {\the\thm@notefont#3}}}
    \let\thmhead\thmhead@plain
    \makeatother
    \usepackage{varioref}
    \usepackage{times}
    \usepackage{chngpage}
    \usepackage{tabulary}
    \usepackage{rotating}
    \usepackage{tabularx}
    \usepackage{placeins}
    \usepackage{float}
    \usepackage{floatpag}
    \usepackage{booktabs}
    \usepackage{multirow}
    \usepackage{caption}
    \usepackage{setspace}
    \usepackage[flushleft]{threeparttable}
    \usepackage[normalem]{ulem}
    \newcommand{\msout}[1]{\text{\sout{\ensuremath{#1}}}}
    \usepackage{chronology}
    \usepackage{easy-todo}
    \input{PgfplotNan.tex}
    \usepackage{titletoc}
    \makeatletter
    \renewcommand\tableofcontents{%
        \@starttoc{toc}%
    }
    \makeatother
    \usepackage{setspace}
    \setcounter{secnumdepth}{2}
    \setcounter{tocdepth}{2}
    
    \usepackage{amsfonts}
    \usepackage{datagloss}
    \selectcolormodel{gray}
    
    \newenvironment{blockquote}{%
      \par%
      \em
      \medskip
      \leftskip=4em\rightskip=2em%
      \noindent\ignorespaces}{%
      \par\medskip}
    
    \makeatletter
    \pgfplotsset{
        every axis x label/.append style={
            alias=current axis xlabel
        },
        legend pos/outer south/.style={
            /pgfplots/legend style={
                at={%
                    (%
                    \@ifundefined{pgf@sh@ns@current axis xlabel}%
                    {xticklabel cs:0.5}%
                    {current axis xlabel.south}%
                    )%
                },
                anchor=north
            }
        }
    }
    \makeatother
    
    \newlength\figureheight
    \newlength\figurewidth
    
    \pgfplotscreateplotcyclelist{black-white-mark}{%
        solid, every mark/.append style={solid, fill=gray}, mark=*\\%
        dotted, every mark/.append style={solid, fill=gray}, mark=square*\\%
        densely dotted, every mark/.append style={solid, fill=gray}, mark=otimes*\\%
        loosely dotted, every mark/.append style={solid, fill=gray}, mark=triangle*\\%
        dashed, every mark/.append style={solid, fill=gray},mark=diamond*\\%
        loosely dashed, every mark/.append style={solid, fill=gray},mark=*\\%
        densely dashed, every mark/.append style={solid, fill=gray},mark=square*\\%
        dashdotted, every mark/.append style={solid, fill=gray},mark=otimes*\\%
        dasdotdotted, every mark/.append style={solid},mark=star\\%
        densely dashdotted,every mark/.append style={solid, fill=gray},mark=diamond*\\%
    }
    \pgfplotscreateplotcyclelist{black-white-nomark}{%
        solid\\%
        dotted\\%
        densely dotted\\%
        loosely dotted\\%
        dashed\\%
        loosely dashed\\%
        densely dashed\\%
        dashdotted\\%
        dasdotdotted\\%
        densely dashdotted\\%
    }
    \newcommand{\chartstyle}{
        /pgf/number format/.cd,
        use comma,
        1000 sep={},
        ymajorgrids=true,
        grid style=dashed,
        % legend style={at={(0,0)}, anchor=north east, align=left}, % Lower left corner
        legend pos=outer south, % Below
        % legend pos=north east, % Top right corner
        cycle list name=black-white-nomark,
    }
    \newcommand{\nochartstyle}{
        /pgf/number format/.cd,
        use comma,
        1000 sep={},
        ymajorgrids=false,
        grid style=dashed,
        % legend style={at={(0,0)}, anchor=north east, align=left}, % Lower left corner
        legend pos=outer south, % Below
        % legend pos=north east, % Top right corner
        cycle list name=black-white-nomark,
        xlabel={},
        xticklabels={,,}
        ylabel={},
        yticklabels={,,},
        axis y line*=left,
        scaled y ticks = false
    }
    
    \theoremstyle{definition}
    \newtheorem{definition}{Definition}
    
    \theoremstyle{plain}
    \newtheorem{theorem}{Theorem}
    
    \theoremstyle{remark}
    \newtheorem*{remark}{Remark}
    
    \theoremstyle{plain}
    \newtheorem{hyp}{Hypothesis} 
    \newtheorem{subhyp}{Hypothesis}[hyp]
    
    \hypersetup{
    colorlinks=true, breaklinks=true, bookmarks=true,bookmarksnumbered,
    urlcolor=black, linkcolor=black, citecolor=black,
    pdftitle={},
    pdfauthor={\textcopyright},
    pdfsubject={},
    pdfkeywords={},
    pdfcreator={pdfLaTeX},
    pdfproducer={LaTeX with hyperref and ClassicThesis}
    }
    
    • Admin
      Admin over 8 years
      Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. I fear somehow, that you're using scrbook together with titlesec or even classicthesis.
    • OleVik
      OleVik over 8 years
      I'm not at the workstation at current, but I do in fact have a vast collage of packages (including classicthesis, and quite possibly titlesec) and solutions that sort of just built as the project went along. I was considering started with a clean template and just input my data again, it's all well-organized as chapters in folders. Why would classicthesis be disadvantageous with scrbook?
    • Johannes_B
      Johannes_B over 8 years
      classicthesis does many things that are no well, are plain run you fool. As long as you know, where classicthesis messes up stuff, you are fine. If not, things may work out not as you want.
    • OleVik
      OleVik over 8 years
      I added a MWE, which compiles without error. It is basically as my document appears currently (save a few edits to remove personalia and comments).
    • Johannes_B
      Johannes_B over 8 years
      Kick out the titlesec stuff and you are fine. Kick out classicthesis as well, it defines the appearance of chapter titles as well. Have you tried KOMA-script without any of those stuff?
    • OleVik
      OleVik over 8 years
      I have not, I just recently stumbled over it when I was told that chapter headings are preferable in a thesis, and I was writing in an article class. With the titlesec and classicthesis packages remove I get an error with \c@lofdepth and \c@lotdepth from tocloft.sty.
    • MaxNoe
      MaxNoe over 8 years
      Did you clear all help files? Like *.aux, *.toc etc?
    • Johannes_B
      Johannes_B over 8 years
      Taking your code and running it, i get errors about files not available. No room for a new `dimen'. Removing all the titlesec and classicsthesis stuff will give an error with the next run, but once the auxiliary files are clear, it should work fine. You have a huge (HUGE) amount of packages there, 98% not related to the topic at hand. I bet this is some kind of template that a good soul gave you. I bet didn't know, that this isn't best-practice, it is bad-practice.
    • Johannes_B
      Johannes_B over 8 years
      KOMA script provides many many many features to help you using a simple interface. You on the other hand are setting stuff by hand, You want to set the toc singelspaced, that is fine. KOMA gives you quite a simple hook for that. You (or the initiator of that code) is whacking KOMAs definition to death, implementing its own version using a corkscrew and some gaffa tape.
    • OleVik
      OleVik over 8 years
      I did clear the cache (I compile with ShareLatex), but the error persisted. I googled a bit and after adding in the hyperref package (not sure why it was not explicitly called) and removing the subfig package it compiled.
    • OleVik
      OleVik over 8 years
      Is there some quick tutorial or good template for using KOMA to write a thesis? You are right, the template I used in its original form is far removed from what it ended up as (it was a bit limiting for what I needed), and almost all it it are additions added by hand.
    • Johannes_B
      Johannes_B over 8 years
      hyperref should be loaded last (few exceptions). classicthesis is loading it for you, right at the beginning.
    • Johannes_B
      Johannes_B over 8 years
      LaTeX for complete novices introduces the first steps with LaTeX on KOMA examples. The KOMA manual can be found on your hard drive -> texdoc koma
    • Johannes_B
      Johannes_B over 8 years
      To get the tableofcontents and the other lists singlespaced, use \AfterTOCHead as seen in Set list of content and other lists single spaced
    • OleVik
      OleVik over 8 years
      Rather than keep hacking away at the current template and hoping for a suitable outcome, I will take your advice and go with a clean KOMA template. After all, most of the content is already written, and can be input practically anywhere. I found a good thesis template on GitHub: github.com/novoid/LaTeX-KOMA-template As an answer to the original question, I think your initial suggestion of removing titlesec and classicthesis is sufficient. Would you mind posting it as an answer (SE should have a function to elevate comments to answers)?
    • Johannes_B
      Johannes_B over 8 years
      In case you speak german: komascript.de/latexvorlage
    • OleVik
      OleVik about 8 years
      It was solved by suggestions in these comments,particularly the above of remove titlesec and classicthesis. I'll add it as an answer, had forgotten about this question some time ago (stresses of actually writing the thesis and all that).