我想知道是否有可能用下标数字改变 ntheorem 对定理/假设/实例的编号。我在软件包的文档中找不到有关此事的任何信息,文档中有阿拉伯语、希腊语、字母、罗马语等选项,但没有下标数字。
梅威瑟:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{ntheorem, fixltx2e, hyperref}
\theoremseparator{:}
\newtheorem{hyp}{Hypothesis}
\begin{document}
Below is my first hypothesis.
\begin{hyp}[H\ref{hyp:h1}] \label{hyp:h1}
The apple seldom falls far from the tree.
\end{hyp}
Below is my second hypothesis.
\begin{hyp}[H\ref{hyp:h2}] \label{hyp:h2}
All swans are white.
\end{hyp}
I am interested in the "H label" appearing like so: \textbf{Hypothesis 2 (H\textsubscript{2})}.
\end{document}
答案1
由于您似乎想要相同的数字,因此您实际上不需要\label
和\ref
。基于类似定理的环境定义新环境更容易。我还提供了一个\hypref
用于引用假设的新命令。
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{ntheorem,hyperref}
\theoremseparator{:}
\newtheorem{hypx}{Hypothesis}
\newenvironment{hyp}{\hypx[H\textsubscript{\thehypx}]}{\endhypx}
\newcommand{\hypref}[1]{\textup{(H\textsubscript{\ref{#1}})}}
\begin{document}
Below is my first hypothesis.
\begin{hyp}\label{hyp:h1}
The apple seldom falls far from the tree.
\end{hyp}
Below is my second hypothesis.
\begin{hyp}
All swans are white.
\end{hyp}
Here is a reference to \hypref{hyp:h1}.
\end{document}