39

How to make an example image in LaTeX, a dummy image, a spot holder? I have seen it before, but I can't remember how they would made. It would be nice to be able to use example images - if you should help anyone or you need to question in this community. You might say I could easily Google it, but I tried - and are obviously too stupid to find anything.

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[ngerman, danish]{babel}
\usepackage[T1]{fontenc}
%\usepackage[]{}

\begin{document}

\iffalse
\begin{figure}
\includegraphics[scale=1]{•} 
\end{figure}
\fi

\end{document}

Is it also possible to resize the example image? So I need a usepackage to make an image without including an immage. An placeholder so anyone can try my code without needing images - just needing my tex-code. I hope you understand?

Kind regards!

  • 1
    Related: New support package for MWEs – Werner Mar 6 '15 at 19:04
  • 1
    If I google "dummy images latex", I get the mwe package documentation as the 4th result. – 1010011010 Mar 6 '15 at 19:09
  • 1
    Sounds like you want placeholder images, not examples, right? – Cole Johnson Mar 7 '15 at 2:15
54

Thanks to Martin Scharrer, modern LaTeX systems offer you some ready-to-use images; the documentation for the mwe package (Section 4 Provided Images) describes all available images (initially you had to load to package to use the images, but then the images were made usable without the package):

\documentclass[12pt,a4paper]{article}
\usepackage{graphicx}

\begin{document}

\noindent\includegraphics[width=3cm]{example-image-a}\qquad
\includegraphics[width=3cm]{example-image-golden}\qquad
\includegraphics[width=3cm]{example-grid-100x100pt}

\noindent\includegraphics[height=5cm]{example-image-b} 

\noindent\includegraphics[scale=0.5]{example-image-c} 

\noindent\includegraphics[width=3cm]{example-image} 

\end{document}

enter image description here

  • It seams example-image stops at c. Is it possible to get example-image-d? – Viesturs Oct 5 '18 at 11:45
  • 3
    @Viesturs There is example-image-duck nowadays :) – TeXnician Oct 9 '18 at 15:33
5

The documentation folder of PStricks contains some images in a separate folder. Most notably it holds tiger (in both EPS and PDF formats):

enter image description here

\documentclass{article}
\usepackage{graphicx}
\begin{document}
\includegraphics[width=150pt]{c:/texlive/2014/texmf-dist/doc/generic/pstricks/images/tiger}
\end{document}

As can be seen above (under TeX Live 2014 in Windows) it's not that readily accessible.

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.