2

How can the following (titleformat part) be applied to standard book class and without classicthesis:

\documentclass[11pt,a4paper,footinclude=true,headinclude=true]{scrbook} % KOMA-Script book
\usepackage{lipsum}
\usepackage{graphicx}  %% For \scalebox
\usepackage{classicthesis} %


\titleformat{\chapter}[display]%
        {\relax}
        {\mbox{}\oldmarginpar{\vspace*{4\baselineskip}%
        \color{halfgray}\scalebox{1.5}{\chapterNumber\thechapter}}}
        {0pt}%
        {\raggedright\spacedallcaps}[\normalsize\vspace*{.8\baselineskip}\titlerule]%
\titlespacing*{\chapter}{0pt}{0pt}{1.2\baselineskip}

\begin{document}

\tableofcontents

\chapter{The grand design}
\section{First principles}
\subsection{Typography exists to honour content}
\lipsum


\end{document}

For example, why does the following give Undefined control sequence. [\chapter{The grand design}] error:

\documentclass[12pt, a4paper]{book}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[american]{babel}
\usepackage{microtype}
\usepackage{libertine}
\usepackage{lipsum}
\usepackage{titlesec}
\usepackage{adjustbox}
\usepackage{graphicx}
\usepackage{xparse}
\usepackage{xcolor}    

\titleformat{\chapter}[display]%
        {\relax}
        {\mbox{}\oldmarginpar{\vspace*{4\baselineskip}%
        \color{gray}\scalebox{1.5}{\chapterNumber\thechapter}}}
        {0pt}%
        {\raggedright\spacedallcaps}[\normalsize\vspace*{.8\baselineskip}\titlerule]%
\titlespacing*{\chapter}{0pt}{0pt}{1.2\baselineskip}    

\begin{document}
\chapter{The grand design}
\section{First principles}
\subsection{Typography exists to honour content}
\lipsum
\end{document}
5
  • So you don't want to use scrbook but book? Or what is your aim?
    – TeXnician
    Jun 30, 2018 at 9:46
  • Yes, I want to use the standard, plain book class.
    – blackened
    Jun 30, 2018 at 9:47
  • Are you using pdflatex, or xelatex, or lualatex? I ask because classicthesis has different definitions of some of those macros depending on the engine used. Jun 30, 2018 at 13:20
  • @Torbjørn pdflatex
    – blackened
    Jun 30, 2018 at 13:22
  • I had the wrong colour by the way, try \colorlet{halfgray}{black!45}. Jun 30, 2018 at 13:34

1 Answer 1

3

This works at least, I haven't done much comparison with the original.

\documentclass[11pt,a4paper]{book} 
\usepackage{lipsum}
\usepackage{graphicx}  %% For \scalebox
%\usepackage{classicthesis} %
\usepackage{titlesec} % for \titleformat
\usepackage{microtype} % for \textls, used in \spacedallcaps
\usepackage{textcase} % for \MakeTextUppercase, used in \spacedallcaps
\usepackage{xcolor} % for color

\colorlet{halfgray}{black!45} % color of chapter number

\DeclareFixedFont{\chapterNumber}{T1}{pplj}{m}{n}{70} % font definition
\DeclareRobustCommand{\spacedallcaps}[1]{\textls[160]{\MakeTextUppercase{#1}}} % used in chapter style

\titleformat{\chapter}[display]%
        {\relax}
        {\mbox{}\marginpar{\vspace*{4\baselineskip}% changed \oldmarginpar to \marginpar
        \color{halfgray}\scalebox{1.5}{\chapterNumber\thechapter}}}
        {0pt}%
        {\raggedright\spacedallcaps}[\normalsize\vspace*{.8\baselineskip}\titlerule]%
\titlespacing*{\chapter}{0pt}{0pt}{1.2\baselineskip}

\begin{document}

\tableofcontents

\chapter{The grand design}
\section{First principles}
\subsection{Typography exists to honour content}
\lipsum


\end{document}

Regarding your last example, the complete error is

! Undefined control sequence.
<argument> \mbox {}\oldmarginpar 
                                 {\vspace *{4\baselineskip }\color {gray}\sc...
l.23 \chapter{The grand design}

? 

which means that \oldmarginpar is not defined (the last macro before the line break in the error). classicthesis does \let\oldmarginpar\marginpar, and then redefines \marginpar. So use \marginpar instead of \oldmarginpar in the \titleformat.

You will get errors for \chapterNumber and \spacedallcaps as well, as these are macros defined in classicthesis.sty. I got the definitions from there. Finally halfgray is a colour defined by classicthesis, so you need a definition of that as well.

2
  • How can I control horizontal location of the sectioning label (chapter number)? Here it is far right. Suppose I want nudge it a bit to the left.
    – blackened
    Jul 13, 2018 at 7:37
  • 1
    @blackened \hspace{-5pt} just before \color{halfgray}? Jul 13, 2018 at 7:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .