Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conflict with acmart #82

Open
Lysxia opened this issue Jun 17, 2020 · 6 comments · May be fixed by #109
Open

Conflict with acmart #82

Lysxia opened this issue Jun 17, 2020 · 6 comments · May be fixed by #109
Labels

Comments

@Lysxia
Copy link

Lysxia commented Jun 17, 2020

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:

\usepackage{amssymb}

Example to reproduce:

% t.lhs
\documentclass{acmart}
%include polycode.fmt
% This is really because of \usepackage{amssymb}
% If you take that out of the preprocessed file the result compiles fine.
\begin{document}
\end{document}
lhs2TeX t.lhs > t.tex
pdflatex t.tex
# Output:
# ...
# ! LaTeX Error: Command `\Bbbk' already defined.
# ...
@kosmikus
Copy link
Owner

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.

@csetzer
Copy link

csetzer commented Apr 30, 2022

'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

@ulysses4ever
Copy link

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.

@kosmikus kosmikus added the latex label Nov 16, 2023
@alt-romes
Copy link

I also ran accross this today 👍

@sgraf812
Copy link
Contributor

sgraf812 commented Aug 22, 2024

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):

Screenshot from 2024-08-22 18-00-55

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 foos 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.

sgraf812 added a commit to sgraf812/lhs2tex that referenced this issue Aug 23, 2024
Declaring `\let\Bbbk\relax` in order to load both newtxmath and amssymb
led to a weird font error in my thesis. (See kosmikus#82 for details.)

This patch removes use of amssymb and amstext in favour of just
newtxmath, exactly like the newer acmart.cls version do.

Fixes kosmikus#82.
sgraf812 added a commit to sgraf812/lhs2tex that referenced this issue Aug 23, 2024
Declaring `\let\Bbbk\relax` in order to load both newtxmath and amssymb
led to a weird font error in my thesis. (See kosmikus#82 for details.)

This patch removes use of amssymb and amstext in favour of just
newtxmath, exactly like the newer acmart.cls version do.

Fixes kosmikus#82.
@sgraf812 sgraf812 linked a pull request Aug 23, 2024 that will close this issue
@sgraf812
Copy link
Contributor

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.

sgraf812 added a commit to sgraf812/lhs2tex that referenced this issue Aug 23, 2024
Declaring `\let\Bbbk\relax` in order to load both newtxmath and amssymb
led to a weird font error in my thesis. (See kosmikus#82 for details.)

This patch removes use of amssymb and amstext in favour of just
newtxmath, exactly like the newer acmart.cls version do.

Fixes kosmikus#82.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants