2

I have the following in amsthm:

\newtheoremstyle{thm}
{}                % Space above
{}                % Space below
{}        % Theorem body font % (default is "\upshape")
{}                % Indent amount
{\bfseries}       % Theorem head font % (default is \mdseries)
{.}               % Punctuation after theorem head % default: no punctuation
{ }               % Space after theorem head
{}                % Theorem head spec
\theoremstyle{thm}
\newtheorem*{thm}{Théorème}
\newtheorem{nthm}{Le théorème}

The theorem names are in french, which forces us to create two different environments. One for numbered theorems and one for unnumbered theorems. Can I only create one environment (the thm one) so that when I insert the * the name automatically replaces to Theoreme instead of La theoreme? The code above is conflicting after other environments are defined, that's why I'm asking for this alternative. Thank you.

7
  • Are “Theoreme” and “La theoreme” French expressions?
    – frougon
    Apr 20, 2020 at 16:51
  • Yup. "La" is "The" in English. You can't say theoreme 1. This is just an example.
    – furfur
    Apr 20, 2020 at 16:53
  • Sorry, but this is incorrect (French is my mother tongue). You want « Le théorème ».
    – frougon
    Apr 20, 2020 at 16:54
  • I didn't add accents, I know. Sorry. I only wanted to provide an example of how a word can differ when you add numerals after it.
    – furfur
    Apr 20, 2020 at 16:55
  • Are you ok with it now? I modified it.
    – furfur
    Apr 20, 2020 at 16:56

2 Answers 2

2

It's not clear what the problem is: it seems that you just want

\newtheorem*{thm*}{Théorème}
\newtheorem{thm}{Le théorème}

enter image description here

Full code.

\documentclass{article}
\usepackage{amsthm}

\newtheoremstyle{thm}
{}                % Space above
{}                % Space below
{}        % Theorem body font % (default is "\upshape")
{}                % Indent amount
{\bfseries}       % Theorem head font % (default is \mdseries)
{.}               % Punctuation after theorem head % default: no punctuation
{ }               % Space after theorem head
{}                % Theorem head spec

\theoremstyle{thm}
\newtheorem*{thm*}{Théorème}
\newtheorem{thm}{Le théorème}

\begin{document}

\begin{thm}
This is numbered, with no attribution
\end{thm}

\begin{thm}[Euclid]
This is numbered, with attribution
\end{thm}

\begin{thm*}
This is unnumbered, with no attribution
\end{thm*}

\begin{thm*}[Archimedes]
This is unnumbered, with attribution
\end{thm*}

\end{document}
4
  • Except that the text for all four of them says "numbered". Oops! Apr 20, 2020 at 21:37
  • @barbarabeeton Your eagle eye misses nothing!
    – egreg
    Apr 20, 2020 at 21:39
  • What you did was simply replace the text "nthm" to "thm*" in my question's provided code. This is not what I wanted, I'm sorry. I want it to be the same theorem, not two separate ones. thm and thm* are in your example two different environments. What I really mean, is that if I create for example a counter like this: \counterwithin*{environment}{thm} it should work for both thm and thm*.
    – furfur
    Apr 21, 2020 at 12:31
  • @furfur Sorry, but I can't understand what the problem is. What syntax do you have in mind?
    – egreg
    Apr 21, 2020 at 14:14
1

Foreword: I'm merely executing what I understood from the question. Still, I consider that a theorem heading reading for instance "Le théorème 1" sounds a bit weird in French.Anyway, le client est roi. :-)

You can define two separate environments, say, theo and theo*, that respectively call nthm or thm. Not sure what you gain by doing so, though—except maybe clarity.

\documentclass{article}
\usepackage{amsthm}

\newtheoremstyle{thm}
  {}                % Space above
  {}                % Space below
  {}                % Theorem body font % (default is "\upshape")
  {}                % Indent amount
  {\bfseries}       % Theorem head font % (default is \mdseries)
  {.}               % Punctuation after theorem head % default: no punctuation
  { }               % Space after theorem head
  {}                % Theorem head spec

\theoremstyle{thm}
\newtheorem*{thm}{Théorème}
\newtheorem{nthm}{Le théorème}

\newenvironment{theo}[1][]{\nthm[#1]}{\endnthm}
\newenvironment{theo*}[1][]{\thm[#1]}{\endthm}

\begin{document}

  \begin{theo}
    This is a numbered theorem.
  \end{theo}

  \begin{theo*}
    This is an unumbered theorem.
  \end{theo*}

  \begin{theo}
    This is another numbered theorem.
  \end{theo}

\end{document}

enter image description here

With the optional argument:

\begin{theo}
  This is a numbered theorem.
\end{theo}

\begin{theo*}[Schreier]
  This is an unumbered theorem.
\end{theo*}

\begin{theo}[Bolzano]
  This is another numbered theorem.
\end{theo}

enter image description here

4
  • egreg's solution is more direct; you should probably accept it.
    – frougon
    Apr 20, 2020 at 21:59
  • Could you also add a note on how to rename the "List of Theorems" section, produced by the \listoftheorems command?
    – Grwlf
    Sep 2, 2021 at 13:11
  • Customizing the title of \listoftheorems works by e.g. adding \renewcommand*{\listtheoremname}{Liste des Définitions} (as described by latex.org/forum/viewtopic.php?t=30867)
    – Grwlf
    Sep 2, 2021 at 13:18
  • @grwlf Sorry, but I don't see much of a relation with the question...
    – frougon
    Sep 2, 2021 at 19:12

You must log in to answer this question.

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