How to add a white background to an angle label in Tikz?












5















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}









share|improve this question


















  • 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
    Dec 13 '18 at 13:31
















5















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}









share|improve this question


















  • 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
    Dec 13 '18 at 13:31














5












5








5








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}









share|improve this question














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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Dec 13 '18 at 13:10









Jasper SalisburyJasper Salisbury

355




355








  • 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
    Dec 13 '18 at 13:31














  • 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
    Dec 13 '18 at 13:31








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
Dec 13 '18 at 13:31





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
Dec 13 '18 at 13:31










2 Answers
2






active

oldest

votes


















6














Use "$alpha$"{fill=white} instead of "$alpha$" in pic



enter image description here



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}





share|improve this answer
























  • Perfect! I knew there would be a simple answer!

    – Jasper Salisbury
    Dec 13 '18 at 13:38



















2














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}


enter image description here






share|improve this answer























    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
    });


    }
    });














    draft saved

    draft discarded


















    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









    6














    Use "$alpha$"{fill=white} instead of "$alpha$" in pic



    enter image description here



    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}





    share|improve this answer
























    • Perfect! I knew there would be a simple answer!

      – Jasper Salisbury
      Dec 13 '18 at 13:38
















    6














    Use "$alpha$"{fill=white} instead of "$alpha$" in pic



    enter image description here



    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}





    share|improve this answer
























    • Perfect! I knew there would be a simple answer!

      – Jasper Salisbury
      Dec 13 '18 at 13:38














    6












    6








    6







    Use "$alpha$"{fill=white} instead of "$alpha$" in pic



    enter image description here



    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}





    share|improve this answer













    Use "$alpha$"{fill=white} instead of "$alpha$" in pic



    enter image description here



    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}






    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Dec 13 '18 at 13:33









    nidhinnidhin

    3,3521927




    3,3521927













    • Perfect! I knew there would be a simple answer!

      – Jasper Salisbury
      Dec 13 '18 at 13:38



















    • Perfect! I knew there would be a simple answer!

      – Jasper Salisbury
      Dec 13 '18 at 13:38

















    Perfect! I knew there would be a simple answer!

    – Jasper Salisbury
    Dec 13 '18 at 13:38





    Perfect! I knew there would be a simple answer!

    – Jasper Salisbury
    Dec 13 '18 at 13:38











    2














    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}


    enter image description here






    share|improve this answer




























      2














      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}


      enter image description here






      share|improve this answer


























        2












        2








        2







        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}


        enter image description here






        share|improve this answer













        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}


        enter image description here







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Dec 13 '18 at 14:40









        Artificial StupidityArtificial Stupidity

        5,35011041




        5,35011041






























            draft saved

            draft discarded




















































            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.




            draft saved


            draft discarded














            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





















































            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







            Popular posts from this blog

            Probability when a professor distributes a quiz and homework assignment to a class of n students.

            Aardman Animations

            Are they similar matrix