1. Torbjorn

    It would be nice if you changed all the $$ .. $$ to \[ .. \], the former is not recommended to use in LaTeX.

  2. The code above re-numbers the lemma from 1.1. How can I set the counter so that the lemma’s number continues the theorem’s number? (theorem 1.1, then lemma 1.2, then theorem 1.3, and so on). Thanks.

    • tom

      Thanks for your question. I assume you refer to the complete code example at the bottom of the article. You’d just have to replace the lemma counter with the theorem counter. Please see the updated lemma code below.

      Best, Tom

      \tikz[baseline=(current bounding box.east),outer sep=0pt]
      {\strut Lemma~\thetheo};}}
      \tikz[baseline=(current bounding box.east),outer sep=0pt]
      {\strut Lemma~\thetheo:~#1};}}%
  3. Kim

    If you don’t use the label part in the theorems the first letter in the output will missing.

    \begin{lem}[B\'ezout's identity]
    Let $a$ and $b$ be nonzero integers and let $d$ be their greatest common divisor. Then there exist integers $x$ and $y$ such that:
    This is a reference to Bezout's lemma \ref{lem:bezout}

    et $a$ and $b$ ….. No L!

    Thanks a lot for the examples and good blog by the way.


    • tom

      Hi Kim,

      Thanks for pointing this out. When the label is not used, just leave the curly brackets empty.

      \begin{lem}[B\'ezout's identity]{}

      Alternatively, you can also change the lem environment definition.

      Best, Tom

  4. Jens

    Hi Tom,

    Thank you for this great article! Since I found it early this year, I use these fancy boxes in every script I write (Iยดm a math student and make summaries).

    Now I like to use such boxes formulas and have problem if my content starts with \[ … \] .
    Then I have a blank line at the beginning.
    If I write a text before \[ … \], then the formula is at the exact same point as without text.

    Can you reproduce this issue? If not, I will make my first minimal example ๐Ÿ˜‰

    Best wishes

    • tom

      Hi Jens,

      I can reproduce the extra whitespace with the displaymath environment in the box. There seems to be an extra baselineskip added within mdframed.

      Although it is not an elegant solution, my suggestion would be to manually remove the whitespace where necessary.



      • Jens

        Hi Tom,

        Thanks a lot for this workaround, that helps indeed.

        In case someone finds an elegant solution it would be nice if you could share it here.


      • tom

        You are welcome! To stay informed of future replies, you can subscribe to comments on this article.


Leave a Reply