
您好,我想在標題的左側僅放置“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}