How to align text above triangle figure Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)Rotate a node but not its content: the case of the ellipse decorationHow to define the default vertical distance between nodes?TikZ scaling graphic and adjust node position and keep font sizealign text in tikz figureNumerical conditional within tikz keys?Relating tree nodes in forest to content in a tableTikZ: Node position in draw environmentLatex and Game Theory: Combining an Extensive and Normal Form for a Three Players GameDrawing graph with Tikz: Link it with main text without overlapping with textTikZ: define arrow starting position based on style and format node label

Why didn't this character "real die" when they blew their stack out in Altered Carbon?

Identifying polygons that intersect with another layer using QGIS?

What is the meaning of the new sigil in Game of Thrones Season 8 intro?

Using audio cues to encourage good posture

Can an alien society believe that their star system is the universe?

Is it true that "carbohydrates are of no use for the basal metabolic need"?

String `!23` is replaced with `docker` in command line

How to align text above triangle figure

Dating a Former Employee

Is the Standard Deduction better than Itemized when both are the same amount?

What LEGO pieces have "real-world" functionality?

How to find all the available tools in macOS terminal?

Why did the Falcon Heavy center core fall off the ASDS OCISLY barge?

How to answer "Have you ever been terminated?"

English words in a non-english sci-fi novel

Sci-Fi book where patients in a coma ward all live in a subconscious world linked together

Extract all GPU name, model and GPU ram

What causes the vertical darker bands in my photo?

When do you get frequent flier miles - when you buy, or when you fly?

How come Sam didn't become Lord of Horn Hill?

Why is my conclusion inconsistent with the van't Hoff equation?

Resolving to minmaj7

prime numbers and expressing non-prime numbers

Is there a (better) way to access $wpdb results?



How to align text above triangle figure



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)Rotate a node but not its content: the case of the ellipse decorationHow to define the default vertical distance between nodes?TikZ scaling graphic and adjust node position and keep font sizealign text in tikz figureNumerical conditional within tikz keys?Relating tree nodes in forest to content in a tableTikZ: Node position in draw environmentLatex and Game Theory: Combining an Extensive and Normal Form for a Three Players GameDrawing graph with Tikz: Link it with main text without overlapping with textTikZ: define arrow starting position based on style and format node label










1















I managed to align my hypotenuse text with the hypotenuse side of my triangle, but I feel like it was done inefficiently using a lot of ~~~~~~ in this line node[above] $sqrt1+x^2$~~~~~~~ (B) --.



Is there a better way to get the same alignment that I have now without the excessive use of ~?



enter image description here



documentclass[hidelinks,14pt, letterpaper]extarticle
usepackageamsmath, amssymb, tikz

newcommandpythagwidth3cm
newcommandpythagheight2cm

begindocument
beginfigure[h]
centering

begintikzpicture[scale=1.25]
coordinate [label=left:$A$] (A) at (-1.5cm,-1.cm);
coordinate [label=above:$B$] (B) at (1.5cm,1.0cm);
coordinate [label=below right:$C$] (C) at (1.5cm,-1.0cm);
draw
(A) --
node[above] $sqrt1+x^2$~~~~~~~ (B) --
node[right] ? (C) --
node[below] ?
(A);
draw
(1.25cm,-1.0cm) rectangle (1.5cm,-0.75cm);

endtikzpicture
captionCaption
labelfig:my_label
endfigure
enddocument









