使用 fancyhead 將圖像和標題居中

使用 fancyhead 將圖像和標題居中

我是乳膠新手,正在嘗試更改模板,但收效甚微。

所以當前的模板在頁面左側的標題中有一個圖像,在中間有一個標題。我需要移動圖像,使其位於標題上方,但無法使其工作。

所以我將下面的行從 [LO] 更改為 [CO] 以使其居中。

\fancyhead[CO]{\parbox{1.5cm}{\includegraphics[width=2cm]{C:/My_path/my_pic.png}}}

但是,如果我將標題的程式碼行放在上面的行下方,則僅顯示標題。如果我將標題程式碼行放在上面的行上方,則僅顯示圖像。

程式碼

 \documentclass[a4paper]{article}
 \usepackage[T1]{fontenc}
 \usepackage{selinput}
 \usepackage{fancyhdr} 
 \usepackage[english]{babel}
 \usepackage{graphicx}
 \usepackage{epstopdf}
 \usepackage{color} 
 \usepackage{float}
 \usepackage{tabularx}
 \usepackage[paperheight=11.69in,paperwidth=8.27in, top=0.9in, bottom=1in, left=0.25in, right=0.25in]{geometry}
 \usepackage{helvet}
 \usepackage{xcolor}
 \usepackage{booktabs}
 \usepackage{array} 


 % imposing fancy page style
\pagestyle{fancy} 

 % creating fancy header and footer 
\fancyhead[CO]{\parbox{1.5cm}{\includegraphics[width=2cm]{C:/My_path/my_pic.png}}}
\fancyhead[CO]{{\Large \color{FCblueOne}{\scshape{\textbf{Some Title} -  Report}}}}
\fancyfoot[CO]{\Grey \scshape{For Internal Use Only}} 
\fancyfoot[RO]{\Grey \scshape{\today}} 
\fancyhead[RO]{\parbox{2.0cm}{\includegraphics[width=2cm]

% adjusting header and footer rules
\renewcommand{\headrulewidth}{0.1pt} 
\renewcommand{\footrulewidth}{0.1pt} 
\renewcommand{\headrule}{\hbox to\headwidth{\color{\Grey}\leaders\hrule height \headrulewidth\hfill}}
\renewcommand{\footrule}{\hbox to\headwidth{\color{\Grey}\leaders\hrule height \headrulewidth\hfill}}

答案1

您指定\fancyhead[CO]多次。只使用最後一個,因為前一個會被覆蓋。嘗試將您想要的所有內容集中在一起\fancyhead[CO],並嘗試實現“標題上方的圖片”fe。具有\\或類似的,即:

\fancyhead[CO]{%
    \parbox{1.5cm}{\includegraphics[width=2cm]{C:/My_path/my_pic.png}}\\
    {\Large \color{FCblueOne}{\scshape{\textbf{Some Title} -  Report}}}%
}
\fancyfoot[CO]{\Grey \scshape{For Internal Use Only}} 
\fancyfoot[RO]{\Grey \scshape{\today}} 

相關內容