如何更改這裡的標題?

如何更改這裡的標題?

我為附錄定義了一些:

\newcommand{\beginsupplement}{%
    \setcounter{table}{0}
    \renewcommand{\thetable}{S\arabic{table}}%
    \setcounter{figure}{0}
    \renewcommand{\thefigure}{S\arabic{figure}}%
    \addcontentsline{toc}{chapter}{Appendix}
    \renewcommand{\thesection}{\Alph{section}}
}

如果我現在使用以下命令開始附錄部分,\beginsupplement我會從上面的部分獲取標題。在我的範例中,我得到標題“表格清單”。我在這個腳本中模擬了這個問題:

\documentclass{scrbook}

\newcommand{\beginsupplement}{%
    \setcounter{table}{0}
    \renewcommand{\thetable}{S\arabic{table}}%
    \setcounter{figure}{0}
    \renewcommand{\thefigure}{S\arabic{figure}}%
    \addcontentsline{toc}{chapter}{Appendix}
    \renewcommand{\thesection}{\Alph{section}}
}

\begin{document}
    \chapter{Tabelle}
    \begin{table}
        \caption[Settings native MS]{Used parameters for native MS}
        \begin{tabular}{ll}\hline
            \textbf{Parameter} & \textbf{Value}\\\hline
            1 & 2\\\hline
        \end{tabular}
        \label{tab:nms}
    \end{table}
\newpage
    \listoftables
    \clearpage
    \beginsupplement
    text
\end{document}

謝謝你的幫忙!

答案1

根據所需的結果,您必須添加\markboth{\appendixname}{}\markboth{}{}

例子:

\documentclass[
  captions=tableheading,% <- suggested option
  %numbers=noenddot% <- maybe you want this option
]
{scrbook}
\usepackage{lipsum}% only for dummy text

\usepackage{xpatch}
\makeatletter
\xapptocmd\appendix{%
  \cleardoubleoddpage
%
  \ifdim \@chapterlistsgap>\z@
    \doforeachtocfile{%
      \iftocfeature{\@currext}{chapteratlist}{%
        \addtocontents{\@currext}{\protect\addvspace{\@chapterlistsgap}}%
      }{}%
    }%
  \fi
  \addchaptertocentry{}{\appendixname}%
%
  \markboth{\appendixname}{}% <- added
%
  \renewcommand{\thesection}{\Alph{section}}%
  \setcounter{table}{0}%
  \renewcommand{\thetable}{S\arabic{table}}%
  \setcounter{figure}{0}%
  \renewcommand{\thefigure}{S\arabic{figure}}%
}{}{\PatchFailed}
\makeatother

\begin{document}
\chapter{First chapter}
\section{Tables}
\captionof{table}{First table in this chapter}
\begin{table}
  \caption[Settings native MS]{Used parameters for native MS}\label{tab:nms}
  \begin{tabular}{ll}\hline
      \textbf{Parameter} & \textbf{Value}\\\hline
      1 & 2\\\hline
  \end{tabular}
\end{table}
\lipsum[1-20]

\chapter{Next chapter}
\captionof{table}{Next table}

\listoftables

\appendix
\section{Section in appendix}
\captionof{table}{Appendix figure}
\captionof{table}{Another appendix figure}
\lipsum[21-40]
\end{document}

結果:

在此輸入影像描述

相關內容