定理形式与方程类似

定理形式与方程类似

我试图按照书中的方式处理定理和引理视觉复杂分析在我看来,它具有非常适合非正式阅读的格式。

我希望方程式和命题在单个枚举中编号,并且枚举器在页面右侧右对齐,如以下取自书中的示例所示:

示例 1:你可以在命题中使用方程(或其他结构,如枚举) 在此处输入图片描述

例2:命题有理有据,方程式居中。 在此处输入图片描述

我的试验还没有取得很大进展,到目前为止我最好的结果只能处理一行命题,如下所示:

\documentclass{article}
\usepackage[fleqn]{amsmath}
\setlength{\mathindent}{1cm}
\begin{document}
  \noindent Some text
  \begin{equation}
     \text{\itshape One line proposition of text and math $f(x) = \sin x$.}
  \end{equation}
  some more text
  \begin{equation}
     f(x) = \sin x 
  \end{equation}
  some more text
  \begin{equation}
    \text{\itshape Long proposition of text don't fit in the page and continue past the         
           right margin.}
  \end{equation}
  some more text
 \end{document}

但是这有很多问题:它不能处理多行命题,而且它一开始就没有将方程式居中。你能给我一些关于如何获得书中使用的风格的提示吗?

答案1

以下是基于的另一个建议tcolorbox

环境myproposition使用星号提供编号和未编号。两种变体都是可破坏的。如果命题被破坏,示例代码会重复编号。overlay middle and last如果您不想这样,只需删除密钥即可。

\documentclass{article}
\usepackage{amsmath,amsthm,lipsum}

\usepackage[many]{tcolorbox}

\tcbset{proposition/.style={enhanced,breakable,fontupper=\itshape,
  frame hidden,interior hidden,boxsep=0pt,boxrule=0pt,
  left=25pt,right=25pt}}

