I am writing a publication-based dissertation. And I want to use the manuscript number in the TOC instead of the section number.
See for example this figure, I want to remove the 2.1 and have as 'sections' the manuscript number. That is, instead of 2.1 Mnuscript 1: title…
I want to have just Manuscript 1: Title….
I tried by using the '\section*{}' command, but that remove that entry from the TOC.
I am using '\usepackage{titletoc}' for the setting of the TOC, and 'scrbook' document class.
Same, I would like to have similar in the section itself:
Instead of having 2.1 Manuscript 1: Title… I would like to have just the word 'Manuscript + the contribution number'
Any guidance with this issue? Of course, I want that just for the chapter of contributions, the others chapters should be 'normal'
Kind regards,
Here is my 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}
Editted to include @esdd proposal:
\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}
Almost there. The only issue I have now is that I get Section 2.0 Manuscript 1 and so on.
I want to have, just for that chapter, the "section" footer just the manuscript number. That is, "Manuscript 1", later "Manuscript 2" and so on.
Best Answer
Replace
\section
by\addsec
. If you add class optionheadings=optiontoheadandtoc
you could use eg.\addsec[head=Manuscript 1]{Manuscript 1: Model Predictive Control ...}
. Then you have to remove the\sectionmark
commands.Additional you have to change your redefinition of
\sectionmark
to avoid the section number in footer for unnumbered sections. Therefore you can use\Ifnumbered{section}{<true>}{<false>}
.Here is an example without the
titletoc
stuff (not related to the issue and I do not recommend to usetitletoc
with a KOMA-Script class):Additional remarks:
\frontmatter
sets\pagenumbering{roman}
\mainmatter
sets\pagenumbering{arabic}
and resets the page counter.I have removed the changed
\headheight
,\footheight
and\footskip
(also fromgeometry
options). Then I have changed the definitions of\footerline
,\footerrightpagenumber
,\footerleftpagenumber
and the settings of\lefoot
and\rofoot