使框架适合(右对齐)文本

使框架适合(右对齐)文本

我希望框架能容纳里面的文字吗?

\documentclass[a4paper]{memoir}
\usepackage{mdframed}
\begin{document}
\begin{flushright}
\begin{framed}
$\textsc{casregner}$
$(f(x)=g(x),x)|x>0$
$x=32.5552$
\end{framed}
\end{flushright}
\end{document}

答案1

\documentclass[a4paper]{memoir}

\begin{document}
\begin{flushright}
\fboxsep=10pt% local change inside flushright
\fbox{\strut%
$\textsc{casregner}$
$(f(x)=g(x),x)|x>0$
$x=32.5552$}
\end{flushright}
\end{document}

相关内容