3

I define a basic hypothesis called "Hyp A", using theorem environment, and also give it a label (say Hyp_A).

Then when I refer to this hypothesis, how to display something like "Let X and G satisfy Hyp A...", where "Hyp A" should link to the original definition of this hypothesis?

My method is as follow.

\newtheorem*{hyp}{} %I don't want the counter.

\begin{hyp} [\textbf{Hyp A}] \label{Hyp_A}

...

\end{hyp}

\nameref{Hyp_A}

Then I can have the following:

enter image description here

I don't like that parenthesis for the consistency reason.

Does any have suggestion to solve this problem?

Thanks in advance!

5
  • 2
    Welcome to TeX.SX! Contrary to what you say, you do want the number! Just change its representation to be alphabetic: \newtheorem{hyp}{Hyp} and \renewcommand{\thehyp}{\Alph{hyp}}. Now Hyp~\ref{Hyp_A} will do.
    – egreg
    Sep 2, 2015 at 13:56
  • If you want to have \ref return names instead of numbers, that can be done too (just not using \label). Sep 2, 2015 at 19:16
  • @JohnKormylo, Thanks, but what's your meaning of "just not using \label"?
    – Fei Hu
    Sep 3, 2015 at 3:40
  • @egreg Thanks! It is helpful for me. Instead of comment, I use \newtheorem{hyp}{} and \renewcommand{\thehyp}{Hyp \thehyp}. Then \ref{Hyp_A} works well.
    – Fei Hu
    Sep 3, 2015 at 3:55
  • See tex.stackexchange.com/questions/236626/… . The hyperref version is slightly more complicated. Sep 3, 2015 at 14:21

1 Answer 1

2

Rather than manually numbering the environments, you should simply change the related counter's representation:

\documentclass{article}
\usepackage{amsthm}

\newtheorem{hyp}{Hyp}
\renewcommand{\thehyp}{\Alph{hyp}}

\begin{document}

\begin{hyp}\label{hyp-flat}
The Earth is flat.
\end{hyp}

Assuming Hyp~\ref{hyp-flat} we now prove that pigs can fly.

\end{document}

There's also the possibility of using cleveref:

\documentclass{article}
\usepackage{amsthm}
\usepackage{cleveref}

\newtheorem{hyp}{Hyp}
\renewcommand{\thehyp}{\Alph{hyp}}
\crefname{hyp}{Hyp}{Hyp} % always uppercase       

\begin{document}

\begin{hyp}\label{hyp-flat}
The Earth is flat.
\end{hyp}

Assuming \cref{hyp-flat} we now prove that pigs can fly.

\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .