My question is related to: "Too many math alphabets" error but I think it is sufficiently different that it warrants a new thread.
Suppose two things:
In my preamble, I have already done a great deal of work to setup the "normal" mathversion in various ways.
Also, in my preamble, I have written: \DeclareMathVersion{normal2}
Here's my issue: In the main body of the LaTeX document, I want to do the following:
\mathversion{normal}
\input chapter1.tex
\input chapter2.tex
\input chapter3.tex
\input chapter4.tex
\input chapter5.tex
\input chapter6.tex
\input chapter7.tex
\input chapter8.tex
\input chapter9.tex
(It is actually much more than 9 chapters. I have approximately 200 chapters, which constitute more than 5000 pages of mathematics, for the collected papers of a colleague.)
Unfortunately, let's say that chapter 3 requires several math fonts. (Also suppose that a few of the other chapters require a few math fonts of their own too... but chapter 3 requires the most math fonts.) We know that the limit on the number of math fonts in LaTeX is 16. So if chapter 3 uses quite a few fonts, then I might run out of space for math fonts in other chapters. For instance, by the time I get down to (say) chapters 4, 5, 6, etc., I get this dreaded error:
"Too many math alphabets used in version normal."
I read this thread many times in recent days (as well as many other related threads):
"Too many math alphabets" error
In Lars Hellström's reply, Lars says:
"We were able to solve the issue by declaring a separate math version for one of the more alphabet-hungry papers. Concretely, we put the command \DeclareMathVersion{normal2} at the end of the preamble, and the commands \mathversion{normal2} and \mathversion{normal} just before and after respectively the \include for the alphabet-hungry paper."
So I gave a try to the advice from Lars, as follows:
\mathversion{normal}
\input chapter1.tex
\input chapter2.tex
\mathversion{normal2}
\input chapter3.tex
\mathversion{normal}
\input chapter4.tex
\input chapter5.tex
\input chapter6.tex
\input chapter7.tex
\input chapter8.tex
\input chapter9.tex
Lars said: "One thing this trick relies upon is that new math versions are created with all settings of the old one in place, so all declarations previously made for math version normal will be in place also in math version normal2 (and normal3, and so on, if one needs to repeat the trick)."
but I do not see this happening. When I run pdflatex, I do not see all of the good attributes from \mathversion{normal} to be taking effect in chapter 3. For instance, the math font for the symbols, which works great with the "normal" math version in chapters 1 and 2, as well as chapters 4, 5, 6, ...., BUT the attributes are messed up in chapter 3.
I am pretty desperate to figure this out.
I am wondering (for instance) if I can fully copy the attributes of "normal" into "normal2", and then modify (only) the "normal2" within chapter 3 (without changing "normal"). That way, when I get to chapters 4, 5, 6, .... , I will be back to my regular "normal" math font settings.
Is this possible? I basically want to copy all of the properties from "normal" into "normal2", so that I may use "normal2" for (only) chapter 3 (without modifying "normal" at all), and then finally come back to using "normal" again for chapters 4, 5, 6, ....
Thank you very much for considering my questions!
Please note: I do not want to move to XeTeX or LuaTeX because I have been working on these Collected Papers for many years, and I am nearing the end of the long process. I can make each individual chapter work on its own, but when I try to wrap all of the chapters into one document, the chapters that are using a lot of math fonts (like chapter 3 here) are preventing me from effectively moving onwards to the rest of the document (e.g., to chapters 8 and 9) and to simultaneously keep the nice properties from the "normal" math font throughout.
Here is a full Minimal Working Example:
\documentclass[letterpaper,12pt]{article}
\usepackage[margin=1in,vmargin=1in]{geometry}
\usepackage{amsmath,amssymb}
\usepackage{mathrsfs}
\usepackage{yfonts}
\usepackage{txfonts}
\usepackage[mathscr]{euscript}
\usepackage{mathtime}
\DeclareMathVersion{normal2}
\begin{document}
%% CHAPTER 1
Ch~1: My favorite fonts are $\mathrm{A} + (\mathfrak{B} + \mathcal{C}) = \mathscr{D}$.
\vskip 24pt
%% CHAPTER 2
Ch~2: I also like bold faced types like $\mathbb{BBB}$.
Here is an interesting math equation:
$(\mathnormal{E} + \textfrak{F}) + \textswab{G} + \textgoth{H} = \varmathbb{I}$
\vskip 24pt
\mathversion{normal2}
%% CHAPTER 3
Ch~3: We can try some more font math. This Chapter is using mathversion ``normal2''.
PROBLEM \#1: This equation is strange, because the left-and-right
parens appear as triangles, and the equal sign appears as a script D:
$(\mathsf{J} + \mathtt{K}) = \mathit{L}$
PROBLEM \#2: Also, the following equation, which worked in Ch.~2, does not
work anymore!
$(\mathnormal{E} + \textfrak{F}) + \textswab{G} + \textgoth{H} = \varmathbb{I}$
\mathversion{normal}
\vskip 24pt
Ch~4: Now I am ready to move onwards with more math. For instance,
the math parentheses and equal sign work again,
because this chapter uses mathversion ``normal'' again.
$(\mathbf{Q} + \mathbf{R}) = \mathbf{S}$
Fortunately, the equation from Ch.~2 works again:
$(\mathnormal{E} + \textfrak{F}) + \textswab{G} + \textgoth{H} = \varmathbb{I}$
\end{document}