10

I was trying to treat theorems and lemmas as in the book Visual complex analysis which in my opinion has a very nice format for informal reading.

I would like to have equations and propositions numbered in a single enumeration, both with the enumerator right justified in the right of the page as in the following examples taken from the book:

Example 1: you can have equations (or other constructs like enumerations) inside the propositions enter image description here

Example 2: Propositions are justified while equations are centered. enter image description here

I haven't arrived very far in my trials, my best so far only handles one line propositions as in:

\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}

But this has a lot of problems: it doesn't handle multiline propositions, and it doesn't center equations to begin with. Could you give me some clue on how to obtain the style used in the book?

  • 1
    Off topic: Nice book! – Sigur Apr 9 '14 at 0:06
3

Here is another suggestion based on tcolorbox.

The myproposition environment is provided numbered and additionally unnumbered using a star. Both variants are breakable. The example code repeats the number, if the propositons gets broken. Just remove the overlay middle and last key, if you do not want that.

\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}

enter image description here enter image description here

Now, that's not very colorful, but you asked for a clean design. Nevertheless, I could not resist to add at least a variant with an ornamentic line. Here, the number for the broken proposition is not repeated:

\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}

enter image description here enter image description here

3

Here's a suggestion similar to what you've already tried:

\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}

enter image description here

Your displayed equations were not being centered because you told amsmath to use fleqn.

I'm not entirely sure whether I like this approach I'm presenting here. In particular, the minipage will not break across pages. I suppose you could try something like tcolorbox which provides features such as breaking boxes across pages. But then where should the number for the proposition or theorem go? Are theorems and equations to be enumerated using the same counter?

Anyhow, consider this as a temporary suggestion until a better recommendation comes along.

Equation numbering

If you wanted to decouple the enumeration style of equations from your propositions, then you could do something like:

\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}}

Basically, this is the amsmath code used to redefine the equation environment hi-jacked to suite our needs here. If this is a route you choose to take, then you'll probably want to fiddle with how the tags are displayed so that duplicate numbering won't create confusion.

  • Thanks a lot. I like the solution is very clean and simple. It has the advantage of allowing the * version when there is no number and to use the same numbering scheme for a few lines of code (which is rather welcome). A pity it doesn't break accross pages. – Esteban Crespi Apr 9 '14 at 11:25
1

Here I adapted the numberedblock package, and created a macro \proposition[]{}. The first optional argument is the label of the form [\plabel{}], and the mandatory argument is the proposition content.

The \numblock macro adapted from numberedblock actually has its own counter, blocknum, which I slave to the equation counter. If you changed your mind and wanted them numbered separately, they could be unslaved from each other, and the placement and format of the blocknum numbering could be altered to distinguish it from the equation numbering.

Note several configurable parameters that I have in this MWE made to mimic the equation environment. They are lengths \maxblocklabelsize and \blockindent. The former controls the label's horizontal location, and can be set negative to push the label outside the margin. The latter is the left indent on the block. Note that I have, through the use of the \parbox width, set up \proposition to provide symmetric indent on the right, corresponding to \blockindent on the left. The last parameter to note is \blocklabel, which governs the appearance of the label at the right margin.

Propositions will NOT break across pages, because they are being set in a LaTeX box.

EDITED to make sure proposition equations were centered like normal equations.

REDITED to demonstrate support for hyperref, which must be loaded before 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}

enter image description here

  • Thanks for your answer. I'm having some problems which I don't quite understand, for some reason the whole block is beeing indented to the right as if it was beeing treated as character. I have tried several alternatives such as placing \par\noindent before the \numblock, but I haven't been able to make it work. There is also a problem with the hyperref package it doesn't allow me to place a \plabel in the first parameter. – Esteban Crespi Apr 9 '14 at 11:11
  • @EstebanCrespi As to the last problem, the numberedblock package was recently updated to handle labels. You may need an update from ctan.org/pkg/numberedblock. As to the indent, there is a parameter I set in the preamble, \setlength\blockindent{0.3in} which says that the proposition blocks should be indented by this amount. Note though, that I set the \parbox width to be symmetrically indented on the right side, to achieve centering of the equations. Making indent =0 on the left will cause the right end to overwrite the label on the right. – Steven B. Segletes Apr 9 '14 at 11:17
  • @EstebanCrespi Another point about hyperref, once you update numberedblock to the latest version. Load hyperref before you load numberedblock. I will update my MWE to show this. – Steven B. Segletes Apr 9 '14 at 11:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.