섹션 머리글 형식 변경

섹션 머리글 형식 변경

내 문서에 다음과 같은 섹션 제목을 추가하고 싶습니다.

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

LaTeX에서 어떻게 이를 달성할 수 있나요?

답변1

최종 솔루션의 경우 원하는 대로 진한 빨간색을 정의하고 제안서에서 '빨간색'으로 바꿉니다. 아래 예에서는 주어진 디자인이 섹션 형식에도 적용됩니다.

코드

\documentclass[11pt]{article}
\usepackage{lipsum}
\usepackage{xcolor}
\usepackage{titlesec}
  \titleformat{\section}
  {\normalfont\Large\itshape\color{red}}{%
    \hspace*{-4.5em}\rule[-1.35mm]{4.5em}{1.25em}
    {\color{white}\hspace{-1cm}\normalfont\thesection\hspace{5pt}}
  }{1em}{}
  \titleformat{\subsection}
  {\normalfont\large\itshape\color{red}}{%
    \hspace*{-4.5em}\rule[-1.35mm]{4.5em}{1.25em}
    {\color{white}\hspace{-1cm}\normalfont\thesubsection\hspace{5pt}}
  }{1em}{}

\begin{document}
\section{Introduction}
\lipsum[1]
\subsection{Laplace Transformation}
\lipsum[2-4]
\end{document}

산출

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

관련 정보