3

My MWE does not compile and the error is: ! LaTeX Error: \chaptermark undefined. I have debugged to the extent that I know the error is the interaction between classicthesis and my \SC command somehow interacting with \spacedlowsmallcaps -- which is why I am attempting to re-define the \spacedlowsmallcaps control sequence.

Basically I am trying to wrest control of smallcaps from classicthesis.

\documentclass[10pt,letterpaper]{scrartcl}
\usepackage{fontspec}
\setmainfont{Alegreya}

\newfontfamily{\SCaps}{Alegreya SC}
\DeclareTextFontCommand{\SC}{\SCaps}

\usepackage{classicthesis}
\renewcommand{\spacedlowsmallcaps}[1]{\DeclareRobustCommand{\SC{#1}}}

\begin{document}

Hello World

\spacedlowsmallcaps{Hello World}

\end{document}
  • 2
    classicthesis is the source of basically any problem in this universe ;-) – user31729 May 4 '16 at 15:38
  • @ChristianHupfer And that is why engineers invented duct tape (which is like the Star Wars' "force")... it has a light side, it has a dark side, and it binds the universe together. – Steven B. Segletes May 4 '16 at 15:42
  • 1
    scrartcl does not define \chapter. If you want to use this class you have to set option nochapters for classicthesis. Or you switch to scrreprt or scrbook. – esdd May 4 '16 at 15:44
  • 1
    @StevenB.Segletes: classicthesis is even worse than the Dark side ;-) – user31729 May 4 '16 at 15:46
  • 1
    There is more than just two of us ;-) – Johannes_B May 4 '16 at 18:37
3

Of course you get an error: if you want to use scrartcl you have to call

\usepackage[nochapters]{classicthesis}

However your redefinition of \spacedlowsmallcaps makes no sense:

\renewcommand{\spacedlowsmallcaps}[1]{\SC{#1}}

is probably what you want.


There is no need to do tricks, though.

\documentclass[10pt,letterpaper]{scrartcl}

\usepackage{fontspec}

\usepackage[nochapters]{classicthesis}

\setmainfont{Alegreya}[
  SmallCapsFont=* SC,
]

\begin{document}

Hello World

\spacedlowsmallcaps{Hello World}

\end{document}

enter image description here

If you don't want to rely on soul for letter spacing when using XeLaTeX, add this code before \begin{document}:

\DeclareRobustCommand{\spacedlowsmallcaps}[1]{{%
  \normalfont\scshape
  \addfontfeatures{LetterSpace=10}%
  \MakeLowercase{#1}%
}}
  • I had used \DeclareRobustCommand because the definition of \spacedlowsmallcaps contained that command. Why did inclusion of \DeclareRobustCommand prevent the font from changing? And thanks for answering both the question asked and the comment question. – A Feldman May 4 '16 at 15:55
  • @AFeldman Your usage of \DeclareRobustCommand is wrong to begin with; it's much similar to \newcommand: does it make sense there? – egreg May 4 '16 at 15:58
  • When you put it that way it seems obvious. So given that \spacedlowsmallcaps was defined using \DeclareRobustCommand I should probably use it for my redefinition. – A Feldman May 4 '16 at 16:03
  • @AFeldman Currently, \spacedlowsmallcaps is in a few cases being written to the .toc file, that's why, I think, it's been defined as robust. The way you used \DeclareRobustCommand is wrong: that command is equivalent to \newcommand, as egreg pointed out, not just something that makes its argument robust. Note that with this redefinition your titles won't be either spaced or low, just regular smallcaps. – PhilipPirrip May 4 '16 at 16:55
  • 1
    @PhilipPirrip I added a way to avoid soul. – egreg May 4 '16 at 18:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.