4

In most cases the default classicthesis section style gives no problem. But, there is some sections in which I need to customized the section font style.

For example, \section{Fe\textsubscript{oct2} terminated Fe\textsubscript{3}O\textsubscript{4} nanocluster model} would make all letter small caps:

enter image description here

but I want the letter "e" in Fe and "oct2" in subscript written as small letter instead of small caps:

enter image description here

How can I achieve that?

user26939
  • 257
  • 1
  • 2
  • 10

2 Answers2

5

The following seems to work (assuming classicthesis' pdfspacing option is active). I don't know if there are places when classicthesis uses its \spacedlowsmallcaps where the non-robust redefinition would cause troubles...

\documentclass{scrbook}
\usepackage[pdfspacing]{classicthesis}
% loadad by `classicthesis' already but so we know it's there,
% provides \NoCaseChange:
\usepackage{textcase}

% chemical formulae:
\usepackage{chemmacros}
\chemsetup{chemformula/format=\normalfont}
% better: use lining numbers for the formulae:
% \chemsetup{chemformula/format=\normalfont\fontfamily{ppl}\selectfont}

% patch \sectionmark, should probably do the same to \chaptermark
% if you're using chapters
\usepackage{etoolbox}
\patchcmd\sectionmark
  {\spacedlowsmallcaps{#1}}
  {\unexpanded{\spacedlowsmallcaps{#1}}}
  {}{}

% the original definition of \spacedlowsmallcaps but not robust:
\renewcommand\spacedlowsmallcaps[1]{\textls[80]{\textsc{\MakeTextLowercase{#1}}}}

\begin{document}

\tableofcontents

\chapter{Some Title}
\section{\NoCaseChange{\ch{Fe_{oct2}}} terminated \NoCaseChange{\ch{Fe3O4}} nanocluster model}

% let's see what the header looks like:
\newpage\null\newpage\null

\end{document}

The table of contents:

enter image description here

The heading:

enter image description here

The header:

enter image description here

cgnieder
  • 66,645
  • Thanks! Actually when I asked, I didn't think of using normal font, but it looks good too (even better). – user26939 Mar 08 '13 at 12:16
  • @user26939 You're welcoms. This is how it should look like, IMHO. This way the proportions with regard to the oldstyle numbers and the small caps are as they should be. You might actually want to use \chemsetup{chemformula/format=\normalfont\fontfamily{ppl}\selectfont} so that chemical formulae get lining numbers instead of oldstyle ones. – cgnieder Mar 08 '13 at 12:32
  • Thanks for the info. Actually I use Minion Pro typeface. In this case I should have \chemsetup{chemformula/format=\normalfont\fontfamily{MinionPro}\selectfont} instead ? – user26939 Mar 08 '13 at 12:47
  • I don't have the MinionPro package installed but according to the documentation something like \chemsetup{chemformula/format=\normalfont\figureversion{lining,proportional}} should work. You might also need to change the redefinition of \spacedlowsmallcaps to \renewcommand\spacedlowsmallcaps[1]{\textssc{\MakeTextLowercase{#1}}} with Minion Pro. – cgnieder Mar 08 '13 at 12:59
  • Thanks. Unfortunately, for now I experience "Package siunitx Error: Support package expl3 too old" when using chemmacros package, , that I need to use \textsubscript{} instead. But that's another issue. – user26939 Mar 08 '13 at 14:06
  • By the way, using \textsubscript{} to replace \ch{...} didn't work here. Is that expected ? – user26939 Mar 08 '13 at 14:31
  • @user26939 you need to update your TeX distribution. chemmacros (and some other packages, too) relies on up to date versions of some programming packages. – cgnieder Mar 08 '13 at 14:33
  • Thanks for the advice. Stranglely the problem with expl3 is still there even after updating. In my other computer, there is even different error occurs: "LaTeX Error: Too many math alphabets used in version normal." For now, I'll just try to resolve that problem first. If I still get stuck, maybe I'll ask new question about that. – user26939 Mar 09 '13 at 17:04
1

classicthesis is printing the heading as lower case small caps already. So you (a) need to switch off the \scshape, easiest done with \textnormal, (b) need to reduce the size of the letter, \scriptsize is one choice, other sizes could be acheived with \fontsize{size}{baselineskip}\selectfont. For the subscripts an extra \textnormal seems fine. You should also provide an optonial argument to \section so these formatting commands don't apply to the table of contents.

EDIT If you also have running heads, then you have change \sectionmark to include the formatting there.

Sample output

running head

Sample running head

\documentclass{scrbook}

\usepackage[nochapters,pdfspacing]{classicthesis}

\newcommand{\hdlower}[1]{\textnormal{\scriptsize #1}}
\newcommand{\hdsub}[1]{\textsubscript{\textnormal{#1}}}

\usepackage{lipsum} %dummy text for illustration

\begin{document}
\tableofcontents

\bigbreak
\hrule
\bigbreak\noindent
Document Body:

\section[Fe\textsubscript{oct2} terminated
  Fe\textsubscript{3}O\textsubscript{4} nanocluster model]%
  {F\hdlower{e}\hdsub{oct2} terminated 
      F\hdlower{e}\hdsub{3}O\hdsub{4} nanocluster model} 

\sectionmark{F\hdlower{e}\hdsub{oct2} terminated
  F\hdlower{e}\hdsub{3}O\hdsub{4} nanocluster model}

\lipsum[1-10] 
\end{document}

The above code provides two commands \hdlower and \hdsub to enact the above suggestions.

Andrew Swann
  • 95,762