헤더가 텍스트 프레임에 맞춰 정렬되지 않았습니다.

헤더가 텍스트 프레임에 맞춰 정렬되지 않았습니다.

머리글과 바닥글을 사용자 정의하려고 시도한 다음 서문이 있습니다. 그런데 찾아보니 패키지가babel 문제를 일으키는 것으로 나타났습니다.왼쪽 페이지의 헤더가 텍스트 프레임과 정렬되지 않았습니다.. 오른쪽 페이지에 있는 텍스트 프레임에 맞게 정렬하려면 어떻게 해야 합니까? 내 문서가 독일어와 영어로 작성되도록 어딘가에 지정해야 하지만 반드시 babel.

왼쪽 페이지:

여기에 이미지 설명을 입력하세요

오른쪽 페이지:

여기에 이미지 설명을 입력하세요

\documentclass[
    twoside,
    footinclude=false,
    fontsize=12pt,
    paper=a4,
    listof=totoc,
    bibliography=totoc,
    BCOR=12mm,
    DIV=12,
    chapterprefix=on,
    numbers=noenddot
]{scrbook}


\usepackage[ngerman,english]{babel} % <--- This line causes headers on the left page not aligned with the text frame

\usepackage{xcolor}
\usepackage{lipsum}

\usepackage[
    top=2cm,
    bottom=2cm,
    inner=3cm,
    outer=2cm,
    a4paper,
    headsep=0.5cm,
    footskip=1cm
]{geometry}

% ------------------------------------------------------
\usepackage{scrlayer-scrpage}
\clearpairofpagestyles   % Removes the default page header and footer entries

\renewcommand{\chaptermark}[1]{\markboth{#1}{}}   % Change this to include chapter name only

\usepackage[final,letterspace=175]{microtype}   % For micro-typographical adjustments
% The package 'microtype' provides the command '\textls{<letterspaced-text>}'
% (Source: https://tex.stackexchange.com/a/62351/245306)

\lehead{\color{gray} \sffamily \textls{\MakeUppercase\leftmark}}
\rohead{\color{gray} \sffamily \textls{\MakeUppercase\leftmark}}
\lefoot[\pagemark]{\color{gray} \sffamily \textls{\pagemark}}
\rofoot[\pagemark]{\color{gray} \sffamily \textls{\pagemark}}
% ------------------------------------------------------

% ------------------------------------------------------
\usepackage{varioref}
\usepackage[unicode,hidelinks,bookmarksnumbered]{hyperref} % 'hidelinks' removes colored boxes around references and links
% According to the documentation, 'hyperref' should be loaded as the last package
% A list of packages that should be loaded after 'hyperref' can be found at:
% https://tex.stackexchange.com/questions/1863/which-packages-should-be-loaded-after-hyperref-instead-of-before
\hypersetup{
    colorlinks=true,
    linkcolor=codegreen,
    citecolor=blue,
    filecolor=codegray,
    urlcolor=darkblue,
}
\newcommand{\aref}[1]{\hyperref[#1]{Appendix~\ref*{#1}}}
\addto\extrasenglish{
    \renewcommand{\chapterautorefname}{Chapter}
    \renewcommand{\sectionautorefname}{Section}
    \let\subsectionautorefname\sectionautorefname
    \let\subsubsectionautorefname\sectionautorefname
}
\usepackage{url}
\usepackage[nameinlink,noabbrev]{cleveref}
\providecommand\algorithmname{Algorithm}
\usepackage{nameref}
% ------------------------------------------------------


\begin{document}

\frontmatter
\pagestyle{plain}
\listoffigures
\listoftables

\mainmatter
\pagestyle{scrheadings}

\chapter{Introduction}
\lipsum[1-50]
\chapter{Methodology}
\lipsum[1-50]

\end{document}

답변1

실제로 공백은 명령에 의해 도입됩니다 \addto\extrasenglish. %매크로로 끝나지 않는 줄 끝에 추가하세요 .

\addto\extrasenglish{%
    \renewcommand{\chapterautorefname}{Chapter}%
    \renewcommand{\sectionautorefname}{Section}%
    \let\subsectionautorefname\sectionautorefname
    \let\subsubsectionautorefname\sectionautorefname
}

답변2

MWE에서는 KOMA-Script 클래스가 scrbook사용됩니다. 따라서 다음 \addto\extrasenglish{...}으로 대체할 수 있습니다.

\renewcaptionname{english}{\chapterautorefname}{Chapter}
\renewcaptionname{english}{\sectionautorefname}{Section}
\renewcaptionname{english}{\subsectionautorefname}{\sectionautorefname}
\renewcaptionname{english}{\subsubsectionautorefname}{\sectionautorefname}

관련 정보