이런 스타일을 어떻게 하면 좋을까요?

이런 스타일을 어떻게 하면 좋을까요?

다음 스크린샷과 같이 내 강좌에 라텍스 스타일을 적용하도록 도와줄 수 있는 사람이 있나요? 여기에 이미지 설명을 입력하세요

감사합니다.

답변1

아시다시피, tcolorbox모든 종류의 색상 상자를 생성할 수 있으며 theorems정리, 정의 등에 대한 색상 환경 생성을 지원하는 라이브러리도 포함되어 있습니다.

이러한 종류의 상자에 대한 주요 명령은 다음과 같습니다.

\newtcbtheorem[init options]{env-name}{displayed name}{format options}{reference prefix}

이는 섹션 16.1에서 설명됩니다.tcolorbox 문서. 이 명령은 env-name정리 제목과 reference prefix이 특정 상자와 연관된 레이블을 생성하기 위해 앞에 오는 레이블이라는 두 개의 필수 매개변수가 있는 환경을 생성합니다 .

\newtcbtheorem다음 코드는 원하는 스타일로 정리, 정의 및 결과를 정의하기 위해 세 가지 명령을 사용하는 방법을 보여줍니다 . 모든 상자는 페이지 경계에서 분리되지만 첫 번째 조각에만 레이블이 지정됩니다. 상자 내용물 높이가 회전된 제목 높이보다 짧은 경우 첫 번째 예에서 볼 수 있듯이 원하지 않는 효과가 나타납니다.

(참고: 다음 코드에 tcolorbox옵션과 관련된 오류가 표시되면 패키지를 업데이트하세요 tcolorbox.`)

\documentclass{report}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage[most]{tcolorbox}
\usepackage{lipsum}

\tcbset{%
    theo/.style={%
        enhanced,
        breakable,
        sharp corners,
        toprule=0pt, rightrule=0pt, bottomrule=0pt, leftrule=1mm,
        colback=#1!5, colframe=#1!80!black, coltitle=#1!80!black, 
        detach title,
        overlay unbroken and first ={
            \node[rotate=90, minimum width=1cm, anchor=south, font=\bfseries] 
               at (frame.west) {\tcbtitle};
        }
    }
}

\newtcbtheorem[auto counter]{mytheo}{Théorème}
{theo=green}{th}

\newtcbtheorem[auto counter]{mydef}{Définition}
{theo=blue}{df}

\newtcbtheorem[auto counter]{mycoro}{Corollaire}
{theo=green}{cl}

\begin{document}

\begin{mytheo}{}{}
\lipsum[1]
\end{mytheo}

\begin{mydef}{}{}
\lipsum[2]
\end{mydef}

\begin{mycoro}{}{}
\lipsum[3]
\end{mycoro}

\end{document}

여기에 이미지 설명을 입력하세요

관련 정보