I know that the package tcolorbox provides the option \tcbox. But apparently it isn't able to handle linebreaks, quotations ( e.g csquotes display equation) or mathmode content. I think that \begin{tcolorbox} is amazing and it does exactly what I want, except for adjusting its width to the content.
All I want is a command that creates an adjusted frame around an arbitrary piece of text and allows me to use linebreaks and environments like equations,quotations etc.. I don't care about pagebreaks.
Can I still achieve that with the tcolorbox package or are there other options?
I'm a beginner with LaTeX, thanks in advance
EDIT: to be more precise, using the \boxed command gives me the general output I want to achieve:
\begin{equation*}
\boxed{
\begin{aligned}
&p = \text{Intervallverhältnis von 1 Cent} \\
&2 = \text{Intervallverhältnis der reinen Oktave} \\ \\
&p^{1200} = 2 \longrightarrow p = \sqrt[1200]{2}
\end{aligned}
}
\end{equation*}
This is exactly what I want to achieve using tcolorbox and its frames. A frame around a (centered) piece of math, with automatically adjusted width.
I already tried using the \tcbox command:
\tcbox{
\begin{equation*}
\begin{aligned}
&p = \text{Intervallverhältnis von 1 Cent} \\
&2 = \text{Intervallverhältnis der reinen Oktave} \\ \\
&p^{1200} = 2 \longrightarrow p = \sqrt[1200]{2}
\end{aligned}
\end{equation*}
}
This results in package amsmath error messages and while the frame is adjusted to its content like I want it, the whole box isn't centered anymore but aligned to the left.



tcolorboxpackage? Please also clarify "except for adjusting its width to the content". How should the output look like? Probably a sketch could help clarify. – leandriis Mar 25 '20 at 15:14varwidth, but the width adjustment is then defined by forced line breaks, or the maximum line length—like a whole paragraph on a single line). So, you need to precisely describe what you want to do. – frougon Mar 25 '20 at 15:35