
--- ПРАВКА 2 ---
Я создал следующий заголовок с помощью редактора изображений, чтобы помочь вам понять, что я пытаюсь сделать.
--- Конец РЕДАКТИРОВАНИЯ 2 ---
--- ПРАВКА 1 ---
Это ближе к тому, что у меня в заголовке. Только вместо того, чтобы писать "Глава 1" и "Подраздел", я использую \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
после your \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}