1

**EDIT: The solution to my problem was editing the graphicspath to: \graphicspath{‪{images/}} **

I am trying to include a figure but I'm getting a myriad of error messages for the same line of code. My preamble:

\documentclass[a4paper,11pt]{article}
\usepackage[
    %backend=biber,
    natbib=true,
    style=numeric,
    sorting=none
]{biblatex}
\addbibresource{referenzen.bib}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{csquotes}
\usepackage{textalpha}
\usepackage{amsmath,amsthm,amssymb}
\usepackage[version=4]{mhchem}

\usepackage{graphicx} 
\graphicspath{‪C:/Users/user/Desktop/Latexgrob/images/}

Calling the figure:

\begin{figure}
\begin{center}
\includegraphics[width=4cm]{lightresponse.jpg}
\caption{Schematisches Diagramm der Photosyntheserate}
\end{center}
\end{figure}

The error log says:

! Package inputenc Error: Invalid UTF-8 byte sequence.
! Undefined control sequence.\GenericError #4 \errhelp \@err@
The control sequence at the end of the top line of your error message was never \def'ed.
!Undefined control sequence.\GenericError... \let \@err@
!Undefined control sequence.\GenericError....\@empty \def \MessageBreak

and so on. I attached a picture with all of them. File compiles just fine without the picture. Could someone help me? enter image description here

  • 1
    I bet your real user name is not "user" but contains some non-ascii char. Better remove the \graphicspath{‪C:/Users/user/Desktop/Latexgrob/images/} and put the graphic is some better place. Btw: there is a brace level missing in the graphicspath command. – Ulrike Fischer Jul 16 '19 at 8:11
  • also if you do use graphicspath you need a brace group around the path \graphicspath{{‪C:/Users/user/Desktop/Latexgrob/images/}} but your document would be more portable if you just used a relative path from your main document – David Carlisle Jul 16 '19 at 8:23
  • @UlrikeFischer Hey, thanks for your answer! When I check the properties of the folder, the Users/user/ thing is indeed the given directory path. I added one more brace on each side to the graphicspath command but that didn't solve the issue. – slemdal Jul 16 '19 at 8:25
  • is is really "user" or is there your real name? – Ulrike Fischer Jul 16 '19 at 8:25
  • @DavidCarlisle I added one more brace on each side, but it didn't help unfortunately. Could you give me an example for a "relative path from my main document"? Not really sure I understand what you mean. – slemdal Jul 16 '19 at 8:28
1

If I copy & paste your graphicspath command and inspect it with an editor that can show invisible unicode chars (in this case with winedt) I see this:

enter image description here

The U+202A (left-to-right embedding) is the problem.

Removing this char (by deleting the surrounding chars and retyping) and adding the missing braces should resolve the problem

 \graphicspath{{C:/Users/user/Desktop/Latexgrob/images/}}

As the main document is in Latexgrob it is much better so use a relative path:

 \graphicspath{{images/}}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.