How to have a second level of labels on x-axis











up vote
4
down vote

favorite












This is so basic, I'm kind of embarrassed, but I'm trying to add fractions on a number line and it looks like crap. Is there a way to drop fractions to a different level or something. I tried [below left]but that didn't look right either. Looking for something like [below below] to double up the drop, but I couldn't find an answer anywhere.



documentclass[letter]{article}
usepackage[english]{babel}
usepackage[margin=1in]{geometry}
usepackage{amsmath}
usepackage{tikz}

begin{document}
begin{center}
begin{tikzpicture}
draw[latex-latex] (-1.5,0) -- (5.5,0);% the x-axis
foreach x in {-1,...,5} % tick marks
draw (x,0) -- (x,-3pt);
foreach x in {-1,...,5} % the numbers
node [below] at (x,-0.1) {$x$};
node [above] at (1.67,0.5) {A};
node [below] at (1.67,-0) {1$frac{2}{3}$};
end{tikzpicture}
end{center}

end{document}


image










share|improve this question
















bumped to the homepage by Community 6 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.











  • 3




    Welcome to TeX.SE! Yes, of course, there are advanced positioning methods available, e.g. when you load usetikzlibrary{positioning}. And you could do node [below=5pt] at (1.67,-0) {1$frac{2}{3}$};, but IMHO node [below=5pt] at (1.67,-0) {$frac{5}{3}$}; looks better. If you load the fp package and the fpu tikz library, you could also do something like pgfmathprintnumber[frac]{0.5}.
    – marmot
    Aug 31 at 2:18










  • Thank you so much! Works perfectly. I'm going to go read up on these packages.
    – Benjamin Compson
    Aug 31 at 23:30










  • I fixed some problems in the code and markup of your post. I think you had the code selected when you added the image. As a result, the code was used as the alt text for the image (as far as the markup was concerned), and when you do that all [ and ] in the code are changed to [ and ], respectively. I.e. the brackets in the code are escaped, so they don't interfere with the brackets in the markdown code for image inclusion (that looks like [![alt text][1]][1], selected text will be used as alt text).
    – Torbjørn T.
    Sep 2 at 6:36










  • @marmot Do you want to post this as an answer so that the question can be closed?
    – Andrew
    Oct 9 at 23:43















up vote
4
down vote

favorite












This is so basic, I'm kind of embarrassed, but I'm trying to add fractions on a number line and it looks like crap. Is there a way to drop fractions to a different level or something. I tried [below left]but that didn't look right either. Looking for something like [below below] to double up the drop, but I couldn't find an answer anywhere.



documentclass[letter]{article}
usepackage[english]{babel}
usepackage[margin=1in]{geometry}
usepackage{amsmath}
usepackage{tikz}

begin{document}
begin{center}
begin{tikzpicture}
draw[latex-latex] (-1.5,0) -- (5.5,0);% the x-axis
foreach x in {-1,...,5} % tick marks
draw (x,0) -- (x,-3pt);
foreach x in {-1,...,5} % the numbers
node [below] at (x,-0.1) {$x$};
node [above] at (1.67,0.5) {A};
node [below] at (1.67,-0) {1$frac{2}{3}$};
end{tikzpicture}
end{center}

end{document}


image










share|improve this question
















bumped to the homepage by Community 6 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.











  • 3




    Welcome to TeX.SE! Yes, of course, there are advanced positioning methods available, e.g. when you load usetikzlibrary{positioning}. And you could do node [below=5pt] at (1.67,-0) {1$frac{2}{3}$};, but IMHO node [below=5pt] at (1.67,-0) {$frac{5}{3}$}; looks better. If you load the fp package and the fpu tikz library, you could also do something like pgfmathprintnumber[frac]{0.5}.
    – marmot
    Aug 31 at 2:18










  • Thank you so much! Works perfectly. I'm going to go read up on these packages.
    – Benjamin Compson
    Aug 31 at 23:30










  • I fixed some problems in the code and markup of your post. I think you had the code selected when you added the image. As a result, the code was used as the alt text for the image (as far as the markup was concerned), and when you do that all [ and ] in the code are changed to [ and ], respectively. I.e. the brackets in the code are escaped, so they don't interfere with the brackets in the markdown code for image inclusion (that looks like [![alt text][1]][1], selected text will be used as alt text).
    – Torbjørn T.
    Sep 2 at 6:36










  • @marmot Do you want to post this as an answer so that the question can be closed?
    – Andrew
    Oct 9 at 23:43













