5

Suppose I have a theorem with numbers and everything like this:

Theorem 1.2.3: Blah Blah Blah...

Sometimes you want to do a slight variation to the same theorem, or write it with a different language, etc. Mathematicians use a notation like this then:

Theorem 1.2.3*: A different Blah Blah Blah

So at the end the text looks like:

Theorem 1.2.3: Blah Blah Blah...

Theorem 1.2.3*: A different Blah Blah Blah

How do you do the * thing in LaTeX?

EDIT My code for the non-starred version looks like this:

\documentclass[11pt]{article}
\usepackage{amsmath} 
\usepackage{amsthm}
\newtheorem{thm}{Theorem}[subsection]
\begin{document}
\section{Blah}
\subsection{Blah Blah}


Typesetted as Theorem 1.1.1:
\begin{thm}[Theorem 1]
Blah Blah Blah
\end{thm}


Typesetted as Theorem 1.1.2
\begin{thm}[Theorem 2]
Blah Blah Blah
\end{thm}


The first theorem with slight variation:
I want this to be typesetted as Theorem 1.1.1*: Blah Blah Blah
%% The code for this??? %%
\end{document}
2
  • 2
    Welcome! If you provide a minimal example showing how you do the non-starred one, it will be much easier to help you. How best to do the starred version depends on what you are using to do the non-starred version. There are different packages for this, as well as some built-in environments etc. and you need to work within a single framework. – cfr Jan 20 '16 at 21:50
  • I edited my question and added a minimal code. Thank you. – Hamed Jan 20 '16 at 22:05
1

You can declare a new theorem and just make its counter look like the regular counter with the addition of a *. If you want to refer to a theorem that is somewhere else in the document, use the \label-\ref system and supply the new number via \thmstarnum{\ref{<label>}}:

enter image description here

\documentclass{article}
\usepackage{amsthm}
\newtheorem{thm}{Theorem}[subsection]
\newtheorem{thm*}{Theorem}% This is a fake theorem environment
% update the counter to look the same as that of 'thm' + '*'

\makeatletter
\expandafter\newcommand\csname thethm*default\endcsname{\thethm*}
\newcommand{\thmstarnum}[1]{\expandafter\gdef\csname thethm*\endcsname{#1*}}
\thmstarnum{\thethm}
\expandafter\g@addto@macro\csname endthm*\endcsname{\thmstarnum{\thethm}}
\makeatother

\begin{document}

\section{This is a section}
\subsection{This is a subsection}
Here is some text.
\begin{thm}\label{thm:first}
This is the first theorem.
\end{thm}
Here is some more text, and then another theorem.
\begin{thm}[Something]
This is the second theorem.
\end{thm}
Now we look at the same theorem again.
\begin{thm*}[Something else]
This is the second theorem again.
\end{thm*}
Now let's review the first theorem again.
\thmstarnum{\ref{thm:first}}
\begin{thm*}
This is the first theorem again.
\end{thm*}
Now the rest of the document with some more theorems.
\begin{thm}
This is the third theorem.
\end{thm}
Let's revisit the third theorem.
\begin{thm*}
This is the third theorem again.
\end{thm*}
The conclusion.

\end{document}
2
  • Is there a way to manipulate this code so it works if the starred theorem is not immediately after? – Hamed Jan 20 '16 at 23:07
  • @Hamed: See my updated answer. – Werner Jan 20 '16 at 23:29
3

If you want to allow that the “variant theorem” appears anywhere (maybe even before the standard one), you need to use \label and \ref:

\documentclass[11pt]{article}
\usepackage{amsmath} 
\usepackage{amsthm}

\newtheorem{thm}{Theorem}[subsection]
\newtheorem*{varthm+inner}{\varthmname}
\newcommand{\varthmname}{}
\newenvironment{varthm}[2][Theorem]
 {\renewcommand{\varthmname}{#1 \ref{#2}*}\begin{varthm+inner}}
 {\end{varthm+inner}}

\begin{document}

\section{Blah}
\subsection{Blah Blah}

Typeset as Theorem 1.1.1:
\begin{thm}\label{test}
Blah Blah Blah
\end{thm}


Typeset as Theorem 1.1.2
\begin{thm}
Blah Blah Blah
\end{thm}

Typeset as Theorem 1.1.1*
\begin{varthm}{test}
Blah blah
\end{varthm}

\end{document}

enter image description here

I added an optional argument, so you can typeset also variant lemmas or whatnot, by calling

\begin{varthm}[Lemma]{label}

The attribution argument is honored, by calling

\begin{varthm}{label}[Somebody]

Example code

Typeset as Theorem 1.1.1:
\begin{thm}[A. Uthor]\label{test}
Blah Blah Blah
\end{thm}

Typeset as Theorem 1.1.2
\begin{thm}
Blah Blah Blah
\end{thm}

Typeset as Theorem 1.1.1*
\begin{varthm}{test}[W. Riter]
Blah blah
\end{varthm}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.