# problem with \mathcal in MIT Thesis package

I am using this thesis template, and I am using the following packages:

%\documentclass[a4paper,12pt,oneside,leftblank]{mitthesis} % commented out by suggestion
\documentclass{article}
\usepackage{amsmath}
%\DeclareMathAlphabet{\mathcal}{OMS}{cmsy}{m}{n}
\usepackage[T1]{fontenc}
\newcommand*{\mycommand}[1]{\texttt{\emph{#1}}}
\pagestyle{plain}

\begin{document}
\section{sect-1}
This is the math, $\mathcal{P},\mathcal{O},\mathcal{W},\mathcal{F}$, $\mathcal{L}$
\end{document}


The problem is with \mathcal function exactly like my last question, meaning that I would like to have the normal \mathcal font but I could not resolve it using the proposed answer in my previous question.

I have tried:

\DeclareMathAlphabet{\mathcal}{OMS}{cmsy}{m}{n}


but it does not affect the style of the font.

Obtained result example,

Expected result,

First Edit:

If I add the declaration after the mathdesign I receive the following error:

! LaTeX Error: Command \mathcal' already defined.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
...

l.104 ...reMathAlphabet{\mathcal}{OMS}{cmsy}{m}{n}


Second Edit:

After applying the solution proposed as:

\let\mathcal\undefined
\DeclareMathAlphabet{\mathcal}{OMS}{cmsy}{m}{n}


I am getting the following error:

! Use of \reserved@a doesn't match its definition.
\reserved@b ->\relax
\ifmmode \else \non@alpherr \mathcal  \fi \use@mathgrou...
l.842 ...ed baseline (mark $\mathcal{L}$) which cannot


Here I mention the other packages I am using, just to be sure that there is no conflict between them.

  lgrind, cmap, times, graphicx, makeidx, subfig, amsmath, algorithm2e, epstopdf, multirow, multicol, tabularx, rotating, framed,color, fancybox, paralist, float, afterpage, quotchap, cite, verbatim, vector, xcolor, babel, hyphenat, footnote, enumerate, bibentry, afterpage, mathdesign, fontenc,

• The declaration should go after you load mathdesign – egreg Jan 19 '15 at 10:29
• If I add the declaration after the mathdesing I get error, which has been added into the question. And I mentioned the other packages to see if there is a conflict between them that causing this problem, now it has been minimized. – NKN Jan 19 '15 at 10:36
• Please edit your MWE to \documentclass{article}! The issue will stay the same and we do not have to follow an external link. Thank you. – LaRiFaRi Jan 19 '15 at 11:44
• @LaRiFaRi that's not necessarily true. I am having a similar issue (tex.stackexchange.com/questions/236186/…) and it is definitely class-dependent. – Gabriel C. Drummond-Cole Mar 31 '15 at 15:18
• @GabrielC.Drummond-Cole But you are having that issue with a completely other documentclass. In this post, it did not matter which class was used. Therefore I asked for a standard class. When searching an issue, I will always replace non-standard classes by standard ones just in order to see, if the problem lays there. This should be done by the asking person. If the custom class stays in the MWE it implies: "the problem appears due to this class". – LaRiFaRi Mar 31 '15 at 15:29

As mentioned by egreg, you will have to declare your math-alphabet \mathcal after the loading of mathdesign, as this package changes all the math-symbols for you.

As you have seen, the package mathdesign seems to be declaring that same alphabet already. That is why you encounter a "Command \mathcal already defined." here. Before patching around in mathdesign or searching for some possible declaration in your non-standard documentclass, I would just undefine this math-alphabet and declare it as you please. See my MWE; it should hopefully clarify my explanation.

% arara: pdflatex

\documentclass[12pt]{mitthesis}
\let\mathcal\undefined
\DeclareMathAlphabet{\mathcal}{OMS}{cmsy}{m}{n}

\begin{document}
This is the math, $\mathcal{P},\mathcal{O},\mathcal{W},\mathcal{F}$.
\end{document}


As noted below, the declaration should take place before the loading of fontenc.

• This solution is producing another error, that I edited into the question. – NKN Jan 19 '15 at 11:47
• @NKN You get this when compiling my code? You have to be more precise please. Also, your new error appears on line 842. I do not have this line. – LaRiFaRi Jan 19 '15 at 11:48
• No I added the two lines (\let... and \Decl...) of your solution into my latex file and got the new error. Is something else producing this error? – NKN Jan 19 '15 at 11:50
• @NKN Don't know. When I add these two lines after mathdesign` in your MWE (which is still too long), I do not get any error. – LaRiFaRi Jan 19 '15 at 11:52
• Undefining \mathcal with \let\mathcal\undefined is wrong. Use \SetMathAlphabet to change the alphabet. – Ulrike Fischer Jun 17 '19 at 15:36