Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am writing a paper where I have a stated a theorem, and then a short time later I state another theorem which is equivalent to the first. Is it possible to number them so that the second is a primed version of the first? In other words, if the first gets numbered as Theorem 7, I would like its equivalent version to be numbered as Theorem 7'. Ideas? Thanks.

share|improve this question

2 Answers 2

up vote 3 down vote accepted
\documentclass[a4paper]{article}

\newtheorem{thm}{Theorem}
\newenvironment{thmbis}[1]
  {\renewcommand{\thethm}{\ref{#1}$'$}%
   \addtocounter{thm}{-1}%
   \begin{thm}}
  {\end{thm}}

\begin{document}
\begin{thm}
$1+1=2$
\end{thm}
\begin{thm}\label{comm}
$a+b=b+a$
\end{thm}
\begin{thmbis}{comm}
$x+y=y+x$
\end{thmbis}
\begin{thm}
$0\ne0$
\end{thm}
\end{document}

In this way the "primed" theorem doesn't need to be near the main one. The thmbis environment takes as argument the label given to the main one.

If the "primed" theorem is always immediately after the main one, you can say

\newenvironment{thmbis}
  {\addtocounter{thm}{-1}%
   \renewcommand{\thethm}{\arabic{thm}$'$}%
   \begin{thm}}
  {\end{thm}}

If hyperref is used, one has to hack its automatic mechanism for creating hyperlinks; the following seems to work:

\makeatletter
\newcommand{\neutralize}[1]{\expandafter\let\csname c@#1\endcsname\count@}
\makeatother

\newtheorem{thm}{Theorem}

\newenvironment{thmbis}[1]
  {\renewcommand{\thethm}{\ref{#1}$'$}%
   \neutralize{thm}\phantomsection
   \begin{thm}}
  {\end{thm}}

Use \ref*{#1} if you don't want to make a link pointing to the "main theorem".

share|improve this answer
    
Would ^\prime not be better than ' for "priming"? –  Seamus Jun 24 '11 at 9:24
1  
it's a bad idea to use \addtocounter{thm}{-1} as it doesn't work well with hyperref. Here, in your second example, if you use the \label/ref mechanism to refer to the primed theorem, the hyperlink will go to the wrong place (the unprimed theorem). –  Philippe Goutet Jun 24 '11 at 12:13
    
@Seamus: $'$ and $^\prime$ are equivalent. –  egreg Jun 24 '11 at 12:38
    
Thanks. This worked for me. –  Jim Bryan Jun 24 '11 at 17:34
    
Very nice solution. Thanks a lot! –  Olivier Sep 20 '11 at 7:05

An idea but ... finally I undelete

\documentclass[12pt]{book}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{amssymb,amsmath,latexsym}

\newtheorem{theo}{Theorem}
\newcounter{biscompt}

\newtheorem{bis}[biscompt]{Theorem}
\renewcommand{\thebiscompt}{% 
\setcounter{biscompt}{\thetheo} 
\arabic{theo}'}
\usepackage{hyperref}   

\begin{document}

\chapter{}

\section{}  
\begin{theo}
On vérifie que :  $1\not= 1$
\end{theo}

\newpage
\section{}
\begin{theo}
On vérifie que :  $2\not= 3$
\end{theo}

\newpage   
\section{}   



\begin{theo}
On vérifie que :  $1\not= 1$
\end{theo}

\begin{bis}\label{bis}
On vérifie que :  $1\not= 1$
\end{bis}

\newpage
\section{}

With \ref{bis} 
\end{document}   
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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