我目前使用这段代码来创建我的盒子:
\documentclass[12pt,a4paper,french]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{tcolorbox}
\newtcolorbox{mybox}[1][]{before=\centering, hbox, drop fuzzy shadow, enhanced}
\tcbuselibrary{skins}
\begin{document}
\begin{large}
\begin{flushleft}
gfdsgsdgsd gdssssssssssssssssssssssssssffffgdsffffffffffffffffffffffffffff\\
\vspace{5mm}
\begin{mybox}
$\begin{aligned}
a\leq b \Leftrightarrow ac \leq bc
\end{aligned}$
\end{mybox}
gfdsgsdgsd gdssssssssssssssssssssssssssffffgdsffffffffffffffffffffffffffff\\
\vspace{5mm}
\begin{mybox}
$\begin{aligned}
1+1=2
\end{aligned}$
\end{mybox}
gfdsgsdgsd gdssssssssssssssssssssssssssffffgdsffffffffffffffffffffffffffff\\
\vspace{5mm}
\begin{mybox}
$\begin{aligned}
gdssssssssssssssssssssssss
\end{aligned}$
\end{mybox}
\end{flushleft}
\end{large}
\end{document}
我希望所有盒子的宽度都和我最大的盒子一样。
我该怎么做?谢谢
答案1
您可以使用软件包轻松完成此操作eqparbox
(需要两次编译):
\documentclass[12pt,a4paper,french]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{eqparbox}
\usepackage{tcolorbox}
\newtcolorbox{mybox}[1][]{before=\centering, hbox, drop fuzzy shadow, enhanced}
\tcbuselibrary{skins}
\begin{document}
\begin{large}
\begin{flushleft}
gfdsgsdgsd gdssssssssssssssssssssssssssffffgdsffffffffffffffffffffffffffff\\
\vspace{5mm}
\begin{mybox}
\eqmakebox[M]{$\begin{aligned}
a\leq b \Leftrightarrow ac \leq bc
\end{aligned}$}
\end{mybox}
gfdsgsdgsd gdssssssssssssssssssssssssssffffgdsffffffffffffffffffffffffffff\\
\vspace{5mm}
\begin{mybox}
\eqmakebox[M]{$\begin{aligned}
1+1=3
\end{aligned}$}
\end{mybox}
gfdsgsdgsd gdssssssssssssssssssssssssssffffgdsffffffffffffffffffffffffffff\\
\vspace{5mm}
\begin{mybox}
\eqmakebox[M]{$\begin{aligned}
gdssssssssssssssssssssssss
\end{aligned}$}
\end{mybox}
\end{flushleft}
\end{large}
\end{document}