在页眉中对齐徽标并添加页眉文本

在页眉中对齐徽标并添加页眉文本

我正在尝试对齐报告标题中的两个徽标。如您所见,右侧徽标位于左侧徽标的下方。我想通过将右侧徽标向上移动并在其下方添加一行文本来对齐这两个徽标。

我的代码和最终的布局目前如下所示:

\documentclass[a4paper,oneside]{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}


\usepackage[a4paper,
            bindingoffset=0pt,
            left=2cm,
            right=1.75cm,
            top=1.25cm,
            bottom=1cm,
            headheight=1.25cm,
            headsep=0.9cm,
            footskip=1.5cm,
            includehead,
            includefoot
            ]{geometry}

%Set header and footer using the fancyhdr package
\usepackage{fancyhdr}

\pagestyle{fancy}
\fancyhf{}

\lhead{\includegraphics[height=1.4cm]{logos/eth_logo.png}} % left logo
\rhead{\includegraphics[height=0.9cm]{logos/ibk_logo.png}} % right logo
\renewcommand{\headrulewidth}{0pt} % remove rule below header

在此先感谢您的帮助!

在此处输入图片描述

在此处输入图片描述

在此处输入图片描述

答案1

将两幅图像放入包中,以便进行垂直对齐。然后,我们\chead可以在新行上用负号添加额外的空格。valign=tadjustbox\vspace

\documentclass[a4paper,oneside]{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}

\usepackage{mwe}%<-- just for sample images
\usepackage{lipsum}%<-- just for sample text
\usepackage[export]{adjustbox}%<--

\usepackage[a4paper,
            bindingoffset=0pt,
            left=2cm,
            right=1.75cm,
            top=1.25cm,
            bottom=1cm,
            headheight=1.25cm,
            headsep=0.9cm,
            footskip=1.5cm,
            includehead,
            includefoot
            ]{geometry}

%Set header and footer using the fancyhdr package
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}

\chead{
\includegraphics[height=1.4cm, valign=t]{example-image-a}
\hfill
\includegraphics[height=0.9cm, valign=t]{example-image-b}\\
\vspace{-.4cm}
\ \hfill An extra line of text
}

\renewcommand{\headrulewidth}{0pt} % remove rule below header
\begin{document}
\lipsum[1-5]
\end{document}

在此处输入图片描述

相关内容