In an Overleaf article I import a PNG file produced with GIMP as follows:

    \caption{\label{fig:global_time_space}Global time-space representation}

And I get an error:

./global_time_space_v02.png:2: Text line contains an invalid character. l.2 ^^Z

If I convert to JPG or TIFF the same error occurs with different characters:

./Figures/global_time_space_v02.jpg:1: Package inputenc Error: Keyboard charact er used is undefined (inputenc) in inputencoding `utf8'. See the inputenc package documentation for explanation. Type H <return> for immediate help. ... l.1 � ���^^@^^PJFIF^^@^^A^^A^^@^^@^^A^^@^^A^^@^^@��^^@C^^@^^H^^F^^F^^G^^F^^E^...

I am using \usepackage[utf8]{inputenc}

  • 2
    You need \includegraphics{global_time_space_v02} not \input (and naturally the graphicx package). – Ulrike Fischer Jul 13 '18 at 12:12
  • 1
    Voting to close as the problem has been solved in the comments. – hpekristiansen Jul 13 '18 at 12:30

As Ulrike Fischer proposed, it needs \includegraphics{global_time_space_v02} and not \input{global_time_space_v02.png} (and naturally the graphicx package).

| improve this answer | |

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