如何創建由兩部分組成的框架

如何創建由兩部分組成的框架

我正在嘗試創建一個由兩部分組成的框架。兩者連接如下圖所示。我想用它來寫我想要的任何東西,我不需要任何計數器。我想自己做櫃檯。我嘗試過使用定理框,但這不是我想要的。

在此輸入影像描述

我希望能夠在其中單獨使用這個定理計數器。定理的高階分層計數

所以,只想做沒有櫃檯的盒子。

謝謝

答案1

包 tcolorbox (https://ctan.org/pkg/tcolorbox)可能會做您想做的所有事情。這是一個例子:

\documentclass[english,11pt,a5paper]{article}
\usepackage{tcolorbox}
\tcbuselibrary{skins,breakable}

\newtcolorbox{MyQuestion}[2][]{%
    enhanced, breakable, 
    title style={green!30}, % background color of the top field
    colback=red!5,        % background color of the bottom field
    colframe=blue!65,       % color of the frame
    width=\textwidth,       % width of the box
    %
    sharp corners,          % or use `arc=6pt` instead of `sharp corners`  
    %
    boxsep=5pt,             % space around the title text
    left=6pt,right=6pt,     % spacing of text inside the box
    top=5pt,bottom=5pt,  
    %
    bottomrule=3pt, toprule=5pt,  % thicknesses of various lines
    leftrule=1pt, rightrule=1pt,
    titlerule=1pt, 
    %
    title={\color{red}#2}, 
    #1                      % everything that is inside [] of \begin{MyQuestion}[]
}

\begin{document}
    \begin{MyQuestion}{%
        Question 1. So, I was taking a walk the other day. 
        And I see a woman pacing up and down ...
    }
        Solution:  ... \\
    \end{MyQuestion}
\end{document}

看起來像這樣:

在此輸入影像描述

我特意選擇了幾種不同的顏色,以便更容易更換。

即使您說您將“手動”處理計數器,但了解tcolorboxes 還支援環境的自訂計數器可能會有所幫助(只需在tcolorbox 文件中搜尋“計數器”,您可以在上面給定的連結中找到該文檔) 。

相關內容