up vote
4
down vote

favorite









up vote
4
down vote

favorite











This is so basic, I'm kind of embarrassed, but I'm trying to add fractions on a number line and it looks like crap. Is there a way to drop fractions to a different level or something. I tried [below left]but that didn't look right either. Looking for something like [below below] to double up the drop, but I couldn't find an answer anywhere.



documentclass[letter]{article}
usepackage[english]{babel}
usepackage[margin=1in]{geometry}
usepackage{amsmath}
usepackage{tikz}

begin{document}
begin{center}
begin{tikzpicture}
draw[latex-latex] (-1.5,0) -- (5.5,0);% the x-axis
foreach x in {-1,...,5} % tick marks
draw (x,0) -- (x,-3pt);
foreach x in {-1,...,5} % the numbers
node [below] at (x,-0.1) {$x$};
node [above] at (1.67,0.5) {A};
node [below] at (1.67,-0) {1$frac{2}{3}$};
end{tikzpicture}
end{center}

end{document}


image










share|improve this question















This is so basic, I'm kind of embarrassed, but I'm trying to add fractions on a number line and it looks like crap. Is there a way to drop fractions to a different level or something. I tried [below left]but that didn't look right either. Looking for something like [below below] to double up the drop, but I couldn't find an answer anywhere.



documentclass[letter]{article}
usepackage[english]{babel}
usepackage[margin=1in]{geometry}
usepackage{amsmath}
usepackage{tikz}

begin{document}
begin{center}
begin{tikzpicture}
draw[latex-latex] (-1.5,0) -- (5.5,0);% the x-axis
foreach x in {-1,...,5} % tick marks
draw (x,0) -- (x,-3pt);
foreach x in {-1,...,5} % the numbers
node [below] at (x,-0.1) {$x$};
node [above] at (1.67,0.5) {A};
node [below] at (1.67,-0) {1$frac{2}{3}$};
end{tikzpicture}
end{center}

end{document}


image







tikz-pgf






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Sep 2 at 6:31









Torbjørn T.

154k13245433




154k13245433










asked Aug 31 at 2:10









Benjamin Compson

623




623





bumped to the homepage by Community 6 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 6 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.










  • 3




    Welcome to TeX.SE! Yes, of course, there are advanced positioning methods available, e.g. when you load usetikzlibrary{positioning}. And you could do node [below=5pt] at (1.67,-0) {1$frac{2}{3}$};, but IMHO node [below=5pt] at (1.67,-0) {$frac{5}{3}$}; looks better. If you load the fp package and the fpu tikz library, you could also do something like pgfmathprintnumber[frac]{0.5}.
    – marmot
    Aug 31 at 2:18










  • Thank you so much! Works perfectly. I'm going to go read up on these packages.
    – Benjamin Compson
    Aug 31 at 23:30










  • I fixed some problems in the code and markup of your post. I think you had the code selected when you added the image. As a result, the code was used as the alt text for the image (as far as the markup was concerned), and when you do that all [ and ] in the code are changed to [ and ], respectively. I.e. the brackets in the code are escaped, so they don't interfere with the brackets in the markdown code for image inclusion (that looks like [![alt text][1]][1], selected text will be used as alt text).
    – Torbjørn T.
    Sep 2 at 6:36










  • @marmot Do you want to post this as an answer so that the question can be closed?
    – Andrew
    Oct 9 at 23:43














  • 3




    Welcome to TeX.SE! Yes, of course, there are advanced positioning methods available, e.g. when you load usetikzlibrary{positioning}. And you could do node [below=5pt] at (1.67,-0) {1$frac{2}{3}$};, but IMHO node [below=5pt] at (1.67,-0) {$frac{5}{3}$}; looks better. If you load the fp package and the fpu tikz library, you could also do something like pgfmathprintnumber[frac]{0.5}.
    – marmot
    Aug 31 at 2:18










  • Thank you so much! Works perfectly. I'm going to go read up on these packages.
    – Benjamin Compson
    Aug 31 at 23:30










  • I fixed some problems in the code and markup of your post. I think you had the code selected when you added the image. As a result, the code was used as the alt text for the image (as far as the markup was concerned), and when you do that all [ and ] in the code are changed to [ and ], respectively. I.e. the brackets in the code are escaped, so they don't interfere with the brackets in the markdown code for image inclusion (that looks like [![alt text][1]][1], selected text will be used as alt text).
    – Torbjørn T.
    Sep 2 at 6:36










  • @marmot Do you want to post this as an answer so that the question can be closed?
    – Andrew
    Oct 9 at 23:43








