如何在 Latex 文档中创建框架?

如何在 Latex 文档中创建框架?

我在创建类似图片的框架时遇到了问题。有人可以告诉我怎么做吗?非常感谢你们。在此处输入图片描述

答案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}

在此处输入图片描述

相关内容