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}
blackened
  • 4,181

1 Answers1

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.

Torbjørn T.
  • 206,688