Here's a method that doesn't require loading TikZ explicitly. (Although mdframed
uses tikz behind the scenes. This is, however, the package for framing boxes.
\documentclass{article}
\usepackage[framemethod=TikZ]{mdframed}
\usepackage{lipsum}
\begin{document}
\begin{mdframed}[roundcorner=10pt]
\lipsum[1]
\end{mdframed}
\end{document}
If you don't even want to use TikZ as a backend, you could use PSTricks:
\documentclass{article}
\usepackage[framemethod=PStricks]{mdframed}
\usepackage{lipsum}
\begin{document}
\begin{mdframed}[roundcorner=10pt]
\lipsum[1]
\end{mdframed}
\end{document}
[Note this doesn't seem to be working for me at the moment.]
To supplement the answer of Harish Kumar, the packages empheq
and tcolorbox
can by used in symbiosis. empheq
allows to specify any box to mark the given equations. For the box you may insert any tcolorbox
which behaves like fbox
. Typically, such boxes are based on the \tcbox
macro (like \tcbhighmath
in the answer of Harish Kumar).
I think, the following example demonstrates what you can do. The singleline equation is boxed with \tcbhighmath
directly, the multiline equations (align
) are boxed using empheq
in conjunction with \tcbhighmath
and some other \tcbox
-based examples.
\documentclass{article}
\usepackage[svgnames,hyperref]{xcolor}
\usepackage{empheq}
\usepackage[many]{tcolorbox}
\tcbset{highlight math style={enhanced,
colframe=red!60!black,colback=yellow!50!white,arc=4pt,boxrule=1pt,
drop fuzzy shadow}}
\newtcbox{\otherbox}[1][]{nobeforeafter,math upper,tcbox raise base,
enhanced,frame hidden,boxrule=0pt,interior style={top color=green!10!white,
bottom color=green!10!white,middle color=green!50!yellow},
fuzzy halo=1pt with green,#1}
\newtcbox{\picturebox}[1][]{nobeforeafter,math upper,tcbox raise base,
enhanced,watermark graphics=example-grid-100x100bp.jpg,% from package mwe
colback=white,frame hidden,boxrule=0pt,arc=10pt,
watermark stretch=1.00,watermark opacity=0.4,#1}
\begin{document}
\begin{equation}
\tcbhighmath{E = mc^2}
\end{equation}
\begin{empheq}[box=\tcbhighmath]{align}
a&=b\\
E&=mc^2 + \int_a^a x\, dx
\end{empheq}
\begin{empheq}[box={\tcbhighmath[colback=blue!20!white]}]{align}
a&=b\\
E&=mc^2 + \int_a^a x\, dx
\end{empheq}
\begin{empheq}[box={\tcbhighmath[watermark text=?!,watermark color=yellow!90!red]}]{align}
a&=b\\
E&=mc^2 + \int_a^a x\, dx
\end{empheq}
\begin{empheq}[box=\otherbox]{align}
a&=b\\
E&=mc^2 + \int_a^a x\, dx
\end{empheq}
\begin{empheq}[box=\picturebox]{align}
a&=b\\
E&=mc^2 + \int_a^a x\, dx
\end{empheq}
\end{document}
Best Answer
Run with
xelatex
and the same with clipping theimage: