环境格式:如何显示公理的名称而不是其计数器编号

环境格式:如何显示公理的名称而不是其计数器编号

我使用以下环境在我的论文中写公理

\theoremstyle{definition}  
\newtheorem{myax}{Axiom}

正如预期的那样,如果我写

\beging{myax}[Axiom of Choice]
\end{myax}

我明白了

公理 1(选择公理)

我想知道我是否可以用粗体显示 [ ] 中的文本,并隐藏其余部分(公理 1)

提前致谢

我正在使用以下代码

\usepackage{amsthm}

\theoremstyle{plain}
\newtheorem{myth}{Theorem}[section]
\newtheorem{myprop}[myth]{Proposition}
\newtheorem{mylemma}[myth]{Lemma}

\theoremstyle{definition}
\newtheorem{mydef}{Definition}[section]
\newtheorem{myax}{Axiom}

\theoremstyle{remark}
\newtheorem{myrmk}{Remark}[section]
\newtheorem{myex}{Example}[section]

使用 ntheorem 进行编码

\usepackage[amsmath,thmmarks]{ntheorem}
\theoremheaderfont{\bfseries\upshape}
\theorembodyfont{\itshape}
\theoremseparator{. }
%%%%%%%%%
\theoremstyle{emptybreak}
\theorembodyfont{\upshape}
\setlength{\labelsep}{0pt}
\newtheorem{myax}
%%%%%%%%%%
\theoremstyle{plain}
\newtheorem{myth}{Theorem}[section]
\newtheorem{myprop}[myth]{Proposition}
\newtheorem{mylemma}[myth]{Lemma}
%%%%%%%%%%
\theoremstyle{plain}
\theorembodyfont{\upshape}
\newtheorem{mydef}{Definition}[section]
%%%%%%%%%%%%%%%%%    
\makeatletter
\newtheoremstyle{remark}
{\item[\hskip\labelsep\theorem@headerfont ##1\ \textup{##2}\theorem@separator]}
{\item[\hskip\labelsep \theorem@headerfont ##1\ \textup{##2}\ (##3)\theorem@separator]}
\makeatother
\theoremstyle{remark}
\theoremheaderfont{\itshape}
\newtheorem{myrmk}{Remark}[section]
\newtheorem{myex}{Example}[section]
%%%%%%%%%%%%%%%%%    
\theoremstyle{nonumberplain}
\theoremheaderfont{\itshape}
\theorembodyfont{\normalfont}
\theoresymbol{\ensuremath\square}
\newtheorem{proof}{Proof}

\usepackage{cleveref}
\crefname{myth}{Theorem}
\crefalias{Myth}{myth}
\crefname{myprop}{Proposition}
\crefalias{Myprop}{myprop}
\crefname{mylemma}{Lemma}
\crefalias{Mylemma}{mylemma}
\crefname{mydef}{Definition}
\crefalias{Mydef}{mydef}
\crefname{myrmk}{Remark}
\crefalias{Myrmk}{myrmk}
\crefname{myex}{Example}
\crefalias{Myex}{myex}
\crefname{myax}{Axiom}
\crefalias{Myax}{myax}

\begin{document}
\begin{myth}
 My theorem.
\end{myth}
\end{document}

答案1

ntheorem使用which 定义empty和样式非常容易emptybreak。这些样式不定义计数器或标题:只打印可选参数。

\documentclass[11pt]{article}
\usepackage{ntheorem}
\theoremstyle{empty}
\theoremheaderfont{\bfseries\upshape} 
\theorembodyfont{\itshape}
\setlength{\labelsep}{0pt}
\newtheorem{named}{}

\theoremstyle{emptybreak}
\newtheorem{namedbreak}{}

\begin{document}

\begin{named}[Axiom of choice. ] If $X$ is a set of nonempty sets, there exists a function $f$ on $X$ such that, for any $A\in X$, one has $f(A)\in A$.
\end{named}

\begin{namedbreak}[Dr Faustroll’s axiom]
  God is the tangential point of $0$ and $\infty$.
\end{namedbreak}

\end{document}

在此处输入图片描述

编辑:要使 的布局与ntheorem的基本样式相同amsthm,请在序言中使用此样式:

\usepackage{ntheorem}

\theoremheaderfont{\bfseries\upshape}
\theorembodyfont{\itshape}
\theoremseparator{. }

%%%%%%%%%
\theoremstyle{empty}
\setlength{\labelsep}{0pt}
\newtheorem{named}{}

\theoremstyle{emptybreak}
\newtheorem{namedbreak}{}
%%%%%%%%%%
\theoremstyle{plain}

\newtheorem{myth}{Theorem}[section]
\newtheorem{myprop}[myth]{Proposition}
\newtheorem{mylemma}[myth]{Lemma}

\theoremstyle{definition}
\theorembodyfont{\upshape}
\newtheorem{mydef}{Definition}[section]

%%%%%%%%%%%%%%%%%    
\makeatletter
 \newtheoremstyle{remark}%
{\item[\hskip\labelsep \theorem@headerfont ##1\ \textup{##2}\theorem@separator]}%
{\item[\hskip\labelsep \theorem@headerfont ##1\ \textup{##2}\ (##3)\theorem@separator]}
\makeatother
\theoremstyle{remark}
\theoremheaderfont{\itshape}
\newtheorem{myrmk}{Remark}[section]
\newtheorem{myex}{Example}[section]

编辑:我清理了你的最后一段代码,并使其完全正常运行。特别是,当你用mytheorem样式声明一个定理结构(比如)时empty,你必须写成\newtheorem{mytheorem}{}(最后一个参数为空)。

\documentclass[11pt]{article}
\usepackage{amsmath, amssymb}
\usepackage[amsmath,thref, thmmarks]{ntheorem}%
\theoremheaderfont{\normalfont\bfseries}
\theoremseparator{. }
%%%%%%%%%
\theoremstyle{emptybreak}
\theorembodyfont{\normalfont}
\setlength{\labelsep}{0pt}
\newtheorem{myax}{}
%%%%%%%%%
\theoremstyle{plain}
\theorembodyfont{\itshape}
\newtheorem{myth}{Theorem}[section]
\newtheorem{myprop}[myth]{Proposition}
\newtheorem{mylemma}[myth]{Lemma}
%%%%%%%%%%%
\theorembodyfont{\normalfont}
\newtheorem{mydef}{Definition}[section]
%%%%%%%%%%%%%%%%%%
\makeatletter
\newtheoremstyle{remark}
{\item[\hskip\labelsep\theorem@headerfont ##1\ \textup{##2}\theorem@separator]}
{\item[\hskip\labelsep \theorem@headerfont ##1\ \textup{##2}\ (##3)\theorem@separator]}
\makeatother
\theoremstyle{remark}
\theoremheaderfont{\itshape}
\newtheorem{myrmk}{Remark}[section]
\newtheorem{myex}{Example}[section]
%%%%%%%%%%%%%%%%%
\theoremstyle{nonumberplain}
\theoremsymbol{\ensuremath\square}
\newtheorem{proof}{Proof}
%%%%%%%%%%%%%%%%%%%%%
\usepackage{cleveref}
\crefname{myth}{Theorem}{Theorems}
\crefalias{Myth}{myth}
\crefname{myprop}{Proposition}{Propositions}
\crefalias{Myprop}{myprop}
\crefname{mylemma}{Lemma}{Lemmas}
\crefalias{Mylemma}{mylemma}
\crefname{mydef}{Definition}{Definitions}
\crefalias{Mydef}{mydef}
\crefname{myrmk}{Remark}{Remarks}
\crefalias{Myrmk}{myrmk}
\crefname{myex}{Example}{Examples}
\crefalias{Myex}{myex}
\crefname{myax}{Axiom}{Axioms}
\crefalias{Myax}{myax}

\begin{document}

\begin{mydef}
 \textbf{Egotist}, n. A person of low taste, more interested in him\-self than in me.
\end{mydef}
\begin{myth}
 My theorem.
\end{myth}

\begin{proof}
 \[ \text{Fiddle dee dee!} \]
\end{proof}

\end{document}

在此处输入图片描述

答案2

您可以使用(我认为amsthm比 更好)来完成此操作。ntheorem

\documentclass[a4paper]{article}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{xparse}
\usepackage{hyperref}
\usepackage{cleveref}

\newtheorem{inneraxiom}{Axiom}
\newtheorem*{inneraxiomnonumber}{\axiomname}
\providecommand{\axiomname}{}

\makeatletter
\NewDocumentEnvironment{axiom}{o}
 {%
  \IfNoValueTF{#1}
    {\inneraxiom}% no optional argument, nothing special
    {% optional argument
     \renewcommand{\axiomname}{#1}% set \axiomname to #1
     \def\@currentlabel{#1}% for \ref
     \inneraxiomnonumber% start the unnumbered environment
    }%
 }
 {\IfNoValueTF{#1}{\endinneraxiom}{\endinneraxiomnonumber}}
\makeatother

\begin{document}

\begin{axiom}\label{axiom:standard}
This is a standard axiom.
\end{axiom}

\begin{axiom}[Francesco's axiom]\label{axiom:francesco}
All axioms are useful.
\end{axiom}

\cref{axiom:standard}

\ref{axiom:francesco}

\end{document}

\cref对于命名公理来说,使用它没有什么意义。

在此处输入图片描述

答案3

amsthm提供带星号的版本\newtheorem,用指定参数替代通常的编号标题。因此,此定义将生成您想要的标题:

\theoremstyle{definition}
\newtheorem*{axch}{Axiom of Choice}

当然,标题现在是固定的,所以如果想要不同的“特定”标题,则\newtheorem*需要单独的标题。

用户指南第 3 页对此进行了描述amsthmtexdoc amsthdoc)。

答案4

看到这个问题又被重新提出,我想我可以详细阐述一下此评论并提供仅依赖于amsthm包的解决方案。

正如 Barbara Beeton 在她的回答,该命令的 * 形式\newtheorem不会创建与所定义环境相关联的计数器,因此会产生未编号的定理(或引理、命题、定义……),但会用命令的第二个参数中指定的文本进行标记\newtheorem*,不加修饰。例如,在论文中通常会看到以下声明:

\newtheorem*{MT}{Main Theorem}

这将创建一个名为的环境MT,用于陈述论文的主要结果:

\begin{MT}
    My research deserves to be funded.
\end{MT}

正如芭芭拉 (Barbara) 已经指出的那样,这有一个缺点(但这真的是一个缺点吗?),即您需要为想要提及的每个“命名”定理(或公理,或......)定义一个不同的环境。

Bernard 问道评论是否可以仅使用amsthm的特征来定义一个“通用”无编号定理的环境,该环境使用的标签不是命令的第二个参数中指定的文本\newtheorem*,而是环境本身的可选参数的内容,IE,该参数旨在为定理头传递一个“可选注释”。答案是肯定的,但你需要通过声明来定义一种新的“定理风格” \newtheoremstyle

\newtheoremstyle命令在软件包手册的第 4.3 节中有描述amsthm。在其第九个参数中,您可以指示如何从以下三个部分构建标记定理/公理/… 的标题:

  1. 该定理姓名例如\newtheorem、“定理”、“引理”、“公理”……):这是(或)命令的第二个参数中指定的文本\newtheorem*

  2. 该定理数字:这是与环境关联的计数器的当前值(更准确地说,它是 的扩展,比如\theaxiom,如果axiom是计数器的名称,它与环境的名称相同)。

  3. 该定理可选注释:这些是环境可选参数的内容。

更准确地说(引用自amsclass.dtx),第九个论点\newtheoremstyle……

…被解释为内部三参数函数的替换文本\thmheadIE,就好像你正在定义

\renewcommand{\thmhead}[3]{...#1...#2...#3...}

但省略了初始的\renewcommand{\thmhead}[3]。将提供的三个参数\thmhead 是名称、编号和可选的注释组件。

有关更多信息,请参阅文件amsclass.dtx。上述信息足以说明,例如,

\newtheoremstyle{emptyplain}
    {}          % default space above
    {}          % default space below
    {\itshape}  % body font
    {}          % no indent
    {\bfseries} % theorem head font
    {.}         % punctuation after theorem head
    { }         % space after theorem head (normal interword space)
    {#3}        % using "\thmnote{#3}" is redundant, isn't it?
\theoremstyle{emptyplain}
\newtheorem*{namedaxiom}{}

按照 Bernard 的要求去做:它定义了一个“通用未编号定理类”环境,对于定理头部,它使用可选注释的纯粹内容。

MWE 概括了我们所说的一切:

% My standard header for TeX.SX answers:
\documentclass[a4paper]{article} % To avoid confusion, let us explicitly 
                                 % declare the paper format.

\usepackage[T1]{fontenc}         % Not always necessary, but recommended.
% End of standard header.  What follows pertains to the problem at hand.

\usepackage{amsmath}
\usepackage{amsthm}

% I deem axioms should typeset like plain theorems...
% \theoremstyle{definition}
\newtheorem{axiom}{Axiom}
\newtheorem*{AC} {Axiom of Choice}
\newtheorem*{GCH}{Generalized Continuum Hypothesis}

\newtheoremstyle{emptyplain}
    {}          % default space above
    {}          % default space below
    {\itshape}  % body font
    {}          % no indent
    {\bfseries} % theorem head font
    {.}         % punctuation after theorem head
    { }         % space after theorem head (normal interword space)
    {#3}        % using "\thmnote{#3}" is redundant, isn't it?
\theoremstyle{emptyplain}
\newtheorem*{namedaxiom}{}



\begin{document}

A few ``generic'' axioms:

\begin{axiom}[Union set]
    If $x$ and~$y$ are sets, then $x\cup y$ is also a set.
\end{axiom}

\begin{axiom}[Power set]
    If $x$ is a set, then $\wp(x)$ is also a set.
\end{axiom}

A named axiom:

\begin{AC}
    Blah blah blah\ldots
\end{AC}

Another one:

\begin{GCH}[a.k.a.\ Cantor's Aleph Hypothesis]
    For every ordinal~$\alpha$,
    \[ \aleph_{\alpha+1} = 2^{\aleph_{\alpha}} \]
\end{GCH}

With the \texttt{emptyplain} theorem style
(and a statement that spans two lines,
so you can check that there are no stray spaces):

\begin{namedaxiom}[Francesco's Axiom of Axioms]
    All axioms are important, but some axioms are more important than others.
\end{namedaxiom}

\begin{axiom}[benchmark]
    This is an axiom.
\end{axiom}

But:

\begin{namedaxiom}
    This axiom is not correctly typeset.
\end{namedaxiom}

\end{document}

输出为:

代码输出

相关内容