Заголовки не выровнены с текстовой рамкой

Заголовки не выровнены с текстовой рамкой

У меня есть следующая преамбула, которая пыталась настроить заголовки и нижние колонтитулы. Однако я обнаружил, что пакет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 scrbookиспользуется класс KOMA-Script. Поэтому можно заменить \addto\extrasenglish{...}на

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

Связанный контент