1

I actually started to use Latex in order to prepare better works.

After that, there is a problem. This is my code actually:

Determine Hyp 1 and 2

\newtheorem{hypothesis}{Hypothesis}

\begin{hypothesis} %Hyp 1
\begin{justify}
\[ RE>RM  \land RF>RM \lor  RE<RM  \land RF<RM \implies \]
\end{justify}\par
\end{hypothesis}

\begin{hypothesis} %Hyp 2
\begin{justify}
 \[ RE>RM  \land RF<RM \lor  RE<RM  \land RF>RM \implies \]
\end{justify}\par
\end{hypothesis}

Now i need to recall Hyp 1 and 2 and i do not want that continue to label it as 3, 4, and so on

\begin{hypothesis} %Hyp1
\begin{equation}
x 
\end{equation}\par
\end{hypothesis}

\begin{hypothesis} %Hyp2
\begin{equation}
x\times (-1)
\end{equation}\par
\end{hypothesis}

Writing this code, as i said, it label them as number 1, 2, 3, and 4 while i need Hyp 1, Hyp 2, Hyp1, and Hyp 2.

How can i achieve that? Many Regards

1
  • Welcome to tex.sx. You can reset the counter for hypothesis to zero before the second set, but since you haven't told us what theorem package you are using and other relevant context (e.g., are these in different sections or the same section?), any attempt to be more specific would be only a guess. Context matters. Dec 7, 2020 at 15:22

1 Answer 1

0

The following is pretty ugly, but gets the job done. Essentially, it makes a new command for hypothesis 1 and 2 that displays some set text and an equation that is numbered as normal. It plays around with the counter and manipulates it to be what is desired. I wasn't sure what your "justifications" were, so I replaced it with equations, but it can be adapted pretty easily based on what you have in mind.

\documentclass{article}
\usepackage{amsthm, amsmath}

\newcounter{hypcounter}
\newtheorem{hypothesis}{Hypothesis}
\newcommand{\firsthyp}[1]{
    \setcounter{hypcounter}{\value{hypothesis}} % save what number we're at
    \setcounter{hypothesis}{0} % so that the hypothesis is numbered 1
    \begin{hypothesis}
        My first hypothesis states some stuff
        \begin{equation} #1 \end{equation}
    \end{hypothesis}
    \setcounter{hypothesis}{\value{hypcounter}} % rewrite that number back into counter
}
\newcommand{\secondhyp}[1]{
    \setcounter{hypcounter}{\value{hypothesis}}
    \setcounter{hypothesis}{1} % so that the hypothesis is numbered 2
    \begin{hypothesis}
        My second hypothesis states some other stuff
        \begin{equation} #1 \end{equation}
    \end{hypothesis}
    \setcounter{hypothesis}{\value{hypcounter}}
}


\begin{document}
\setcounter{hypothesis}{2} % so that a hypotheses afterwards will begin at 3
\firsthyp{RE>RM  \land RF>RM \lor  RE<RM  \land RF<RM \implies}
\secondhyp{RE>RM  \land RF<RM \lor  RE<RM  \land RF>RM \implies}

\begin{hypothesis}
Another hypothesis will be numbered with the next number, $3$.
\begin{equation}
    \text{Equation numbering continue as normal}
\end{equation}
\end{hypothesis}

\firsthyp{x}
\secondhyp{x\times (-1)}

\end{document}
1
  • I think \setcounter{hypothesis}{n} (n= previous value) before calling the hypothesis and a \setcounter{hypothesis}{x} (x= previous than the last hypothesis) after that would be enough for an accepted answer. Or at least if you want to automate it you could do it in a \newenvironment command with possibly an optional argument... Seems too complicated to me
    – koleygr
    Sep 19, 2018 at 1:09

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