![章番号を削除し、セクション番号は保持する](https://rvso.com/image/330741/%E7%AB%A0%E7%95%AA%E5%8F%B7%E3%82%92%E5%89%8A%E9%99%A4%E3%81%97%E3%80%81%E3%82%BB%E3%82%AF%E3%82%B7%E3%83%A7%E3%83%B3%E7%95%AA%E5%8F%B7%E3%81%AF%E4%BF%9D%E6%8C%81%E3%81%99%E3%82%8B.png)
Chapter #
各章の前の章番号 ( ) を削除し、同時にセクション番号を保持する方法がわかりません。そのため、次のようなものが必要です。
章名
1.1 第1節
1.2 第2セクション
また、写真の番号付けが少し変です。現在、写真 2.1 があります (写真はセクション 2 にあるため)。写真 1、写真 2 などの通常の番号付けにしたいだけです。
助けてくれてありがとう!
答え1
最も簡単な方法は\thechapter
何も設定しないことです。つまり、 ですが、これでは末尾に{}
が残り、章の見出しは引き続き表示されます(または)。\thesection
.
Chapter
\chaptername
連続した図番号を取得するには、図カウンターを章リセット リストから除外する必要があります\counterwithout{figure}{chapter}
。つまり、. thenを使用します。
質問が少し不明瞭なので、\@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}