TransWikia.com

Adding a label to Theorems etc

TeX - LaTeX Asked by Matthew Daws on March 9, 2021

I would like to add some labels to Theorem (etc.) environments. Here is a minimal working example:

documentclass[a4paper, 12pt]{article}
usepackage{amsmath, amssymb, amsthm}
theoremstyle{plain}
newtheorem{theorem}[subsection]{Theorem}
reversemarginpar

begin{document}

Some text that goes before.

begin{theorem}marginpar{0x5af3}
Let $E$ be a Banach space.  If ldots
end{theorem}

Some text that comes after.

end{document}

enter image description here

As you can see, the margin label appears higher up than the "Theorem" label. I would like the text in the label to be at the same vertical level as the bold "Theorem" in the main text.

  • I could fix this by putting the marginpar into the text of the theorem, instead of straight after the begin{theorem}. But that’s very messy.
  • I had a look at the TeX source code for the showkeys package, and I see a lot of code which I don’t understand, which deals with this issue (around boxes, and vertical lists etc.) But I just don’t understand this, nor how to re-create the effect.

I am looking for a LaTeX solution which is easy to understand. Or, failing that, a "standard" solution, if this is possible?

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP