Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I write some of my network notes in TeX. I wanted to make a table, and inside it insert an image:

see it here.

I wrote a document:

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{booktabs}
\usepackage{array}

\begin{document}
\begin{tabular}{m{3cm}m{3cm}m{5cm}}
\toprule
Configuration for ... & Commands & Topology\\
\midrule
PPP: CHAP, PAP & \#sh int se 0/0/0  & \includegraphics[width=4cm, height=4cm]{chappap.png}\\
 & & \\
\bottomrule
\end{tabular}
\end{document}

But instead of my network topology image, I see only this: black picture.

I don't know what is wrong, cause my image is 100% in the same dir, as my *.tex file.

EDIT:

Changed my code as @Jubobs suggsted, no everything is just fine:

\documentclass{article}
    \usepackage{graphicx}
    \usepackage{booktabs}
    \usepackage{array}

    \begin{document}
    \begin{tabular}{m{3cm}m{3cm}m{5cm}}
    \toprule
    Configuration for ... & Commands & Topology\\
    \midrule
    PPP: CHAP, PAP & \#sh int se 0/0/0  & \includegraphics[width=4cm, height=4cm]{chappap.png}\\
     & & \\
    \bottomrule
    \end{tabular}
    \end{document}
share|improve this question
10  
That's what happens when the demo option is passed to the graphicx package: all external pictures are replaced by black rectangles. Do you also get the black rectangle without that option? –  Jubobs May 4 '13 at 20:00
    
@Jubobs: Geez, didnt think about that it can be 'the problem' here. Thanks :D –  Katie May 4 '13 at 20:03
    
@Katie If you're happy with it, could you please accept my answer? That will reduce the clutter in the "unanswered" section of the site :) –  Jubobs May 5 '13 at 12:24
1  
@Jubobs: Sorry that made it so late but done! Accepted your answer, thanks again;) –  Katie May 5 '13 at 15:24
add comment

1 Answer

up vote 6 down vote accepted

That's what happens when the demo option is passed to the graphicx package (as in your MWE). That option is described in the graphicx manual:

demo: Instead of inserting an image file \includegraphics draws a 150 pt by 100 pt rectangle unless other dimensions are specified manually.

If you want the actual external picture to be included by \includegraphics{...},

  1. disable the demo option,
  2. make sure that the path to that picture specified in \includegraphics{...} is correct.

Note that you will get an error from LaTeX, not merely a black rectangle, if the path to your external picture is incorrect.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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