Issues importing a png file to Latex

1,289

With deactivated shorthands and correct path to the file it should work:

\shorthandoff{"}
\includegraphics[scale=0.5]{"Key Category colors 8"}
\shorthandon{"}

Nevertheless, I would recommend not to use white spaces in file names. Rename Key Category colors 8.png to, e.g., Key-Category-colors-8.png and use:

\includegraphics[scale=0.5]{Key-Category-colors-8}

Images/ as part of the file name argument is not needed, because you have already \graphicspath{{Images/}}.

Share:
1,289

Related videos on Youtube

Deb
Author by

Deb

Updated on August 01, 2022

Comments

  • Deb
    Deb over 1 year

    I'm having trouble compiling my document since I added a figure to it. Checked the other related questions, but so far solutions did not apply... I'd be thankful for your insights! This is what the set up looks like:

    \documentclass[12pt, oneside]{article}
    
    \usepackage{fontspec}
    \usepackage{libertine}
    %\usepackage[utf8]{inputenc}
    \usepackage[portuguese, german, spanish, english]{babel}
    \usepackage[autostyle]{csquotes}
    \usepackage[a4paper,width=150mm,top=25mm,bottom=25mm, bindingoffset=6mm]{geometry}
    \usepackage{graphicx}
    \graphicspath{ {Images/} }
    ...
    \begin{figure}[p]
    \centering
    \includegraphics[scale=0.5]{"Images/Key Category colors 8"}
    \caption{Visual representation ...}
    \label{fig:1}
    \end{figure}
    
  • Deb
    Deb over 6 years
    Thank you, it worked :) The tip about the file names did the trick!
  • Schweinebacke
    Schweinebacke over 6 years
    @Deb: Please have a look at the tour (already linked in the welcome comment) to see how "thank you" can be done by voting for (or accepting) an answer.