In the preamble of my thesis, I get the following error, when I write \newpage:
Undefined control sequence. LaTex Error: File ´' not found.
Note that I have 2 x \newpage in the code below, but it's only the second of these that creates a problem. I have tried to write \clearpage instead, but this gives the same answer.
Can anyone see what might have caused the error?
\documentclass[oneside]{article}
%%%% packages
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage{footnote}
\usepackage{csquotes}
\usepackage{eso-pic}
\usepackage[dvipdfm]{graphicx}
\usepackage{bmpsize}
\usepackage[a4paper, hmargin={2.5cm, 3cm}, vmargin={3cm, 3cm}]{geometry}
\usepackage{fancyhdr}
\graphicspath{ {figures/} }
\usepackage{array}
\usepackage[titletoc]{appendix}
\usepackage{tcolorbox}
\usepackage{tabularx}
\usepackage{multirow}
\usepackage{topcapt}
\usepackage{marginnote}
\usepackage{threeparttable}
\usepackage[font=small,format=plain,labelfont=bf,textfont=normal,justification=justified,singlelinecheck=false]{caption}
\usepackage{booktabs}
\usepackage{amsmath}
\usepackage{setspace}
\usepackage{parskip}
\usepackage{float}
\usepackage{wrapfig}
\usepackage[style=apa, citestyle=apa, sorting=nyt ]{biblatex}
\addbibresource{Biblo.bib}
\pagestyle{fancy}
\usepackage{etoolbox}\apptocmd\appendix{\pretocmd\section{\clearpage}{}{}}{}{}
\usepackage{subfiles}
% commands
\setstretch{1.25}
\newcommand{\margmod}[1]{\marginnote{\setstretch{.5}\parbox[t]{\marginparwidth}{\raggedright\emph{#1}}}}
\author{
\LARGE{My name} \
\vspace{0cm} \
{Academic Supervisor: Supervisor name} \
\vspace{.5cm} \
}
\title{
\vspace{3mm}
\Huge{Master's Thesis}\
\vspace{18mm}
\LARGE{Name of thesis}
\vspace{90mm}
}
\date{February 2022}
%%%% Layout style
\linespread{1.5}
\fancyhead[L]{}
\fancyhead[R]{\slshape \rightmark}
\setlength{\parskip}{1em}
\usepackage{tikz}
\usetikzlibrary{calc,matrix}
\usepackage{lipsum}
\newcommand{\Maroonunderline}[1]{{\color{Maroon}\underline{{\color{black}#1}}}}
\definecolor{Maroon_1}{RGB}{144,26,30}
%%%% Frontpage layout
\begin{document}
\pagenumbering{roman}
\AddToShipoutPicture{\put(0,602){\includegraphics[viewport=0 600 700 1600]{\ColourPDF}}} % adds frontpage image
\AddToShipoutPicture{\put(0,0){\includegraphics{\TitlePDF}}}
\thispagestyle{empty}
\newpage % This one doesn't create any trouble
%%%% Meta info
\begin{table}[!ht]
\begin{tabular}{lll}
\vspace{5mm}
\textbf{University} & & {University of Copenhagen} \
\vspace{5mm}
\textbf{Name of Department} & & {Department of Political Science} \
\vspace{5mm}
\textbf{Study Programme} & & {Master of Science (MSc) in Political Science} \
\vspace{5mm}
\textbf{Author} & & {My name} \
\vspace{5mm}
\textbf{Student ID} & & {My student ID} \
\vspace{5mm}
\textbf{Academic Supervisor} & & {Supervisor name} \
\textbf{Title} & & {Title of thesis} \
% \vspace{5mm}
%\textbf{Subtitle} & & {Subtitle} \
%\vspace{5mm}
\
\textbf{Date of Submission} & & {March 20, 2021} \
% \vspace{5mm}
\
\textbf{ECTS} & & {30} \
\end{tabular}
\end{table}
\newpage % This line creates the problem
Updated code and picture of issue with graphics issue (based on answer to samcarter_is_at_topanswers):
%%%% Packages
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage{footnote}
\usepackage{csquotes}
\usepackage[style=apa, citestyle=apa, sorting=nyt ]{biblatex}
\addbibresource{Biblo.bib}
\usepackage{eso-pic}
\usepackage{graphicx}
\usepackage[a4paper, hmargin={2.5cm, 3cm}, vmargin={3cm, 3cm}]{geometry}
\usepackage{fancyhdr}
\graphicspath{ {figures/} }
\usepackage{array}
\usepackage[titletoc]{appendix}
\usepackage{tcolorbox}
\usepackage{tabularx}
\usepackage{multirow}
\usepackage{marginnote}
\usepackage{threeparttable}
\usepackage[font=small,format=plain,labelfont=bf,textfont=normal,justification=justified,singlelinecheck=false]{caption}
\usepackage{amsmath}
\usepackage{setspace}
\usepackage{parskip}
\usepackage{float}
\pagestyle{fancy}
\usepackage{etoolbox}\apptocmd\appendix{\pretocmd\section{\clearpage}{}{}}{}{}
\usepackage{subfiles}
% Extra packages
\usepackage[T1]{fontenc}
\usepackage{bmpsize}
\usepackage{topcapt}
\usepackage{booktabs}
\usepackage{wrapfig}
% commands
\setstretch{1.25}
\newcommand{\margmod}[1]{\marginnote{\setstretch{.5}\parbox[t]{\marginparwidth}{\raggedright\emph{#1}}}}
% Front page
\def \ColourPDF {Images/Metaimages/Front page_Political Science.pdf}
\def \TitlePDF {Images/Metaimages/Front page_Political Science.pdf}
\author{
\LARGE{My name} \
\vspace{0cm} \
{Academic Supervisor: Supervisor name} \
\vspace{.5cm} \
}
\title{
\vspace{3mm}
\Huge{Master's Thesis}\
\vspace{18mm}
\LARGE{Name of thesis}
\vspace{90mm}
}
\date{February 2022}
%%%% Layout style
\linespread{1.5}
\fancyhead[L]{}
\fancyhead[R]{\slshape \rightmark}
\setlength{\parskip}{1em}
%%%% Frontpage layout
\begin{document}
\pagenumbering{roman}
\AddToShipoutPicture{\put(0,602){\includegraphics[viewport=0 600 700 1600]{example-image}}} % adds frontpage image
\AddToShipoutPicture{\put(0,0){\includegraphics{example-image}}}
\thispagestyle{empty}
\newpage
%%%% Meta info
\begin{table}[!ht]
\begin{tabular}{lll}
\vspace{5mm}
\textbf{University} & & {University of Copenhagen} \
\vspace{5mm}
\textbf{Name of Department} & & {Department of Political Science} \
\vspace{5mm}
\textbf{Study Programme} & & {Master of Science (MSc) in Political Science} \
\vspace{5mm}
\textbf{Author} & & {My name} \
\vspace{5mm}
\textbf{Student ID} & & {My student ID} \
\vspace{5mm}
\textbf{Academic Supervisor} & & {Supervisor name} \
\textbf{Title} & & {Title of thesis} \
% \vspace{5mm}
%\textbf{Subtitle} & & {Subtitle} \
%\vspace{5mm}
\
\textbf{Date of Submission} & & {March 20, 2021} \
% \vspace{5mm}
\
\textbf{ECTS} & & {30} \
\end{tabular}
\end{table}
\newpage
Start of thesis..
\end{document}

\ColourPDFand\TitlePDF, I don't get any output at all - only two blank pages. Do you have any idea why that is? A good thing though: When I comment out\ColourPDF,\TitlePDFand the twoaddtoShipoutPicturelines, the\newpageerror goes away. So you were right that the error was caused be this :) – Nicolai MC Feb 10 '22 at 11:23graphicxpackage, I get the error "cannot determine size of graphic in X... (no BoundingBox)" for all the graphics (images) that I have included in the text. Before, when I specified a driver with\usepackage[dvipdfm]{graphicx}, I didn't get the same error for my graphics, although the images weren't actually shown in the output - apart from the caption, notes and the "outline" of the image (the picture above shows an example). Any idea what is causing these issues with the graphics?LaTeXcompiler with PDF files? Much easier to use the defaultpdflatexcompiler. – daleif Feb 11 '22 at 10:43