3

I am trying to submit LaTeX sources to arXiv and I ran into some issues. My project lives in overleaf where I am using TeX Live 2021 and everything compiles without any errors or warnings (except from overfull or underfull boxes). However, when I tried to process the source files on arXiv, the \MakeUppercase leads to a compilation error.

I was able to replicate the error locally using the following snippet, suggesting that the combination of the bm package and the \MakeUppercase is the problem:

\documentclass{standalone}

\usepackage{amsmath} \usepackage{bm}

\begin{document} Test plain: $\bm{x}$.

%replacing \bm by \boldsymbol resolves the issue Test upper: $\bm{\MakeUppercase{x}}$. \end{document}

However, I was unable to replicate this issue inside overleaf (trying both TeX Live 2022 and 2023). After some more digging, I figured out that my TeX Live (2023) distribution uses LaTeX2e 2022-11-01, whereas overleaf uses 2022-06-01. Also, arXiv seems to be using 2022-11-01.

While looking around, I noticed there have been some changes to \MakeUppercase that caused issues with the microtype package. Furthermore, I found this Github issue on issues with the Greek alphabet. I am not sure if these issues are related, but they definitely seem relevant.

This comment in the Github issue seems to suggest that it is better/easier to fix the code than to create a workaround. However, (to the best of my knowledge) I cannot change the LaTeX version on the arXiv servers. Therefore, it seems like I will need some sort of workaround after all.

One solution I could think of would be to replace \usepackage{bm} by something like \let\bm\boldsymbol, but I'm unsure whether this would have any undesired effects to the typesetting. Is this a reasonable solution, or are there other options I should consider to upload my project to arXiv?

More generally, I would also be interested to understand why \MakeUppercase causes this many issues recently. E.g. Is there a list of packages that are known to have issues with \MakeUppercase and is there a more general solution?


update: On version 2022-11-01 patch level 1, \MakeUppercase also fails with \boldsymbol with the following error(s):

/home/hoedt/Downloads/tmp/test.tex:10: Undefined control sequence.
\MakeUppercase    [#1]#2->\let \kernel@saved@oe 
                                                \oe \let \oe \OE \@@text@cas...
l.10 Test upper: $\boldsymbol{\MakeUppercase{x}}
                                                $.
/home/hoedt/Downloads/tmp/test.tex:10: Undefined control sequence.
\MakeUppercase    ...#2}\let \oe \kernel@saved@oe

l.10 Test upper: $\boldsymbol{\MakeUppercase{x}} $. /home/hoedt/Downloads/tmp/test.tex:10: Extra }, or forgotten $. \bm@command ...\space @spaces @spaces @spaces } {LaTeX Warning: Command \p... l.10 Test upper: $\boldsymbol{\MakeUppercase{x}} $.

Joseph Wright
  • 259,911
  • 34
  • 706
  • 1,036

2 Answers2

1

Updates to how case changing works have been made to support UTF-8 and babel/polyglossia. This has been an iterative process as it could not be done in one place in one step. The latest release of LaTeX (2023-11-01) supported by up-to-date expl3 uses an improved approach which does not require \kernel@saved@oe: rather it retains the 'traditional' grouping inside \MakeUppercase. As such, the best advice here is to update to current LaTeX or to use the latexrelease mechanism to patch an older kernel to achieve the same effect.

Joseph Wright
  • 259,911
  • 34
  • 706
  • 1,036
  • As noted by Ulrike, case changing for maths is normally not a great plan ... – Joseph Wright Jan 15 '24 at 09:58
  • I tried using \RequirePackage[2023-11-01]{latexrelease} before \documentclass (as well as some other, older dates), but it seems to do nothing. I also learned that my OS only updates TeX Live on a yearly basis (currently 2023). The latest system update installed a new release of the package, but reverting did not resolve anything. This makes things really weird, because this used to compile just fine. Is there any other package outside of TeX Live that could be interfering here? Where should \kernel@saved@oe be defined? – Mr Tsjolder from codidact Jan 15 '24 at 13:21
  • Have you got the latest version of latexrelease? It won't be included in an older TeX distribution, so you've have to have downloaded it yourself. – Joseph Wright Jan 15 '24 at 13:24
  • But really, we are back with case changing does not belong in math mode, as case in maths is important ... – Joseph Wright Jan 15 '24 at 13:25
0

A pretty nice workaround has been provided by egreg in an answer to another question of mine.

It is possible to define a new command \ToUppercase using the LaTeX3 coding language:

\ExplSyntaxOn
\cs_new_eq:NN \ToUppercase \text_uppercase:n
\ExplSyntaxOff

This command does not cause issues when used with \boldsymbol or \bm and allows me to compile my documents. I am not sure if there are (subtle) differences to \MakeUppercase, but it seems to work well enough for my use case.