I can do
\textcolor{red}{
\fbox{
\includegraphics{path}
}
}
To get a red frame sitting tightly around an image inside a firgure
environment. Now, is there a way to also get a red cross over the image?
Kind regards.
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this communityA TikZ solution that includes the image file inside a tikzpicture
and draws a square and cross relative to the coordinates of the image:
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\node[inner sep=0] (image) at (0,0) {\includegraphics[width=0.5\textwidth]{example-image}};
\draw[red,ultra thick] (image.south east) -- (image.north west);
\draw[red,ultra thick] (image.north east) -- (image.south west);
\draw[red,ultra thick] (image.south west) rectangle (image.north east);
\end{tikzpicture}
\end{document}
\draw[red,ultra thick] (image.south west) rectangle (image.north east); \draw[red,ultra thick] (image.south east) -- (image.north west); \draw[red,ultra thick] (image.north east) -- (image.south west);
;-)
ultra thick
(then it's also more similar to \fbox
) but I guess that's a matter of taste.
as supplement to @Marjin answer (+1), a little bit shorter code ...
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\node (image) [inner sep=0] {\includegraphics[width=0.5\textwidth]{example-image}};
\draw[red,ultra thick] (image.south west) -- (image.north east)
(image.north west) -- (image.south east)
(image.south west) rectangle (image.north east);
\end{tikzpicture}
the result is similar: