PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Appendix/Landscape Problem



NeZwe
01-03-2011, 12:22
Hallo,

ich hoffe mir kann jemand weiterhelfen...
Ich versuche seit einiger Zeit ein Dokument zu erstellen, bei dem der Anhang nicht im Inhalts-, Tabellen- und Abbildungsverzeichnis erscheint. Das bekomme ich auch ohne Probleme hin.

Mein Problem ist jetzt allerdings, dass ich gar kein Abbildungs- und Tabellenverzeichnis mehr erhalte, sobald ich im Anhang die landscape-Umgebung verwende. Weiß zufälligerweise jemand, woran das liegt?


\documentclass[a4paper, 12pt, parskip, bibliography=totoc, captions=nooneline, DIV=12, BCOR=.8cm]{scrreprt}

\usepackage[ngerman]{babel}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lscape}
\usepackage{pdflscape}
\usepackage{lipsum}
\usepackage{caption}

\begin{document}

\pagenumbering{Roman}
\setcounter{page}{1}

\tableofcontents

\listoffigures
\addcontentsline{toc}{chapter}{Abbildungsverzeichn is}

\newpage

\listoftables
\addcontentsline{toc}{chapter}{Tabellenverzeichnis }

\newpage

\pagenumbering{arabic}
\setcounter{page}{1}
\chapter{Irgendeine Überschrift}
\section{und eine Unterüberschrift}

\begin{table}[h]
\centering
\begin{tabular}{c|c|c}
dumm & di & dumm \\
\hline
bli & bla & blubb \\
\end{tabular}
\caption{Ab ins Tabellenverzeichnis}
\label{tab:AbInsTabellenverzeichnis}
\end{table}

\appendix
\addtocontents{toc}{\protect\setcounter{tocdepth}{-1}}
\addtocontents{lof}{\protect\setcounter{tocdepth}{-1}}
\addtocontents{lot}{\protect\setcounter{tocdepth}{-1}}

\addchap{Anhang}
\refstepcounter{chapter}
\section{Erster Abschnitt}
\lipsum


\begin{landscape}
\section{Zweiter Abschnitt}
\centering
\captionsetup{type=table}
\captionof{table}{\textbf{Tabelle quer}}
\begin{scriptsize}
\begin{tabular}{|llccrrrr|}
\hline
\multicolumn{1}{|c} {\textbf{Durchgang}} & \multicolumn{1}{c}{\textbf{Besuchsart}} &\multicolumn{1}{c}{ \textbf{ZF}} & \multicolumn{1}{c}{\textbf{Datum}} &\multicolumn{1}{c}{ \textbf{Min Temp.}} & \multicolumn{1}{c}{ \textbf{Max Temp.}} &\multicolumn{1}{c} {\textbf{MW Temp.}} &\multicolumn{1}{c|}{\textbf{MW rel. Luftfeuchte}} \\
\hline
I & Kontrolle & 1. & 13.05.2008 & 6,2 & 23,4 & 16,5 & 51,0 \\
& Kontrolle & 2. & 19.05.2008 & 9,7 & 15,4 & 12,3 & 81,0 \\
& Versuch & 1. & 03.06.2008 & 16,2 & 21,3 & 18,5 & 81,0 \\
& Versuch & 2. & 10.06.2008 & 10,6 & 27,0 & 19,9 & 69,0 \\
\hline
\end{tabular}
\end{scriptsize}
%\label{tab: Entenanzahl}
\end{landscape}

\addtocontents{toc}{\protect\setcounter{tocdepth}{ 3}}
\addtocontents{lof}{\protect\setcounter{tocdepth}{ 3}}
\addtocontents{lot}{\protect\setcounter{tocdepth}{ 3}}

\end{document}

LG NeZwe

u_fischer
01-03-2011, 12:48
\addtocontents wird beim \shipout verarbeitet, also nur wenn eine Seite ausgegeben wird. Wenn es alleine auf einer leeren Seite steht, verschwindet es.

Für eine Lösung siehe z.B.

http://tex.stackexchange.com/questions/10291/addtocontents-at-end-of-document-not-getting-written-to-toc-file

Schweinebacke
01-03-2011, 13:11
Das Problem hat nichts mit landscape zu tun, sondern damit, dass \setcounter global wirkt und \addtocontents normalerweise \write und nicht \immediate\write verwendet. Allerdings bietet KOMA-Script für letzteres einen Ausweg:

\documentclass[a4paper, 12pt, parskip, bibliography=totoc, captions=nooneline, DIV=12, BCOR=.8cm]{scrreprt}

\usepackage[ngerman]{babel}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lscape}
\usepackage{pdflscape}
\usepackage{lipsum}
\usepackage{caption}

\begin{document}

\pagenumbering{Roman}
\setcounter{page}{1}

\tableofcontents

\listoffigures
\addcontentsline{toc}{chapter}{Abbildungsverzeichn is}

\newpage

\listoftables
\addcontentsline{toc}{chapter}{Tabellenverzeichnis }

\newpage

\pagenumbering{arabic}
\setcounter{page}{1}
\chapter{Irgendeine Überschrift}
\section{und eine Unterüberschrift}

\begin{table}[h]
\centering
\begin{tabular}{c|c|c}
dumm & di & dumm \\
\hline
bli & bla & blubb \\
\end{tabular}
\caption{Ab ins Tabellenverzeichnis}
\label{tab:AbInsTabellenverzeichnis}
\end{table}

