장 번호를 제거하고 섹션 번호를 유지합니다.

장 번호를 제거하고 섹션 번호를 유지합니다.

Chapter #각 챕터( ) 앞에 있는 챕터 번호를 없애고 동시에 섹션 번호를 유지하는 방법을 모르겠습니다 . 그래서 다음과 같은 것이 필요합니다.

챕터 이름

1.1 첫 번째 섹션

1.2 두 번째 섹션

그리고 사진에 번호 매기기가 좀 이상하네요. 지금은 사진 2.1이 있습니다(사진은 섹션 2에 있으므로). 사진 1, 사진 2 등과 같은 일반적인 번호 매기기를 원합니다.

도와주셔서 감사합니다!

답변1

가장 쉬운 방법은 \thechapter아무 것도 설정하지 않는 것입니다(예: ) . 하지만 이렇게 하면 후행이 {}남고 장 제목이 계속 표시됩니다 (또는 ).\thesection.Chapter\chaptername

연속적인 그림 번호를 얻으려면 그림 카운터를 챕터 재설정 목록에서 제거해야 합니다. 즉, 를 사용하십시오 \counterwithout{figure}{chapter}. 그 다음에.

질문이 좀 불분명해서 \@makechapterhead지금은 바꾸지 않습니다.

\documentclass{book}


\usepackage{chngcntr}%


\renewcommand{\thechapter}{}%
\renewcommand{\thesection}{\arabic{chapter}.\arabic{section}}%
\counterwithout{figure}{chapter}

\begin{document}
\tableofcontents
\listoffigures
\chapter{First chapter}

\section{First section}



\begin{figure}
\caption{Dummy figure}
\end{figure}

\chapter{Second chapter}

\section{First section in 2nd chapter}

\begin{figure}
\caption{Another dummy figure}
\end{figure}


\end{document}

답변2

다음은 이를 수행하는 방법입니다 titlesec(비록 최신 버전에 문제가 있는 것 같지만 이전 버전의 titlesec에서는 정확히 이런 방식으로 수행하지 않았을 것입니다).

\documentclass{book}
\usepackage[utf8]{inputenc} \usepackage{titlesec}

\titleformat{\chapter}[block]{\bfseries\Huge}{}{0em}{}
\titleformat{\section}[hang]{\bfseries\Large}{}{1em}{\thesection\enspace}

\begin{document}
\tableofcontents
\listoffigures
\chapter{First chapter}

\section{First section}

\begin{figure}
\caption{Dummy figure}
\end{figure}

\end{document}

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

관련 정보