標題不同角的兩張圖片

標題不同角的兩張圖片

我正在用 LaTex 編寫文檔,但是標題有問題。我需要在文件標題中插入兩個圖像以及一些文字行。到目前為止我的程式碼:

\documentclass{article}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{fancyhdr}
\usepackage{graphicx}

\pagestyle{fancy}
\fancyhf{}
\fancyhead[LE,RO]{\includegraphics{departamentulCalc.png}
}
\fancyhead[RE,LO]{\includegraphics{SIglaUTCN.png} 
}
\setlength\headheight{61pt} 

\fancyfoot[CE,CO]{\leftmark}
\fancyfoot[LE,RO]{\thepage}
\renewcommand{\headrulewidth}{1pt}
\renewcommand{\footrulewidth}{1pt}

\begin{document}

\section{First Section}

Hello,  here  is  some  text  without  a  meaning.   This  
text  should  show  what  a printed text will look like at 
this place.  If you read this text, you will get no information.  
Really?  Is there no information?  Is there a difference between 
this ...

\end{document}

確實插入圖像,但章節中的文字會跳過圖像和頁腳。在此輸入影像描述

知道如何解決這個問題嗎?謝謝 !

答案1

您的程式碼(回答此問題時)無法編譯。我認為應該是這樣的

\documentclass[twoside]{article}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{fancyhdr}
\usepackage{graphicx}

\pagestyle{fancy}
\fancyhf{}
\setlength\headheight{26pt} 
\fancyhead[LE,RO]{
\includegraphics{departamentulCalc.png}
}
\fancyhead[RE,LO]{
\includegraphics{SIglaUTCN.png} 
}
\fancyfoot[CE,CO]{\leftmark}
\fancyfoot[LE,RO]{\thepage}
\renewcommand{\headrulewidth}{1pt}
\renewcommand{\footrulewidth}{1pt}

\begin{document}

\section{First Section}

Hello,  here  is  some  text  without  a  meaning.   This  
text  should  show  what  a printed text will look like at 
this place.  If you read this text, you will get no information.  
Really?  Is there no information?  Is there a difference between 
this ...

\end{document}

當你編譯它時,你會收到一些警告,如下所示:

Package Fancyhdr Warning: \headheight is too small (26.0pt): 
Make it at least 60.70523pt.
We now make it that large for the rest of the document.
This may cause the page layout to be inconsistent, however.

準確地按照它告訴你的去做:\setlength\headheight{61pt}。它會解決問題。

\documentclass[twoside]{article}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{fancyhdr}
\usepackage{graphicx}
\pagestyle{fancy}
\fancyhf{}
\setlength\headheight{61pt} 
\fancyhead[LE,RO]{
\includegraphics[scale=.5]{example-image-duck}
}
\fancyhead[RE,LO]{
\includegraphics[scale=.5]{example-image-duck} 
}
\fancyfoot[CE,CO]{\leftmark}
\fancyfoot[LE,RO]{\thepage}
\renewcommand{\headrulewidth}{1pt}
\renewcommand{\footrulewidth}{1pt}
\begin{document}

\section{First Section}

Hello,  here  is  some  text  without  a  meaning.   This  
text  should  show  what  a printed text will look like at 
this place.  If you read this text, you will get no information.  
Really?  Is there no information?  Is there a difference between 
this ...

\end{document}

在此輸入影像描述

相關內容