\appendix
\addtocontents{toc}{\protect\setcounter{tocdepth}{-1}}
\addtocontents{lof}{\protect\setcounter{tocdepth}{-1}}
\addtocontents{lot}{\protect\setcounter{tocdepth}{-1}}
\BeforeClosingMainAux{%
\addtocontents{toc}{\protect\setcounter{tocdepth}{ 3}}%
\addtocontents{lof}{\protect\setcounter{tocdepth}{ 3}}%
\addtocontents{lot}{\protect\setcounter{tocdepth}{ 3}}%
}

\addchap{Anhang}
\refstepcounter{chapter}
\section{Erster Abschnitt}
\lipsum


\begin{landscape}
\section{Zweiter Abschnitt}
\centering
\captionsetup{type=table}
\captionof{table}{\textbf{Tabelle quer}}
\begin{scriptsize}
\begin{tabular}{|llccrrrr|}
\hline
\multicolumn{1}{|c} {\textbf{Durchgang}} & \multicolumn{1}{c}{\textbf{Besuchsart}} &\multicolumn{1}{c}{ \textbf{ZF}} & \multicolumn{1}{c}{\textbf{Datum}} &\multicolumn{1}{c}{ \textbf{Min Temp.}} & \multicolumn{1}{c}{ \textbf{Max Temp.}} &\multicolumn{1}{c} {\textbf{MW Temp.}} &\multicolumn{1}{c|}{\textbf{MW rel. Luftfeuchte}} \\
\hline
I & Kontrolle & 1. & 13.05.2008 & 6,2 & 23,4 & 16,5 & 51,0 \\
& Kontrolle & 2. & 19.05.2008 & 9,7 & 15,4 & 12,3 & 81,0 \\
& Versuch & 1. & 03.06.2008 & 16,2 & 21,3 & 18,5 & 81,0 \\
& Versuch & 2. & 10.06.2008 & 10,6 & 27,0 & 19,9 & 69,0 \\
\hline
\end{tabular}
\end{scriptsize}
%\label{tab: Entenanzahl}
\end{landscape}

\end{document}Die einfachere Lösung ist aber:

\documentclass[a4paper, 12pt, parskip, bibliography=totoc, captions=nooneline, DIV=12, BCOR=.8cm]{scrreprt}

\usepackage[ngerman]{babel}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lscape}
\usepackage{pdflscape}
\usepackage{lipsum}
\usepackage{caption}

\begin{document}

\pagenumbering{Roman}
\setcounter{page}{1}

\tableofcontents

\listoffigures
\addcontentsline{toc}{chapter}{Abbildungsverzeichn is}

\newpage

\listoftables
\addcontentsline{toc}{chapter}{Tabellenverzeichnis }

\newpage

\pagenumbering{arabic}
\setcounter{page}{1}
\chapter{Irgendeine Überschrift}
\section{und eine Unterüberschrift}

\begin{table}[h]
\centering
\begin{tabular}{c|c|c}
dumm & di & dumm \\
\hline
bli & bla & blubb \\
\end{tabular}
\caption{Ab ins Tabellenverzeichnis}
\label{tab:AbInsTabellenverzeichnis}
\end{table}

\appendix
\addtocontents{toc}{\value{tocdepth}=-2}
\addtocontents{lof}{\value{tocdepth}=-2}
\addtocontents{lot}{\value{tocdepth}=-2}

\addchap{Anhang}
\refstepcounter{chapter}
\section{Erster Abschnitt}
\lipsum


\begin{landscape}
\section{Zweiter Abschnitt}
\centering
\captionsetup{type=table}
\captionof{table}{\textbf{Tabelle quer}}
\begin{scriptsize}
\begin{tabular}{|llccrrrr|}
\hline
\multicolumn{1}{|c} {\textbf{Durchgang}} & \multicolumn{1}{c}{\textbf{Besuchsart}} &\multicolumn{1}{c}{ \textbf{ZF}} & \multicolumn{1}{c}{\textbf{Datum}} &\multicolumn{1}{c}{ \textbf{Min Temp.}} & \multicolumn{1}{c}{ \textbf{Max Temp.}} &\multicolumn{1}{c} {\textbf{MW Temp.}} &\multicolumn{1}{c|}{\textbf{MW rel. Luftfeuchte}} \\
\hline
I & Kontrolle & 1. & 13.05.2008 & 6,2 & 23,4 & 16,5 & 51,0 \\
& Kontrolle & 2. & 19.05.2008 & 9,7 & 15,4 & 12,3 & 81,0 \\
& Versuch & 1. & 03.06.2008 & 16,2 & 21,3 & 18,5 & 81,0 \\
& Versuch & 2. & 10.06.2008 & 10,6 & 27,0 & 19,9 & 69,0 \\
\hline
\end{tabular}
\end{scriptsize}
%\label{tab: Entenanzahl}
\end{landscape}

\end{document}Dabei wird ausgenutzt, dass die Verzeichnisse (zumindest bei KOMA-Script) immer innerhalb einer Gruppe gelesen werden.

NeZwe
01-03-2011, 13:17
Super, dankeschön!

Funktioniert wunderbar und endlich kann ich mich mit was anderem rumärgern! :D

LG NeZwe