在目录中使用个性化条目来代替 Scrbook 中的章节编号

在目录中使用个性化条目来代替 Scrbook 中的章节编号

我正在撰写一篇基于出版物的论文。我想在目录中使用稿件编号,而不是章节编号。

例如,参见此图,我想删除 2.1,并将稿件编号作为“部分”。也就是说,不是 2.1 Mnuscript 1:标题...

我只想要手稿 1:标题……

在此处输入图片描述

我尝试使用'\section*{}'命令,但是这会从目录中删除该条目。

我使用“\usepackage{titletoc}”来设置目录,并使用“scrbook”文档类。

同样,我希望在部分本身中也有类似的内容: 在此处输入图片描述

我不想使用 2.1 手稿 1:标题...我希望只使用“手稿 + 贡献编号”这个词

对此问题有任何指导吗?当然,我希望除了贡献章节之外,其他章节应该是“正常的”

亲切的问候,这是我的 MWE:

\documentclass[twoside,12pt,openright]{scrbook}
\usepackage[a4paper,hmargin=2.5cm,vmargin=3cm,
            footskip=185pt,includefoot=false,twoside]{geometry}
\usepackage[dvipsnames]{xcolor}
\usepackage[pdftex]{graphicx}
\usepackage{titletoc}
\usepackage{lipsum}
\usepackage{scrlayer-scrpage}
\usepackage{xhfill}
\usepackage[sfdefault]{universalis}
\usepackage{tikz}
\usetikzlibrary{decorations, decorations.pathmorphing, decorations.pathreplacing}
\usepackage{hyperref}
\hypersetup{%
plainpages=false, colorlinks=true, citecolor=blue!80, linkcolor=black, filecolor=red, urlcolor=violet, pdfpagemode=FullScreen, pdfborder={0 0 0}, breaklinks=true,  bookmarksnumbered=true, bookmarksopen=true}
\definecolor{maincolor}{cmyk}{1, .50, .10, .01}
%% Define some format spacing--------------------------------------------------------
\setparsizes{1em}{1em plus .1\baselineskip}{0pt plus 1fil}
\renewcommand{\baselinestretch}{1.25}\selectfont
%% Title format for Chapters -------------------------------------------------------
\newcommand{\ssfont}{\fontfamily{bch}\selectfont}
\newcommand{\thesischapterfont}{\color{maincolor}\normalfont\huge\ssfont}
\newcommand{\thesissectionfont}{\color{maincolor}\normalfont\Large\ssfont}
\newcommand{\thesissubsectionfont}{\color{maincolor}\normalfont\large\ssfont}
\newcommand{\fontfootertext}{\color{blue}\normalfont\footnotesize}
\newcommand{\fontfooterpagenumber}{\color{red}\normalfont\normalsize\bfseries}
% headings
\setkomafont{chapter}{\thesischapterfont}
\setkomafont{section}{\thesissectionfont}
\setkomafont{subsection}{\thesissubsectionfont}

%%  Header and Footer ----------------------------------------------------------------------
\automark[section]{chapter} 
\setlength{\headheight}{19pt} 
\setlength{\footheight}{160pt} 
\setlength{\footskip}{185pt}
\KOMAoption{footwidth}{foot:53pt}
\setkomafont{pagefoot}{\fontfootertext}
\setkomafont{pagenumber}{\fontfooterpagenumber}

%% command to print the TOC ---------------------------------------------
\titlecontents{chapter}[2.4pc]{\addvspace{1pc}}
{ \begin{tikzpicture}[remember picture, overlay,box/.style = {text width=3cm, font=\color{white}\large\scshape\bfseries}]
    \node (rect) at (-2.5,1ex) [box, draw,thick,minimum width=4cm,minimum height=1cm, fill=maincolor!90,draw=maincolor!90,rounded corners=5pt,align=right ] {Chapter\ \thecontentslabel};
\end{tikzpicture}   
\hspace*{-1ex}\color{maincolor!90}\large\scshape\bfseries}
{\hspace*{-1ex}\color{maincolor!90}\large\scshape\bfseries}
{\color{maincolor!90}\large\scshape\bfseries\;\dotfill\thecontentspage}
[\addvspace{0pc}]

