1

This is my code:

\documentclass{article}
\usepackage{amsthm}
\theoremstyle{definition}
\renewcommand{\thesection}{Section \arabic{section}}
\newtheorem{theorem}{Theorem}[section]

\begin{document}

\section{}

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

\end{document}

This produces:

Section 1
Theorem Section 1.1. A theorem.

I would like it to say:

Section 1
Theorem 1.1. A theorem.

How can I do this?

Thanks.

user24121
  • 135

1 Answers1

2

The theorem counter is dependent on the section counter (due to your definition of theorem). To that end, \thetheorem prints \thesection.\arabic{theorem}. So, if you modify \thesection, it will end up in the printing of the theorem title. A different approach might be to just update the way the section number is formatted inside the sectioning command(s):

\makeatletter
\def\@seccntformat#1{Section~\csname the#1\endcsname\quad}
\makeatother

This will hold true for all sectioning commands, including \subsection and \subsubsection (and possibly others). However, this may be sufficient. Here's a minimal example:

enter image description here

\documentclass{article}
\usepackage{amsthm}
\makeatletter
\def\@seccntformat#1{Section~\csname the#1\endcsname\quad}
\makeatother
\theoremstyle{definition}
\newtheorem{theorem}{Theorem}[section]

\begin{document}

\section{}

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

\end{document}
Werner
  • 603,163