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}
A Feldman
  • 3,930
  • 2
    classicthesis is the source of basically any problem in this universe ;-) –  May 04 '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 04 '16 at 15:42
  • Yes, I am aware of that aspect of this problem. – A Feldman May 04 '16 at 15:43
  • 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 04 '16 at 15:44
  • 1
    @StevenB.Segletes: classicthesis is even worse than the Dark side ;-) –  May 04 '16 at 15:46
  • Thanks @esdd now it compiles, but absolutely refuses to use the Alegreya SC font, either with the redefined \spacedlowsmallcaps or with \SC Anybody have a handle on why? I guess I might need to post a separate question. – A Feldman May 04 '16 at 15:48
  • By the way, do people use classicthesis because it gives better results in some way; given the acknowledged source of problems it causes. – A Feldman May 04 '16 at 16:13
  • @AFeldman It surely gives better results, typographically speaking (standard classes are just OK, KOMA-script classes, if I may say, look really ugly), and sure there's a price to pay for using it. You'll see (two!) people complaining about it here, saying it should never be used, and I'm thinking they probably have some personal issues with it. The package is far from perfect, sure, still you don't see better options being developed. Specifically, I'd really like to see \spacedlowsmallcaps being defined so that it acts as a font switch (i.e. like \scshape, not \MakeLowercase{}) – PhilipPirrip May 04 '16 at 17:17
  • @PhilipPirrip Thanks much for the explanation, and for your below remark on the need for a robust command also. – A Feldman May 04 '16 at 17:52
  • 1
    There is more than just two of us ;-) – Johannes_B May 04 '16 at 18:37
  • Thanks, @Johannes_B I like the way things look with classicthesis but I am no expert on typographical things. I do notice that it takes forever to compile. – A Feldman May 04 '16 at 18:58
  • @AFeldman The typography is one thing, the implementation another. For example, classicthesis is designed to work with a KOMA class, but does no testing if it is used. No problem though, it loads needed packages. But it does not set the options that are needed for a sane type block. Use the package with book or something and use \Blinddocument (from blindtext) and you will notice, something is off. classicthesis also uses scrpage which is now deprecated for i think two years. And it uses titlesec which raises quite some erros with KOMA. classicthesis needs an update, now. – Johannes_B May 04 '16 at 19:56
  • You're right, @Johannes_B, about headinclude and footinclude - they should be always there. You're not right about scrpage, classicthesis has switched to scrlayer-scrpage. Not sure if there's an easy solution for titlesec+koma, seems that koma will relax it's requirements now. Is there a better way of doing what titlesec does, but remaining compatible with classes other than koma? Sure, one could do it from scratch, and still run into same problems. http://www.komascript.de/titlesec – PhilipPirrip May 05 '16 at 02:14
  • @PhilipPirrip Uses scrlayer-scrpage but still with the old compatibility commands of scrpage2. classicthesis should be a class file, not a package. That way, no testing would be needed on the class used. You would need to test for KOMA, which has its own \DeclareSectionCommand, standard classes and memoir and provide appropriate things for all. – Johannes_B May 05 '16 at 06:01
  • Templates are a mess. – Johannes_B May 05 '16 at 06:02

1 Answers1

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}%
}}
egreg
  • 1,121,712
  • 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 04 '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 04 '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 04 '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 04 '16 at 16:55
  • The reason for the question is that I wanted to use Alegreya throughout, and without the redefinition, that did not seem to be possible as \spacedlowsmallcaps stopped working (no smallcaps) the moment I changed the font. – A Feldman May 04 '16 at 17:53
  • @AFeldman I added the real way to cope with the problem, based on the new information you gave. – egreg May 04 '16 at 18:04
  • Check if pdfspacing option is in the call to classicthesis. Soul package letterspacing tends to break more often. – PhilipPirrip May 04 '16 at 18:06
  • @egreg Thanks, much better to use that than my idea. – A Feldman May 04 '16 at 18:12
  • Oh, nevermind... You're using XeLaTeX, classicthesis will switch to soul anyway. – PhilipPirrip May 04 '16 at 18:25
  • 1
    @PhilipPirrip I added a way to avoid soul. – egreg May 04 '16 at 18:41
  • @PhilipPirrip thanks for your comments, I usually use lualatex. I'll keep in mind your warning regarding soul. – A Feldman May 04 '16 at 18:41