How to add a white background to an angle label in Tikz?
up vote
4
down vote
favorite
I'm drawing a diagram for a project, but with the n vector going through the angle label it isn't very clear, I'd like to add a white background to the alpha label so it's easier to see. Thanks, see MWE below.
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{amsmath}
usepackage{tikz}
usetikzlibrary{calc,patterns,angles,quotes,arrows}
begin{document}
begin{figure}
begin{center}
begin{tikzpicture}
%Define coordinates
coordinate (origin) at (0,0);
coordinate (bhat) at (0,5);
coordinate (zetahat) at (5,0);
coordinate (vector) at (3,4);
coordinate (normal) at (1.581,4.743);
%Draw axes
draw[thick, <->] (bhat) node[above]{$hat{b}$} -- (origin) -- (zetahat) node[right]{$hat{zeta}$};
%Draw vector
draw[thick, ->, blue] (origin) -- (vector) node[above]{$vec{v_r}$};
%N vector
draw[thick, dotted, ->] (origin) -- (normal) node[above]{$hat{n}$};
%Draw angle
pic [draw, "$alpha$", angle eccentricity = 1.2, angle radius = 1.5cm, thick] {angle = vector--origin--bhat};
end{tikzpicture}
caption{Pitch angle $alpha$ is equal to $2theta_{bn}$, showing specular reflection}
label{fig:Pitch Angle}
end{center}
end{figure}
end{document}
tikz-node tikz-angles
add a comment |
up vote
4
down vote
favorite
I'm drawing a diagram for a project, but with the n vector going through the angle label it isn't very clear, I'd like to add a white background to the alpha label so it's easier to see. Thanks, see MWE below.
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{amsmath}
usepackage{tikz}
usetikzlibrary{calc,patterns,angles,quotes,arrows}
begin{document}
begin{figure}
begin{center}
begin{tikzpicture}
%Define coordinates
coordinate (origin) at (0,0);
coordinate (bhat) at (0,5);
coordinate (zetahat) at (5,0);
coordinate (vector) at (3,4);
coordinate (normal) at (1.581,4.743);
%Draw axes
draw[thick, <->] (bhat) node[above]{$hat{b}$} -- (origin) -- (zetahat) node[right]{$hat{zeta}$};
%Draw vector
draw[thick, ->, blue] (origin) -- (vector) node[above]{$vec{v_r}$};
%N vector
draw[thick, dotted, ->] (origin) -- (normal) node[above]{$hat{n}$};
%Draw angle
pic [draw, "$alpha$", angle eccentricity = 1.2, angle radius = 1.5cm, thick] {angle = vector--origin--bhat};
end{tikzpicture}
caption{Pitch angle $alpha$ is equal to $2theta_{bn}$, showing specular reflection}
label{fig:Pitch Angle}
end{center}
end{figure}
end{document}
tikz-node tikz-angles
1
fill=white
but I think this will also fill other parts that you don't want to fill. If that is the case you'd have to create the label separately or someone else has a smarter idea about that
– Raven
14 hours ago
add a comment |
up vote
4
down vote
favorite
up vote
4
down vote
favorite
I'm drawing a diagram for a project, but with the n vector going through the angle label it isn't very clear, I'd like to add a white background to the alpha label so it's easier to see. Thanks, see MWE below.
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{amsmath}
usepackage{tikz}
usetikzlibrary{calc,patterns,angles,quotes,arrows}
begin{document}
begin{figure}
begin{center}
begin{tikzpicture}
%Define coordinates
coordinate (origin) at (0,0);
coordinate (bhat) at (0,5);
coordinate (zetahat) at (5,0);
coordinate (vector) at (3,4);
coordinate (normal) at (1.581,4.743);
%Draw axes
draw[thick, <->] (bhat) node[above]{$hat{b}$} -- (origin) -- (zetahat) node[right]{$hat{zeta}$};
%Draw vector
draw[thick, ->, blue] (origin) -- (vector) node[above]{$vec{v_r}$};
%N vector
draw[thick, dotted, ->] (origin) -- (normal) node[above]{$hat{n}$};
%Draw angle
pic [draw, "$alpha$", angle eccentricity = 1.2, angle radius = 1.5cm, thick] {angle = vector--origin--bhat};
end{tikzpicture}
caption{Pitch angle $alpha$ is equal to $2theta_{bn}$, showing specular reflection}
label{fig:Pitch Angle}
end{center}
end{figure}
end{document}
tikz-node tikz-angles
I'm drawing a diagram for a project, but with the n vector going through the angle label it isn't very clear, I'd like to add a white background to the alpha label so it's easier to see. Thanks, see MWE below.
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{amsmath}
usepackage{tikz}
usetikzlibrary{calc,patterns,angles,quotes,arrows}
begin{document}
begin{figure}
begin{center}
begin{tikzpicture}
%Define coordinates
coordinate (origin) at (0,0);
coordinate (bhat) at (0,5);
coordinate (zetahat) at (5,0);
coordinate (vector) at (3,4);
coordinate (normal) at (1.581,4.743);
%Draw axes
draw[thick, <->] (bhat) node[above]{$hat{b}$} -- (origin) -- (zetahat) node[right]{$hat{zeta}$};
%Draw vector
draw[thick, ->, blue] (origin) -- (vector) node[above]{$vec{v_r}$};
%N vector
draw[thick, dotted, ->] (origin) -- (normal) node[above]{$hat{n}$};
%Draw angle
pic [draw, "$alpha$", angle eccentricity = 1.2, angle radius = 1.5cm, thick] {angle = vector--origin--bhat};
end{tikzpicture}
caption{Pitch angle $alpha$ is equal to $2theta_{bn}$, showing specular reflection}
label{fig:Pitch Angle}
end{center}
end{figure}
end{document}
tikz-node tikz-angles
tikz-node tikz-angles
asked 15 hours ago
Jasper Salisbury
305
305
1
fill=white
but I think this will also fill other parts that you don't want to fill. If that is the case you'd have to create the label separately or someone else has a smarter idea about that
– Raven
14 hours ago
add a comment |
1
fill=white
but I think this will also fill other parts that you don't want to fill. If that is the case you'd have to create the label separately or someone else has a smarter idea about that
– Raven
14 hours ago
1
1
fill=white
but I think this will also fill other parts that you don't want to fill. If that is the case you'd have to create the label separately or someone else has a smarter idea about that– Raven
14 hours ago
fill=white
but I think this will also fill other parts that you don't want to fill. If that is the case you'd have to create the label separately or someone else has a smarter idea about that– Raven
14 hours ago
add a comment |
2 Answers
2
active
oldest
votes
up vote
6
down vote
accepted
Use "$alpha$"{fill=white}
instead of "$alpha$"
in pic
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{amsmath}
usepackage{tikz}
usetikzlibrary{calc,patterns,angles,quotes,arrows}
begin{document}
begin{figure}
begin{center}
begin{tikzpicture}
%Define coordinates
coordinate (origin) at (0,0);
coordinate (bhat) at (0,5);
coordinate (zetahat) at (5,0);
coordinate (vector) at (3,4);
coordinate (normal) at (1.581,4.743);
%Draw axes
draw[thick, <->] (bhat) node[above]{$hat{b}$} -- (origin) -- (zetahat) node[right]{$hat{zeta}$};
%Draw vector
draw[thick, ->, blue] (origin) -- (vector) node[above]{$vec{v_r}$};
%N vector
draw[thick, dotted, ->] (origin) -- (normal) node[above]{$hat{n}$};
%Draw angle
pic [draw, "$alpha$"{fill=white}, angle eccentricity = 1.2, angle radius = 1.5cm, thick] {angle = vector--origin--bhat};
end{tikzpicture}
caption{Pitch angle $alpha$ is equal to $2theta_{bn}$, showing specular reflection}
label{fig:Pitch Angle}
end{center}
end{figure}
end{document}
Perfect! I knew there would be a simple answer!
– Jasper Salisbury
14 hours ago
add a comment |
up vote
2
down vote
A PSTricks solution only for comparison purposes. A single *
does the job (making the label background solid).
documentclass[pstricks,12pt]{standalone}
begin{document}
pspicture(-1,-1)(6,6)
psline{<->}(0,5)(0,0)(5,0)
psline{->}(5;60)
psline[linestyle=dotted,dotsep=1pt]{->}(5;75)
uput[90](0,5){$hat{b}$}
uput[0](5,0){$hat{zeta}$}
uput[60](5;60){$vec{v}_r$}
uput[75](5;75){$hat{n}$}
uput*{2.5}[75](0,0){$alpha$}
psarc(0,0){2}{60}{90}
endpspicture
end{document}
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',
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%2f464699%2fhow-to-add-a-white-background-to-an-angle-label-in-tikz%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
up vote
6
down vote
accepted
Use "$alpha$"{fill=white}
instead of "$alpha$"
in pic
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{amsmath}
usepackage{tikz}
usetikzlibrary{calc,patterns,angles,quotes,arrows}
begin{document}
begin{figure}
begin{center}
begin{tikzpicture}
%Define coordinates
coordinate (origin) at (0,0);
coordinate (bhat) at (0,5);
coordinate (zetahat) at (5,0);
coordinate (vector) at (3,4);
coordinate (normal) at (1.581,4.743);
%Draw axes
draw[thick, <->] (bhat) node[above]{$hat{b}$} -- (origin) -- (zetahat) node[right]{$hat{zeta}$};
%Draw vector
draw[thick, ->, blue] (origin) -- (vector) node[above]{$vec{v_r}$};
%N vector
draw[thick, dotted, ->] (origin) -- (normal) node[above]{$hat{n}$};
%Draw angle
pic [draw, "$alpha$"{fill=white}, angle eccentricity = 1.2, angle radius = 1.5cm, thick] {angle = vector--origin--bhat};
end{tikzpicture}
caption{Pitch angle $alpha$ is equal to $2theta_{bn}$, showing specular reflection}
label{fig:Pitch Angle}
end{center}
end{figure}
end{document}
Perfect! I knew there would be a simple answer!
– Jasper Salisbury
14 hours ago
add a comment |
up vote
6
down vote
accepted
Use "$alpha$"{fill=white}
instead of "$alpha$"
in pic
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{amsmath}
usepackage{tikz}
usetikzlibrary{calc,patterns,angles,quotes,arrows}
begin{document}
begin{figure}
begin{center}
begin{tikzpicture}
%Define coordinates
coordinate (origin) at (0,0);
coordinate (bhat) at (0,5);
coordinate (zetahat) at (5,0);
coordinate (vector) at (3,4);
coordinate (normal) at (1.581,4.743);
%Draw axes
draw[thick, <->] (bhat) node[above]{$hat{b}$} -- (origin) -- (zetahat) node[right]{$hat{zeta}$};
%Draw vector
draw[thick, ->, blue] (origin) -- (vector) node[above]{$vec{v_r}$};
%N vector
draw[thick, dotted, ->] (origin) -- (normal) node[above]{$hat{n}$};
%Draw angle
pic [draw, "$alpha$"{fill=white}, angle eccentricity = 1.2, angle radius = 1.5cm, thick] {angle = vector--origin--bhat};
end{tikzpicture}
caption{Pitch angle $alpha$ is equal to $2theta_{bn}$, showing specular reflection}
label{fig:Pitch Angle}
end{center}
end{figure}
end{document}
Perfect! I knew there would be a simple answer!
– Jasper Salisbury
14 hours ago
add a comment |
up vote
6
down vote
accepted
up vote
6
down vote
accepted
Use "$alpha$"{fill=white}
instead of "$alpha$"
in pic
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{amsmath}
usepackage{tikz}
usetikzlibrary{calc,patterns,angles,quotes,arrows}
begin{document}
begin{figure}
begin{center}
begin{tikzpicture}
%Define coordinates
coordinate (origin) at (0,0);
coordinate (bhat) at (0,5);
coordinate (zetahat) at (5,0);
coordinate (vector) at (3,4);
coordinate (normal) at (1.581,4.743);
%Draw axes
draw[thick, <->] (bhat) node[above]{$hat{b}$} -- (origin) -- (zetahat) node[right]{$hat{zeta}$};
%Draw vector
draw[thick, ->, blue] (origin) -- (vector) node[above]{$vec{v_r}$};
%N vector
draw[thick, dotted, ->] (origin) -- (normal) node[above]{$hat{n}$};
%Draw angle
pic [draw, "$alpha$"{fill=white}, angle eccentricity = 1.2, angle radius = 1.5cm, thick] {angle = vector--origin--bhat};
end{tikzpicture}
caption{Pitch angle $alpha$ is equal to $2theta_{bn}$, showing specular reflection}
label{fig:Pitch Angle}
end{center}
end{figure}
end{document}
Use "$alpha$"{fill=white}
instead of "$alpha$"
in pic
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{amsmath}
usepackage{tikz}
usetikzlibrary{calc,patterns,angles,quotes,arrows}
begin{document}
begin{figure}
begin{center}
begin{tikzpicture}
%Define coordinates
coordinate (origin) at (0,0);
coordinate (bhat) at (0,5);
coordinate (zetahat) at (5,0);
coordinate (vector) at (3,4);
coordinate (normal) at (1.581,4.743);
%Draw axes
draw[thick, <->] (bhat) node[above]{$hat{b}$} -- (origin) -- (zetahat) node[right]{$hat{zeta}$};
%Draw vector
draw[thick, ->, blue] (origin) -- (vector) node[above]{$vec{v_r}$};
%N vector
draw[thick, dotted, ->] (origin) -- (normal) node[above]{$hat{n}$};
%Draw angle
pic [draw, "$alpha$"{fill=white}, angle eccentricity = 1.2, angle radius = 1.5cm, thick] {angle = vector--origin--bhat};
end{tikzpicture}
caption{Pitch angle $alpha$ is equal to $2theta_{bn}$, showing specular reflection}
label{fig:Pitch Angle}
end{center}
end{figure}
end{document}
answered 14 hours ago
nidhin
3,179927
3,179927
Perfect! I knew there would be a simple answer!
– Jasper Salisbury
14 hours ago
add a comment |
Perfect! I knew there would be a simple answer!
– Jasper Salisbury
14 hours ago
Perfect! I knew there would be a simple answer!
– Jasper Salisbury
14 hours ago
Perfect! I knew there would be a simple answer!
– Jasper Salisbury
14 hours ago
add a comment |
up vote
2
down vote
A PSTricks solution only for comparison purposes. A single *
does the job (making the label background solid).
documentclass[pstricks,12pt]{standalone}
begin{document}
pspicture(-1,-1)(6,6)
psline{<->}(0,5)(0,0)(5,0)
psline{->}(5;60)
psline[linestyle=dotted,dotsep=1pt]{->}(5;75)
uput[90](0,5){$hat{b}$}
uput[0](5,0){$hat{zeta}$}
uput[60](5;60){$vec{v}_r$}
uput[75](5;75){$hat{n}$}
uput*{2.5}[75](0,0){$alpha$}
psarc(0,0){2}{60}{90}
endpspicture
end{document}
add a comment |
up vote
2
down vote
A PSTricks solution only for comparison purposes. A single *
does the job (making the label background solid).
documentclass[pstricks,12pt]{standalone}
begin{document}
pspicture(-1,-1)(6,6)
psline{<->}(0,5)(0,0)(5,0)
psline{->}(5;60)
psline[linestyle=dotted,dotsep=1pt]{->}(5;75)
uput[90](0,5){$hat{b}$}
uput[0](5,0){$hat{zeta}$}
uput[60](5;60){$vec{v}_r$}
uput[75](5;75){$hat{n}$}
uput*{2.5}[75](0,0){$alpha$}
psarc(0,0){2}{60}{90}
endpspicture
end{document}
add a comment |
up vote
2
down vote
up vote
2
down vote
A PSTricks solution only for comparison purposes. A single *
does the job (making the label background solid).
documentclass[pstricks,12pt]{standalone}
begin{document}
pspicture(-1,-1)(6,6)
psline{<->}(0,5)(0,0)(5,0)
psline{->}(5;60)
psline[linestyle=dotted,dotsep=1pt]{->}(5;75)
uput[90](0,5){$hat{b}$}
uput[0](5,0){$hat{zeta}$}
uput[60](5;60){$vec{v}_r$}
uput[75](5;75){$hat{n}$}
uput*{2.5}[75](0,0){$alpha$}
psarc(0,0){2}{60}{90}
endpspicture
end{document}
A PSTricks solution only for comparison purposes. A single *
does the job (making the label background solid).
documentclass[pstricks,12pt]{standalone}
begin{document}
pspicture(-1,-1)(6,6)
psline{<->}(0,5)(0,0)(5,0)
psline{->}(5;60)
psline[linestyle=dotted,dotsep=1pt]{->}(5;75)
uput[90](0,5){$hat{b}$}
uput[0](5,0){$hat{zeta}$}
uput[60](5;60){$vec{v}_r$}
uput[75](5;75){$hat{n}$}
uput*{2.5}[75](0,0){$alpha$}
psarc(0,0){2}{60}{90}
endpspicture
end{document}
answered 13 hours ago
Artificial Stupidity
5,01611039
5,01611039
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.
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%2f464699%2fhow-to-add-a-white-background-to-an-angle-label-in-tikz%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
1
fill=white
but I think this will also fill other parts that you don't want to fill. If that is the case you'd have to create the label separately or someone else has a smarter idea about that– Raven
14 hours ago