[Tex/LaTex] Change font of single greek letter in math environment for all equations (classicthesis.sty)

classicthesiscomputer-moderneulerfontsmath-mode

I am using the classicthesis style (not the whole package, just the .sty) to write a (very long) document, and I don't like the Euler font for \xi in the math environment. This is an example with the Euler font:

\documentclass[a4paper,10 pt,twoside]{book}
\usepackage[T1]{fontenc} %font encoding
\usepackage[utf8]{inputenc} %input encoding
\usepackage[french,english]{babel}
\usepackage[linedheaders,parts,pdfspacing]{classicthesis} % ,manychapters

\begin{document}
This is \verb+\xi+: $\xi$
\end{document}

enter image description here

Whereas this is how it looks with the computer modern (CM) font:

enter image description here

I like the other characters of Euler, but for \xi I would like to use the CM font.

Is there a way to change the font for \xi from Euler to CM in the whole document, but keeping Euler for the other math fonts?

Best Answer

Here I save the original as \altxi, so that both remain available.

I used Fig.4 on p.430 of the TeXbook, to determine the font name as cmmi and the slot as 24.

Side note: as a general rule, this is a bad idea, as the font dimensions and weight of what you are replacing with will generally not match those of what is being replaced.

\documentclass[a4paper,10 pt,twoside]{book}
\usepackage[T1]{fontenc} %font encoding
\usepackage[utf8]{inputenc} %input encoding
\usepackage[french,english]{babel}
\usepackage[linedheaders,parts,pdfspacing]{classicthesis} % ,manychapters
% =============================================
%Import symbols from font cmmi without importing the whole package
% =============================================
\DeclareFontFamily{U} {cmmi}{}

\DeclareFontShape{U}{cmmi}{m}{n}{
  <-6> cmmi5
  <6-7> cmmi6
  <7-8> cmmi7
  <8-9> cmmi8
  <9-10> cmmi9
  <10-12> cmmi10
  <12-> cmmi12}{}

\DeclareSymbolFont{Xcmmi} {U} {cmmi}{m}{n}

\let\altxi\xi
\DeclareMathSymbol{\xi}{\mathord}{Xcmmi}{24}
% =============================================

\begin{document}
This is \verb+\xi+: $\xi$ and $\altxi$
\end{document}

enter image description here