
Ich verwende hyperref
und autoref
, definiere aber die Autorefnames neu. Ich füge Kapitel- und Abschnittsnamen mit in meine Seitenkopfzeilen ein scrlayer-scrpage
. Es gibt etwas unerwünschten Platz, immer auf der linken Seite in der Überschrift ... egal, ob ich auf einer geraden oder ungeraden Seite bin. Das ist besonders offensichtlich, wenn Kapitel- oder Abschnittsnamen zu lang sind, um in die Überschrift zu passen. Im Beispiel könnten sie prinzipiell passen, tun es aber aufgrund des Platzes nicht.
Wenn ich die s nicht umbenenne autoref
, ist alles in Ordnung. Was ist hier los und wie kann ich es beheben?
ich habe es versucht"verschlingen", vor und nach dem neuen \...autorefname
, aber das hilft nichts.
\documentclass[pdfa,a4paper,
11pt,
bibliography=totoc,
numbers=noenddot,
twoside,openright,
parskip=half]{scrbook}
\usepackage{lipsum}
% ********************************************************************
% Languages, Typesetting
% ********************************************************************
\usepackage[ngerman, english]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc} %windows: latin9, linux: utf8
% ********************************************************************
% page layout
% ********************************************************************
\usepackage[]{scrlayer-scrpage}
\renewcommand{\chapterpagestyle}{empty} % no headings or footings on first chapter page
\renewcommand{\chaptermark}[1]{\markboth{{#1}}{{#1}}}
\renewcommand{\sectionmark}[1]{\markright{\upshape{\thesection}\enspace{#1}}}
\lehead{\mbox{\llap{\small\upshape\thepage\kern2em}\scshape\headmark\hfil}}
\rohead{\mbox{\hfil{\scshape\headmark}\rlap{\small\kern2em\upshape\thepage}}}
\chead{}\ifoot{}\cfoot{}\ofoot{}
\pagestyle{scrheadings}
% ********************************************************************
% Hyperreferences, always load last
% ********************************************************************
\usepackage[]{hyperref}
% Commenting this whole block fixes the problem
\makeatletter
\@ifpackageloaded{babel}
{
\addto\extrasenglish{
\renewcommand*{\figureautorefname}{Figure}
\renewcommand*{\tableautorefname}{Table}
\renewcommand*{\partautorefname}{Part}
\renewcommand*{\chapterautorefname}{Chapter}
\renewcommand*{\sectionautorefname}{Section}
\renewcommand*{\subsectionautorefname}{Section}
\renewcommand*{\subsubsectionautorefname}{Section}
\renewcommand*{\appendixautorefname}{Appendix}
}
}{\relax}
\makeatother
\begin{document}
\part{Intro}
\chapter{Short chapter name}
\lipsum[1]
\section{Short section name}
\lipsum
\lipsum
\chapter{Very long chapter name just not fitting into the headline}
\lipsum[1]
\section{Very long section name just not fitting into the headline}
\lipsum
\lipsum
\end{document}
Antwort1
Sie können
\AfterPackage*{babel}
{
\renewcaptionname{english}{\figureautorefname}{Figure}
\renewcaptionname{english}{\tableautorefname}{Table}
\renewcaptionname{english}{\partautorefname}{Part}
\renewcaptionname{english}{\chapterautorefname}{Chapter}
\renewcaptionname{english}{\sectionautorefname}{Section}
\renewcaptionname{english}{\subsectionautorefname}{Section}
\renewcaptionname{english}{\subsubsectionautorefname}{Section}
\renewcaptionname{english}{\appendixautorefname}{Appendix}
}
\AfterPackage*
wird durch ein Paket definiert scrlfile
, das von den KOMA-Script-Klassen automatisch geladen wird. \renewcaptionname
ist ebenfalls ein KOMA-Script-Befehl.
Zusätzlich würde ich die Einstellungen für das Seitenlayout ändern auf
\renewcommand{\chapterpagestyle}{empty} % no headers or footers on first chapter page
\usepackage[]{scrlayer-scrpage}
\automark[chapter]{chapter}
\automark*[section]{}
\renewcommand\chaptermarkformat{}% no chapter number in header/footer
\addtokomafont{pagehead}{\scshape}
\addtokomafont{pagenumber}{\small}
\clearmainofpairofpagestyles
\lehead{\mbox{\llap{\pagemark\kern2em}\headmark}}
\rohead{\mbox{{\ifstr{\leftmark}{\rightmark}{}{\upshape}\headmark}\rlap{\kern2em\pagemark}}}
Beispiel:
\documentclass[pdfa,a4paper,
11pt,
bibliography=totoc,
numbers=noenddot,
twoside,openright,
parskip=half]{scrbook}
\usepackage{lipsum}
% ********************************************************************
% Languages, Typesetting
% ********************************************************************
\usepackage[ngerman, english]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
% ********************************************************************
% page layout
% ********************************************************************
\renewcommand{\chapterpagestyle}{empty} % no headers or footers on first chapter page
\usepackage[]{scrlayer-scrpage}
\automark[chapter]{chapter}
\automark*[section]{}
\renewcommand\chaptermarkformat{}% no chapter number in header/footer
\addtokomafont{pagehead}{\scshape}
\addtokomafont{pagenumber}{\small}
\clearmainofpairofpagestyles
\lehead{\mbox{\llap{\pagemark\kern2em}\headmark}}
\rohead{\mbox{{\ifstr{\leftmark}{\rightmark}{}{\upshape}\headmark}\rlap{\kern2em\pagemark}}}
% ********************************************************************
% Hyperreferences, always load last
% ********************************************************************
\usepackage[]{hyperref}
\AfterPackage*{babel}
{
\renewcaptionname{english}{\figureautorefname}{Figure}
\renewcaptionname{english}{\tableautorefname}{Table}
\renewcaptionname{english}{\partautorefname}{Part}
\renewcaptionname{english}{\chapterautorefname}{Chapter}
\renewcaptionname{english}{\sectionautorefname}{Section}
\renewcaptionname{english}{\subsectionautorefname}{Section}
\renewcaptionname{english}{\subsubsectionautorefname}{Section}
\renewcaptionname{english}{\appendixautorefname}{Appendix}
}
\begin{document}
\part{Intro}
\chapter{Short chapter name}
\lipsum[1]
\section{Short section name}
\lipsum
\lipsum
\chapter{Very long chapter name just not fitting into the headline}
\lipsum[1]
\section{Very long section name just not fitting into the headline}
\lipsum
\lipsum
\end{document}
Aktualisieren:Ein weiteres Beispiel für einen Kommentar:
\documentclass[pdfa,a4paper,
11pt,
bibliography=totoc,
numbers=noenddot,
twoside,openright,
parskip=half]{scrbook}
\usepackage{lipsum}
% ********************************************************************
% Languages, Typesetting
% ********************************************************************
\usepackage[ngerman, english]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{microtype}
\usepackage{textcase}
\DeclareRobustCommand{\spacedlowsmallcaps}[1]{\textls[80]{\scshape\MakeTextLowercase{#1}}}
% ********************************************************************
% page layout
% ********************************************************************
\renewcommand{\chapterpagestyle}{empty} % no headers or footers on first chapter page
\usepackage[]{scrlayer-scrpage}
\automark[chapter]{chapter}
\automark*[section]{}
\renewcommand*\chaptermarkformat{}% no chapter number in header/footer
\renewcommand*\sectionmarkformat{{\small\thesection\autodot\enskip}}% section number using \small
\addtokomafont{pagenumber}{\small}% page number using \small
\clearmainofpairofpagestyles% remove all default entries for page style scrheadings
\lehead{\mbox{\llap{\pagemark\kern2em}\spacedlowsmallcaps{\headmark}}}
\rohead{\mbox{\spacedlowsmallcaps{\headmark}\rlap{\kern2em\pagemark}}}
% ********************************************************************
% Hyperreferences, always load last
% ********************************************************************
\usepackage[]{hyperref}
\AfterPackage*{babel}
{
\renewcaptionname{english}{\figureautorefname}{Figure}
\renewcaptionname{english}{\tableautorefname}{Table}
\renewcaptionname{english}{\partautorefname}{Part}
\renewcaptionname{english}{\chapterautorefname}{Chapter}
\renewcaptionname{english}{\sectionautorefname}{Section}
\renewcaptionname{english}{\subsectionautorefname}{Section}
\renewcaptionname{english}{\subsubsectionautorefname}{Section}
\renewcaptionname{english}{\appendixautorefname}{Appendix}
}
\begin{document}
\part{Intro}
\chapter{Short chapter name}
\lipsum[1]
\section{Short section name}
\lipsum
\lipsum
\chapter{Very long chapter name just not fitting into the headline}
\lipsum[1]
\section{Very long section name just not fitting into the headline}
\lipsum
\lipsum
\end{document}
\MakeTextLowercase
Beachten Sie, dass Sie in \setkomafont
oder nicht verwenden können \addtokomafont
. Sie müssen daher \spacedlowsmallcaps
in \lehead
any einfügen \rohead
.
Antwort2
Jede der \renewcommand*{\....autorefname}{...}
Anweisungen führt zu einem zusätzlichen Leerzeichen, da dies innerhalb des Befehls erfolgt, \extraenglish
der während des Satzes aufgerufen wird, und nicht bereits in der Präambel.
%
Fügen Sie am Ende jeder dieser Zeilen ein hinzu .
\documentclass[pdfa,a4paper,
11pt,
bibliography=totoc,
numbers=noenddot,
twoside,openright,
parskip=half]{scrbook}
\usepackage{lipsum}
% ********************************************************************
% Languages, Typesetting
% ********************************************************************
\usepackage[ngerman, english]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc} %windows: latin9, linux: utf8
% ********************************************************************
% page layout
% ********************************************************************
\usepackage[]{scrlayer-scrpage}
\renewcommand{\chapterpagestyle}{empty} % no headings or footings on first chapter page
\renewcommand{\chaptermark}[1]{\markboth{{#1}}{{#1}}}
\renewcommand{\sectionmark}[1]{\markright{\upshape{\thesection}\enspace{#1}}}
\lehead{\mbox{\llap{\small\upshape\thepage\kern2em}\scshape\headmark\hfil}}
\rohead{\mbox{\hfil{\scshape\headmark}\rlap{\small\kern2em\upshape\thepage}}}
\chead{}\ifoot{}\cfoot{}\ofoot{}
\pagestyle{scrheadings}
% ********************************************************************
% Hyperreferences, always load last
% ********************************************************************
\usepackage[]{hyperref}
% Commenting this whole block fixes the problem
\makeatletter
\@ifpackageloaded{babel}
{
\addto\extrasenglish{%
\renewcommand*{\figureautorefname}{Figure}%
\renewcommand*{\tableautorefname}{Table}%
\renewcommand*{\partautorefname}{Part}%
\renewcommand*{\chapterautorefname}{Chapter}%
\renewcommand*{\sectionautorefname}{Section}%
\renewcommand*{\subsectionautorefname}{Section}%
\renewcommand*{\subsubsectionautorefname}{Section}%
\renewcommand*{\appendixautorefname}{Appendix}%
}%
}{\relax}
\makeatother
\begin{document}
\part{Intro}
\chapter{Short chapter name}
\lipsum[1]
\section{Short section name}
\lipsum
\lipsum
\chapter{Very long chapter name just not fitting into the headline}
\lipsum[1]
\section{Very long section name just not fitting into the headline}
\lipsum
\lipsum
\end{document}