spacedallcaps and spacedlowsmallcaps undefined when compiling with plain latex

Issue #174 open
Luca Dessì created an issue

When compiling with latex (instead of pdflatex) I get error

! Undefined control sequence.
<argument> \raggedright \spacedallcaps

A minimal working example who reproduce the problem is

\documentclass[a4paper,12pt]{scrreprt}
\usepackage{classicthesis}
\begin{document}
\chapter{Lorem}
Lorem ipsum dolor sit amet
\end{document}

This code compiles just fine with pdflatex but gives the error mentioned above with latex

I discovered that with an older version of the package I don’t get the error, comparing the two classicthesis.sty I found that portion of the code where spacedallcaps and spacedlowsmallcaps are defined is changed from

%%% engine-dependent letterspacing: microtype for pdflatex, fontspec for xelatex and luatex
\ifthenelse{\boolean{ct@minionpro}}{% MinionPro small caps
        \PackageInfo{classicthesis}{Using MinionPro's textssc for character spacing.}
        \DeclareRobustCommand{\spacedallcaps}[1]{\textssc{\MakeTextUppercase{#1}}}
        \DeclareRobustCommand{\spacedlowsmallcaps}[1]{\textssc{\MakeTextLowercase{#1}}}
      }{
        % engine-based spacedallcaps and spacedlowsmallcaps
        \ifthenelse{\boolean{pdf}\OR\boolean{luatex}}{ % pdf will soon test true for both pdflatex and luatex; \AND\NOT\boolean{luatex}
            \PackageInfo{classicthesis}{Using pdftex/microtype for character spacing.%
                                        Make sure your pdftex is version 1.40 or higher.}%
            \microtypesetup{expansion=false}
            \DeclareRobustCommand{\spacedallcaps}[1]{\textls[160]{\MakeTextUppercase{#1}}}
            \DeclareRobustCommand{\spacedlowsmallcaps}[1]{\textls[80]{\scshape\MakeTextLowercase{#1}}}
          }{\relax}

        \ifthenelse{\boolean{xetex}}{ % use fontspec features; \OR\boolean{luatex} does not work well
          \DeclareRobustCommand{\spacedallcaps}[1]{{\addfontfeature{LetterSpace=18.0}\MakeTextUppercase{#1}}}% WordSpace=1.8
          \DeclareRobustCommand{\spacedlowsmallcaps}[1]{{\addfontfeatures{LetterSpace=14.0}\scshape\MakeTextLowercase{#1}}}% WordSpace=1.8
          }{\relax}

        \ifthenelse{\boolean{pdf}\OR\boolean{xetex}\OR\boolean{luatex}}% ever used? only dvi engines remain
          {\relax}{%
            \RequirePackage{soulutf8} % for letterspacing
                \sodef\allcapsspacing{\upshape}{0.15em}{0.65em}{0.6em}%
                \sodef\lowsmallcapsspacing{\scshape}{0.075em}{0.5em}{0.6em}%
                \DeclareRobustCommand{\spacedallcaps}[1]{\MakeTextUppercase{\allcapsspacing{#1}}}%
                \DeclareRobustCommand{\spacedlowsmallcaps}[1]{\MakeTextLowercase{\lowsmallcapsspacing{#1}}}%\protect
          }%
      }

to

%%% define spacedallcaps and spacedlowsmallcaps
%%% engine-dependent letterspacing: microtype for pdflatex, fontspec for xelatex and luatex
    \ifthenelse{\boolean{pdf}\OR\boolean{luatex}}{ % pdf will soon test true for both pdflatex and luatex; \AND\NOT\boolean{luatex}
      \PackageInfo{classicthesis}{Using microtype for character spacing.%
                                  Make sure your pdflatex is version 1.40 or higher.}%
      % \microtypesetup{expansion=false}
      \microtypesetup{protrusion=true,expansion=true}
      \DeclareRobustCommand{\spacedallcaps}[1]{\textls[160]{\ct@caps\MakeTextUppercase{#1}}}
      \DeclareRobustCommand{\spacedlowsmallcaps}[1]{\textls[80]{\ct@caps\MakeTextLowercase{#1}}}
      }{\relax}

    \ifthenelse{\boolean{xetex}}{ % use fontspec features; \OR\boolean{luatex} does not work well
      \PackageInfo{classicthesis}{Using fontspec for character spacing.}%
      \microtypesetup{expansion=false}
      \DeclareRobustCommand{\spacedallcaps}[1]{{\addfontfeature{LetterSpace=18.0}\ct@caps\MakeTextUppercase{#1}}}% WordSpace=1.8
      \DeclareRobustCommand{\spacedlowsmallcaps}[1]{{\addfontfeatures{LetterSpace=14.0}\ct@caps\MakeTextLowercase{#1}}}% WordSpace=1.8
      }{\relax}

but I don’t have the knowledge to understand exactly what is happening

Official response

Comments (16)

  1. Ivo Pletikosić

    As DVI and PS formats are not that common any more, we decided to drop support for plain latex and stopped using a package that could change letterspacing (can't remember its name any more) for that engine. Would converting from PDF to PS work for you? Feel free to use any older version of classicthesis.sty that works for you; the style has been modernized, yes, but nothing in the style has ever changed. Btw: aren't the two code excerpts in your question the same?

  2. Luca Dessì reporter

    Btw: aren't the two code excerpts in your question the same?

    yeah. Edited now.

    As DVI and PS formats are not that common any more

    I know, I had to use latex instead of pdflatex because I was “playing“ with PStricks

  3. Ivo Pletikosić

    You could just put back the old code, say after the classicthesis.sty has been loaded:

            \ifthenelse{\boolean{pdf}\OR\boolean{xetex}\OR\boolean{luatex}}% ever used? only dvi engines remain
              {\relax}{%
                \RequirePackage{soulutf8} % for letterspacing
                    \sodef\allcapsspacing{\upshape}{0.15em}{0.65em}{0.6em}%
                    \sodef\lowsmallcapsspacing{\scshape}{0.075em}{0.5em}{0.6em}%
                    \DeclareRobustCommand{\spacedallcaps}[1]{\MakeTextUppercase{\allcapsspacing{#1}}}%
                    \DeclareRobustCommand{\spacedlowsmallcaps}[1]{\MakeTextLowercase{\lowsmallcapsspacing{#1}}}%\protect
              }%
    

    When none of the three pdf engines are used, you'll fall back to using soulutf8 package for letterspacing.

  4. Luca Dessì reporter

    Since as mentioned in @Ivo Pletikosić response support to plain latex as been dropped, I’m changing Issue type to enhancement and priority to minor.

    I would suggest adding a warning when plain latex compiler is detected

  5. Ivo Pletikosić
    • changed status to open

    Let me reopen this. I takes about the same amount to code to show all those warnings as it does to make latex work with classicthesis again (so it compiles, not sure if it looks the same - check microtypography, hyperrefs etc). I'm kind of against increasing the entropy in the code because of these, afaik, really marginal cases. Yours truly devil's advocate.

  6. André Miede repo owner

    Thanks for your work and input on this issue. There is now a warning when using plain LaTeX. @Ivo Pletikosić We can also make it work again, but who know what we will find? ;-\

  7. Log in to comment