乳胶数学文档中的编号

乳胶数学文档中的编号

我正在寻找乳胶代码,该代码在定理、命题、引理、推论、注释和其他简单的数学方程式之前产生每个编号,就像书中的以下页面一样: 在此处输入图片描述

在上面的例子中,该节是第 1 章的 1.3 节。另请注意,编号以粗体显示。谢谢您的帮助。

答案1

适当地定义定理样式;对于粗体形式的方程编号也需要使用一些技巧。

\documentclass[leqno]{book}
\usepackage{amsmath,amsthm}

\makeatletter
% http://tex.stackexchange.com/a/261647/4427
% detach \eqref and \tag making
\renewcommand{\eqref}[1]{\textup{\eqreftagform@{\ref{#1}}}}
\let\eqreftagform@\tagform@
% equation numbers are boldface
\def\tagform@#1{%
  \maketag@@@{\bfseries(\ignorespaces#1\unskip\@@italiccorr)}%
}
\makeatother

\newtheoremstyle{main}% name
  {\topsep}%   Space above
  {\topsep}%   Space below
  {\itshape}%  Body font (use \slshape if you want slanted type)
  {}%          Indent amount (empty = no indent, \parindent = para indent)
  {\bfseries}% Thm head font
  {:}%         Punctuation after thm head
  { }%         Space after thm head: " " = normal interword space;
  {(\thmnumber{#2}) \thmname{#1}\thmnote{ {\normalfont(#3)}}}

\newtheoremstyle{maindefinition}% name
  {\topsep}%   Space above
  {\topsep}%   Space below
  {\upshape}%  Body font
  {}%          Indent amount (empty = no indent, \parindent = para indent)
  {\bfseries}% Thm head font
  {:}%         Punctuation after thm head
  { }%         Space after thm head: " " = normal interword space;
  {(\thmnumber{#2}) \thmname{#1}\thmnote{ {\normalfont(#3)}}}%


\numberwithin{equation}{section}
\theoremstyle{main}
\newtheorem{theorem}[equation]{Theorem}
\newtheorem{proposition}[equation]{Proposition}
\theoremstyle{maindefinition}
\newtheorem{definition}[equation]{Definition}

\begin{document}

\chapter{Exactness and intertwining}

\setcounter{section}{2}

\section{Test}

\setcounter{equation}{2}

\begin{definition}
We define \emph{something}
\end{definition}

Some text

\begin{proposition}
Some statement, an equation
\begin{equation}
a+b=c
\end{equation}
and the end of the statement.
\end{proposition}

\begin{theorem}[With note]
Something
\end{theorem}

\end{document}

在此处输入图片描述

答案2

您也可以使用thmtools+amsthmnthm单独使用 来执行此操作。至于方程编号,它是leqno文档类中的选项。当然,您应该注释掉您不想使用的代码部分:

\documentclass[leqno]{book}
\usepackage{xcharter}
\usepackage{mathtools}
%%% Code for amsthm
\usepackage{amsthm, thmtools}
%
\declaretheoremstyle[%
headfont=\normalfont\bfseries,
within=chapter, headformat = swapnumber, headpunct={:}, spaceabove = 8pt,spacebelow = 8pt]%
{mythm}
\declaretheorem[name=Theorem, style=mythm, %
preheadhook={\renewcommand \theTheorem{(\thesection.\arabic{Theorem})}}]{Theorem}

%%% Code for ntheorem
\usepackage{ntheorem}
\theoremstyle{change}
\theoremseparator{:}
\newtheorem{Theorem}{Theorem}[chapter]
\renewcommand \theTheorem{(\thesection.\arabic{Theorem})} 
%%%%%%%

\begin{document}

\setcounter{chapter}{3}
\section{A first section}
\begin{Theorem}
  The following assertion is true: %
  \begin{equation}\label{testeq}
    a = a\end{equation}
    \end{Theorem}

\end{document}

在此处输入图片描述

注意thmtools也适用于ntheorem,但这里不是必需的。使用amsthm,可以简化新定理样式的定义。

答案3

为了完整起见,这里有一个解决方案,它使用ntheorem没有其他辅助包的包来定义定理标题的自定义外观。

在此处输入图片描述

\documentclass{report} % use a class that features chapter-level headers

%% Customize the appearance of equation numbers
\usepackage[leqno]{mathtools} % for \newtagform and \usetagform macros
\numberwithin{equation}{section}
\newtagform{bold}[\bfseries]{(}{)} % bold equation numbers
\usetagform{bold}
\renewcommand\eqref[1]{\textup{(\ref{#1})}} % but non-bold cross-references


%% Customize the appearance of theorem-like environments
\usepackage[amsmath]{ntheorem}
\makeatletter
\newtheoremstyle{mythm}%
   {\item[\hskip\labelsep\theorem@headerfont(##2) ##1\theorem@separator]}%
   {\item[\hskip\labelsep\theorem@headerfont(##2) ##1 [##3]\theorem@separator]}
\makeatother    
\theoremstyle{mythm}  % switch to the newly-defined theorem style
\theorembodyfont{\slshape}
\theoremseparator{:}  
\newtheorem{thm}{Theorem}[equation]
\newtheorem{prop}[equation]{Proposition}
\newtheorem{defn}[equation]{Definition}

\begin{document}

\setcounter{chapter}{1}  % just for this example
\setcounter{section}{3}
\setcounter{equation}{2}

\begin{defn} 
A \emph{tame corestriction on $A$} (relative to $E/F$) is a \dots 
\end{defn}
\begin{prop} 
(i) Let $\psi_E$, $\psi_F$ be continuous additive characters \dots There exists a unique map $s\colon A\to B$ such that
\begin{equation} \label{eq:co}
\psi_A(ab)=\psi_B(s(a)b), \quad a\in A, b\in B.
\end{equation}
\end{prop}

\end{document}

相关内容