68

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!

2 Answers2

93

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

Gonzalo Medina
  • 505,128
6

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.

Werner
  • 603,163