6

I would like to define my own theorem and to capture it around a double (or oval) box as it specified in fancybox package. Here is a MWE

\documentclass{article}

\useackage{amsmath,fancybox}

\newtheorem{test}{Test}

\begin{document}

\doublebox{%
\begin{test}
bla bla bla
\end{test}}

\end{document}
1
  • 2
    I think you should have a look at tcolorbox
    – egreg
    Commented Dec 16, 2016 at 21:19

3 Answers 3

4

You can use tcolorbox, which allows for much power over customizations than fancybox.

\documentclass{article}

\usepackage{amsmath,amsthm}
\usepackage[many]{tcolorbox}
\usepackage{lipsum}

\newtheorem{test}{Test}
\tcolorboxenvironment{test}{
  enhanced,
  borderline={0.8pt}{0pt}{black},
  borderline={0.4pt}{2pt}{black},
  boxrule=0.4pt,
  colback=white,
  coltitle=black,
  sharp corners,
}

\begin{document}

\lipsum[2]

\begin{test}
bla bla bla
\end{test}

\lipsum[2]

\end{document}

enter image description here

5

A simple solution with theframed option from ntheorem and the eponymous package:

\documentclass{article}
\usepackage[showframe]{geometry}
\usepackage{amsmath,fancybox}

\usepackage{framed}

 \usepackage[thmmarks, thref, amsmath, framed]{ntheorem}

  \def\theoremframecommand{\doublebox}
  \theoremheaderfont{\bfseries}
  \theorembodyfont{\normalfont}
  \theoremseparator{.}
  \newshadedtheorem{thmtest}{Test}

\begin{document}

\begin{thmtest}
Bla bla bla
\end{thmtest}

\end{document} 

enter image description here

1
  • @gigabytes: I hate repeating myself… ;o)
    – Bernard
    Commented Dec 17, 2016 at 16:21
3
\documentclass{article}

\usepackage{amsmath,fancybox}
\usepackage{calc}
\newtheorem{test}{Test}

\newenvironment{boxedtest}
{\noindent\begin{Sbox}\begin{minipage}{\linewidth-7.5\fboxrule-2\fboxsep-1pt}\begin{test}}
{\end{test}\end{minipage}\end{Sbox}\doublebox{\TheSbox}}

\begin{document}

\begin{boxedtest}
  bla bla bla
\end{boxedtest}

\end{document}

enter image description here

You must log in to answer this question.

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