第一个 tcolorbox 是有解决方案的示例。最后三个 tcolorbox 包含没有解决方案的问题,带有虚线。所有 tcolorbox 的高度相同且可破坏。请帮我将代码更正为自动!提前谢谢!
\documentclass[a4paper]{article}
\usepackage{tikz}
\usepackage{tikzscale}
\usepackage{tcolorbox}
\usepackage[utf8]{vietnam}
\tcbuselibrary{raster}
\usepackage{lipsum}
\begin{document}
\begin{tcbraster}[%
raster columns=2,
raster rows=2,
raster height=\textheight,
]
\begin{tcolorbox}[title={\fontfamily{qag}\textbf{Example 1.}}]
\lipsum[10]
\end{tcolorbox}
\begin{tcolorbox}{\fontfamily{qag}\textbf{Example 2.}} \par
\edef\sodongt{\the\numexpr\dimexpr (\tcbtextheight)/(\dimexpr \baselineskip\relax) \relax\relax}
\pgfmathsetmacro{\sodong}{int(\sodongt-1)}
\foreach \i in {1,...,\sodong}{
\dotfill\endgraf
}
\end{tcolorbox}
\begin{tcolorbox}
\edef\sodongt{\the\numexpr\dimexpr (\tcbtextheight)/(\dimexpr \baselineskip\relax) \relax\relax}
\pgfmathsetmacro{\sodong}{int(\sodongt-1)}
{\fontfamily{qag}\textbf{Example 3.}} \par Some text\\
Some text \sodong
\foreach \i in {1,...,\sodong}{
\dotfill\endgraf
}
\end{tcolorbox}
\begin{tcolorbox}
\edef\sodongt{\the\numexpr\dimexpr (\tcbtextheight)/(\dimexpr \baselineskip\relax) \relax\relax}
\pgfmathsetmacro{\sodong}{int(\sodongt-1)}
{\fontfamily{qag}\textbf{Example 4.}} \par Some text\\
Some text 2\\
Some text 3\\
\foreach \i in {1,...,\sodong}{
\dotfill\endgraf
}
\end{tcolorbox}
\end{tcbraster}
\end{document}