KOMA scrlayer-scrpage 标题和图像在同一行

KOMA scrlayer-scrpage 标题和图像在同一行

有没有办法将头标(标题中的标题名称)设置为与图像相同的高度?

\documentclass[12pt,DIV=10,ngerman,headings = normal,listof = totoc,bibliography = totoc,index = totoc]{scrreprt}
\usepackage{babel}
\usepackage[latin1]{inputenc}
\usepackage{setspace}
\onehalfspacing
\usepackage{geometry}
\geometry{left=30mm,right=30mm,top=25mm,bottom=45mm,headheight=21mm}
\usepackage[demo]{graphicx}
\usepackage{xcolor} 
\usepackage[automark,headsepline=1pt]{scrlayer-scrpage}
\renewcommand*{\chapterpagestyle}{scrheadings} 
\clearpairofpagestyles

%\ihead{\textsc{}\\ [1ex]{\headmark}}
\ihead{\headmark}

\rohead{\includegraphics[width=3cm,height=1cm]{Test}}  
\renewcommand{\headfont}{\color{gray}\normalfont\small}
\begin{document} 
\chapter{no depth}
\chapter{with a g}
\end{document}

并且与头线的间距非常小?

答案1

也许你想要类似的东西

在此处输入图片描述

\documentclass[12pt,DIV=10,ngerman,headings=normal,listof=totoc,bibliography=totoc,index=totoc]{scrreprt}
\usepackage{babel}
\usepackage[latin1]{inputenc}
\usepackage{setspace}
\onehalfspacing
\usepackage{geometry}
\geometry{left=30mm,right=30mm,top=25mm,bottom=45mm,headheight=21mm}
\usepackage[demo]{graphicx}
\usepackage{xcolor}
\usepackage[automark,headsepline=1pt]{scrlayer-scrpage}
\clearpairofpagestyles
\ihead{\headmark}
\rohead{\raisebox{0pt}[\ht\strutbox]{\includegraphics[width=3cm,height=1cm]{Test}}}% <- changed
\addtokomafont{pagehead}{\color{gray}\normalfont\small}% <- changed
\renewcommand*{\chapterpagestyle}{scrheadings}

\begin{document} 
\chapter{test}
\chapter{with a g}
\end{document}

您可以使用头部分隔线修改图层以更改其垂直位置:

\ModifyLayer[addvoffset=5pt]{scrheadings.head.below.line}

如果plainheadsepline=true设置了选项,您还必须修改图层的样式plain

\ModifyLayer[addvoffset=5pt]{plain.scrheadings.head.below.line}

答案2

并将 headerspline 的边距更改为文本和图像:

\ModifyLayer[addvoffset=5pt]{scrheadings.head.below.line}
\ModifyLayer[addvoffset=5pt]{plain.scrheadings.head.below.line}

来源:降低头顶线

相关内容