您好,我想在标题左侧只放置“Kapitel X”,其中 X = 此节的编号(“Kapitel 3”或其他)。我想在右侧只放置不带标记的节名称。现在我已经发现第二个有效...
\documentclass[12pt]{scrartcl}
\usepackage[a4paper]{geometry}
\geometry{left=3.5cm,right=3.5cm,top=3cm,bottom=3cm}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{lmodern}
%% Kopf- und Fußzeile
\usepackage[headsepline,footsepline,automark]{scrlayer-scrpage}
\renewcommand*{\sectionmarkformat}{%
}
\clearscrheadfoot
\ohead[]{\headmark}
\ihead[]{Kapitel \sectionmark}
\setkomafont{pageheadfoot}{\sffamily}
\begin{document}
\section{Hauptteil}
\end{document}
答案1
\documentclass[12pt]{scrartcl}
\usepackage[a4paper]{geometry}
\geometry{left=3.5cm,right=3.5cm,top=3cm,bottom=3cm}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{lmodern}
%% Kopf- und Fußzeile
\usepackage[headsepline,footsepline,automark]{scrlayer-scrpage}
\renewcommand*{\sectionmarkformat}{Kapitel~\thesection\hfill}
\clearscrheadfoot
\ihead[]{\headmark}
\setkomafont{pageheadfoot}{\sffamily}
\begin{document}
\section{Hauptteil}
\end{document}