I am using a newcommand to define how the chapters show up on the manuscript and ToC. That worked fine. Then, I wanted to place an image (logo) next to the page number in each page. It works, but I get the Missing $ inserted error for the lines where I make use of the newcommand (\mychapter) and for \end{document}.
Additionally, I want to align vertically the image with the page number. I tried with parbox but it didn't change anything.
Here is my MWE. In the original document (on Overleaf) I use input files and the error is the same.
Thanks for any tips.
Code: Select all
\documentclass[11pt]{report}
\usepackage[utf8]{inputenc}
\usepackage[a4paper, total={170mm,257mm},
left=20mm,
top=20mm,]{geometry}
\usepackage{graphicx}
\usepackage{fancyhdr}
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\fancypagestyle{plain}
{
\cfoot{ Page \thepage \ \vert \ \includegraphics[scale=0.1] {example-image-a}}
}
%%% change font %%%
\renewcommand{\sfdefault}{phv}
\renewcommand{\familydefault}{\sfdefault}
%%% set path of figures folder
\graphicspath{ {figures/} }
%%% packages %%%
\usepackage{enumitem}
\usepackage{float}
\usepackage{xcolor}
\usepackage{cancel}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{parskip}
\usepackage{svg}
\usepackage{accents}
\usepackage{mwe} % For dummy images
\usepackage{subcaption}
\usepackage{wrapfig}
\usepackage[hidelinks]{hyperref} % disable hidelinks to show boxes
\usepackage{cleveref}
\usepackage{wrapfig}
\usepackage{comment}
\usepackage{cancel}
\usepackage{rotating}
\usepackage{pdflscape}
\usepackage{csquotes}
\usepackage[version=4]{mhchem} %chemical
\usepackage[acronym]{glossaries} % acronyms page
\usepackage{blindtext}
%%% define colors and change %%%
\definecolor{blue1}{HTML}{045474}
\definecolor{green1}{HTML}{34b434}
\definecolor{darkblue1}{HTML}{042464}
\usepackage{sectsty}
\chapterfont{\color{blue1}} % sets colour of chapters
\sectionfont{\color{green1}} % sets colour of sections
%%% displaystyle for math mode %%%
\everymath{\displaystyle}
%% change name of Contents (ToC) %%%
\renewcommand{\contentsname}{Table of Contents}
%%% new command to hide chapter numbers %%%
\newcommand{\mychapter}[2]{
\setcounter{chapter}{#1}
\setcounter{section}{0}
\chapter*{#2}
\addcontentsline{toc}{chapter}{#2}
}
\begin{document}
\begin{titlepage}
%\raggedright
%\includegraphics[width = 7cm]{figures/wurlogo.png}\\[8ex]
\begin{center}
\vspace*{2cm}
\textbf{\large title}
\vspace{1cm}
\vspace{0.2cm}
\vfill
Department \\
Place\\
\today
\end{center}
\end{titlepage}
\chapter*{Executive Summary}
\blindtext
\thispagestyle{empty}
\tableofcontents
\thispagestyle{empty}
\listoffigures
\thispagestyle{empty}
\listoftables
\thispagestyle{empty}
\clearpage
\mychapter{1}{Introduction}
\blindtext
\appendix
\mychapter{2}{Appendix}
\end{document}