The following is a theorem from Algebraic topology written by A. Hatcher.

I'm interested in to know how is possible do theorems like this: enter image description here

I know that a new environment has the following form, how to put two vertical lines. Thanks


  • 1
    mdframed is the better one
    – MadyYuvi
    Jun 2, 2020 at 7:23
  • 2
    Thesmall framed package defines a leftbar environment. You also can look at the thmtools package.
    – Bernard
    Jun 2, 2020 at 7:39
  • @MadyYuvi thanks. this package is awesome.
    – Qurultay
    Jun 2, 2020 at 9:06
  • @Bernard thmtools package is great. Thanks
    – Qurultay
    Jun 2, 2020 at 9:07
  • You can use the lettrine package for the big T in Theorem. Jun 2, 2020 at 14:03

1 Answer 1


Several people have suggested packages such as thmtools in the comments. If you want to roll your own, here is a wrapper around an existing environment. It supports an optional argument, but cannot break across pages. It’s therefore only appropriate for short theorems.

\usepackage{amsmath, amsthm} % For \newtheorem*.
\usepackage{unicode-math}    % Or your math package of choice.
\usepackage{xparse}          % For \NewDocumentEnvironment.
\usepackage{settobox}        % For \settoboxtotalheight.
\usepackage{microtype}       % For font expansion.
\usepackage{lipsum}          % For \lipsum.

%% This is the font actually used within the example you gave:
%\setmathfont{Cambria Math}




This is a theorem.

Suppose \(H^\ast (X ; \mathbb{Z}_p)\) is the polynomial algebra
\(\mathbb{Z}_p[\alpha]\) on a generator \(\alpha\) of dimension \(n\),
possibly truncated by the relation \(\alpha^m = 0\) for \(m > p\).  Then if
\(p = 2\), \(n\) must be a power of \(2\), and if \(p\) is an odd prime, \(n\)
must be of the form \(p^k \ell\), where \(\ell\) is an even divisor of


Theorem layout sample

Essentially, this typesets the theorem text inside a minipage that subtracts the width of the left rule. Instead of using it immediately, we save that in a box so we can measure its height. This lets us lay out the rules to the left first.

The code uses xparse to make it possible to use an argument in the code to close an environment, settobox as a convenient way to add the height and the depth of the theorem, and includes amsmath before amsthm because, otherwise, another package would have loaded it afterwards, which could have caused bugs in a more complex document.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .