Open Lysxia opened 4 years ago
Yes, this is unfortunate.
The quick workaround is
\let\Bbbk\undefined
prior to including polycode.fmt
A proper solution would be to rewrite polycode.fmt
to either not include amssymb if acmart is being used, or to make it generally possible to not include amssymb.
'acmart' loads '/usr/share/texlive/texmf-dist/tex/latex/newtx/newtxmath.sty' and I found the following post https://tex.stackexchange.com/questions/564075/can-newtxmath-be-used-with-amssymb-in-pdflatex which says: "Can newtxmath
be used with amssymb
in PDFLaTeX?"
Answer: "The literal answer to what you asked is: yes, but you don’t want to. As egreg brought up in the comments, newtxmath defines every symbol that amssymb does, designed to match Times. The amssymb symbols are designed to go with Computer Modern"
So the solution is not to include amssymb.sty
So the solution is not to include amssymb.sty
I think this could fail outside acmart
(i.e. when newtxmath
is not used). I think a safer fix would be to replace amssymb
with newtxmath
in polycode.fmt
.
I also ran accross this today 👍
As fate would have it, I debugged a font error today which might be related to the workaround and the reinclusion of amssymb
. Here's an MWE:
\documentclass{article}
\usepackage{biblatex}
\usepackage{newtxmath}
\usepackage{wasysym}
\usepackage{mathbbol}
\let\Bbbk\relax
\usepackage{amssymb}
\usepackage{stmaryrd}
\begin{document}
\section{$5_{\mathbf{sub}}$}
$\mathit{foo}\;\texttt{bar}\;\mathsf{baz}$
\noindent
$\mathit{foo}\;\texttt{bar}$
\end{document}
Note that I would expect both uses of foo
in math mode to be printed in italics. However, this is what I get (TeXLive 2023):
Note that the first foo
is not set in italics, however the second is.
There is something going on here and I don't know who is to blame. If I remove any of the packages or the section header, both foo
s are printed in italics.
It would perhaps be better if we included newtxmath
instead.
Edit: Alas, it turns out that is only part of the solution. A re-import of newtxmath
will still error out for redefinition of macros such as \iint
, \iiint
etc.
I tried the simplest thing in #109 and replaced use of amstext
and amssymb
with newtxmath
.
After rebuilding my thesis, I noticed that the font errors were still present.
Then I removed the \let\Bbbk\relax
workaround from my LaTeX preamble and it built without font errors.
Recent versions of acmart (at least since 1.70) cause an error with
\usepackage{amssymb}
(issue borisveytsman/acmart#395), which lhs2tex appears to insert unconditionally:https://github.com/kosmikus/lhs2tex/blob/34301bed0a895691631ab3acd61808411fae0711/lhs2TeX.sty.lit#L41
Example to reproduce: