Titelzeile: Kapitel (\chapter) und Abschnitt (\section)

Antwort erstellen


Diese Frage dient dazu, das automatisierte Versenden von Formularen durch Spam-Bots zu verhindern.
Smilies
:D :) :( :o :shock: :? 8) :lol: :-x :P :oops: :cry: :evil: :twisted: :roll: :wink: :!: :?: :idea: :arrow: :| :mrgreen:

BBCode ist eingeschaltet
[img] ist eingeschaltet
[flash] ist ausgeschaltet
[url] ist eingeschaltet
Smilies sind eingeschaltet

Die letzten Beiträge des Themas

Ich habe die Datenschutzerklärung gelesen und bin damit einverstanden.

   

Wenn du eine Datei oder mehrere Dateien anhängen möchtest, gib die Details unten ein.

Ansicht erweitern Die letzten Beiträge des Themas: Titelzeile: Kapitel (\chapter) und Abschnitt (\section)

von KOMA » Do 22. Jul 2010, 12:36

Das KOMA-Script-Buch gibt es auch in gut sortierten öffentlichen Bibliotheken oder Uni-Bibliotheken. Wenn Du vorhast LaTeX öfter zu verwenden, wird es sich irgendwann auch bezahlt machen.

Aber Du hast Glück: In der englischen Anleitung scrguien.pdf findet man die entsprechenden Hinweise bei der Erklärung zu \chapterpagestyle noch.

von Gast0815 » Do 22. Jul 2010, 12:23

Ich habe nun alles auf scrpage2 umgestellt, fancyhdr ist raus.
\def habe ich in \renewcommand geändert.

Aber mit dem Inhalt der Kopfzeile bin ich nicht weiter.
Ich habe das Buch nicht und da ich relativer Neuling in Sachen Latex bin, weiß ich nicht wie ich \rightmark umdefinieren kann.

von KOMA » Di 20. Jul 2010, 17:49

Der Grund für Dein Problem ist schlicht, dass \rightmark über die TeX-Marke \firstmark arbeitet. Da die erste Marke von \chaptermark gesetzt wird, ist die rechte Marke in der ersten Mark leer (oder allenfalls ebenfalls der Kapiteleintrag). Du kannst ja in \chaptermark nicht auch de Abschnittsmarke setzen, weil diese zu dem Zeitpunkt noch gar nicht bekannt ist.

Also bleibt Dir theoretisch nur \rightmark umzudefinieren (siehe dazu beispielsweise Teil II des KOMA-Script-Buchs), dass es wie \leftmark auf \botmark basiert. Aber eigentlich ist das überflüssig, weil man auf Kapitelanfangsseiten ohnehin besser keine Kolumnentitel setzt (auch das wird im KOMA-Script-Buch ausführlich diskutiert).

BTW: scrpage2 harmoniert weit besser mit KOMA-Script-Klassen als fancyhdr. Außerdem sollte man in LaTeX nach Möglichkeit \renewcommand (oder \newcommand oder \providecommand) an Stelle von \def verwenden.

BTW: Statt selbst Massen an blindtext in ein Minimalbeispiel einzufügen, kann man leichter und sollte man besser, eines der Pakete blindtext oder lipsum verwenden, wie das auch im Wiki-Eintrag zum Thema Minimalbeispiel empfohlen wird.

Titelzeile: Kapitel (\chapter) und Abschnitt (\section)

von Gast0815 » Di 20. Jul 2010, 17:36

Hallo,

ich erstelle mir gerade eine Latex-Vorlage und habe jetzt folgendes Problem, das ich auch mit Google's Hilfe und viel Ausprobieren nicht lösen konnte:

Ich möchet das auf jeder Seite in der Kopfzeile die Kapitelnummer, der Kapitelname, ein Bindestrich, die Nummer des Abschnitts und dann der Name des Abschnitts steht, also so:
1. Kapitel - 1.1 Abschnitt

Soweit funktioniert das auch schon, nur auf den Seiten, auf den ein neues Kapitel anfängt, fehlt mir der Abschnitt.

Hier mal ein MinimalBsp meines Codes:
\documentclass[a4paper,oneside] {scrreprt}

\usepackage[ngerman]{babel}
\usepackage[T1]{fontenc}
\usepackage[ansinew]{inputenc}
\usepackage{fancyhdr}

\pagestyle{fancy}
\def\chapterpagestyle{fancy}

\renewcommand{\sectionmark}[1]{\markright{\thesection #1}}
\renewcommand{\chaptermark}[1]{\markboth{#1}{ABC}}

\begin{document}

\lhead[]{\thechapter. \leftmark - \rightmark} \chead[]{} \rhead[]{}
\lfoot[]{} \cfoot[]{} \rfoot[]{}

\chapter{Kapitel1}
Text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text.

\section{Abschnitt1}
Text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text.
Text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text.
Text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text.
Text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text.Text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text.
Text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text.
Text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text.Text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text.
Text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text.
Text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text.Text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text.
Text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text.

\section{Abschnitt2}
Noch mehr Text. Noch mehr Text. Noch mehr Text. Noch mehr Text. Noch mehr Text. Noch mehr Text. Noch mehr Text. Noch mehr Text. Noch mehr Text. Noch mehr Text. Noch mehr Text. Noch mehr Text. Noch mehr Text. Noch mehr Text. Noch mehr Text. Noch mehr Text. Noch mehr Text. Noch mehr Text. Noch mehr Text. Noch mehr Text. Noch mehr Text. Noch mehr Text. Noch mehr Text. Noch mehr Text. 

\end{document}
Wie bekomme ich den Abschnitt auch auf Kapitelstartseiten?
Ich denke ich müsste es als zweites Argument an \markboth übergeben (hier: "ABC"). Habe vieles versucht aber bisher tat nichts, wie ich das wollte :-(

Danke.

Nach oben