2

I would like to use the tikz package to draw over an image. I followed the instructions found here.

\documentclass[twocolumn,10pt]{article}

\usepackage{lipsum}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}
\node[anchor=south west,inner sep=0] at (0,0) {\includegraphics[width=1.0\textwidth]{image}};
\draw[red] (7.5,5.3) rectangle (9.4,6.2);
\end{tikzpicture}

\lipsum
\end{document}

However I'm working in two columns mode and, since my image is large and should span along the entire width of the page, the text overlaps with the image as shown here:

enter image description here

Generally I use * to overcome the problem but the enviroment tikzpicture doesn't allow it.

FlyBob
  • 169
  • It would be great if you could show us what you have tried. Posting a minimal working example that indicates what you are trying to do makes it easier for people to understand what you want. It also makes it easier for people to help you, since they have some code to start from, and hence much more likely that some one will try to help you. Related? https://tex.stackexchange.com/questions/398584/image-with-some-overlaid-text –  Feb 16 '20 at 13:24
  • Pure guessing: \begin{tikzpicture} \node (n1) [inner sep=0] {\includegraphics[width=\linewidth]{image/ultimate1}}; \node (n2) [red,ultra thick,rounded corners, minimum width=19mm, minimum height=9mm, above5mm] (n1.south) {}; \end{tikzpicture}. See if it fit in one column of your document. For more particular help you need to provide MWE. – Zarko Feb 16 '20 at 14:01
  • However, if should be over two column, you need to enclose it in float environment figure* and than try with your code snippet. your question is unclear. – Zarko Feb 16 '20 at 14:04

1 Answers1

1

It is not clear, what you like to have. Image over two columns? than enclose it in figure?* environment:

enter image description here

Image will appear on the top of the next page, or with employing package stfloats can be placed on the bottom (using [b] position specifier) or on the top (using [t] position specifier)of the same page, if there is enough space for it:

\documentclass[twocolumn,10pt]{article}
\usepackage{graphicx}
\usepackage{stfloats} % for positioning of figure* on the same page
\usepackage{tikz}

\usepackage{lipsum}

\begin{document}
\lipsum[66]

    \begin{figure*}
\begin{tikzpicture}
\node[anchor=south west,inner sep=0] at (0,0) {\includegraphics[width=1.0\textwidth]{example-image-duck}};
\draw[red] (7.5,5.3) rectangle (9.4,6.2);
\end{tikzpicture}
    \caption{May image}
\label{fig:tikz}
    \end{figure*}
\lipsum
\end{document}    
Zarko
  • 296,517
  • Hello Zarko, you got it. Excuse me but i couldn't explain it better. The problem was that I didn't use the figure enviroment to include the tikzpicture one – FlyBob Feb 16 '20 at 14:31
  • @FlyBob, please answer your own question with your solution (or close/delete it if you think it isn't relevant anymore, perhaps ask a new question with what you learned and answer it yourself). – vonbrand Feb 17 '20 at 03:23