5

I'm using the acmart documentclass for a conference paper submission. I've provided a simple example (code below) which currently renders to the following output:

enter image description here

Questions:

  1. How can I change the "definition" environment so that the text "Definition" looks the same as the text "Theorem" (remove the italicization and the Font seems to be different as well)?
  2. How I add a new "Remark" environment which displays the same as the ones (theorem, lemma, corollary, ...) which are already present?
  3. How can I add a "qed square" of the same size to the end of any of these environments (even when they have no "proof")?

Code:

\documentclass[acmtog,anonymous,review]{acmart}
\usepackage{graphicx}

\AtEndPreamble{%
\theoremstyle{acmtheorem}
\newtheorem{remark}[theorem]{Remark}}

\begin{document}

\section{}

\begin{theorem}
    A theorem.
    \begin{proof}
    \end{proof}
\end{theorem}

\begin{definition}
    A definition.
    \begin{flushright}
        $\square$
    \end{flushright}
\end{definition}

\begin{remark}
    A remark.
    \begin{flushright}
        $\square$
    \end{flushright}
\end{remark}

\end{document}
5
  • Did you only want to change the headings for definitions to match those of theorems (small caps, not italicized)? Or did you also want to change the style of the main definition text to be italicized, same as theorems?
    – bonk
    Jan 16 at 0:22
  • Same with remarks: did you want remarks to completely match the style of theorems for both headings and main remark texts?
    – bonk
    Jan 16 at 0:23
  • 3
    This question gives the recipe for reliably adding a mark at the end of a line of text: Denoting the end of example/remark Jan 16 at 0:38
  • @bonk No, I actually would like to have it the other way around. All environments (especially theorems) should have not italicized text.
    – 0xbadf00d
    Jan 16 at 9:51
  • Got it, modified my answer to match
    – bonk
    Jan 16 at 17:59

2 Answers 2

6

If you're submitting to a conference, you shouldn't try to modify their standard. Anyway, here's how you can do.

\documentclass[acmtog,anonymous,review]{acmart}

\AtEndPreamble{%
  \theoremstyle{acmplain}%
  % note to copy editors: remove the following
  % two lines if standard ACM style is preferred
  \let\definition\relax\let\enddefinition\relax
  \newtheorem{definition}[theorem]{Definition}%
  % end note to copy editors
  \newtheorem{remark}[theorem]{Remark}%
  \AtBeginEnvironment{definition}{\pushQED{\qed}}%
  \AtEndEnvironment{definition}{\popQED}%
  \AtBeginEnvironment{remark}{\pushQED{\qed}}%
  \AtEndEnvironment{remark}{\popQED}%
}

\begin{document}

\section{Test}

\begin{theorem}
A theorem.
\end{theorem}
\begin{proof}
And its proof.
\end{proof}

\begin{definition}
A definition.
\end{definition}

\begin{remark}
A remark.
\end{remark}

\end{document}

enter image description here

Notes.

  1. The standard theorem style is acmplain.
  2. A proof doesn't belong to the theorem.
2
  • Thank you for your answer. Unfortunately, this gives the error Command \c@definition already defined. Any idea how I can fix this? Somehow undefine the existing definition before?
    – 0xbadf00d
    Jan 23 at 20:51
  • @0xbadf00d I get no error. Do you get one with the exact code? If not, there's something else you're doing in your document.
    – egreg
    Jan 23 at 20:54
3

I understood your question to mean that you want theorems, definitions, and remarks to all have of the same styling. In that case, I'll answer your questions out of order:

  1. How I add a new "Remark" environment which displays the same as the ones (theorem, lemma, corollary, ...) which are already present?

Edit: based on your comment, I believe you want all three environments to have small caps for the headers and non-italicized font for the main text.

Firstly, you'll need to define a new theorem style, since neither of acmart's predefined theorem styles suit your needs. The acmart class documentation provides the source code for the definition of the acmplain theorem style (on page 110, I believe), so you can copy-paste that definition into your own code and modify it as you see fit. Then you can use \theoremstyle{your-style-name} to set the styling of your custom theorem environments.

  1. How can I change the "definition" environment so that the text "Definition" looks the same as the text "Theorem" (remove the italicization and the Font seems to be different as well)?

Since there's no straightforward way to modify the definition of a theorem environment, you'll have to define the styling of definition (and theorem) yourself. You have two options:

  1. Define your own definition and theorem environments with different names so that they don't clash with the existing environments. I recommend this option since it's the most straightforward, and it doesn't overwrite the existing definitions (in case that might cause issues with your submission).
  2. Suppress the existing environment definitions with the class option acmthm=false. Then you can define your own definition and theorem environment without clashing with any existing environments. Note that this suppresses all theorem environments defined by acmart, including theorem, proposition, definition, example, etc. Thus, if you choose this option, you'll have to define all the other environments yourself as necessary.
  1. How can I add a "qed square" of the same size to the end of any of these environments (even when they have no "proof")?

I recommend using the thmtools package for your custom environment definitions, as this makes setting the QED symbol very easy. This solution is suggested in the post linked by @barbara-beeton in the comments, but it's the third one down. Refer to the thmtools package documentation for more details.

New and improved MWE (with custom environments under different names):

\documentclass[acmtog, anonymous, review]{acmart}

\usepackage{thmtools}

\makeatletter
\AtEndPreamble{
    % Modified from definition of acmplain
    % acmart documentation, page 110
    % https://mirror.las.iastate.edu/tex-archive/macros/latex/contrib/acmart/acmart.pdf
    \newtheoremstyle{mystyle}%
        {.5\baselineskip\@plus.2\baselineskip
            \@minus.2\baselineskip}% space above
        {.5\baselineskip\@plus.2\baselineskip
            \@minus.2\baselineskip}% space below
        {\normalfont}% body font
        {\@acmplainindent}% indent amount
        {\scshape}% head font
        {.}% punctuation after head
        {.5em}% spacing after head
        {\thmname{#1}\thmnumber{ #2}\thmnote{ {\@acmplainnotefont(#3)}}}% head spec

    \theoremstyle{mystyle}
    \declaretheorem[name=Theorem, parent=section]{thm}
    \declaretheorem[name=Definition, qed=$\square$, sibling=thm]{defn}
    \declaretheorem[name=Remark, qed=$\square$, sibling=thm]{remark}
}
\makeatother

\begin{document}

\section{}

\begin{thm}
    A theorem.
    \begin{proof}
    \end{proof}
\end{thm}

\begin{defn}
    A definition.
\end{defn}

\begin{remark}
    A remark.
\end{remark}

\end{document}

OP's MWE with desired styling and QED symbols

1
  • @0xbadf00d I've modified my answer based on your comment. Now all three environments have small caps for the headers (like theorems do) as well as non-italicized main text (like definitions do). Is this the styling that you're going for?
    – bonk
    Jan 16 at 17:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .