von Statnach » Mo 22. Feb 2016, 13:16
Liebes Forum,
Ich habe ein Problem mit doppelten Einträgen im Inhaltsverzeichnis meines LaTeX-Dokuments. Ich arbeite mit fancyhdr und \addcontentsline. Sobald ich unter addcontentsline die \section{..} anfange erscheint die jeweilige Überschrift doppelt im Inhaltsverzeichnis, einmal mit und ohne einmal ohne Nummer. Was schafft da Abhilfe?
Folgend das Minimalbeispiel; ich benutze allerdings noch deutlich mehr Pakete.
\documentclass[11pt,twoside]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[a4paper]{geometry}
\geometry{verbose,tmargin=3cm,bmargin=3cm,lmargin=3cm,rmargin=2cm}
\usepackage{array}
\usepackage{float}
\usepackage{units}
\usepackage{amsmath}
\usepackage{amssymb}
\makeatletter
\setlength{\headheight}{12.51453pt}
\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}
\fancyhead{}
\fancyfoot{}
\fancyfoot[LE,RO]{\thepage}
\usepackage{amsmath}
\numberwithin{equation}{section}
\usepackage{bbm}
\usepackage{nccmath}
\usepackage{graphicx}
\usepackage{color}
\allowdisplaybreaks
\usepackage{array}
\usepackage{mathdots}
\usepackage{rotating}
\usepackage{tikz}
\usepackage{caption}
\captionsetup[figure]{labelfont={bf}}
\captionsetup[table]{labelfont={bf}}
\usepackage[innercaption]{sidecap}
\sidecaptionvpos{figure}{t}
\usepackage[flushmargin]{footmisc}
%\usepackage{slashbox}
\newcommand{\vast}{\bBigg@{5.5}}
\newcommand{\Vast}{\bBigg@{6.5}}
\renewcommand{\thefigure}{\arabic{section}.\arabic{figure}}
\makeatletter \@addtoreset{figure}{section} \makeatother
\renewcommand{\thetable}{\arabic{section}.\arabic{table}}
\makeatletter \@addtoreset{table}{section} \makeatother
\begin{document}
........
\renewcommand{\thepage}{\Roman{page}}
\setcounter{page}{1}
\fancyhead{}
\fancyhead[LE,RO]{\slshape \rightmark}
\tableofcontents{}\newpage{}
.......
\addcontentsline{toc}{section}{Introduction}\fancyhead{}
\fancyhead[LE,RO]{\emph{INTRODUCTION}}
\section{Introduction}
......
\end{document}
Liebes Forum,
Ich habe ein Problem mit doppelten Einträgen im Inhaltsverzeichnis meines LaTeX-Dokuments. Ich arbeite mit fancyhdr und \addcontentsline. Sobald ich unter addcontentsline die \section{..} anfange erscheint die jeweilige Überschrift doppelt im Inhaltsverzeichnis, einmal mit und ohne einmal ohne Nummer. Was schafft da Abhilfe?
Folgend das Minimalbeispiel; ich benutze allerdings noch deutlich mehr Pakete.
[code]\documentclass[11pt,twoside]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[a4paper]{geometry}
\geometry{verbose,tmargin=3cm,bmargin=3cm,lmargin=3cm,rmargin=2cm}
\usepackage{array}
\usepackage{float}
\usepackage{units}
\usepackage{amsmath}
\usepackage{amssymb}
\makeatletter
\setlength{\headheight}{12.51453pt}
\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}
\fancyhead{}
\fancyfoot{}
\fancyfoot[LE,RO]{\thepage}
\usepackage{amsmath}
\numberwithin{equation}{section}
\usepackage{bbm}
\usepackage{nccmath}
\usepackage{graphicx}
\usepackage{color}
\allowdisplaybreaks
\usepackage{array}
\usepackage{mathdots}
\usepackage{rotating}
\usepackage{tikz}
\usepackage{caption}
\captionsetup[figure]{labelfont={bf}}
\captionsetup[table]{labelfont={bf}}
\usepackage[innercaption]{sidecap}
\sidecaptionvpos{figure}{t}
\usepackage[flushmargin]{footmisc}
%\usepackage{slashbox}
\newcommand{\vast}{\bBigg@{5.5}}
\newcommand{\Vast}{\bBigg@{6.5}}
\renewcommand{\thefigure}{\arabic{section}.\arabic{figure}}
\makeatletter \@addtoreset{figure}{section} \makeatother
\renewcommand{\thetable}{\arabic{section}.\arabic{table}}
\makeatletter \@addtoreset{table}{section} \makeatother
\begin{document}
........
\renewcommand{\thepage}{\Roman{page}}
\setcounter{page}{1}
\fancyhead{}
\fancyhead[LE,RO]{\slshape \rightmark}
\tableofcontents{}\newpage{}
.......
\addcontentsline{toc}{section}{Introduction}\fancyhead{}
\fancyhead[LE,RO]{\emph{INTRODUCTION}}
\section{Introduction}
......
\end{document}
[/code]