\newtcolorbox[use counter=equation]{myproposition}[1][]{%
  proposition,
  overlay unbroken and first={\node[left,inner sep=0pt,outer sep=0pt]
    at (frame.east) {(\thetcbcounter)};},
  overlay middle and last={\node[left,inner sep=0pt,outer sep=0pt,align=center]
    at (frame.east) {\textit{\footnotesize cont.}\\(\thetcbcounter)};},
  #1}

\newtcolorbox{myproposition*}[1][]{proposition,#1}

\begin{document}

\begin{equation}
\frac{r_B}{r_A} = \sqrt{\rho}
\end{equation}

For our second application, recall that if two points on a sphere are
diametrically opposite to each other (such as the north and south poles) then
they are said to be antipodal. Let us show that
\begin{myproposition}[label={antipodal points}]
  If $\hat p$ and $\hat q$ are \emph{antipodal points} of $\Sigma$, then their
  stereographic projections $p$ and $q$ are related by the following formula:
  \[ q = -(1/\bar p)\]
\end{myproposition}

\lipsum[1-3]

\begin{myproposition}[label={antipodal points 2}]
  This proposition is broken from one page to the next.
  If $\hat p$ and $\hat q$ are \emph{antipodal points} of $\Sigma$, then their
  stereographic projections $p$ and $q$ are related by the following formula:
  \[ q = -(1/\bar p)\]
\end{myproposition}

\lipsum[4]

See something in Proposition~\ref{antipodal points}
or in Proposition~\ref{antipodal points 2}.

Now follows an unnumbered proposition.

\begin{myproposition*}
  If $\hat p$ and $\hat q$ are \emph{antipodal points} of $\Sigma$, then their
  stereographic projections $p$ and $q$ are related by the following formula:
  \[ q = -(1/\bar p)\]
\end{myproposition*}

\end{document}

在此处输入图片描述 在此处输入图片描述

现在,这不是很丰富多彩,但你要求一个干净的设计。尽管如此,我还是忍不住至少添加一个带有装饰线的变体。在这里,破损命题的数字没有重复:

\documentclass{article}
\usepackage{amsmath,amsthm,lipsum}

\usepackage[many]{tcolorbox}

\tcbset{proposition/.style={enhanced,breakable,fontupper=\itshape,
  frame hidden,interior hidden,boxsep=0pt,boxrule=0pt,
  left=25pt,right=25pt,
  overlay={\draw[lightgray,line width=2pt]
    ([xshift=-1pt]frame.north east) -- ([xshift=-1pt]frame.south east);}}}

\newtcolorbox[use counter=equation]{myproposition}[1][]{%
  proposition,
  overlay unbroken and first={%
    \node[left,inner sep=0pt,outer sep=0pt] (N) at (frame.east) {(\thetcbcounter)};
    \draw[lightgray,line width=2pt]
      ([xshift=-1pt]frame.north east) |- ([yshift=2pt]N.north west)
      ([yshift=-2pt]N.south west) -| ([xshift=-1pt]frame.south east);},
  #1}

\newtcolorbox{myproposition*}[1][]{proposition,#1}

\begin{document}

\begin{equation}
\frac{r_B}{r_A} = \sqrt{\rho}
\end{equation}

For our second application, recall that if two points on a sphere are
diametrically opposite to each other (such as the north and south poles) then
they are said to be antipodal. Let us show that
\begin{myproposition}[label={antipodal points}]
  If $\hat p$ and $\hat q$ are \emph{antipodal points} of $\Sigma$, then their
  stereographic projections $p$ and $q$ are related by the following formula:
  \[ q = -(1/\bar p)\]
\end{myproposition}

\lipsum[1-3]

\begin{myproposition}[label={antipodal points 2}]
  This proposition is broken from one page to the next.
  If $\hat p$ and $\hat q$ are \emph{antipodal points} of $\Sigma$, then their
  stereographic projections $p$ and $q$ are related by the following formula:
  \[ q = -(1/\bar p)\]
\end{myproposition}

\lipsum[4]

See something in Proposition~\ref{antipodal points}
or in Proposition~\ref{antipodal points 2}.

Now follows an unnumbered proposition.

\begin{myproposition*}
  If $\hat p$ and $\hat q$ are \emph{antipodal points} of $\Sigma$, then their
  stereographic projections $p$ and $q$ are related by the following formula:
  \[ q = -(1/\bar p)\]
\end{myproposition*}

\end{document}

在此处输入图片描述 在此处输入图片描述

答案2

以下是与您已尝试过的建议类似的建议:

\documentclass{article}
\usepackage{amsmath}
\usepackage{amsthm}

\newenvironment{myproposition}
  {\begin{equation}
   \begin{minipage}{0.90\linewidth}
     \itshape}
  {\end{minipage}%%
   \end{equation}}

\usepackage{lipsum}

\begin{document}

  For our second application, recall that if two points on a sphere are
  diametrically opposite to each other (such as the north and south poles) then
  they are said to be antipodal.  Let us show that
  \begin{myproposition}
    \label{antipodal points}
    If $\hat p$ and $\hat q$ are \emph{antipodal points} of $\Sigma$, then their
    stereographic projections $p$ and $q$ are related by the following formula:
    \[ q = -(1/\bar p)\]
  \end{myproposition}
  \lipsum[1]
  See \ref{antipodal points}.

 \end{document}

在此处输入图片描述

amsmath由于您告诉使用,因此您显示的方程式未居中fleqn

我不太确定我是否喜欢我在这里介绍的这种方法。特别是,minipage不会跨页拆分。我想你可以尝试类似的东西tcolorbox,它提供了跨页拆分框等功能。但是,那么应该在哪里输入主张或者定理去吧?定理和方程式是否要使用同一个计数器来枚举?

无论如何,请将其视为临时建议,直到出现更好的建议为止。

方程编号

如果你想将方程的枚举样式与你的命题分离,那么你可以这样做:

\newcounter{myequation}
\makeatletter
\def\my@incr@eqnum{\refstepcounter{myequation}\let\my@eqnum\@empty}
\newenvironment{myequation}{%
  \my@incr@eqnum
  \mathdisplay@push
  \st@rredfalse \global\@eqnswtrue
  \mathdisplay{equation}%
}{%
  \endmathdisplay{equation}%
  \mathdisplay@pop
  \ignorespacesafterend
}
\makeatother

\newenvironment{myproposition}
  {\begin{myequation}
   \begin{minipage}{0.90\linewidth}
     \itshape}
  {\end{minipage}%%
   \end{myequation}}

基本上,这是amsmath用来重新定义equation环境的代码,以满足我们的需求。如果您选择采用这种方式,那么您可能需要调整标签的显示方式,以免重复编号造成混淆。

答案3

这里我改编了这个numberedblock包,并创建了一个宏\proposition[]{}。第一个可选参数是表单的标签[\plabel{}],强制参数是命题内容。

\numblock改编自的宏实际上numberedblock有自己的计数器,,blocknum我将其从属于计数器equation。如果您改变主意并希望对它们进行单独编号,则可以将它们彼此取消从属关系,并且blocknum可以更改编号的位置和格式以将其与编号区分开来equation

请注意,我在此 MWE 中设置了几个可配置参数来模拟环境equation。它们是长度\maxblocklabelsize\blockindent。前者控制标签的水平位置,可以设置为负数以将标签推到边距之外。后者是块上的左缩进。请注意,我已经通过使用宽度\parbox设置\proposition为在右侧提供对称缩进,与\blockindent左侧相对应。要注意的最后一个参数是\blocklabel,它控制标签在右边距的外观。

提案将不是跨页换行,因为它们被设置在 LaTeX 框中。

已编辑以确保命题方程像正规方程一样居中。

REDITED 以证明对的支持hyperref,必须加载 numberedblock

\documentclass{article}
\usepackage{hyperref}
\usepackage{numberedblock}[2014/02/24]
\usepackage{lipsum}
 \setlength\maxblocklabelsize{.25in}
 \setlength\blockindent{0.3in}
 \renewcommand\blocklabel[1]{(\arabic{#1})}
 \let\plabel\nblabel
\newcommand\proposition[2][]{%
  \setcounter{blocknum}{\theequation}%
  \numblock{\parbox{\dimexpr\textwidth-2\blockindent\relax}%
    {\rmfamily\itshape#2}#1}\newline%
  \stepcounter{equation}}
\begin{document}
In the beginning,
\begin{equation}
F = \frac{d}{dt} MV
\end{equation}
\lipsum[4]
\proposition[\plabel{p:X}]{If $\hat p$ and $\hat q$ are antipodal points of $\Sigma$,
then their stereographic projections $p$ and $q$ are related by the following 
formula:

\centering\( q = -(1/\bar p).\)
}
In proposition~\ref{p:X}, \lipsum[5]
\begin{equation}
E = mc^2
\end{equation}
\end{document}

在此处输入图片描述

相关内容