Inhaltsverzeichnis Bearbeitung

Inhaltsverzeichnis Bearbeitung

Dies ist meine erste Frage auf der Site. Ich möchte das Wort „Kapitel“ komplett in Großbuchstaben schreiben und vor den Kapiteltitel ein „:“ setzen. Ich habe die Dokumentklasse „Report“ verwendet und die einzigen Pakete für das Inhaltsverzeichnis sind \usepackage[toc,page], \usepackage[nottoc,notlof,notlot]{tocbibind}. Ich weiß nicht, ob sie zur Änderung dienen oder nicht … ich bin wirklich nur ein Benutzer in Latex und dies ist mein erster Versuch, eine Abschlussarbeit zu schreiben.

   \documentclass[12pt,a4paper]{report} 
   \usepackage{amsmath,amssymb,amsthm,amsfonts,mathrsfs} 
   \usepackage{graphicx,epsfig,subfig}                 
   \usepackage{geometry}                               
   \usepackage{setspace}                                 
   \usepackage{array}                                
   \usepackage[toc,page]{appendix}               
   \usepackage[labelfont=bf]{caption}                  
   \usepackage{xpatch}                              
   \usepackage{fmtcount}                       
   \renewcommand{\thechapter}{\NUMBERstring{chapter}} 
   \renewcommand{\thesection}{\arabic{chapter}.\arabic{section}}  
   \renewcommand{\thefigure}{\arabic{chapter}.\arabic{figure}}  
   \makeatletter
   \input{fc-british.def}
   \xpatchcmd{\@chapter}% <cmd>
   {\numberline{\thechapter}}% <search>
   {\@chapapp~\thechapter\quad}% <replace>
   {}{}% <success><failure>
   \makeatother
   \newcolumntype{L}[1]{>
   {\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
   \newcolumntype{C}[1]{>
  {\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
   \newcolumntype{R}[1]{>
   {\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
    \usepackage{caption}
    \usepackage[pagestyles]{titlesec}
    \titleformat{\chapter}[display]
   {\normalfont\LARGE\bfseries\centering}
   {\centering\MakeUppercase{\chaptertitlename}\ \thechapter}{20pt}{\Large}
    \titlespacing*{\chapter}
    {0pt}{50pt}{40pt}
    \geometry{verbose,a4paper,tmargin=30mm,bmargin=25mm,
     lmargin=30mm,rmargin=25mm}
    \renewcommand{\baselinestretch}{1.65}
    \usepackage{fancyhdr}
    \usepackage{psfrag}
    \usepackage{array}
    \usepackage{booktabs}
    \usepackage{float}
    \usepackage{caption}
    \usepackage{multirow}
    \usepackage[shortlabels]{enumitem}
    \usepackage[monochrome]{xcolor}
    \usepackage{pdflscape}
    \usepackage[toc,page]{appendix}
    \usepackage{titlesec}
    \usepackage{amsmath}
    \usepackage[nottoc,notlof,notlot]{tocbibind} 
    \renewcommand\bibname{References}
    \makeatletter
    \newcommand*{\rom}[1]{\expandafter\@slowromancap\romannumeral #1@}
    \makeatother
    \setcounter{secnumdepth}{5} 
    \setcounter{tocdepth}{5}    
    \newtheorem{theorem}{Theorem}
    \newtheorem{acknowledgement}{Acknowledgement}
    \newtheorem{algorithm}{Algorithm}
    \newtheorem{axiom}{Axiom}
    \newtheorem{case}{Case}
    \newtheorem{claim}{Claim}
    \newtheorem{conclusion}{Conclusion}
    \newtheorem{condition}{Condition}
    \newtheorem{conjecture}{Conjecture}
    \newtheorem{corollary}{Corollary}
    \newtheorem{criterion}{Criterion}
    \newtheorem{definition}{Definition}
    \newtheorem{example}{Example}
    \newtheorem{exercise}{Exercise}
    \newtheorem{lemma}{Lemma}
    \newtheorem{notation}{Notation}
    \newtheorem{problem}{Problem}
    \newtheorem{proposition}{Proposition}
    \newtheorem{remark}{Remark}
    \newtheorem{solution}{Solution}
    \newtheorem{summary}{Summary}
    \numberwithin{equation}{chapter}
    \numberwithin{theorem}{chapter}
    \fancypagestyle{plain}{%
    \fancyhf{} % clear all header and footer fields 
    \fancyfoot[C]{\bfseries\large\thepage} % except the center
    \renewcommand{\headrulewidth}{0pt}
    \renewcommand{\footrulewidth}{0pt}}

    \begin{document}

    \addcontentsline{toc}{chapter}{Contents}
    \tableofcontents 

    \chapter{General Introduction}\label{chapter:Intro} 
    \section{Introduction}
    Composite steel-concrete construction

    \end{document}  

Bildbeschreibung hier eingeben

Antwort1

Ich habe damit begonnen, Ihren Code auf ein minimaleres funktionierendes Beispiel zu reduzieren. Obwohl Sie das in Ihrem echten Dokument natürlich nicht tun möchten,sollenbeschneiden und organisieren Sie Ihre Präambel. Sie laden Pakete mehrmals, manchmal mit unterschiedlichen Optionen, und laden widersprüchliche Pakete oder Pakete, die mit Optionen in Konflikt stehen, die an andere Pakete übergeben wurden. Beispielsweise wird pagestylesmit „übergeben an“ titlesecder Fußzeilen-/Kopfzeilen-Cousin dieses Pakets geladen. Dieser Cousin konkurriert dann mit fancyhdrum die Kontrolle dieses Aspekts Ihres Dokumentlayouts. Wählen Sie. Eines, das andere oder keines von beiden. Aber nicht beides. Sie laden auch titlesecohne diese Option, was ebenfalls potenzielle Konflikte erzeugt, wenn Sie nicht zufällig auf eine Reihenfolge stoßen, die keinen Fehler auslöst.

Ich habe dann den \xpatchBefehl angepasst, um „Kapitel“ als „KAPITEL“ festzulegen und nach dem Zahlenwort einen Punkt einzufügen. Ich weiß, dass Sie einen Doppelpunkt angefordert haben, aber ich finde ehrlich gesagt, dass das komisch aussieht. Sie können das jedoch problemlos .durch ein a ersetzen :, wenn Sie dieses Format wirklich bevorzugen (oder verwenden müssen).

\documentclass{report} 
\usepackage[toc,page]{appendix}               
\usepackage{xpatch}                              
\usepackage[british]{fmtcount}% set dialect in a standard way the package recommends                
% \usepackage[pagestyles]{titlesec}% use of pagestyles conflicts with use of fancyhdr
\usepackage{titlesec}% use of pagestyles conflicts with use of fancyhdr
\usepackage{fancyhdr}
\usepackage[nottoc,notlof,notlot]{tocbibind} 

\renewcommand{\thechapter}{\NUMBERstring{chapter}} 
\renewcommand{\thesection}{\arabic{chapter}.\arabic{section}}  
\makeatletter
\xpatchcmd{\@chapter}% <cmd>
{\numberline{\thechapter}}% <search>
{\MakeUppercase{\@chapapp}~\thechapter.\quad}% <replace>% <= \MakeUppercase for the capitalisation; added . for dot
{}{}% <success><failure>
\makeatother
\titleformat{\chapter}[display]
{\normalfont\LARGE\bfseries\centering}
{\centering\MakeUppercase{\chaptertitlename}\ \thechapter}{20pt}{\Large}
\titlespacing*{\chapter}
{0pt}{50pt}{40pt}
\setcounter{tocdepth}{5}    
\fancypagestyle{plain}{%
  \fancyhf{}% clear all header and footer fields 
  \fancyfoot[C]{\bfseries\large\thepage}% except the center
  \renewcommand{\headrulewidth}{0pt}%
  \renewcommand{\footrulewidth}{0pt}}

\begin{document}

\addcontentsline{toc}{chapter}{Contents}
\tableofcontents 

\chapter{General Introduction}\label{chapter:Intro} 
\section{Introduction}
Composite steel-concrete construction

\end{document} 

optimierte Inhaltsverzeichniszeile für Kapitel

verwandte Informationen