
--- 편집 2 ---
제가 하려는 작업을 여러분의 이해를 돕기 위해 이미지 편집기를 사용하여 다음 헤더를 만들었습니다.
--- 편집 2 끝 ---
--- 편집 1 ---
이것은 내 헤더에 있는 내용에 더 가깝습니다. 실제로 "Chapter 1"과 "Subsection"을 쓰는 대신 \rightmark와 \leftmark를 사용하고 있지만 결과는 기본적으로 동일합니다. 물론 저는 다른 이미지를 사용하고 있습니다. 문제는 이미지를 가로지르는 선에 있습니다. 아니면 헤더 줄의 길이와 관련이 있을 수도 있습니다.
--- 편집 1 끝 ---
좋아, 여기저기서 검색해 봤는데 답을 찾을 수 없는 것 같아. 이미지와 헤더 줄 사이에 공백을 두어 줄이 이미지를 가로지르지 않게 하는 방법을 아는 사람이 있나요? 이것이 내가 지금까지 가지고 있는 것입니다.
\documentclass[12pt,twoside]{report}
\usepackage{graphicx}
\usepackage{fancyhdr}
\usepackage{blindtext}
\pagestyle{fancy}
% ---------------------------- Header ---------------------------- %
\fancyhead{}
\fancyhead[RE,RO]{\nouppercase{Subsection 1.1}}
\fancyhead[CO,CE]{\MakeUppercase{Chapter 1}}
\fancyhead[L]{\raisebox{-.6\height}[0pt][0pt]{\includegraphics[width=1cm]{example-image-a}}}
% ---------------------------- Footer ---------------------------- %
\fancyfoot{}
\fancyfoot[RE,RO]{\thepage}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}
\begin{document}
\blindtext
\end{document}
답변1
간단한 솔루션은 \headrule
배치를 미세 조정하기 위해 재정의됩니다.
\documentclass[12pt,twoside]{report}
\usepackage{graphicx}
\usepackage{fancyhdr}
\usepackage{blindtext}
\pagestyle{fancy}
% ---------------------------- Header ---------------------------- %
\fancyhead{}
\fancyhead[RE,RO]{\nouppercase{Subsection 1.1}}
\fancyhead[CO,CE]{\MakeUppercase{Chapter 1}}
\fancyhead[L]{\raisebox{-.7\height}[0pt][0pt]{\includegraphics[width=1cm]{example-image-a}}}
% ---------------------------- Footer ---------------------------- %
\fancyfoot{}
\fancyfoot[RE,RO]{\thepage}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}
\renewcommand{\headrule}{\hspace*{1.2cm}\rule[2ex]{\dimexpr\textwidth-1.2cm}{0.4pt}}
\begin{document}
\blindtext
\end{document}
답변2
\vspace
트릭을 수행해야 뒤에 추가 하십시오 \includegraphics
. Razebox가 필요하지 않습니다:
\documentclass[12pt,twoside]{report}
\usepackage{graphicx}
\usepackage{fancyhdr}
\usepackage{blindtext}
\pagestyle{fancy}
% ---------------------------- Header ---------------------------- %
\fancyhead{} % blank \fancyhead command which clears all the header fields.%
% --------- The lines below are commented because I'm using in the original file, but I think that there is no need for it in here. ---------
% \fancyhead[RE,RO]{\nouppercase{\rightmark}}
% \renewcommand{\chaptermark}[1]{%
% \markboth{#1}{}}
% \fancyhead[CO,CE]{\MakeUppercase{\leftmark}}
\fancyhead[L]{\includegraphics[width=1cm]{example-image-a}\vspace{3pt}}
% ---------------------------- Footer ---------------------------- %
\fancyfoot{} %Clears the footer fields using a blank \fancyfoot command.%
\fancyfoot[RE,RO]{\thepage} % makes the page number appear on the right of the footer for an even page and the right for an odd. The \thepage command returns the page number of the page it's used on.
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}
\begin{document}
\blindtext
\end{document}