3




3




Welcome to TeX.SE! Yes, of course, there are advanced positioning methods available, e.g. when you load usetikzlibrary{positioning}. And you could do node [below=5pt] at (1.67,-0) {1$frac{2}{3}$};, but IMHO node [below=5pt] at (1.67,-0) {$frac{5}{3}$}; looks better. If you load the fp package and the fpu tikz library, you could also do something like pgfmathprintnumber[frac]{0.5}.
– marmot
Aug 31 at 2:18




Welcome to TeX.SE! Yes, of course, there are advanced positioning methods available, e.g. when you load usetikzlibrary{positioning}. And you could do node [below=5pt] at (1.67,-0) {1$frac{2}{3}$};, but IMHO node [below=5pt] at (1.67,-0) {$frac{5}{3}$}; looks better. If you load the fp package and the fpu tikz library, you could also do something like pgfmathprintnumber[frac]{0.5}.
– marmot
Aug 31 at 2:18












Thank you so much! Works perfectly. I'm going to go read up on these packages.
– Benjamin Compson
Aug 31 at 23:30




Thank you so much! Works perfectly. I'm going to go read up on these packages.
– Benjamin Compson
Aug 31 at 23:30












I fixed some problems in the code and markup of your post. I think you had the code selected when you added the image. As a result, the code was used as the alt text for the image (as far as the markup was concerned), and when you do that all [ and ] in the code are changed to [ and ], respectively. I.e. the brackets in the code are escaped, so they don't interfere with the brackets in the markdown code for image inclusion (that looks like [![alt text][1]][1], selected text will be used as alt text).
– Torbjørn T.
Sep 2 at 6:36




I fixed some problems in the code and markup of your post. I think you had the code selected when you added the image. As a result, the code was used as the alt text for the image (as far as the markup was concerned), and when you do that all [ and ] in the code are changed to [ and ], respectively. I.e. the brackets in the code are escaped, so they don't interfere with the brackets in the markdown code for image inclusion (that looks like [![alt text][1]][1], selected text will be used as alt text).
– Torbjørn T.
Sep 2 at 6:36












@marmot Do you want to post this as an answer so that the question can be closed?
– Andrew
Oct 9 at 23:43




@marmot Do you want to post this as an answer so that the question can be closed?
– Andrew
Oct 9 at 23:43










1 Answer
1






active

oldest

votes

















up vote
0
down vote













Towards an answer ... don't know precisely what you want... positioning allows, as its name suggest, for an intuitive positioning. It also helps to work with the anchor=base key in this case, I'd say.



