如何修正乳膠中的標題?

如何修正乳膠中的標題?

我正在使用 LaTeX 按項目進行準備。我在用\documentclass{report}

因為我需要第一章“簡介”,但沒有我使用過的章節號

\newcommand{\mychapter}[2]{
        \setcounter{chapter}{#1}
        \setcounter{section}{0}
        \chapter*{#2}
        \addcontentsline{toc}{chapter}{#2}
    } 

在序言中。

\begin{document}因為在我添加了以下評論之後,我需要在介紹之前提供圖表列表

\listoffigures

\mychapter{0}{Introduction}
In Chapter 1, we give the basic ideas and facts.....

在輸出中,章節介紹的​​標題是圖形清單。 (見圖)。願任何人都能幫助解決這個問題。

'在此輸入影像描述

答案1

您可以使用更好的定義\mychapter

\documentclass{report}

\usepackage{kantlipsum} % for mock text

\pagestyle{headings} % to get headers

\newcounter{savedsecnumdepth}

\newcommand{\mychapter}[1]{%
  \setcounter{savedsecnumdepth}{\value{secnumdepth}}%
  \setcounter{secnumdepth}{-1000}%
  \chapter{#1}%
  \setcounter{secnumdepth}{\value{savedsecnumdepth}}%
  \refstepcounter{chapter}%
}

\setcounter{chapter}{-1}% first should be Chapter 0
\begin{document}

\tableofcontents

\mychapter{Introduction}

\section{Ghijk}

\kant[1-30]

\end{document}

在此輸入影像描述

相關內容