share|improve this question


























    1















    I managed to align my hypotenuse text with the hypotenuse side of my triangle, but I feel like it was done inefficiently using a lot of ~~~~~~ in this line node[above] $sqrt1+x^2$~~~~~~~ (B) --.



    Is there a better way to get the same alignment that I have now without the excessive use of ~?



    enter image description here



    documentclass[hidelinks,14pt, letterpaper]extarticle
    usepackageamsmath, amssymb, tikz

    newcommandpythagwidth3cm
    newcommandpythagheight2cm

    begindocument
    beginfigure[h]
    centering

    begintikzpicture[scale=1.25]
    coordinate [label=left:$A$] (A) at (-1.5cm,-1.cm);
    coordinate [label=above:$B$] (B) at (1.5cm,1.0cm);
    coordinate [label=below right:$C$] (C) at (1.5cm,-1.0cm);
    draw
    (A) --
    node[above] $sqrt1+x^2$~~~~~~~ (B) --
    node[right] ? (C) --
    node[below] ?
    (A);
    draw
    (1.25cm,-1.0cm) rectangle (1.5cm,-0.75cm);

    endtikzpicture
    captionCaption
    labelfig:my_label
    endfigure
    enddocument









    share|improve this question
























      1












      1








      1








      I managed to align my hypotenuse text with the hypotenuse side of my triangle, but I feel like it was done inefficiently using a lot of ~~~~~~ in this line node[above] $sqrt1+x^2$~~~~~~~ (B) --.



      Is there a better way to get the same alignment that I have now without the excessive use of ~?



      enter image description here



      documentclass[hidelinks,14pt, letterpaper]extarticle
      usepackageamsmath, amssymb, tikz

      newcommandpythagwidth3cm
      newcommandpythagheight2cm

      begindocument
      beginfigure[h]
      centering

      begintikzpicture[scale=1.25]
      coordinate [label=left:$A$] (A) at (-1.5cm,-1.cm);
      coordinate [label=above:$B$] (B) at (1.5cm,1.0cm);
      coordinate [label=below right:$C$] (C) at (1.5cm,-1.0cm);
      draw
      (A) --
      node[above] $sqrt1+x^2$~~~~~~~ (B) --
      node[right] ? (C) --
      node[below] ?
      (A);
      draw
      (1.25cm,-1.0cm) rectangle (1.5cm,-0.75cm);

      endtikzpicture
      captionCaption
      labelfig:my_label
      endfigure
      enddocument









      share|improve this question














      I managed to align my hypotenuse text with the hypotenuse side of my triangle, but I feel like it was done inefficiently using a lot of ~~~~~~ in this line node[above] $sqrt1+x^2$~~~~~~~ (B) --.



      Is there a better way to get the same alignment that I have now without the excessive use of ~?



      enter image description here



      documentclass[hidelinks,14pt, letterpaper]extarticle
      usepackageamsmath, amssymb, tikz

      newcommandpythagwidth3cm
      newcommandpythagheight2cm

      begindocument
      beginfigure[h]
      centering

      begintikzpicture[scale=1.25]
      coordinate [label=left:$A$] (A) at (-1.5cm,-1.cm);
      coordinate [label=above:$B$] (B) at (1.5cm,1.0cm);
      coordinate [label=below right:$C$] (C) at (1.5cm,-1.0cm);
      draw
      (A) --
      node[above] $sqrt1+x^2$~~~~~~~ (B) --
      node[right] ? (C) --
      node[below] ?
      (A);
      draw
      (1.25cm,-1.0cm) rectangle (1.5cm,-0.75cm);

      endtikzpicture
      captionCaption
      labelfig:my_label
      endfigure
      enddocument






      tikz-pgf






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 2 hours ago









      Evan KimEvan Kim

      1453




      1453




















          2 Answers
          2






          active

          oldest

          votes


















          3














          Something like this? I use node[midway,above left=0pt,inner sep=0.5pt] $sqrt1+x^2$, where inner sep=0.5pt controls the distance.



          documentclass[hidelinks,14pt, letterpaper]extarticle
          usepackageamsmath, amssymb, tikz

          newcommandpythagwidth3cm
          newcommandpythagheight2cm

          begindocument
          beginfigure[h]
          centering

          begintikzpicture[scale=1.25]
          coordinate [label=left:$A$] (A) at (-1.5cm,-1.cm);
          coordinate [label=above:$B$] (B) at (1.5cm,1.0cm);
          coordinate [label=below right:$C$] (C) at (1.5cm,-1.0cm);
          draw
          (A) --
          node[midway,above left=0pt,inner sep=0.5pt] $sqrt1+x^2$ (B) --
          node[right] ? (C) --
          node[below] ?
          (A);
          draw
          (1.25cm,-1.0cm) rectangle (1.5cm,-0.75cm);

          endtikzpicture
          captionCaption
          labelfig:my_label
          endfigure
          enddocument


          enter image description here



          ADDENDUM: Just for fun: an even simpler and shorter code with TikZ...



          documentclass[tikz,border=3.14mm]standalone
          begindocument
          begintikzpicture[scale=1.25]
          draw (-1.5,-1) coordinate [label=left:$A$] (A) --
          node[midway,above,sloped] $sqrt1+x^2$
          (1.5,1) coordinate [label=above:$B$] (B) --
          node[right] ?
          (1.5,-1)coordinate [label=below right:$C$] (C) --
          node[below] ? cycle;
          draw ([xshift=-0.25cm]C) |- ([yshift=0.25cm]C);
          endtikzpicture
          enddocument


          enter image description here






          share|improve this answer

























          • yes that is it thanks! It seems like simply having node [midway,above left=0pt] $sqrt1+x^2$ (B) -- does the trick too without using inner_sept

            – Evan Kim
            1 hour ago



















          1














          Just for fun: with pstricks, a very short code to have this figure:



           documentclassarticle
          usepackagepst-eucl%,
          usepackageauto-pst-pdf

          begindocument

          beginpostscript
          pssetunit=2, linejoin=1, PointSymbol=none,
          pstTriangle(-1.5,-1)A(1.5,1)B(1.5,-1)C
          ncline[linestyle=none]ABnaput*[nrot=:U]$ sqrt1 + x^2$
          pssetPointName=none
          pstMiddleABACIuput[d](I)?
          pstMiddleABBCJuput[r](J)?
          endpostscript

          enddocument


          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%2f485211%2fhow-to-align-text-above-triangle-figure%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









            3














            Something like this? I use node[midway,above left=0pt,inner sep=0.5pt] $sqrt1+x^2$, where inner sep=0.5pt controls the distance.



            documentclass[hidelinks,14pt, letterpaper]extarticle
            usepackageamsmath, amssymb, tikz

            newcommandpythagwidth3cm
            newcommandpythagheight2cm

            begindocument
            beginfigure[h]
            centering

            begintikzpicture[scale=1.25]
            coordinate [label=left:$A$] (A) at (-1.5cm,-1.cm);
            coordinate [label=above:$B$] (B) at (1.5cm,1.0cm);
            coordinate [label=below right:$C$] (C) at (1.5cm,-1.0cm);
            draw
            (A) --
            node[midway,above left=0pt,inner sep=0.5pt] $sqrt1+x^2$ (B) --
            node[right] ? (C) --
            node[below] ?
            (A);
            draw
            (1.25cm,-1.0cm) rectangle (1.5cm,-0.75cm);

            endtikzpicture
            captionCaption
            labelfig:my_label
            endfigure
            enddocument


            enter image description here



            ADDENDUM: Just for fun: an even simpler and shorter code with TikZ...



            documentclass[tikz,border=3.14mm]standalone
            begindocument
            begintikzpicture[scale=1.25]
            draw (-1.5,-1) coordinate [label=left:$A$] (A) --
            node[midway,above,sloped] $sqrt1+x^2$
            (1.5,1) coordinate [label=above:$B$] (B) --
            node[right] ?
            (1.5,-1)coordinate [label=below right:$C$] (C) --
            node[below] ? cycle;
            draw ([xshift=-0.25cm]C) |- ([yshift=0.25cm]C);
            endtikzpicture
            enddocument


            enter image description here






            share|improve this answer

























            • yes that is it thanks! It seems like simply having node [midway,above left=0pt] $sqrt1+x^2$ (B) -- does the trick too without using inner_sept

              – Evan Kim
              1 hour ago
















            3














            Something like this? I use node[midway,above left=0pt,inner sep=0.5pt] $sqrt1+x^2$, where inner sep=0.5pt controls the distance.



            documentclass[hidelinks,14pt, letterpaper]extarticle
            usepackageamsmath, amssymb, tikz

            newcommandpythagwidth3cm
            newcommandpythagheight2cm

            begindocument
            beginfigure[h]
            centering

            begintikzpicture[scale=1.25]
            coordinate [label=left:$A$] (A) at (-1.5cm,-1.cm);
            coordinate [label=above:$B$] (B) at (1.5cm,1.0cm);
            coordinate [label=below right:$C$] (C) at (1.5cm,-1.0cm);
            draw
            (A) --
            node[midway,above left=0pt,inner sep=0.5pt] $sqrt1+x^2$ (B) --
            node[right] ? (C) --
            node[below] ?
            (A);
            draw
            (1.25cm,-1.0cm) rectangle (1.5cm,-0.75cm);

            endtikzpicture
            captionCaption
            labelfig:my_label
            endfigure
            enddocument


            enter image description here



            ADDENDUM: Just for fun: an even simpler and shorter code with TikZ...



            documentclass[tikz,border=3.14mm]standalone
            begindocument
            begintikzpicture[scale=1.25]
            draw (-1.5,-1) coordinate [label=left:$A$] (A) --
            node[midway,above,sloped] $sqrt1+x^2$
            (1.5,1) coordinate [label=above:$B$] (B) --
            node[right] ?
            (1.5,-1)coordinate [label=below right:$C$] (C) --
            node[below] ? cycle;
            draw ([xshift=-0.25cm]C) |- ([yshift=0.25cm]C);
            endtikzpicture
            enddocument


            enter image description here






            share|improve this answer

























            • yes that is it thanks! It seems like simply having node [midway,above left=0pt] $sqrt1+x^2$ (B) -- does the trick too without using inner_sept

              – Evan Kim
              1 hour ago














            3












            3








            3







            Something like this? I use node[midway,above left=0pt,inner sep=0.5pt] $sqrt1+x^2$, where inner sep=0.5pt controls the distance.



            documentclass[hidelinks,14pt, letterpaper]extarticle
            usepackageamsmath, amssymb, tikz

            newcommandpythagwidth3cm
            newcommandpythagheight2cm

            begindocument
            beginfigure[h]
            centering

            begintikzpicture[scale=1.25]
            coordinate [label=left:$A$] (A) at (-1.5cm,-1.cm);
            coordinate [label=above:$B$] (B) at (1.5cm,1.0cm);
            coordinate [label=below right:$C$] (C) at (1.5cm,-1.0cm);
            draw
            (A) --
            node[midway,above left=0pt,inner sep=0.5pt] $sqrt1+x^2$ (B) --
            node[right] ? (C) --
            node[below] ?
            (A);
            draw
            (1.25cm,-1.0cm) rectangle (1.5cm,-0.75cm);

            endtikzpicture
            captionCaption
            labelfig:my_label
            endfigure
            enddocument


            enter image description here



            ADDENDUM: Just for fun: an even simpler and shorter code with TikZ...



            documentclass[tikz,border=3.14mm]standalone
            begindocument
            begintikzpicture[scale=1.25]
            draw (-1.5,-1) coordinate [label=left:$A$] (A) --
            node[midway,above,sloped] $sqrt1+x^2$
            (1.5,1) coordinate [label=above:$B$] (B) --
            node[right] ?
            (1.5,-1)coordinate [label=below right:$C$] (C) --
            node[below] ? cycle;
            draw ([xshift=-0.25cm]C) |- ([yshift=0.25cm]C);
            endtikzpicture
            enddocument


            enter image description here






            share|improve this answer















            Something like this? I use node[midway,above left=0pt,inner sep=0.5pt] $sqrt1+x^2$, where inner sep=0.5pt controls the distance.



            documentclass[hidelinks,14pt, letterpaper]extarticle
            usepackageamsmath, amssymb, tikz

            newcommandpythagwidth3cm
            newcommandpythagheight2cm

            begindocument
            beginfigure[h]
            centering

            begintikzpicture[scale=1.25]
            coordinate [label=left:$A$] (A) at (-1.5cm,-1.cm);
            coordinate [label=above:$B$] (B) at (1.5cm,1.0cm);
            coordinate [label=below right:$C$] (C) at (1.5cm,-1.0cm);
            draw
            (A) --
            node[midway,above left=0pt,inner sep=0.5pt] $sqrt1+x^2$ (B) --
            node[right] ? (C) --
            node[below] ?
            (A);
            draw
            (1.25cm,-1.0cm) rectangle (1.5cm,-0.75cm);

            endtikzpicture
            captionCaption
            labelfig:my_label
            endfigure
            enddocument


            enter image description here



            ADDENDUM: Just for fun: an even simpler and shorter code with TikZ...



            documentclass[tikz,border=3.14mm]standalone
            begindocument
            begintikzpicture[scale=1.25]
            draw (-1.5,-1) coordinate [label=left:$A$] (A) --
            node[midway,above,sloped] $sqrt1+x^2$
            (1.5,1) coordinate [label=above:$B$] (B) --
            node[right] ?
            (1.5,-1)coordinate [label=below right:$C$] (C) --
            node[below] ? cycle;
            draw ([xshift=-0.25cm]C) |- ([yshift=0.25cm]C);
            endtikzpicture
            enddocument


            enter image description here







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited 57 mins ago

























            answered 1 hour ago









            marmotmarmot

            118k6153288




            118k6153288












            • yes that is it thanks! It seems like simply having node [midway,above left=0pt] $sqrt1+x^2$ (B) -- does the trick too without using inner_sept

              – Evan Kim
              1 hour ago


















            • yes that is it thanks! It seems like simply having node [midway,above left=0pt] $sqrt1+x^2$ (B) -- does the trick too without using inner_sept

              – Evan Kim
              1 hour ago

















            yes that is it thanks! It seems like simply having node [midway,above left=0pt] $sqrt1+x^2$ (B) -- does the trick too without using inner_sept

            – Evan Kim
            1 hour ago






            yes that is it thanks! It seems like simply having node [midway,above left=0pt] $sqrt1+x^2$ (B) -- does the trick too without using inner_sept

            – Evan Kim
            1 hour ago












            1














            Just for fun: with pstricks, a very short code to have this figure:



             documentclassarticle
            usepackagepst-eucl%,
            usepackageauto-pst-pdf

            begindocument

            beginpostscript
            pssetunit=2, linejoin=1, PointSymbol=none,
            pstTriangle(-1.5,-1)A(1.5,1)B(1.5,-1)C
            ncline[linestyle=none]ABnaput*[nrot=:U]$ sqrt1 + x^2$
            pssetPointName=none
            pstMiddleABACIuput[d](I)?
            pstMiddleABBCJuput[r](J)?
            endpostscript

            enddocument


            enter image description here






            share|improve this answer



























              1














              Just for fun: with pstricks, a very short code to have this figure:



               documentclassarticle
              usepackagepst-eucl%,
              usepackageauto-pst-pdf

              begindocument

              beginpostscript
              pssetunit=2, linejoin=1, PointSymbol=none,
              pstTriangle(-1.5,-1)A(1.5,1)B(1.5,-1)C
              ncline[linestyle=none]ABnaput*[nrot=:U]$ sqrt1 + x^2$
              pssetPointName=none
              pstMiddleABACIuput[d](I)?
              pstMiddleABBCJuput[r](J)?
              endpostscript

              enddocument


              enter image description here






              share|improve this answer

























                1












                1








                1







                Just for fun: with pstricks, a very short code to have this figure:



                 documentclassarticle
                usepackagepst-eucl%,
                usepackageauto-pst-pdf

                begindocument

                beginpostscript
                pssetunit=2, linejoin=1, PointSymbol=none,
                pstTriangle(-1.5,-1)A(1.5,1)B(1.5,-1)C
                ncline[linestyle=none]ABnaput*[nrot=:U]$ sqrt1 + x^2$
                pssetPointName=none
                pstMiddleABACIuput[d](I)?
                pstMiddleABBCJuput[r](J)?
                endpostscript

                enddocument


                enter image description here






                share|improve this answer













                Just for fun: with pstricks, a very short code to have this figure:



                 documentclassarticle
                usepackagepst-eucl%,
                usepackageauto-pst-pdf

                begindocument

                beginpostscript
                pssetunit=2, linejoin=1, PointSymbol=none,
                pstTriangle(-1.5,-1)A(1.5,1)B(1.5,-1)C
                ncline[linestyle=none]ABnaput*[nrot=:U]$ sqrt1 + x^2$
                pssetPointName=none
                pstMiddleABACIuput[d](I)?
                pstMiddleABBCJuput[r](J)?
                endpostscript

                enddocument


                enter image description here







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 1 hour ago









                BernardBernard

                176k778210




                176k778210



























                    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%2f485211%2fhow-to-align-text-above-triangle-figure%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

                    Canceling a color specificationRandomly assigning color to Graphics3D objects?Default color for Filling in Mathematica 9Coloring specific elements of sets with a prime modified order in an array plotHow to pick a color differing significantly from the colors already in a given color list?Detection of the text colorColor numbers based on their valueCan color schemes for use with ColorData include opacity specification?My dynamic color schemes

                    Invision Community Contents History See also References External links Navigation menuProprietaryinvisioncommunity.comIPS Community ForumsIPS Community Forumsthis blog entry"License Changes, IP.Board 3.4, and the Future""Interview -- Matt Mecham of Ibforums""CEO Invision Power Board, Matt Mecham Is a Liar, Thief!"IPB License Explanation 1.3, 1.3.1, 2.0, and 2.1ArchivedSecurity Fixes, Updates And Enhancements For IPB 1.3.1Archived"New Demo Accounts - Invision Power Services"the original"New Default Skin"the original"Invision Power Board 3.0.0 and Applications Released"the original"Archived copy"the original"Perpetual licenses being done away with""Release Notes - Invision Power Services""Introducing: IPS Community Suite 4!"Invision Community Release Notes

                    199年 目錄 大件事 到箇年出世嗰人 到箇年死嗰人 節慶、風俗習慣 導覽選單