% %*****************************************************
\titlecontents{section}[2.0pc]{\addvspace{0pc}}
{\hspace{1.6cm}\contentslabel[\thecontentslabel]{2.4pc}}{}
{\;\dotfill\;\normalsize \thecontentspage} [\addvspace{-0.5pc}]
% %*****************************************************
\titlecontents{subsection}[4.6pc]{\addvspace{0pc}}
{\hspace{1.6cm}\contentslabel[\thecontentslabel]{2.4pc}}{}
{\;\dotfill\;\normalsize\thecontentspage} [\addvspace{-0.5pc}]
%*****************************************************
\makeatletter
\renewcommand{\tableofcontents}{ \chapter*{ \vspace*{-1cm} 
    \begin{tikzpicture}[remember picture, overlay]
        \clip (current page.north west) rectangle ([yshift=-8cm]current page.north east);
        \node[anchor=north west,inner sep=0pt] at (current page.north west) {\includegraphics[width=\paperwidth]{example-image-a}};
        \draw[anchor=west] (current page.north west) node [
                anchor=north west,  xshift=3cm, yshift=-3.5cm,
                line width=2pt, rounded corners=10pt,   draw=maincolor,
                fill=black!5,   fill opacity=0.1, text opacity=1,
                inner ysep=12.5pt,  inner xsep=20pt, align=flush left,
                text width=1.2\linewidth,        font=\Huge\sffamily\scshape\bfseries\color{maincolor}
                ] { \contentsname }; 
    \end{tikzpicture}}
\@starttoc{toc}}
\makeatother

\setcounter{tocdepth}{2}
% Begin document ---------------------------------------------
\begin{document}
    \frontmatter 
    \pagenumbering{roman}
    \pagestyle{empty}   
    \tableofcontents        
    \mainmatter
    \pagenumbering{arabic}
    \setcounter{page}{1}
    \pagestyle{headings}
% Chapter 1 -----------------------------------
    \chapter{Introduction}
    \lipsum[1-3]
    \section{Section 1}
    \lipsum[1-5]
        \subsection{Subsection 1}
        \lipsum[1-3]
        \subsection{Subsection 2}
        \lipsum[1-3]
    \section{Section 2}
    \lipsum[1-3]
% Chapter 2 -----------------------------------
% \chapter{Optimal Control for Wave Energy Converters: Contributions}
\chapter{Optimal Control for Wave Energy Converters: Contributions}
\clearpage
    \section{Manuscript 1: Model Predictive Control for Wave Energy Converters: A Moving Window Blocking Approach}
    \sectionmark{Manuscript 1}
        \lipsum[1-8]
\clearpage
    \section{Manuscript 2: Efficiency-aware nonlinear model-predictive control with real-time iteration scheme for wave energy converters}
    \sectionmark{Manuscript 2}
        \lipsum[1-8]
\clearpage
    \section{Manuscript 3: Nonlinear Model Predictive Control based on Real-Time Iteration Scheme for Wave Energy Converters using WEC-Sim}
    \sectionmark{Manuscript 3}
            \lipsum[1-8]
\end{document}

编辑以包含@esdd 提案:

\documentclass[twoside,12pt,openright,headings=optiontoheadandtoc]{scrbook}
\usepackage[a4paper,hmargin=2.5cm,vmargin=3cm,
            footskip=185pt,includefoot=false,twoside]{geometry}
