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

\subsubsection incorrectly adds a period punctuation if the last letter is in capital #536

Open
Darel13712 opened this issue Aug 6, 2024 · 0 comments

Comments

@Darel13712
Copy link

Example document

\documentclass[sigconf]{acmart}
\begin{document}
\subsubsection{WTF?}
\end{document}

Observed behaviour: \subsubsection{WTF?}WTF?.
Expected behaviour: \subsubsection{WTF?}WTF?

The problem

This behaviour seems to happen only when the last character is a capital letter, but does not happen when it is in lower case.
This also happens with other punctuation symbols:
\subsubsection{WTF!}WTF!.
\subsubsection{WTF.}WTF..

This does not happen if the punctuation symbol is repeated more than once:
\subsubsection{WTF??}WTF??

Also this problem does not arise when you use \subsection or \section.

Workaround

I don't really understand the acmart.cls file but was able to produce the following workaround with chatgpt which seems to be working:

\makeatletter
% Redefine \@adddotafter to handle punctuation correctly
\def\@adddotafter#1{%
  \ifx\relax#1\relax
    #1%
  \else
    \def\@tempb{\expandafter\@gobble\string#1.}%
    \ifx\@tempb\@empty
      #1\@addpunct{.}%
    \else
      #1%
    \fi
  \fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant