Latex. Is it possible to have text on top of images?

I want to create something like a latex flyer / magazine. Is it possible to place text on top of the image and freely style the text?

Any links to examples of something like this?

+9
image pdflatex latex
source share
7 answers

I usually do something like

\usepackage{tikz} ... \begin{tikzpicture} \draw (0, 0) node[inner sep=0] {\includegraphics[width=4cm]{imagefile.png}}; \draw (1, 1) node {Hello world}; \end{tikzpicture} 
+17
source share

Very good image processing tools - pgf/TikZ pdf doc .

See \pgfimage for examples. This allows you to freely mix text and image. There are many ways to do this. One of them is to use layers (p. 220 of pgfmanual ). The pgf contains many simple examples and is very accurate.

Another solution is to use the lpic package: the home page contains some examples.

You can find other examples for pfg and TikZ here and here for many impressive examples.

+5
source share

Another solution is the textpos package, which allows you to specify fields in absolute positions on the page. Boxes can overlap, so you can put a shape in one square and text in another box on top of it.

+3
source share

I understand that the question is old and the answer is accepted, but for completeness I would like to suggest an alternative approach for creating leaflets in LaTeX.

In particular, the leaflet style served me very well for this purpose.

A good blog post can be found here here . There are several packages that you need to use in order for the proposed approach to work, but not mentioned in the blog post:

 \usepackage[usenames,dvipsnames]{xcolor} \usepackage{transparent} 
+3
source share

As already suggested, you can annotate different parts of a drawing using TikZ . However, sometimes it’s even better to use numbers to refer to different parts and explain them in the title of the picture.

To easily obtain accurate relative positions (which is often tedious) and automatically generate LaTeX code, you can use the new LaTeX Overlay Generator web interface that I built for such cases. This is just a small interactive tool to help you find the right places.

+1
source share

Another way to do this, admittedly, without using LaTeX, would be to simply edit the image using photoshop or gimp or something like that. I assume that your version from the point of view of math layout can be quite limited, doing it this way.

Otherwise, I would approve of using tikz.

Are you sure you want to do this in LaTeX? Desktop publishing software might be more suitable for your needs ... Something like scribus might be simpler than tikz in terms of learning curve, depending on what you want to do.

0
source share

I would like to add @midtiby's answer ...

You can also specify the position of the text using a relative position, for example like this:

 \usepackage{tikz} ... \begin{tikzpicture} \node[inner sep=0] (image) at (0,0) {\includegraphics[width=4cm]{imagefile.png}}; \node[above=0 of image] {Hello world}; \end{tikzpicture} 
-one
source share

All Articles