documentclass[letter]{article}
usepackage[english]{babel}
usepackage[margin=1in]{geometry}
usepackage{amsmath}
usepackage{tikz}
usetikzlibrary{positioning}
begin{document}
begin{center}
begin{tikzpicture}
draw[latex-latex] (-1.5,0) -- (5.5,0);% the x-axis
foreach x in {-1,...,5} % tick marks
draw (x,0) -- (x,-3pt);
foreach x in {-1,...,5} % the numbers
{node [below=12pt,anchor=base] at (x,0) {$x$};}
node [above=12pt,anchor=base] at (5/3,0) {A};
node [below=12pt,anchor=base] at (5/3,-0) {$frac{5}{3}$};
end{tikzpicture}
end{center}
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',
    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%2f448600%2fhow-to-have-a-second-level-of-labels-on-x-axis%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    Towards an answer ... don't know precisely what you want... positioning allows, as its name suggest, for an intuitive positioning. It also helps to work with the anchor=base key in this case, I'd say.



    documentclass[letter]{article}
    usepackage[english]{babel}
    usepackage[margin=1in]{geometry}
    usepackage{amsmath}
    usepackage{tikz}
    usetikzlibrary{positioning}
    begin{document}
    begin{center}
    begin{tikzpicture}
    draw[latex-latex] (-1.5,0) -- (5.5,0);% the x-axis
    foreach x in {-1,...,5} % tick marks
    draw (x,0) -- (x,-3pt);
    foreach x in {-1,...,5} % the numbers
    {node [below=12pt,anchor=base] at (x,0) {$x$};}
    node [above=12pt,anchor=base] at (5/3,0) {A};
    node [below=12pt,anchor=base] at (5/3,-0) {$frac{5}{3}$};
    end{tikzpicture}
    end{center}
    end{document}


    enter image description here






    share|improve this answer

























      up vote
      0
      down vote













      Towards an answer ... don't know precisely what you want... positioning allows, as its name suggest, for an intuitive positioning. It also helps to work with the anchor=base key in this case, I'd say.



      documentclass[letter]{article}
      usepackage[english]{babel}
      usepackage[margin=1in]{geometry}
      usepackage{amsmath}
      usepackage{tikz}
      usetikzlibrary{positioning}
      begin{document}
      begin{center}
      begin{tikzpicture}
      draw[latex-latex] (-1.5,0) -- (5.5,0);% the x-axis
      foreach x in {-1,...,5} % tick marks
      draw (x,0) -- (x,-3pt);
      foreach x in {-1,...,5} % the numbers
      {node [below=12pt,anchor=base] at (x,0) {$x$};}
      node [above=12pt,anchor=base] at (5/3,0) {A};
      node [below=12pt,anchor=base] at (5/3,-0) {$frac{5}{3}$};
      end{tikzpicture}
      end{center}
      end{document}


      enter image description here






      share|improve this answer























        up vote
        0
        down vote










        up vote
        0
        down vote









        Towards an answer ... don't know precisely what you want... positioning allows, as its name suggest, for an intuitive positioning. It also helps to work with the anchor=base key in this case, I'd say.



        documentclass[letter]{article}
        usepackage[english]{babel}
        usepackage[margin=1in]{geometry}
        usepackage{amsmath}
        usepackage{tikz}
        usetikzlibrary{positioning}
        begin{document}
        begin{center}
        begin{tikzpicture}
        draw[latex-latex] (-1.5,0) -- (5.5,0);% the x-axis
        foreach x in {-1,...,5} % tick marks
        draw (x,0) -- (x,-3pt);
        foreach x in {-1,...,5} % the numbers
        {node [below=12pt,anchor=base] at (x,0) {$x$};}
        node [above=12pt,anchor=base] at (5/3,0) {A};
        node [below=12pt,anchor=base] at (5/3,-0) {$frac{5}{3}$};
        end{tikzpicture}
        end{center}
        end{document}


        enter image description here






        share|improve this answer












        Towards an answer ... don't know precisely what you want... positioning allows, as its name suggest, for an intuitive positioning. It also helps to work with the anchor=base key in this case, I'd say.



        documentclass[letter]{article}
        usepackage[english]{babel}
        usepackage[margin=1in]{geometry}
        usepackage{amsmath}
        usepackage{tikz}
        usetikzlibrary{positioning}
        begin{document}
        begin{center}
        begin{tikzpicture}
        draw[latex-latex] (-1.5,0) -- (5.5,0);% the x-axis
        foreach x in {-1,...,5} % tick marks
        draw (x,0) -- (x,-3pt);
        foreach x in {-1,...,5} % the numbers
        {node [below=12pt,anchor=base] at (x,0) {$x$};}
        node [above=12pt,anchor=base] at (5/3,0) {A};
        node [below=12pt,anchor=base] at (5/3,-0) {$frac{5}{3}$};
        end{tikzpicture}
        end{center}
        end{document}


        enter image description here







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Oct 10 at 0:37









        marmot

        81.4k491174




        81.4k491174






























            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.





            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.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f448600%2fhow-to-have-a-second-level-of-labels-on-x-axis%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

            Entries order in /etc/network/interfaces

            新発田市

            Grub takes very long (several minutes) to open Menu (in Multi-Boot-System)