可以将定理数存储在变量中吗?
我使用 \newtheorem 并且编号是自动完成的。有时在文中我会用这个数字来引用定理。我希望有一个等于该数字的变量,因此如果定理编号发生变化,引用也会发生变化。
I use \newtheorem and the numbering is done automatically. Sometimes in the text I'll refer to a theorem by this number. I'd like to have a variable equal to this number, so if the theorem number changes, the references will change also.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的,它通过通常的
\label
/\ref
机制工作:(您需要运行两次 LaTeX 才能确定数字,您将收到一条消息关于更改的引用。)标签命令“附加”某些内容,例如节标题、标题、枚举项以及定理和朋友。
还有一些扩展可以自动区分节与子节或图形,为此,请参阅 hyperref 的
\autoref
或 smartef 包,但此时不必担心。Yes, it works through the usual
\label
/\ref
-mechanism:(You'll need two runs of LaTeX for the number to settle, you'll get a message about changed references.) Label commands "tack onto" certain things like section headers, captions, items of enumerations and, indeed, theorems and friends.
There are also extensions that can automatically distinguish sections from subsections or figures, for that, see hyperref's
\autoref
or the cleveref package, but don't worry about it at this point.您需要在
\begin{yourtheorem} \end{yourtheorem}
之间放置一个\label
并使用\ref
照常引用它。您可以查看此链接以获取有关更广泛上下文的说明定理
You need to put a
\label
between the\begin{yourtheorem} \end{yourtheorem}
and use\ref
to refer to it as usual.You can check this link for explanations with some broader context about theorems