\chapter, \section 등의 기본 형식을 얻는 방법은 무엇입니까?

\chapter, \section 등의 기본 형식을 얻는 방법은 무엇입니까?

titlesec섹션 및 장 제목을 일부 수정하는 데 사용하고 싶지만 titleformat단순히 수정하는 대신 형식을 완전히 재정의합니다(예: 색상만 변경하려는 경우).

titlesec완전히 재정의하는 대신 수정하려면 어떻게 해야 합니까 ? 이것이 가능한가?

그렇지 않다면, 무엇이 무엇인지 어떻게 알 수 있습니까?현재의\chapter, 등 의 서식을 지정 \section하여 복제하고 수정할 수 있습니까?


샘플 문서 요청에 대한 응답으로 가장 기본적인 것은 다음과 같습니다.

\documentclass{article}
\begin{document}
\section{Hello World}
Hello world!
\end{document}

\section그러나 나는 특정 구성에 대해 단순히 "알고" 있는 대신 현재 형식을 알아내는(예: 인쇄하는) 방법에 관심이 있습니다 .

답변1

제목 색상과 같은 간단한 수정의 경우 라이트 버전을 사용할 수 있지만 매개변수 값(글꼴 크기, 두께, 모양)이 무엇인지 \titleformat확인 article.cls(또는 report, 또는 )해야 합니다.book

예는 다음과 같습니다.

\documentclass[a4paper]{article}
\usepackage[svgnames]{xcolor}
\usepackage{titlesec}
\titleformat*{\section}{\color{IndianRed}\normalfont\bfseries\Large}

\begin{document}

\section{A short title}
This is a paragraph. This is a paragraph. This is a paragraph. This is a paragraph. This is a paragraph. This is a paragraph. This is a paragraph. This is a paragraph.

\end{document} 

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

답변2

표준 클래스는 다음과 같이 정의됩니다.titlesec 참조, 섹션 8.2)

\titleformat{\chapter}[display]
{\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\Huge}
\titleformat{\section}
{\normalfont\Large\bfseries}{\thesection}{1em}{}
\titleformat{\subsection}
{\normalfont\large\bfseries}{\thesubsection}{1em}{}
\titleformat{\subsubsection}
{\normalfont\normalsize\bfseries}{\thesubsubsection}{1em}{}
\titleformat{\paragraph}[runin]
{\normalfont\normalsize\bfseries}{\theparagraph}{1em}{}
\titleformat{\subparagraph}[runin]
{\normalfont\normalsize\bfseries}{\thesubparagraph}{1em}{}
\titlespacing*{\chapter}     {0pt}{50pt}{40pt}
\titlespacing*{\section}     {0pt}{3.5ex plus 1ex minus .2ex}{2.3ex plus .2ex}
\titlespacing*{\subsection}   {0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}
\titlespacing*{\subsubsection}{0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}
\titlespacing*{\paragraph}   {0pt}{3.25ex plus 1ex minus .2ex}{1em}
\titlespacing*{\subparagraph} {\parindent}{3.25ex plus 1ex minus .2ex}{1em}

답변3

시도해 보세요

\documentclass{scrartcl}
\usepackage{xcolor}
\addtokomafont{section}{\color{red}}
\begin{document}
\section{Hello World}
Hello world!
\end{document}

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

관련 정보