答案1
非常简单tcolorbox
:
\documentclass{book}
\usepackage[most]{tcolorbox}
\newtcolorbox[auto counter]{problem}[1][]{%
enhanced,
breakable,
colback=white,
colbacktitle=white,
coltitle=black,
fonttitle=\bfseries,
boxrule=.6pt,
titlerule=.2pt,
toptitle=3pt,
bottomtitle=3pt,
title=Problem~\thetcbcounter,
#1}
\begin{document}
Some test before the first problem
Some test before the first problem
Some test before the first problem
\begin{problem}
Test of the first problem
Test of the first problem
Test of the first problem
Test of the first problem
\end{problem}
Some text after the first problem and before the second problem
Some text after the first problem and before the second problem
\begin{problem}
Test of the second problem
Test of the second problem
Test of the second problem
\end{problem}
Some test after the second problem
\end{document}