\usepackage[dvipsnames]{xcolor}
\usepackage[pdftex]{graphicx}
\usepackage{titletoc}
\usepackage{lipsum}
\usepackage{scrlayer-scrpage}
\usepackage{xhfill}
\usepackage[sfdefault]{universalis}
\usepackage{tikz}
\usetikzlibrary{decorations, decorations.pathmorphing, decorations.pathreplacing}
\usepackage{hyperref}
\hypersetup{%
plainpages=false, colorlinks=true, citecolor=blue!80, linkcolor=black, filecolor=red, urlcolor=violet, pdfpagemode=FullScreen, pdfborder={0 0 0}, breaklinks=true,  bookmarksnumbered=true, bookmarksopen=true}
\definecolor{maincolor}{cmyk}{1, .50, .10, .01}
%% Define some format spacing--------------------------------------------------------
\setparsizes{1em}{1em plus .1\baselineskip}{0pt plus 1fil}
\renewcommand{\baselinestretch}{1.25}\selectfont
%% Title format for Chapters -------------------------------------------------------
\newcommand{\ssfont}{\fontfamily{bch}\selectfont}
\newcommand{\thesischapterfont}{\color{maincolor}\normalfont\huge\ssfont}
\newcommand{\thesissectionfont}{\color{maincolor}\normalfont\Large\ssfont}
\newcommand{\thesissubsectionfont}{\color{maincolor}\normalfont\large\ssfont}
\newcommand{\fontfootertext}{\color{blue}\normalfont\footnotesize}
\newcommand{\fontfooterpagenumber}{\color{red}\normalfont\normalsize\bfseries}
% headings
\setkomafont{chapter}{\thesischapterfont}
\setkomafont{section}{\thesissectionfont}
\setkomafont{subsection}{\thesissubsectionfont}

%%  Header and Footer ----------------------------------------------------------------------
\automark[section]{chapter}         % automatically marks sections as rightmark and chapters as leftmark
\setlength{\headheight}{19pt}      % avoids scrlayer-scrpage warning: footheight to low
\setlength{\footheight}{160pt}      % avoids scrlayer-scrpage warning: footheight to low warning
\setlength{\footskip}{185pt}        % BAD HACK that moves the foot downwards
\KOMAoption{footwidth}{foot:53pt}   % BAD HACK that moves the foot towards the outer border
\setkomafont{pagefoot}{\fontfootertext}           % font for footer
\setkomafont{pagenumber}{\fontfooterpagenumber}   % font for page numbers

