[Tex/LaTex] includegraphics missing inserted $ and missing number, treated as zero


I cannot figure out why my command fails in LaTeX.

Here is my problem, this line of code right here causes ! Missing $ inserted.

    \includegraphics[width=\textwidth]{../Thesis\ Results/CaptureNoVibrate/d4c9f2c9-afe0-4693-9a1b-20621a7a1953/algorithm_backprojection_sr.png}

So I changed it to the following and get this error !Missing number, treated as zero.

    \includegraphics[width=\textwidth]{../Thesis\ Results/CaptureNoVibrate/d4c9f2c9-afe0-4693-9a1b-20621a7a1953/algorithm\_backprojection\_sr.png}

I have tried all sorts of variations beyond this, using quotes, not escaping the space, adding { } around the file path, I always end with the errors mentioned.

Here is my file structure:
The previous code is in this file
/Thesis/Thesis Doc/ch4.tex

While the image I'm attempting to load is here

/Thesis/Thesis Results/CaptureNoVibrate/d4c9f2c9-afe0-4693-9a1b-20621a7a1953/alorithm_back_projection_sr.png

I have a separate Matlab script which generates this structure (the result structure), which is why I am using GUIDs in my filepath.

I have checked over the spelling and such multiple times.

Any help is much appreciated.


Here is the base tex document

% Baylor University Master's Thesis LaTeX template
% Template created by Jonathan Drake (2013)

% Thesis class, based on report
        %short, % omit front matter
        %draft,         % draft heading, don't load graphics, etc.

% Optional additional packages
\usepackage{lipsum} % Because this comes with a demo
\usepackage{hyperref}  % for workin links and bookmarks (alexsalo)
\usepackage{bookmark}  % faster bookmarks manegment (alexsalo)

% Thesis parameters
\title{Baylor University Master's Thesis \LaTeX\ Template}
\author{Tyler Hartwig}
\degree{Master of Science}
\date{May 2017}

% Administration
\graduateDean{J. Larry Lyon, Ph.D.}
\department{Department of Electrical and Computer Engineering}
\departmentChair{Gregory D. Speegle, Ph.D.}

% Supervisor (adviser / mentor)
\supervisor{Keith Evan Schubert, Ph.D.}

%  Readers (committee members)
\readerOne{Robert Marks, Ph.D.}
\readerTwo{Byron, Newberry, Ph.D.}
%\readerThree{J. J. J. Heimer-Schmidt, M.D.}

% Abstract
\abstract{Mobile phones and cameras are incredibly popular and the hardware is becoming very impressive. The photos these devices are currently able to take are already of high quality, however it is possible to improve these cameras in software. It is possible to take burst-shot photos and utilize the phase offsets to realize a higher resolution signal. While this takes a large amount of computation, it is possible to reduce that computation by using the IMU devices on mobile phones. This research explores that idea, as well as investigating what signal resolving algorithms produce the highest quality image in combination with the IMU data. IMU sensors are shown to help in reducing the time it takes to register photos to sub-pixel accuracy. It is also shown that the results by using the sensors are comparable to not using these sensors.}

% Acknowledgments (optional)
%\acknowledgements{I want to express my great appreciation to several people.
%Aenean vulputate, est eget tempor dignissim, massa magna dignissim nulla, quis
%pharetra nulla libero ac libero. Cras id ornare augue. Nunc auctor nunc at dolor
%mattis suscipit. Vestibulum eu fringilla est. Morbi elementum varius ornare.
%Nulla vitae nibh sed lectus posuere tincidunt. Praesent sed dignissim turpis.
%Nulla euismod dolor nec nulla ornare blandit.}

% Dedication (optional)
%\dedication{\it Pour la rose qui fait important le temps qu'on perd}

% List of figures (optional)

% List of tables (optional)

% Document body
        \pdfbookmark[-1]{CONTENT}{bookmark:Content}  % Top level bookmark to hold all chapters

        % Chapters

        % Appendices (optional)
        % TODO: make the thesisAppendixPage automagic if the \begin{appendices} exists
                \appendix % Vaclav Cibur compile fix

        % Bibliography
        \bibliographystyle{chicago} % or whatever style your department uses


Here is a repo for the template I am using.

Best Answer

Just a brief summary of the solution from the comments:

The issue lay with the presence of a space in the file address (and some misleading error messages from latex). Your file location was of the form:

\Folder Name\filename.jpg

Therefore you need some quotation marks around the file address in order for latex to handle the spaces correctly. The correct code to insert this image is:

\includegraphics{"Folder Name/filename"}

Note that if no spaces are present in the file name/location, the code will work both with and without the quotation marks (").

Personally, I make a point of avoiding spaces altogether in file and folder names, as it's easy to forget the quotation marks and go off at a tangent trying to figure out why the code has suddenly stopped working, since the error messages can often be bizarre and unhelpful. Hyphens (-) and underscores (_) are usually good replacements for spaces in file names, and latex always handles them without issue.