Crossed out red box fitting tightly around image
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.
graphics boxes
add a comment |
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.
graphics boxes
add a comment |
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.
graphics boxes
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.
graphics boxes
graphics boxes
asked 4 hours ago
sigvaldmsigvaldm
1384
1384
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
A 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.5textwidth]{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}
My compliments for your answer. I have deleted my previous comment for the OP.
– Sebastiano
4 hours ago
1
Even shorter: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);
;-)
– AndiW
4 hours ago
@AndiW Better indeed :) I've edited my answer.
– Marijn
4 hours ago
1
Thanks to all of you. When changing the answer, you forgot one of the diagonals in the cross. You might want to fix that. Personally I also liked it better withoutultra thick
(then it's also more similar tofbox
) but I guess that's a matter of taste.
– sigvaldm
3 hours ago
add a comment |
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.5textwidth]{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:
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f487546%2fcrossed-out-red-box-fitting-tightly-around-image%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
A 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.5textwidth]{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}
My compliments for your answer. I have deleted my previous comment for the OP.
– Sebastiano
4 hours ago
1
Even shorter: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);
;-)
– AndiW
4 hours ago
@AndiW Better indeed :) I've edited my answer.
– Marijn
4 hours ago
1
Thanks to all of you. When changing the answer, you forgot one of the diagonals in the cross. You might want to fix that. Personally I also liked it better withoutultra thick
(then it's also more similar tofbox
) but I guess that's a matter of taste.
– sigvaldm
3 hours ago
add a comment |
A 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.5textwidth]{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}
My compliments for your answer. I have deleted my previous comment for the OP.
– Sebastiano
4 hours ago
1
Even shorter: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);
;-)
– AndiW
4 hours ago
@AndiW Better indeed :) I've edited my answer.
– Marijn
4 hours ago
1
Thanks to all of you. When changing the answer, you forgot one of the diagonals in the cross. You might want to fix that. Personally I also liked it better withoutultra thick
(then it's also more similar tofbox
) but I guess that's a matter of taste.
– sigvaldm
3 hours ago
add a comment |
A 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.5textwidth]{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}
A 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.5textwidth]{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}
edited 3 hours ago
answered 4 hours ago
MarijnMarijn
8,829639
8,829639
My compliments for your answer. I have deleted my previous comment for the OP.
– Sebastiano
4 hours ago
1
Even shorter: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);
;-)
– AndiW
4 hours ago
@AndiW Better indeed :) I've edited my answer.
– Marijn
4 hours ago
1
Thanks to all of you. When changing the answer, you forgot one of the diagonals in the cross. You might want to fix that. Personally I also liked it better withoutultra thick
(then it's also more similar tofbox
) but I guess that's a matter of taste.
– sigvaldm
3 hours ago
add a comment |
My compliments for your answer. I have deleted my previous comment for the OP.
– Sebastiano
4 hours ago
1
Even shorter: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);
;-)
– AndiW
4 hours ago
@AndiW Better indeed :) I've edited my answer.
– Marijn
4 hours ago
1
Thanks to all of you. When changing the answer, you forgot one of the diagonals in the cross. You might want to fix that. Personally I also liked it better withoutultra thick
(then it's also more similar tofbox
) but I guess that's a matter of taste.
– sigvaldm
3 hours ago
My compliments for your answer. I have deleted my previous comment for the OP.
– Sebastiano
4 hours ago
My compliments for your answer. I have deleted my previous comment for the OP.
– Sebastiano
4 hours ago
1
1
Even shorter:
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);
;-)– AndiW
4 hours ago
Even shorter:
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);
;-)– AndiW
4 hours ago
@AndiW Better indeed :) I've edited my answer.
– Marijn
4 hours ago
@AndiW Better indeed :) I've edited my answer.
– Marijn
4 hours ago
1
1
Thanks to all of you. When changing the answer, you forgot one of the diagonals in the cross. You might want to fix that. Personally I also liked it better without
ultra thick
(then it's also more similar to fbox
) but I guess that's a matter of taste.– sigvaldm
3 hours ago
Thanks to all of you. When changing the answer, you forgot one of the diagonals in the cross. You might want to fix that. Personally I also liked it better without
ultra thick
(then it's also more similar to fbox
) but I guess that's a matter of taste.– sigvaldm
3 hours ago
add a comment |
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.5textwidth]{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:
add a comment |
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.5textwidth]{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:
add a comment |
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.5textwidth]{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:
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.5textwidth]{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:
answered 4 hours ago
ZarkoZarko
131k869170
131k869170
add a comment |
add a comment |
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f487546%2fcrossed-out-red-box-fitting-tightly-around-image%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown