3

The problem:

I'm trying to find an appropriate environment for the listing of hypotheses near the beginning of a mathematics research paper. The hypotheses themselves are mostly text, interspersed with display-style mathematics and the occasional equation.

Requirements:

  • Each hypothesis should be numbered in the same way that equations are numbered, with the number appearing on the right-hand side of the page (if the standard article class is used)
  • The number assigned to a hypothesis should be centred vertically with respect to that hypothesis
  • LaTeX should (preferably) handle linebreaks, since each hypothesis is mostly words
  • The left-hand margin should be greater than the usual text margin, so that it's inset a little (like with the enumerate environment)

Attempts at solution:

  • Using the enumerate environment with the enumitem package gives almost what I want, but the labels appear on the left-hand side of the page, at the beginning of each item. If they were on the right-hand side, and vertically centred, that would probably suffice. Some example code:

    \documentclass{article}
    \usepackage{amsmath,amssymb}
    \usepackage{enumitem}
    
    \begin{document}
    
    \begin{enumerate}[label=(H\arabic*)]
    \item $T>0$ and $\Omega$ is an open, bounded and connected subset of $\mathbb{R}^d$, 
    where $d\in\mathbb{N}$. \label{hyp:domain}
    \item For every $n\in\mathbb{N}$, $\beta_{n}:\mathbb{R}\to\mathbb{R}$ is nondecreasing, Lipschitz continuous 
    with uniform Lipschitz constant $L_\beta > 0$ and satisfies $\beta_{n}(0)=0$.
    There is a function $\beta:\mathbb{R}\to\mathbb{R}$ such that $\beta_{n}\to\beta$ locally uniformly 
    on $\mathbb{R}$. \label{hyp:beta}
    \end{enumerate}
    
    \end{document}
    
  • Using a left-aligned array for each hypothesis gives me the correct margins, alignment and numbering, but it just doesn't seem appropriate to use for something that is a list and mostly text. The spacing between lines is wrong and I'm forever having to insert manual linebreaks and \mbox's everywhere. Some example code:

    \documentclass{article}
    \usepackage{amsmath,amssymb}
    \usepackage{geometry}
    
    \begin{document}
    \begin{subequations}
    \begin{align}
    &\begin{array}{l}
    \mbox{$T>0$ and $\Omega$ is an open, bounded and connected subset of $\mathbb{R}^d$, 
    where $d\in\mathbb{N}$.}
    \end{array}\label{hyp:domain} \\ 
    &\begin{array}{l}
    \mbox{For every $n\in\mathbb{N}$, $\beta_{n}:\mathbb{R}\to\mathbb{R}$ is nondecreasing, Lipschitz continuous 
    with uniform} \\
    \mbox{Lipschitz constant $L_\beta > 0$ and satisfies $\beta_{n}(0)=0$.}\\
    \mbox{There is a function $\beta:\mathbb{R}\to\mathbb{R}$ such that $\beta_{n}\to\beta$ locally uniformly 
    on $\mathbb{R}$.}
    \end{array}
    \end{align}
    \end{subequations}
    \end{document}
    

I should point out that the difference in styles of numbering ( (H1), (H2), etc. for the first example, (1a), (1b), etc. for the second example) isn't so important; I'd probably prefer the second style though.

Is the solution to create a custom hypothesis environment (which would be pretty handy for future papers), or is there no middle-ground to be had between my above attempts at solution?

  • You should really give us some code to work with, since it would (should!) highlight some of the restrictions you're working with (class and or packages). It will also guide anyone who answers in terms of the desired interface you require. – Werner Feb 27 '15 at 1:11
  • @Werner Thanks for the heads up; I've added some sample code (which should compile if you do a direct copy+paste into a text editor). Do let me know if you'd like me to post some output nonetheless. – KST Feb 27 '15 at 1:55
2

Here's one possibility using tcolorbox. A new hypotheses environment is defined (internally is just a list); inside this environment you use the \Hypo command for each hypothesis; the syntax is

\Hypo[<label>]{<text>}

The code:

\documentclass{article}
\usepackage[many]{tcolorbox}
\usepackage{enumitem}
\usepackage{amsmath,amssymb}
\usepackage{lipsum}

\newcounter{myhypo}
\renewcommand\themyhypo{(H\arabic{myhypo})}

