# Frame spaces and caption

I have question about frames, how to add text under the frame and spaces like this? I have more frames and all are the same. I need this:

And I have:

Code fragment:

\begin{framed}
\begin{thm} Neka su f i g realne funkcije, takve da je kompozicija $f \circ g$ definirana. Neka je također g derivabilna u $x_0$, a f u točki $g(x_0)$. Tada vrijedi
\begin{myequation}
\mathbf{(vi)} \quad (f\circ g)'(x_0) =f'(g(x_0)) \cdot g'(x_0)
\end{myequation}
\end{thm}
\end{framed}
Dokaz ovog teorema može se vidjeti u \textit{Dodatku 4.1}

• Please show some code (MWE) to help us help you. – TeXnician Apr 6 '17 at 12:33
• Please make the code compilable (make it a MWE). – TeXnician Apr 6 '17 at 12:35
• I fixed question is know ok? – Ana Leko Apr 6 '17 at 12:46
• @AnaLeko a MWE consist of everything necessary to compile your snippet. Starting from \documentclass ending at \end{document} with all necessary packages (so only those needed, no more no less). – Skillmon Apr 6 '17 at 13:03
• Do you use ntheorem and its framed option, per chance? – Bernard Apr 6 '17 at 13:06

A simple solution with the framed option of ntheorem (which uses framed-the-package):

\documentclass[a4paper]{report}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\pagestyle{plain}
\usepackage{geometry}%
\usepackage[svgnames]{xcolor}
\usepackage{mathtools}
\usepackage{framed} %
\usepackage[framed, thref, amsmath, thmmarks]{ntheorem} %

%%%%%%%%%%%%%%%%
\theoremstyle{plain}
\theorembodyfont{\itshape}
\colorlet{framecolor}{NavyBlue!65}
\def\theoremframecommand{\setlength{\fboxrule}{1.6pt}\fcolorbox{framecolor}{white}}
\theoremframepostskip{0cm}
\theoreminframepreskip{5pt}
\theoreminframepostskip{4pt}
\theoremindent = 1cm\theoremrightindent = 1cm
%%%%%%%%%%%%%%%%

\begin{document}

\appendix%
\setcounter{chapter}{4}
\setcounter{thm}{3}
\setcounter{equation}{17}
\begin{thm} Neka su f i g realne funkcije, takve da je kompozicija $f ∘ g$ definirana. Neka je također g derivabilna u $x₀$, a f u točki $g(x₀)$. Tada vrijedi%
\let\belowdisplayskip\belowdisplayshortskip\let\abovedisplayskip\abovedisplayshortskip
$$\mathbf{(vi)} \quad (f ∘ g)'(x₀) =f'(g(x₀)) · g'(x₀)$$
\end{thm}
\hspace*{\dimexpr\fboxrule + \theoremindent + \fontdimen4\font-\parindent}
Dokaz ovog teorema može se vidjeti u \textit{Dodatku 4.1}

\end{document}


• Is it possible to change the vertical space between the frame and the content? Other than that, best answer so far. – Skillmon Apr 6 '17 at 17:41
• @Skillmon: Sorry for not checking the code (my editor does some pretty display for a better readability of formulae, and I often forget to copy the saved version). Fixed. Thanks for pointing it! Concerning the vertical spacing, there's a tool for that. I'll update the answer in a moment. – Bernard Apr 6 '17 at 17:46
• @Skillmon: I've added the parameters which allow to modify the inner vertical spacings. – Bernard Apr 6 '17 at 18:09
\documentclass{minimal}

\usepackage{framed}
\usepackage{amsmath}
\usepackage{amsthm}

\setlength{\parindent}{0cm}

\newtheorem{thm}{Thm:}

\begin{document}

\begin{framed}
\begin{thm} Neka su f i g realne funkcije, takve da je kompozicija $f \circ g$ definirana. Neka je također g derivabilna u $x_0$, a f u točki $g(x_0)$. Tada vrijedi
\begin{align*}
\mathbf{(vi)} \quad (f\circ g)'(x_0) =f'(g(x_0)) \cdot g'(x_0)
\end{align*}
\end{thm}
\end{framed}

\hspace{.1in} Dokaz ovog teorema može se vidjeti u \textit{Dodatku 4.1}

\end{document}


Output:

• That does not answer the question as the horizontal space within the framed part is not altered. – TeXnician Apr 6 '17 at 13:00

You can use this:

\documentclass[]{scrartcl}

\usepackage{framed}
\usepackage{amsmath}

\FrameSep=3em

\begin{document}
\begin{framed}
this is a nice test.
\begin{align}
E = mc^2
\label{eqn:emc}
\end{align}
\end{framed}
\hskip\dimexpr\FrameSep+\FrameRule\relax
Test
\end{document}


The drawback is, that the framed-package uses \FrameSep for vertical and horizontal spacing.