
두 부분으로 구성된 프레임을 만들려고 합니다. 아래 사진처럼 둘 다 연결되어 있습니다. 나는 그것을 사용하여 내가 원하는 것을 쓰고 싶고 카운터가 필요하지 않습니다. 카운터는 제가 직접 하고 싶어요. 정리 상자를 사용하려고 시도했지만 원하는 것이 아닙니다.
나는 이 정리 카운터를 그 안에 별도로 사용할 수 있기를 원합니다.정리에 대한 고급 계층적 계산
그래서 카운터 없이 상자를 만들고 싶습니다.
감사합니다
답변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 문서에서 "카운터"를 검색하면 됩니다). .