\newtcolorbox{hypo}[1][]{
  breakable,
  enhanced,
  top=0pt,
  bottom=0pt,
  nobeforeafter,
  colback=white,
  boxrule=0pt,
  arc=0pt,
  right=30pt,
  left=20pt,
  outer arc=0pt,
  overlay={
    \node[inner sep=0pt,anchor=east] 
    at (frame.east) 
    {\refstepcounter{myhypo}\themyhypo\label{#1}};
  },
}
\newenvironment{hypotheses}
  {\list{}{\setlength\leftmargin{0pt}\item\relax}}
  {\endlist}
\newcommand\Hypo[2][]{%
  \begin{hypo}[#1]#2\end{hypo}}  

\begin{document}

\lipsum[4]
\begin{hypotheses}
\Hypo[hyp:domain]{%
$T>0$ and $\Omega$ is an open, bounded and connected subset of $\mathbb{R}^d$, 
where $d\in\mathbb{N}$.}

\Hypo[hyp:beta]{%
For every $n\in\mathbb{N}$, $\beta_{n}:\mathbb{R}\to\mathbb{R}$ is nondecreasing, Lipschitz continuous 
with uniform Lipschitz constant $L_\beta > 0$ and satisfies $\beta_{n}(0)=0$.
There is a function $\beta:\mathbb{R}\to\mathbb{R}$ such that $\beta_{n}\to\beta$ locally uniformly on $\mathbb{R}$.}

\Hypo[hyp:test]{%
A short hypothesis.}
\end{hypotheses}
As we see from hypotheses~\ref{hyp:domain}, \ref{hyp:beta} and~\ref{hyp:test}...

\end{document}

The result:

enter image description here

I used

\renewcommand\themyhypo{(H\arabic{myhypo})}

to get (H1), (H2),... but you can get any other numbering schema by changing this redefinition.

  • This works really well, but the output (at least for me) has boxes around each hypothesis. This may be a consequence of an error that I get when I compile, about not having the latest version of the package xparse. – KST Feb 27 '15 at 5:55
  • Hmm... even compiling on a fully up-to-date TeXLive distribution, I'm still seeing the outlines of the boxes. How would I modify your code to make the boxes invisible? – KST Feb 27 '15 at 7:57
  • Update: found it... Adding colframe=white in the newtcolorbox does the job. Thanks for your code and answer, Gonzalo! – KST Feb 27 '15 at 8:09
  • the space above the block of hypotheses is larger than it should be -- it should match the space below. may be the result of the (built-in) \par at the end of a lipsum text? – barbara beeton Feb 27 '15 at 14:41
  • @barbarabeeton I think it must be. Upon implementing Gonzalo's code in my paper, the space above the hypotheses block appears comparable to that which the equation environment would generate. – KST Feb 28 '15 at 6:17
0

I know I'm like 3 years late but since this question still shows in Google, I will add my answer for completeness.

As I didn't want to use any extra packages (especially one such as tcolorbox which has a lot of unwanted fuzz, at least to me); I hacked together a solution using tabular environments. Please note that I don't know the efficiency of this, what with my Master Thesis having a few hypotheses (4 or so) there is no noticeable compilation overhead, but I don't know what would happen with a text with, say, 100 hypotheses.

\documentclass{article}

\usepackage{amsmath,amssymb} % needed for math
\usepackage{array} % needed for the 'm' column type in tabular

\newcounter{hypocounter}
\renewcommand\thehypocounter{(H\arabic{hypocounter})} % this produces '(H1)'
                                                      % when referencing
\setcounter{hypocounter}{0}

\newenvironment{hypothesis}{
\refstepcounter{hypocounter}
\begin{center}
\begin{tabular}{m{0.75\linewidth}c} % adjust '0.75' to preferred width
}{&\thehypocounter\end{tabular}\end{center}}

\begin{document}

This is some text.

\begin{hypothesis}
\label{hyp:one}
$T>0$ and $\Omega$ is an open, bounded and connected subset of $\mathbb{R}^d$, 
where $d\in\mathbb{N}$.
\end{hypothesis}

This is a reference to hypothesis \ref{hyp:one}.

\begin{hypothesis}
For every $n\in\mathbb{N}$, $\beta_{n}:\mathbb{R}\to\mathbb{R}$ is nondecreasing, Lipschitz continuous 
with uniform Lipschitz constant $L_\beta > 0$ and satisfies $\beta_{n}(0)=0$.
There is a function $\beta:\mathbb{R}\to\mathbb{R}$ such that $\beta_{n}\to\beta$ locally uniformly on $\mathbb{R}$.
\end{hypothesis}

\begin{hypothesis}
\label{hyp:three}
A short hypothesis.
\end{hypothesis}

Another reference to the last hypothesis: \ref{hyp:three}.

\end{document}

Which procuces this: enter image description here

  • 2
    Welcome to TeX.SE! :) – Troy May 21 '18 at 9:49

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.