![我的所有盒子都具有相同的尺寸](https://linux22.com/image/409217/%E6%88%91%E7%9A%84%E6%89%80%E6%9C%89%E7%9B%92%E5%AD%90%E9%83%BD%E5%85%B7%E6%9C%89%E7%9B%B8%E5%90%8C%E7%9A%84%E5%B0%BA%E5%AF%B8.png)
我目前使用这段代码来创建我的盒子:
\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}