%% Redefinition of the chapter mark (used for footer mark on even (left) pages)
\renewcommand{\chaptermark}[1]{%
    \markboth{%
        \fontfootertext
        \protect\raggedright
        {\color{blue}\textbf{\@Chapter\ \thechapter:}}%
        \hspace{.25cm}%
        \protect\begin{minipage}[t]{\minof{\widthof{#1}}{.7\textwidth}}%
            #1 
        \protect\end{minipage}%
        }{}
    }

%% Redefinition of the section mark (used for footer mark on odd (right) pages)
\renewcommand{\sectionmark}[1]{%
    \markright{%
        \fontfootertext
        \protect\raggedleft
        {\color{blue}\textbf{\@Section\ \thesection}}%
        \hspace{.25cm}
        \protect\begin{minipage}[t]{\minof{\widthof{#1}}{.7\textwidth}}%
            #1
        \protect\end{minipage}%
        }%
    }

%% Vertical line in the footer (between page number and mark)
\newcommand{\footerline}{\color{blue}\rule[-90pt]{1.25pt}{100pt}}
%% Page number for odd (right) pages
\newcommand{\footerrightpagenumber}{%
    \footerline%
    \hspace*{10pt}%
    \protect\begin{minipage}[b]{1.5cm}%
        \raggedright
        \pagemark\ %
    \protect\end{minipage}%
    }
%% Page number for even (left) pages
\newcommand{\footerleftpagenumber}{%
    \begin{minipage}[b]{1.5cm}%
        \raggedleft
        \pagemark\ %
    \end{minipage}%
    \hspace*{10pt}%
    \footerline%
    }
%% Defines the content for header and footer ----------------------------
\lehead{} \cehead{} \rehead{}
\lohead{} \cohead{} \rohead{}
\lefoot[\footerleftpagenumber]{\footerleftpagenumber\hspace*{0.75cm} \leftmark} \cefoot{} \refoot{}
\lofoot{} \cofoot{} \rofoot[\footerrightpagenumber]{\rightmark \hspace*{0.75cm}\footerrightpagenumber}

%% command to print the TOC ---------------------------------------------
\titlecontents{chapter}[2.4pc]{\addvspace{1pc}}
{ \begin{tikzpicture}[remember picture, overlay,box/.style = {text width=3cm, font=\color{white}\large\scshape\bfseries}]
    \node (rect) at (-2.5,1ex) [box, draw,thick,minimum width=4cm,minimum height=1cm, fill=maincolor!90,draw=maincolor!90,rounded corners=5pt,align=right ] {Chapter\ \thecontentslabel};
\end{tikzpicture}   
\hspace*{-1ex}\color{maincolor!90}\large\scshape\bfseries}
{\hspace*{-1ex}\color{maincolor!90}\large\scshape\bfseries}
{\color{maincolor!90}\large\scshape\bfseries\;\dotfill\thecontentspage}
[\addvspace{0pc}]
% %*****************************************************
\titlecontents{section}[2.0pc]{\addvspace{0pc}}
{\hspace{1.6cm}\contentslabel[\thecontentslabel]{2.4pc}}{}
{\;\dotfill\;\normalsize \thecontentspage} [\addvspace{-0.5pc}]
% %*****************************************************
\titlecontents{subsection}[4.6pc]{\addvspace{0pc}}
{\hspace{1.6cm}\contentslabel[\thecontentslabel]{2.4pc}}{}
{\;\dotfill\;\normalsize\thecontentspage} [\addvspace{-0.5pc}]
%*****************************************************
\makeatletter
\renewcommand{\tableofcontents}{ \chapter*{ \vspace*{-1cm} 
    \begin{tikzpicture}[remember picture, overlay]
        \clip (current page.north west) rectangle ([yshift=-8cm]current page.north east);
        \node[anchor=north west,inner sep=0pt] at (current page.north west) {\includegraphics[width=\paperwidth]{example-image-a}};
        \draw[anchor=west] (current page.north west) node [
                anchor=north west,  xshift=3cm, yshift=-3.5cm,
                line width=2pt, rounded corners=10pt,   draw=maincolor,
                fill=black!5,   fill opacity=0.1, text opacity=1,
                inner ysep=12.5pt,  inner xsep=20pt, align=flush left,
                text width=1.2\linewidth,        font=\Huge\sffamily\scshape\bfseries\color{maincolor}
                ] { \contentsname }; 
    \end{tikzpicture}}
\@starttoc{toc}}
\makeatother

\setcounter{tocdepth}{2}
% Begin document ---------------------------------------------
\begin{document}
    \frontmatter 
    \pagenumbering{roman}
    \pagestyle{empty}   
    \tableofcontents        
    \mainmatter
    \pagenumbering{arabic}
    \setcounter{page}{1}
    \pagestyle{headings}
% Chapter 1 -----------------------------------
    \chapter{Introduction}
    \lipsum[1-3]
    \section{Nice section title}
    \lipsum[1-5]
        \subsection{Nice subsection title}
        \lipsum[1-3]
        \subsection{Not so nice subsection title}
        \lipsum[1-3]
    \section{Very boring section}
    \lipsum[1-3]
% Chapter 2 -----------------------------------
\chapter{Optimal Control for Wave Energy Converters: Contributions}
\clearpage
    \addsec[head=Manuscript 1]{Manuscript 1: Model Predictive Control for Wave Energy Converters: A Moving Window Blocking Approach}
        \lipsum[1-8]
\clearpage
    \addsec[head=Manuscript 2]{Manuscript 2: Efficiency-aware nonlinear model-predictive control with real-time iteration scheme for wave energy converters}
    \lipsum[1-8]
\clearpage
    \addsec[head=Manuscript 3]{Manuscript 3: Nonlinear Model Predictive Control based on Real-Time Iteration Scheme for Wave Energy Converters using WEC-Sim}
    \lipsum[1-8]
% Chapter 3 -----------------------------------
    \chapter{Another chapter}
    \lipsum[1-3]
    \section{Nice section title}
    \lipsum[1-5]
        \subsection{Nice subsection title}
        \lipsum[1-3]
        \subsection{Not so nice subsection title}
        \lipsum[1-3]
    \section{Very boring section}
    \lipsum[1-3]
\end{document}

快完成了。现在我唯一的问题是我得到了第 2.0 节手稿 1 等等。

在此处输入图片描述

我希望该章的“节”页脚只显示手稿编号。即“手稿 1”,之后是“手稿 2”,依此类推。

答案1

替换\section\addsec。如果您添加类选项,headings=optiontoheadandtoc则可以使用例如。\addsec[head=Manuscript 1]{Manuscript 1: Model Predictive Control ...}然后您必须删除\sectionmark命令。

另外,您必须更改 的重新定义,\sectionmark以避免页脚中出现未编号部分的节号。因此,您可以使用\Ifnumbered{section}{<true>}{<false>}

这是一个没有这些内容的示例titletoc(与问题无关,我不建议titletoc与 KOMA-Script 类一起使用):

\documentclass[twoside,12pt,openright,headings=optiontoheadandtoc]{scrbook}
\usepackage[main=english]{babel}% <- added
\usepackage[a4paper,hmargin=2.5cm,vmargin=3cm,
            includefoot=false]{geometry}
\usepackage[dvipsnames]{xcolor}
\usepackage[pdftex]{graphicx}
\usepackage{lipsum}
\usepackage{scrlayer-scrpage}
\usepackage{xhfill}
\usepackage[sfdefault]{universalis}
\usepackage{hyperref}
\hypersetup{%
plainpages=false, colorlinks=true, citecolor=blue!80, linkcolor=black, filecolor=red, urlcolor=violet, pdfpagemode=FullScreen, pdfborder={0 0 0}, breaklinks=true,  bookmarksnumbered=true, bookmarksopen=true}
\definecolor{maincolor}{cmyk}{1, .50, .10, .01}
%% Define some format spacing--------------------------------------------------------
\setparsizes{1em}{1em plus .1\baselineskip}{0pt plus 1fil}
\renewcommand{\baselinestretch}{1.25}\selectfont
%% Title format for Chapters -------------------------------------------------------
\newcommand{\ssfont}{\fontfamily{bch}\selectfont}
\newcommand{\thesischapterfont}{\color{maincolor}\normalfont\huge\ssfont}
\newcommand{\thesissectionfont}{\color{maincolor}\normalfont\Large\ssfont}
\newcommand{\thesissubsectionfont}{\color{maincolor}\normalfont\large\ssfont}
\newcommand{\fontfootertext}{\color{blue}\normalfont\footnotesize}
\newcommand{\fontfooterpagenumber}{\color{red}\normalfont\normalsize\bfseries}
% headings
\setkomafont{chapter}{\thesischapterfont}
\setkomafont{section}{\thesissectionfont}
\setkomafont{subsection}{\thesissubsectionfont}

%%  Header and Footer ----------------------------------------------------------------------
\automark[section]{chapter}         % automatically marks sections as rightmark and chapters as leftmark
\setkomafont{pagefoot}{\fontfootertext}           % font for footer
\setkomafont{pagenumber}{\fontfooterpagenumber}   % font for page numbers

%% Redefinition of the chapter mark (used for footer mark on even (left) pages)
\renewcommand*{\chaptermarkformat}{\textbf{\chaptername\ \thechapter:}\hspace{.25cm}}
\makeatletter
\renewcommand*{\chaptermark}[1]{%
  \markboth{\MakeMarkcase{%
    \Ifnumbered{chapter}{\if@mainmatter\chaptermarkformat\fi}{}%
    \begin{minipage}[t]{\minof{\widthof{#1}}{.7\textwidth}}
      #1
    \end{minipage}%
  }}{}%
}
\makeatother

%% Redefinition of the section mark (used for footer mark on odd (right) pages)
\newcaptionname{english}{\Sectionname}{Section}
\renewcommand*{\sectionmarkformat}{\textbf{\Sectionname\ \thesection:}\hspace{.25cm}}
\makeatletter
\renewcommand{\sectionmark}[1]{%
  \markright{\MakeMarkcase{%
    \Ifnumbered{section}{\if@mainmatter\sectionmarkformat\fi}{}%
    \begin{minipage}[t]{\minof{\widthof{#1}}{.7\textwidth}}
      #1
    \end{minipage}%
  }}%
}
\makeatother

%% Vertical line in the footer (between page number and mark)
\newcommand{\footerline}{\smash{\rule[-90pt]{1.25pt}{100pt}}}
%% Page number for odd (right) pages
\newcommand{\footerrightpagenumber}{%
  \makebox[0pt][l]{%
    \footerline%
    \hspace*{10pt}%
    \begin{minipage}[b]{1.5cm}%
      \raggedright
      \pagemark%
    \end{minipage}%
  }%
}
%% Page number for even (left) pages
\newcommand{\footerleftpagenumber}{%
  \makebox[0pt][r]{%
    \begin{minipage}[b]{1.5cm}%
      \raggedleft
      \pagemark%
    \end{minipage}%
    \hspace*{10pt}%
    \footerline%
  }%
}
%% Defines the content for header and footer ----------------------------
\clearpairofpagestyles
\lefoot[\footerleftpagenumber]{\footerleftpagenumber\hspace*{0.75cm}\leftmark}
\rofoot[\footerrightpagenumber]{\rightmark\hspace*{0.75cm}\footerrightpagenumber}

\setcounter{tocdepth}{2}
% Begin document ---------------------------------------------
\begin{document}
  \frontmatter 
  \pagestyle{empty}
  \tableofcontents
  \mainmatter
  \pagestyle{scrheadings}
% Chapter 1 -----------------------------------
  \chapter{Introduction}
  \lipsum[1-3]
  \section{Nice section title}
  \lipsum[1-5]
    \subsection{Nice subsection title}
    \lipsum[1-3]
    \subsection{Not so nice subsection title}
    \lipsum[1-3]
  \section{Very boring section}
  \lipsum[1-3]
% Chapter 2 -----------------------------------
\chapter{Optimal Control for Wave Energy Converters: Contributions}
  \clearpage
  \addsec[head=Manuscript 1]{Manuscript 1: Model Predictive Control for Wave Energy Converters: A Moving Window Blocking Approach}
    \lipsum[1-8]
  \clearpage
  \addsec[head=Manuscript 2]{Manuscript 2: Efficiency-aware nonlinear model-predictive control with real-time iteration scheme for wave energy converters}
  \lipsum[1-8]
  \clearpage
  \addsec[head=Manuscript 3]{Manuscript 3: Nonlinear Model Predictive Control based on Real-Time Iteration Scheme for Wave Energy Converters using WEC-Sim}
  \lipsum[1-8]
% Chapter 3 -----------------------------------
\chapter{Another chapter}
  \lipsum[1-3]
  \section{Nice section title}
  \lipsum[1-5]
    \subsection{Nice subsection title}
    \lipsum[1-3]
    \subsection{Not so nice subsection title}
    \lipsum[1-3]
  \section{Very boring section}
  \lipsum[1-3]
\end{document}

在此处输入图片描述

补充说明:

  • \frontmatter\pagenumbering{roman}

  • \mainmatter设置\pagenumbering{arabic}并重置页面计数器。

  • 我删除了更改的\headheight\footheight\footskip(也从选项中删除)。然后我更改了、geometry的定义以及和的设置\footerline\footerrightpagenumber\footerleftpagenumber\lefoot\rofoot

相关内容