Text Formatting ⇒ Left border for Definitions, Examples, Proofs, etc
Left border for Definitions, Examples, Proofs, etc
I am using \newtheorem{mdef}[equation]{Definition} for definitions, examples and proofs. To emphasise these text blocks in a large text document, I am trying to implement a thick border on the left side of this text block. Is there any possibility to simply draw a gray thick line vertically next to a \begin{mdef}...\end{mdef} block?
I have tried to use pdfcomments, I do not understand a word how to use it. I tried changebars, but it is getting to float-errors all the time. Are you having any simple example for a left border without reading wide documentations without any useful code?
Thank you in advance!
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
Left border for Definitions, Examples, Proofs, etc
you can use the leftbar environment provided by the framed package to design a new environment combining the leftbar and mdef environments:
Code: Select all
\documentclass{book}
\usepackage{amsthm}
\usepackage{framed}
\newtheorem{mdef}[equation]{Definition}
\newenvironment{mydef}
{\begin{leftbar}\begin{mdef}}
{\end{mdef}\end{leftbar}}
\begin{document}
\begin{mydef}
dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text
\end{mydef}
\end{document}- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Left border for Definitions, Examples, Proofs, etc
[1] View topic: ruled margins
Best regards
Thorsten
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10