7

I have a situation where there are two alternative assumptions that can hold in order for some estimate to be correct. I would like to number them 2.a and 2.b and refer to them in the text (an assumption 1 already exists). So far I do the following, which gives assumption numbers 2 and 3:

\documentclass[11pt,a4paper]{article}
\usepackage{amsmath,amsfonts,amssymb,amsthm}

\theoremstyle{plain}
\newtheorem{assumption}{Assumption}

\begin{document}

\begin{assumption}[Comparability]\label{as:comparability} Individuals with the same $x_{it}$ vector are \textit{comparable} over time.\end{assumption}

\begin{assumption}[Comparability in differences; replacing Assumption \ref{as:comparability}]\label{as:comparabilityDiff} Differences between individuals $i$ and $j$ with the vectors $x_{it}$ and $x_{jt}$ are \textit{comparable} over time.\end{assumption}

What Assumption \ref{as:comparabilityDiff} implies economically can best be explained using an example…

Is there a way to do this in with the amsthm package? I have seen this post (link), but don’t know how to reference the theorem in this case.

Mike
  • 71
  • 1
    Welcome to TeX.SX! See the package chngcntr and the \numberwithin command. –  Sep 13 '15 at 17:17
  • Does http://tex.stackexchange.com/questions/43346/how-do-i-get-sub-numbering-for-theorems-theorem-1-a-theorem-1-b-theorem-2 help? – egreg Sep 13 '15 at 19:10

2 Answers2

3

Something like this? Not the best solution, I assume, I'll try to improve it later on.

\documentclass[11pt,a4paper]{article}
\usepackage{amsmath,amsfonts,amssymb,amsthm}

\usepackage{chngcntr}



\theoremstyle{plain}
\newtheorem{assumption}{Assumption}

\let\origtheassumption\theassumption

\begin{document}

\begin{assumption}[Comparability]\label{as:comparability} Individuals with the same $x_{it}$ vector are \textit{comparable} over time.\end{assumption}

\edef\oldassumption{\the\numexpr\value{assumption}+1}

\setcounter{assumption}{0}
\renewcommand{\theassumption}{\oldassumption.\alph{assumption}}
\begin{assumption}[Comparability in differences; replacing Assumption \ref{as:comparability}]\label{as:comparabilityDiff} 
  Differences between individuals $i$ and $j$ with the vectors $x_{it}$ and $x_{jt}$ are \textit{comparable} over time.
\end{assumption}

\begin{assumption}[Comparability in differences; replacing Assumption \ref{as:comparability}]\label{as:comparabilityDiffother} 
  Differences between individuals $i$ and $j$ with the vectors $x_{it}$ and $x_{jt}$ are \textit{comparable} over time.
\end{assumption}

\let\theassumption\origtheassumption

What Assumption \ref{as:comparabilityDiff} implies economically can best be explained using an example… and \ref{as:comparabilityDiffother}

\begin{assumption}{Foo}
bar
\end{assumption}

\end{document}

enter image description here

  • Great, this does the trick. Thanks very much! – Mike Sep 13 '15 at 20:05
  • This only works specifically when you're trying to use this for assumption 2- since you reset the assumption counter, the next assumption gets labelled 3. Easy fix is to use another counter to hold over the original assumption numbering. – A Simmons Sep 06 '16 at 10:30
0

I was having a similar issue and since I couldn't find any other solutions, I'll post what I did for anyone who might have the same problem in the future. The idea:

  • Created an "intermediate" assumption environment for all of those assumptions that will need to be separated from the rest
  • Use \numberwithin this environment
  • Use \stepcounter to make sure numbering in the new environment is consistent

It's pretty hacky since I'm not good at LaTeX, but it worked for me. It has the advantage that you don't need to redefine the command if you need assumptions with the extra naming again, as I did.

Using your example:

\documentclass[11pt,a4paper]{article}
\usepackage{amsmath,amsfonts,amssymb,amsthm}

\theoremstyle{plain} \newtheorem{assumption}{Assumption} \newtheorem{intassumption}{Assumption} \numberwithin{intassumption}{assumption} \renewcommand{\theintassumption}{\theassumption.\alph{intassumption}}

\begin{document}

\begin{assumption}[Comparability]\label{as:comparability} Individuals with the same $x_{it}$ vector are \textit{comparable} over time.\end{assumption}

\stepcounter{assumption} \begin{intassumption}[Comparability in differences; replacing Assumption \ref{as:comparability}]\label{as:comparabilityDiff} Differences between individuals $i$ and $j$ with the vectors $x_{it}$ and $x_{jt}$ are \textit{comparable} over time.\end{assumption}

\begin{intassumption}[Comparability in differences; replacing Assumption \ref{as:comparability}]\label{as:comparabilityDiff} Differences between individuals $i$ and $j$ with the vectors $x_{it}$ and $x_{jt}$ are \textit{comparable} over time.\end{assumption}

What Assumption \ref{as:comparabilityDiff} implies economically can best be explained using an example…

\begin{assumption}{Foo} bar \end{assumption}

\end{document}

Result

Santiago
  • 125