我正在写一篇论文,我需要将引言 (Einleitung)、结论 (Schluss)、图表列表和表格列表加粗。这意味着所有未编号的条目。就像参考书目 (Literaturverzeichnis) 一样。但我没有找到只更改整个目录中单个标题的解决方案。此外,图表列表和表格列表未显示在目录中。有人知道这些问题的解决方案吗?我很乐意提供帮助。提前致谢。
\documentclass[twoside, parskip=half, 12pt, egregdoesnotlikesansseriftitles]{scrreprt}
\renewcommand{\thesection}{\arabic{section}} %entfernugn der null bei der numerierung
\usepackage{graphicx}
\usepackage{tabularray}
\usepackage[nottoc,notlot,notlof]{tocbibind}
\title{xxx}
\author{xxx}
\date{xxx}
\begin{document}
\maketitle
\tableofcontents
\section*{Einleitung}
\addcontentsline{toc}{section}{Einleitung}
\section{Definition Big Data}
That's a text \cite{text}.
\begin{figure}
\centering
\includegraphics[scale=0.4]{Images}
\caption{And that's an Image}
\label{fig:Image}
\end{figure}
\begin{table}[h]
\centering
\begin{tblr}{
colspec = {|l|l|l|},
} \hline
Item & Qty & Unit \\ \hline
Widget & 1 & 199.99 \\
Gadget & 2 & 399.933 \\
Cable & 3 & 19.99 \\ \hline
\end{tblr}
\caption{And that's a table}
\end{table}
\section{Cambridge Analytica}
\section{Schweiz}
\section*{Schluss}
\addcontentsline{toc}{section}{Schluss}
\bibliographystyle{unsrt}
\bibliography{Bibliography.bib}
\listoffigures
\listoftables
\end{document}
答案1
你的例子有点奇怪,因为你正在使用类scrreprt
,但似乎你不想使用\chapter
。所以在我看来使用scrartcl
是更好的选择。在这种情况下,目录中部分条目的默认设置已经是粗体。所以:
\documentclass[%
twoside, parskip=half, 12pt, egregdoesnotlikesansseriftitles,
%headings=normal,% Maybe you want to have smaller headings
]{scrartcl}% It seems you are not using \chapter, so this would be the better class.
\renewcommand{\thesection}{\arabic{section}} %entfernugn der null bei der numerierung
\usepackage{graphicx}
\usepackage{tabularray}
%\usepackage[nottoc,notlot,notlof]{tocbibind}% This package is not recommended
% with scrreprt or scrarcl. You
% should use options like
% bibliography=totoc instead
\title{xxx}
\author{xxx}
\date{xxx}
\begin{document}
\maketitle
\tableofcontents
\addsec{Einleitung}
\section{Definition Big Data}
That's a text \cite{text}.
\begin{figure}
\centering
\includegraphics[scale=0.4]{example-image}
\caption{And that's an Image}
\label{fig:Image}
\end{figure}
\begin{table}[h]
\centering
\begin{tblr}{
colspec = {|l|l|l|},
} \hline
Item & Qty & Unit \\ \hline
Widget & 1 & 199.99 \\
Gadget & 2 & 399.933 \\
Cable & 3 & 19.99 \\ \hline
\end{tblr}
\caption{And that's a table}
\end{table}
\section{Cambridge Analytica}
\section{Schweiz}
\addsec{Schluss}
\bibliographystyle{unsrt}
\bibliography{Bibliography.bib}
\listoffigures
\listoftables
\end{document}
已经将未编号的节条目设为粗体(但编号的节条目也设为粗体)。如果您确实不想将编号的节条目设为粗体,并且还想删除节条目前的距离,则可以使用:
\documentclass[%
twoside, parskip=half, 12pt, egregdoesnotlikesansseriftitles,
%headings=normal,% Maybe you want to have smaller headings
]{scrartcl}% It seems you are not using \chapter, so this would be the better class.
\renewcommand{\thesection}{\arabic{section}} %entfernugn der null bei der numerierung
\usepackage{graphicx}
\usepackage{tabularray}
%\usepackage[nottoc,notlot,notlof]{tocbibind}% This package is not recommended
% with scrreprt or scrarcl. You
% should use options like
% bibliography=totoc instead
\title{xxx}
\author{xxx}
\date{xxx}
\renewcommand*{\addsectiontocentry}[2]{%
\IfArgIsEmpty{#1}{% no number
\addtocentrydefault{section}{#1}{\bfseries #2}% make if bold
}{%
\addtocentrydefault{section}{#1}{#2}% this is the original definition
}%
}
\DeclareTOCStyleEntry[entryformat=\textmd,beforeskip=0pt]{section}{section}
\begin{document}
\maketitle
\tableofcontents
\addsec{Einleitung}
\section{Definition Big Data}
That's a text \cite{text}.
\begin{figure}
\centering
\includegraphics[scale=0.4]{example-image}
\caption{And that's an Image}
\label{fig:Image}
\end{figure}
\begin{table}[h]
\centering
\begin{tblr}{
colspec = {|l|l|l|},
} \hline
Item & Qty & Unit \\ \hline
Widget & 1 & 199.99 \\
Gadget & 2 & 399.933 \\
Cable & 3 & 19.99 \\ \hline
\end{tblr}
\caption{And that's a table}
\end{table}
\section{Cambridge Analytica}
\section{Schweiz}
\addsec{Schluss}
\bibliographystyle{unsrt}
\bibliography{Bibliography.bib}
\listoffigures
\listoftables
\end{document}
但是,如果你坚持使用scrreprt
without \chapter
,你仍然可以这样做:
\documentclass[%
twoside, parskip=half, 12pt, egregdoesnotlikesansseriftitles,
%headings=normal,% Maybe you want to have smaller headings
]{scrreprt}% It seems you are not using \chapter, so this would be the better class.
\renewcommand{\thesection}{\arabic{section}} %entfernugn der null bei der numerierung
\usepackage{graphicx}
\usepackage{tabularray}
%\usepackage[nottoc,notlot,notlof]{tocbibind}% This package is not recommended
% with scrreprt or scrarcl. You
% should use options like
% bibliography=totoc instead
\title{xxx}
\author{xxx}
\date{xxx}
\renewcommand*{\addsectiontocentry}[2]{%
\IfArgIsEmpty{#1}{% no number
\addtocentrydefault{section}{#1}{\bfseries #2}% make if bold
}{%
\addtocentrydefault{section}{#1}{#2}% this is the original definition
}%
}
\RedeclareSectionCommand[counterwithout=chapter,
tocentryformat=\textmd,tocbeforeskip=0pt]{section}
\begin{document}
\maketitle
\tableofcontents
\addsec{Einleitung}
\section{Definition Big Data}
That's a text \cite{text}.
\begin{figure}
\centering
\includegraphics[scale=0.4]{example-image}
\caption{And that's an Image}
\label{fig:Image}
\end{figure}
\begin{table}[h]
\centering
\begin{tblr}{
colspec = {|l|l|l|},
} \hline
Item & Qty & Unit \\ \hline
Widget & 1 & 199.99 \\
Gadget & 2 & 399.933 \\
Cable & 3 & 19.99 \\ \hline
\end{tblr}
\caption{And that's a table}
\end{table}
\section{Cambridge Analytica}
\section{Schweiz}
\addsec{Schluss}
\bibliographystyle{unsrt}
\bibliography{Bibliography.bib}
\listoffigures
\listoftables
\end{document}
但是,在这种情况下,我建议也添加tocentryindent=0pt
选项\RedeclareSectionCommand
。
答案2
像这样吗?
\documentclass[twoside, parskip=half, 12pt, egregdoesnotlikesansseriftitles]{scrreprt}
\renewcommand{\thesection}{\arabic{section}} %entfernugn der null bei der numerierung
\usepackage{graphicx}
\usepackage{tabularray}
\usepackage[nottoc,notlot,notlof]{tocbibind}
%\usepackage{hyperref} <-- uncomment it for klicable TOC
\title{xxx}
\author{xxx}
\date{xxx}
\begin{document}
\maketitle
\thispagestyle{empty}
\tableofcontents
\listoffigures
\listoftables
\clearpage
\section*{Einleitung}
\addcontentsline{toc}{section}{\textbf{Einleitung}}
\section{Definition Big Data}
That's a text \cite{text}.
\begin{figure}
\centering
\includegraphics[width=0.4\linewidth]{example-image-a}
\caption{And that's an Image}
\label{fig:Image}
\end{figure}
\begin{table}
\begin{tabular}{lrr}
Item & Qty & Unit \$ \\
Widget & 1 & 199.99 \\
Gadget & 2 & 399.933 \\
Cable & 3 & 19.99 \\
\end{tabular}
\caption{And that's a table}
\end{table}
\section{Cambridge Analytica}
\section{Schweiz}
\section*{Schluss}
\addcontentsline{toc}{section}{\textbf{Schluss}}
\bibliographystyle{unsrt}
\bibliography{Bibliography.bib}
\end{document}