draw border around edge of symbol
Is it possible to draw a (coloured) border around the edge of a LaTeX symbol?
For instance, I would like to draw a black border around the edge of
a bigstar
. So, something like this
Below a very short MWE
documentclass[tikz,border=10pt]{standalone}
usepackage{tikz}
usepackage{amssymb}
begin{document}
begin{tikzpicture}[scale = 0.5]
node [yellow] at (0,0,0) {$bigstar$};
end{tikzpicture}
end{document}
I searched for solutions, but I only get squared frames around basically anything, but not what I'm after. Any idea? Cheers
tikz-pgf draw
add a comment |
Is it possible to draw a (coloured) border around the edge of a LaTeX symbol?
For instance, I would like to draw a black border around the edge of
a bigstar
. So, something like this
Below a very short MWE
documentclass[tikz,border=10pt]{standalone}
usepackage{tikz}
usepackage{amssymb}
begin{document}
begin{tikzpicture}[scale = 0.5]
node [yellow] at (0,0,0) {$bigstar$};
end{tikzpicture}
end{document}
I searched for solutions, but I only get squared frames around basically anything, but not what I'm after. Any idea? Cheers
tikz-pgf draw
add a comment |
Is it possible to draw a (coloured) border around the edge of a LaTeX symbol?
For instance, I would like to draw a black border around the edge of
a bigstar
. So, something like this
Below a very short MWE
documentclass[tikz,border=10pt]{standalone}
usepackage{tikz}
usepackage{amssymb}
begin{document}
begin{tikzpicture}[scale = 0.5]
node [yellow] at (0,0,0) {$bigstar$};
end{tikzpicture}
end{document}
I searched for solutions, but I only get squared frames around basically anything, but not what I'm after. Any idea? Cheers
tikz-pgf draw
Is it possible to draw a (coloured) border around the edge of a LaTeX symbol?
For instance, I would like to draw a black border around the edge of
a bigstar
. So, something like this
Below a very short MWE
documentclass[tikz,border=10pt]{standalone}
usepackage{tikz}
usepackage{amssymb}
begin{document}
begin{tikzpicture}[scale = 0.5]
node [yellow] at (0,0,0) {$bigstar$};
end{tikzpicture}
end{document}
I searched for solutions, but I only get squared frames around basically anything, but not what I'm after. Any idea? Cheers
tikz-pgf draw
tikz-pgf draw
asked Dec 11 '18 at 18:01
andrea
1127
1127
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
Basic
documentclass[preview,border=12pt,varwidth,dvipsnames]{standalone}
usepackage{contour}
usepackage{xcolor,amssymb}
contourlength{0.5pt} % thickness
contournumber{10} % number of replication
begin{document}
huge
contour{orange}{$bigstar$}
end{document}
Miscellaneous
The following example is not impossible but it takes much time and energy with PSTricks, let alone TikZ.
documentclass[preview,border=12pt,varwidth,dvipsnames]{standalone}
usepackage{contour}
usepackage{xcolor,amsmath}
usepackage{CJK}
contourlength{0.2pt} % thickness
contournumber{10} % number of replication
begin{document}
huge
begin{CJK}{UTF8}{min}
begin{center}
contour{orange}{気持ちは}
end{center}
[
contour{red}{$sqrt{x^2}$},
contour{green}{$not=$},
contour{blue}{$x$}
]
begin{center}
contour{cyan}{言い表しにくいです}
end{center}
end{CJK}
end{document}
contour{red}{$sqrt{x^2}$}, contour{green}{$not=$}, contour{blue}{$x$}
should becontour{red}{$mathsurround=0ptdisplaystylesqrt{x^2}$} mathrel{contour{green}{$mathsurround=0ptdisplaystyleneq$}} contour{blue}{$mathsurround=0ptdisplaystyle x$}
– Henri Menke
Dec 12 '18 at 2:01
these are both great answers, thank you guys. now the dilemma: which one to accept? Is there some criteria? I don't want to be unjust with @marmot
– andrea
Dec 12 '18 at 9:25
add a comment |
I guess the most simple-minded approach would be to draw the node in black and a bit larger underneath. Notice that you need to add transform shape
for the scale=0.5
to affect the node.
documentclass[tikz,border=10pt]{standalone}
usepackage{tikz}
usepackage{amssymb}
begin{document}
begin{tikzpicture}[scale = 0.5,transform shape]
node [black,scale=1.2] at (0,0,0) {$bigstar$};
node [yellow] at (0,0,0) {$bigstar$};
end{tikzpicture}
end{document}
contour
, as suggested in this answer does basically the same. However, TikZ also has star symbols built in. Why not use those?
documentclass[tikz,border=10pt]{standalone}
usepackage{tikz}
usetikzlibrary{shapes.geometric}
begin{document}
begin{tikzpicture}
node [star,draw,fill=yellow,minimum size=5mm,star point ratio=2]{};
end{tikzpicture}
end{document}
The crucial advantage is that you have all sorts of parameters that you can adjust to obtain the star you really want (a so-called super-star ;-), see the pgfmanual on p. 701.
+1. I also wrote the same code., except that I used red instead of black :)
– nidhin
Dec 11 '18 at 18:17
@nidhin You very recently scooped me in another answer, which I (of course) upvoted, thanks!
– marmot
Dec 11 '18 at 18:21
1
hehe. Then let us consider it even. :)
– nidhin
Dec 11 '18 at 18:22
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%2f464360%2fdraw-border-around-edge-of-symbol%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
Basic
documentclass[preview,border=12pt,varwidth,dvipsnames]{standalone}
usepackage{contour}
usepackage{xcolor,amssymb}
contourlength{0.5pt} % thickness
contournumber{10} % number of replication
begin{document}
huge
contour{orange}{$bigstar$}
end{document}
Miscellaneous
The following example is not impossible but it takes much time and energy with PSTricks, let alone TikZ.
documentclass[preview,border=12pt,varwidth,dvipsnames]{standalone}
usepackage{contour}
usepackage{xcolor,amsmath}
usepackage{CJK}
contourlength{0.2pt} % thickness
contournumber{10} % number of replication
begin{document}
huge
begin{CJK}{UTF8}{min}
begin{center}
contour{orange}{気持ちは}
end{center}
[
contour{red}{$sqrt{x^2}$},
contour{green}{$not=$},
contour{blue}{$x$}
]
begin{center}
contour{cyan}{言い表しにくいです}
end{center}
end{CJK}
end{document}
contour{red}{$sqrt{x^2}$}, contour{green}{$not=$}, contour{blue}{$x$}
should becontour{red}{$mathsurround=0ptdisplaystylesqrt{x^2}$} mathrel{contour{green}{$mathsurround=0ptdisplaystyleneq$}} contour{blue}{$mathsurround=0ptdisplaystyle x$}
– Henri Menke
Dec 12 '18 at 2:01
these are both great answers, thank you guys. now the dilemma: which one to accept? Is there some criteria? I don't want to be unjust with @marmot
– andrea
Dec 12 '18 at 9:25
add a comment |
Basic
documentclass[preview,border=12pt,varwidth,dvipsnames]{standalone}
usepackage{contour}
usepackage{xcolor,amssymb}
contourlength{0.5pt} % thickness
contournumber{10} % number of replication
begin{document}
huge
contour{orange}{$bigstar$}
end{document}
Miscellaneous
The following example is not impossible but it takes much time and energy with PSTricks, let alone TikZ.
documentclass[preview,border=12pt,varwidth,dvipsnames]{standalone}
usepackage{contour}
usepackage{xcolor,amsmath}
usepackage{CJK}
contourlength{0.2pt} % thickness
contournumber{10} % number of replication
begin{document}
huge
begin{CJK}{UTF8}{min}
begin{center}
contour{orange}{気持ちは}
end{center}
[
contour{red}{$sqrt{x^2}$},
contour{green}{$not=$},
contour{blue}{$x$}
]
begin{center}
contour{cyan}{言い表しにくいです}
end{center}
end{CJK}
end{document}
contour{red}{$sqrt{x^2}$}, contour{green}{$not=$}, contour{blue}{$x$}
should becontour{red}{$mathsurround=0ptdisplaystylesqrt{x^2}$} mathrel{contour{green}{$mathsurround=0ptdisplaystyleneq$}} contour{blue}{$mathsurround=0ptdisplaystyle x$}
– Henri Menke
Dec 12 '18 at 2:01
these are both great answers, thank you guys. now the dilemma: which one to accept? Is there some criteria? I don't want to be unjust with @marmot
– andrea
Dec 12 '18 at 9:25
add a comment |
Basic
documentclass[preview,border=12pt,varwidth,dvipsnames]{standalone}
usepackage{contour}
usepackage{xcolor,amssymb}
contourlength{0.5pt} % thickness
contournumber{10} % number of replication
begin{document}
huge
contour{orange}{$bigstar$}
end{document}
Miscellaneous
The following example is not impossible but it takes much time and energy with PSTricks, let alone TikZ.
documentclass[preview,border=12pt,varwidth,dvipsnames]{standalone}
usepackage{contour}
usepackage{xcolor,amsmath}
usepackage{CJK}
contourlength{0.2pt} % thickness
contournumber{10} % number of replication
begin{document}
huge
begin{CJK}{UTF8}{min}
begin{center}
contour{orange}{気持ちは}
end{center}
[
contour{red}{$sqrt{x^2}$},
contour{green}{$not=$},
contour{blue}{$x$}
]
begin{center}
contour{cyan}{言い表しにくいです}
end{center}
end{CJK}
end{document}
Basic
documentclass[preview,border=12pt,varwidth,dvipsnames]{standalone}
usepackage{contour}
usepackage{xcolor,amssymb}
contourlength{0.5pt} % thickness
contournumber{10} % number of replication
begin{document}
huge
contour{orange}{$bigstar$}
end{document}
Miscellaneous
The following example is not impossible but it takes much time and energy with PSTricks, let alone TikZ.
documentclass[preview,border=12pt,varwidth,dvipsnames]{standalone}
usepackage{contour}
usepackage{xcolor,amsmath}
usepackage{CJK}
contourlength{0.2pt} % thickness
contournumber{10} % number of replication
begin{document}
huge
begin{CJK}{UTF8}{min}
begin{center}
contour{orange}{気持ちは}
end{center}
[
contour{red}{$sqrt{x^2}$},
contour{green}{$not=$},
contour{blue}{$x$}
]
begin{center}
contour{cyan}{言い表しにくいです}
end{center}
end{CJK}
end{document}
edited Dec 11 '18 at 18:23
answered Dec 11 '18 at 18:08
God Must Be Crazy
5,60511039
5,60511039
contour{red}{$sqrt{x^2}$}, contour{green}{$not=$}, contour{blue}{$x$}
should becontour{red}{$mathsurround=0ptdisplaystylesqrt{x^2}$} mathrel{contour{green}{$mathsurround=0ptdisplaystyleneq$}} contour{blue}{$mathsurround=0ptdisplaystyle x$}
– Henri Menke
Dec 12 '18 at 2:01
these are both great answers, thank you guys. now the dilemma: which one to accept? Is there some criteria? I don't want to be unjust with @marmot
– andrea
Dec 12 '18 at 9:25
add a comment |
contour{red}{$sqrt{x^2}$}, contour{green}{$not=$}, contour{blue}{$x$}
should becontour{red}{$mathsurround=0ptdisplaystylesqrt{x^2}$} mathrel{contour{green}{$mathsurround=0ptdisplaystyleneq$}} contour{blue}{$mathsurround=0ptdisplaystyle x$}
– Henri Menke
Dec 12 '18 at 2:01
these are both great answers, thank you guys. now the dilemma: which one to accept? Is there some criteria? I don't want to be unjust with @marmot
– andrea
Dec 12 '18 at 9:25
contour{red}{$sqrt{x^2}$}, contour{green}{$not=$}, contour{blue}{$x$}
should be contour{red}{$mathsurround=0ptdisplaystylesqrt{x^2}$} mathrel{contour{green}{$mathsurround=0ptdisplaystyleneq$}} contour{blue}{$mathsurround=0ptdisplaystyle x$}
– Henri Menke
Dec 12 '18 at 2:01
contour{red}{$sqrt{x^2}$}, contour{green}{$not=$}, contour{blue}{$x$}
should be contour{red}{$mathsurround=0ptdisplaystylesqrt{x^2}$} mathrel{contour{green}{$mathsurround=0ptdisplaystyleneq$}} contour{blue}{$mathsurround=0ptdisplaystyle x$}
– Henri Menke
Dec 12 '18 at 2:01
these are both great answers, thank you guys. now the dilemma: which one to accept? Is there some criteria? I don't want to be unjust with @marmot
– andrea
Dec 12 '18 at 9:25
these are both great answers, thank you guys. now the dilemma: which one to accept? Is there some criteria? I don't want to be unjust with @marmot
– andrea
Dec 12 '18 at 9:25
add a comment |
I guess the most simple-minded approach would be to draw the node in black and a bit larger underneath. Notice that you need to add transform shape
for the scale=0.5
to affect the node.
documentclass[tikz,border=10pt]{standalone}
usepackage{tikz}
usepackage{amssymb}
begin{document}
begin{tikzpicture}[scale = 0.5,transform shape]
node [black,scale=1.2] at (0,0,0) {$bigstar$};
node [yellow] at (0,0,0) {$bigstar$};
end{tikzpicture}
end{document}
contour
, as suggested in this answer does basically the same. However, TikZ also has star symbols built in. Why not use those?
documentclass[tikz,border=10pt]{standalone}
usepackage{tikz}
usetikzlibrary{shapes.geometric}
begin{document}
begin{tikzpicture}
node [star,draw,fill=yellow,minimum size=5mm,star point ratio=2]{};
end{tikzpicture}
end{document}
The crucial advantage is that you have all sorts of parameters that you can adjust to obtain the star you really want (a so-called super-star ;-), see the pgfmanual on p. 701.
+1. I also wrote the same code., except that I used red instead of black :)
– nidhin
Dec 11 '18 at 18:17
@nidhin You very recently scooped me in another answer, which I (of course) upvoted, thanks!
– marmot
Dec 11 '18 at 18:21
1
hehe. Then let us consider it even. :)
– nidhin
Dec 11 '18 at 18:22
add a comment |
I guess the most simple-minded approach would be to draw the node in black and a bit larger underneath. Notice that you need to add transform shape
for the scale=0.5
to affect the node.
documentclass[tikz,border=10pt]{standalone}
usepackage{tikz}
usepackage{amssymb}
begin{document}
begin{tikzpicture}[scale = 0.5,transform shape]
node [black,scale=1.2] at (0,0,0) {$bigstar$};
node [yellow] at (0,0,0) {$bigstar$};
end{tikzpicture}
end{document}
contour
, as suggested in this answer does basically the same. However, TikZ also has star symbols built in. Why not use those?
documentclass[tikz,border=10pt]{standalone}
usepackage{tikz}
usetikzlibrary{shapes.geometric}
begin{document}
begin{tikzpicture}
node [star,draw,fill=yellow,minimum size=5mm,star point ratio=2]{};
end{tikzpicture}
end{document}
The crucial advantage is that you have all sorts of parameters that you can adjust to obtain the star you really want (a so-called super-star ;-), see the pgfmanual on p. 701.
+1. I also wrote the same code., except that I used red instead of black :)
– nidhin
Dec 11 '18 at 18:17
@nidhin You very recently scooped me in another answer, which I (of course) upvoted, thanks!
– marmot
Dec 11 '18 at 18:21
1
hehe. Then let us consider it even. :)
– nidhin
Dec 11 '18 at 18:22
add a comment |
I guess the most simple-minded approach would be to draw the node in black and a bit larger underneath. Notice that you need to add transform shape
for the scale=0.5
to affect the node.
documentclass[tikz,border=10pt]{standalone}
usepackage{tikz}
usepackage{amssymb}
begin{document}
begin{tikzpicture}[scale = 0.5,transform shape]
node [black,scale=1.2] at (0,0,0) {$bigstar$};
node [yellow] at (0,0,0) {$bigstar$};
end{tikzpicture}
end{document}
contour
, as suggested in this answer does basically the same. However, TikZ also has star symbols built in. Why not use those?
documentclass[tikz,border=10pt]{standalone}
usepackage{tikz}
usetikzlibrary{shapes.geometric}
begin{document}
begin{tikzpicture}
node [star,draw,fill=yellow,minimum size=5mm,star point ratio=2]{};
end{tikzpicture}
end{document}
The crucial advantage is that you have all sorts of parameters that you can adjust to obtain the star you really want (a so-called super-star ;-), see the pgfmanual on p. 701.
I guess the most simple-minded approach would be to draw the node in black and a bit larger underneath. Notice that you need to add transform shape
for the scale=0.5
to affect the node.
documentclass[tikz,border=10pt]{standalone}
usepackage{tikz}
usepackage{amssymb}
begin{document}
begin{tikzpicture}[scale = 0.5,transform shape]
node [black,scale=1.2] at (0,0,0) {$bigstar$};
node [yellow] at (0,0,0) {$bigstar$};
end{tikzpicture}
end{document}
contour
, as suggested in this answer does basically the same. However, TikZ also has star symbols built in. Why not use those?
documentclass[tikz,border=10pt]{standalone}
usepackage{tikz}
usetikzlibrary{shapes.geometric}
begin{document}
begin{tikzpicture}
node [star,draw,fill=yellow,minimum size=5mm,star point ratio=2]{};
end{tikzpicture}
end{document}
The crucial advantage is that you have all sorts of parameters that you can adjust to obtain the star you really want (a so-called super-star ;-), see the pgfmanual on p. 701.
edited Dec 11 '18 at 18:20
answered Dec 11 '18 at 18:12
marmot
87.4k4100187
87.4k4100187
+1. I also wrote the same code., except that I used red instead of black :)
– nidhin
Dec 11 '18 at 18:17
@nidhin You very recently scooped me in another answer, which I (of course) upvoted, thanks!
– marmot
Dec 11 '18 at 18:21
1
hehe. Then let us consider it even. :)
– nidhin
Dec 11 '18 at 18:22
add a comment |
+1. I also wrote the same code., except that I used red instead of black :)
– nidhin
Dec 11 '18 at 18:17
@nidhin You very recently scooped me in another answer, which I (of course) upvoted, thanks!
– marmot
Dec 11 '18 at 18:21
1
hehe. Then let us consider it even. :)
– nidhin
Dec 11 '18 at 18:22
+1. I also wrote the same code., except that I used red instead of black :)
– nidhin
Dec 11 '18 at 18:17
+1. I also wrote the same code., except that I used red instead of black :)
– nidhin
Dec 11 '18 at 18:17
@nidhin You very recently scooped me in another answer, which I (of course) upvoted, thanks!
– marmot
Dec 11 '18 at 18:21
@nidhin You very recently scooped me in another answer, which I (of course) upvoted, thanks!
– marmot
Dec 11 '18 at 18:21
1
1
hehe. Then let us consider it even. :)
– nidhin
Dec 11 '18 at 18:22
hehe. Then let us consider it even. :)
– nidhin
Dec 11 '18 at 18:22
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.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- 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%2f464360%2fdraw-border-around-edge-of-symbol%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