tikz: 5 squares on a row, roman numbered 1 -> 5How can I get Roman numerals in text?Draw open squares in a row with numbers insidePlacing node at path using `midway` in pgfplotsSuper complicated figure, how to proceed? (tikz)Draw open squares in a row with numbers insideTikZ: squares and arrowsHow to draw pictures of surfaces in LaTeXdrawing circles and squares with TikZDrawing many random paths in TikZTikZ: flipping shape without moving anchorsHelp with a node diagramdrawing simple maps with TikZ: filling areas

What's the correct term for a waitress in the Middle Ages?

Does the growth of home value benefit from compound interest?

Side by side histograms

PhD student with mental health issues and bad performance

Can a magnetic field of an object be stronger than its gravity?

Did Darth Vader wear the same suit for 20+ years?

It possible to have subscript and super script that does not shrink the font size?

How certain is a caster of when their spell will end?

what is triplication on fpga?

Humans meet a distant alien species. How do they standardize? - Units of Measure

Old black and white movie: glowing black rocks slowly turn you into stone upon touch

X-shaped crossword

Personalization conditions switching doesn`t work in Experience Editor (9.1.0, Initial Release)

Will TSA allow me to carry a Continuous Positive Airway Pressure (CPAP) device?

Working in the USA for living expenses only; allowed on VWP?

Did thousands of women die every year due to illegal abortions before Roe v. Wade?

If Boris Johnson were prosecuted and convicted of lying about Brexit, can that be used to cancel Brexit?

Past participle agreement with the subject in the case of pronominal verbs

Why does a helium balloon rise?

Is there any word or phrase for negative bearing?

Why don't B747s start takeoffs with full throttle?

How much water is needed to create a Katana capable of cutting flesh, bones and wood?

How to make thick Asian sauces?

Building a road to escape Earth's gravity by making a pyramid on Antartica



tikz: 5 squares on a row, roman numbered 1 -> 5


How can I get Roman numerals in text?Draw open squares in a row with numbers insidePlacing node at path using `midway` in pgfplotsSuper complicated figure, how to proceed? (tikz)Draw open squares in a row with numbers insideTikZ: squares and arrowsHow to draw pictures of surfaces in LaTeXdrawing circles and squares with TikZDrawing many random paths in TikZTikZ: flipping shape without moving anchorsHelp with a node diagramdrawing simple maps with TikZ: filling areas













3















Having never worked with tkiz before, I can't even begin to understand how to draw this simple thing.



5 squares on a row, roman numbered 1 -> 5



I hate to beg for a "can someone make this for me" but after trying to make this solution work for me by fiddling, tweaking, reading and fumbling for hours on end, and not getting anywhere closer to a solution, I have to turn to my internetfriends for help...



So: basically I need the above drawing, lined out to the middle of the page...



Thank you for your help!










share|improve this question


























    3















    Having never worked with tkiz before, I can't even begin to understand how to draw this simple thing.



    5 squares on a row, roman numbered 1 -> 5



    I hate to beg for a "can someone make this for me" but after trying to make this solution work for me by fiddling, tweaking, reading and fumbling for hours on end, and not getting anywhere closer to a solution, I have to turn to my internetfriends for help...



    So: basically I need the above drawing, lined out to the middle of the page...



    Thank you for your help!










    share|improve this question
























      3












      3








      3


      0






      Having never worked with tkiz before, I can't even begin to understand how to draw this simple thing.



      5 squares on a row, roman numbered 1 -> 5



      I hate to beg for a "can someone make this for me" but after trying to make this solution work for me by fiddling, tweaking, reading and fumbling for hours on end, and not getting anywhere closer to a solution, I have to turn to my internetfriends for help...



      So: basically I need the above drawing, lined out to the middle of the page...



      Thank you for your help!










      share|improve this question














      Having never worked with tkiz before, I can't even begin to understand how to draw this simple thing.



      5 squares on a row, roman numbered 1 -> 5



      I hate to beg for a "can someone make this for me" but after trying to make this solution work for me by fiddling, tweaking, reading and fumbling for hours on end, and not getting anywhere closer to a solution, I have to turn to my internetfriends for help...



      So: basically I need the above drawing, lined out to the middle of the page...



      Thank you for your help!







      tikz-pgf draw






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked May 18 at 18:42









      LooselySubtleLooselySubtle

      1367




      1367




















          3 Answers
          3






          active

          oldest

          votes


















          6














          LaTeX allows you do use Roman<counter> that automatically inserts the right roman number.



          documentclass[tikz,border=3.14mm]standalone
          newcounterpft
          begindocument
          begintikzpicture
          foreach X in 1,...,5
          node[minimum width=6mm] (X) at (X,0) setcounterpftXRomanpft;
          draw(X.north west) rectangle ([yshift=-3mm]X.south east);
          draw([xshift=-1em]1.south west) -- ++ (0,2.5em) -| ([xshift=1em]5.south east);
          endtikzpicture
          enddocument


          enter image description here



          Or using text depth from Joule V's answer and Martin Scharrer's answer without counter and even more automatic.



          documentclass[tikz,border=3.14mm]standalone
          begindocument
          begintikzpicture
          foreach X in 1,...,5
          node[minimum width=8mm,text depth=2ex,draw] (X) at (1.2*X,0)
          uppercaseexpandafterromannumeralXrelax;
          draw([xshift=-1em]1.west) -- ++ (0,2.5em) -| ([xshift=1em]5.east);
          endtikzpicture
          enddocument


          enter image description here






          share|improve this answer

























          • I have no idea what I just copy/pasted but it works. Could you kind of explain what you and @JouleV did? I understand the foreach, but what is `node and how do you get the |----| around it?

            – LooselySubtle
            May 18 at 19:36











          • @LooselySubtle node is a TikZ command that, well, defines a node. This node has a main argument, its content, which is often a text (but can also be a graphics etc.). And these nodes have anchors, which we are using when we draw the hat over them. TikZ has a lot of functions, but the good news is that the pgfmanual has a nice tutorial, and this site many examples from which one can learn.

            – marmot
            May 18 at 19:40






          • 1





            @LooselySubtle, the TikZ manual can be a bit scary for its size, but I think you should at least read the first tutorial. It has been my starting point and it's so well written you can't not understand it (double negative on purpose).

            – Rmano
            May 18 at 19:49


















          6














          documentclass[tikz]standalone
          tikzsetmynode/.style=draw,minimum size=1.5cm,text depth=2baselineskip
          begindocument
          begintikzpicture
          foreach i/ins in 1/I,2/II,3/III,4/IV,5/V
          node[mynode] (i) at (2*i,0) ins;
          draw ([xshift=-.5cm]1.west) |- ([shift=(.5cm,.5cm)]5.north east) -- ++ (0,-1);
          endtikzpicture
          enddocument


          enter image description here






          share|improve this answer






























            2














            With employing of TikZ libraries chains and positioning:



            documentclass[tikz, margin=3mm]standalone
            usetikzlibrarychains, positioning

            begindocument
            begintikzpicture[
            node distance = 4mm,
            start chain = A going right,
            box/.style = draw, minimum size=1.5cm,
            label=[anchor=north,font=large]:#1,
            on chain=A
            ]
            foreach i in I, II, III, IV, V
            node[box=i] ;
            draw ([xshift=-5mm] A-1.west) |- ([yshift=5mm] A-1.north) -| ([xshift=5mm] A-5.east);
            endtikzpicture
            enddocument


            enter image description here



            and with use of Stefan Kottwitz answer on for Roman numerals, which enable to draw arbitrary long chain of nodes:



            documentclass[tikz, margin=3mm]standalone
            usetikzlibrarychains, positioning
            makeatletter
            newcommand*rom[1]expandafter@slowromancapromannumeral #1@
            makeatother

            begindocument
            begintikzpicture[
            node distance = 4mm,
            start chain = A going right,
            box/.style = draw, minimum size=1.5cm,
            label=[anchor=north,font=large]:rom#1, % <---
            on chain=A
            ]
            defNmax5 % <---
            foreach i in 1,...,Nmax % <---
            node[box=i] ;
            draw ([xshift=-5mm] A-1.west) |-
            ([yshift=5mm] A-1.north) -| ([xshift=5mm] A-Nmax.east); % <---
            endtikzpicture
            enddocument


            Result is the same as before.






            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%2f491520%2ftikz-5-squares-on-a-row-roman-numbered-1-5%23new-answer', 'question_page');

              );

              Post as a guest















              Required, but never shown

























              3 Answers
              3






              active

              oldest

              votes








              3 Answers
              3






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              6














              LaTeX allows you do use Roman<counter> that automatically inserts the right roman number.



              documentclass[tikz,border=3.14mm]standalone
              newcounterpft
              begindocument
              begintikzpicture
              foreach X in 1,...,5
              node[minimum width=6mm] (X) at (X,0) setcounterpftXRomanpft;
              draw(X.north west) rectangle ([yshift=-3mm]X.south east);
              draw([xshift=-1em]1.south west) -- ++ (0,2.5em) -| ([xshift=1em]5.south east);
              endtikzpicture
              enddocument


              enter image description here



              Or using text depth from Joule V's answer and Martin Scharrer's answer without counter and even more automatic.



              documentclass[tikz,border=3.14mm]standalone
              begindocument
              begintikzpicture
              foreach X in 1,...,5
              node[minimum width=8mm,text depth=2ex,draw] (X) at (1.2*X,0)
              uppercaseexpandafterromannumeralXrelax;
              draw([xshift=-1em]1.west) -- ++ (0,2.5em) -| ([xshift=1em]5.east);
              endtikzpicture
              enddocument


              enter image description here






              share|improve this answer

























              • I have no idea what I just copy/pasted but it works. Could you kind of explain what you and @JouleV did? I understand the foreach, but what is `node and how do you get the |----| around it?

                – LooselySubtle
                May 18 at 19:36











              • @LooselySubtle node is a TikZ command that, well, defines a node. This node has a main argument, its content, which is often a text (but can also be a graphics etc.). And these nodes have anchors, which we are using when we draw the hat over them. TikZ has a lot of functions, but the good news is that the pgfmanual has a nice tutorial, and this site many examples from which one can learn.

                – marmot
                May 18 at 19:40






              • 1





                @LooselySubtle, the TikZ manual can be a bit scary for its size, but I think you should at least read the first tutorial. It has been my starting point and it's so well written you can't not understand it (double negative on purpose).

                – Rmano
                May 18 at 19:49















              6














              LaTeX allows you do use Roman<counter> that automatically inserts the right roman number.



              documentclass[tikz,border=3.14mm]standalone
              newcounterpft
              begindocument
              begintikzpicture
              foreach X in 1,...,5
              node[minimum width=6mm] (X) at (X,0) setcounterpftXRomanpft;
              draw(X.north west) rectangle ([yshift=-3mm]X.south east);
              draw([xshift=-1em]1.south west) -- ++ (0,2.5em) -| ([xshift=1em]5.south east);
              endtikzpicture
              enddocument


              enter image description here



              Or using text depth from Joule V's answer and Martin Scharrer's answer without counter and even more automatic.



              documentclass[tikz,border=3.14mm]standalone
              begindocument
              begintikzpicture
              foreach X in 1,...,5
              node[minimum width=8mm,text depth=2ex,draw] (X) at (1.2*X,0)
              uppercaseexpandafterromannumeralXrelax;
              draw([xshift=-1em]1.west) -- ++ (0,2.5em) -| ([xshift=1em]5.east);
              endtikzpicture
              enddocument


              enter image description here






              share|improve this answer

























              • I have no idea what I just copy/pasted but it works. Could you kind of explain what you and @JouleV did? I understand the foreach, but what is `node and how do you get the |----| around it?

                – LooselySubtle
                May 18 at 19:36











              • @LooselySubtle node is a TikZ command that, well, defines a node. This node has a main argument, its content, which is often a text (but can also be a graphics etc.). And these nodes have anchors, which we are using when we draw the hat over them. TikZ has a lot of functions, but the good news is that the pgfmanual has a nice tutorial, and this site many examples from which one can learn.

                – marmot
                May 18 at 19:40






              • 1





                @LooselySubtle, the TikZ manual can be a bit scary for its size, but I think you should at least read the first tutorial. It has been my starting point and it's so well written you can't not understand it (double negative on purpose).

                – Rmano
                May 18 at 19:49













              6












              6








              6







              LaTeX allows you do use Roman<counter> that automatically inserts the right roman number.



              documentclass[tikz,border=3.14mm]standalone
              newcounterpft
              begindocument
              begintikzpicture
              foreach X in 1,...,5
              node[minimum width=6mm] (X) at (X,0) setcounterpftXRomanpft;
              draw(X.north west) rectangle ([yshift=-3mm]X.south east);
              draw([xshift=-1em]1.south west) -- ++ (0,2.5em) -| ([xshift=1em]5.south east);
              endtikzpicture
              enddocument


              enter image description here



              Or using text depth from Joule V's answer and Martin Scharrer's answer without counter and even more automatic.



              documentclass[tikz,border=3.14mm]standalone
              begindocument
              begintikzpicture
              foreach X in 1,...,5
              node[minimum width=8mm,text depth=2ex,draw] (X) at (1.2*X,0)
              uppercaseexpandafterromannumeralXrelax;
              draw([xshift=-1em]1.west) -- ++ (0,2.5em) -| ([xshift=1em]5.east);
              endtikzpicture
              enddocument


              enter image description here






              share|improve this answer















              LaTeX allows you do use Roman<counter> that automatically inserts the right roman number.



              documentclass[tikz,border=3.14mm]standalone
              newcounterpft
              begindocument
              begintikzpicture
              foreach X in 1,...,5
              node[minimum width=6mm] (X) at (X,0) setcounterpftXRomanpft;
              draw(X.north west) rectangle ([yshift=-3mm]X.south east);
              draw([xshift=-1em]1.south west) -- ++ (0,2.5em) -| ([xshift=1em]5.south east);
              endtikzpicture
              enddocument


              enter image description here



              Or using text depth from Joule V's answer and Martin Scharrer's answer without counter and even more automatic.



              documentclass[tikz,border=3.14mm]standalone
              begindocument
              begintikzpicture
              foreach X in 1,...,5
              node[minimum width=8mm,text depth=2ex,draw] (X) at (1.2*X,0)
              uppercaseexpandafterromannumeralXrelax;
              draw([xshift=-1em]1.west) -- ++ (0,2.5em) -| ([xshift=1em]5.east);
              endtikzpicture
              enddocument


              enter image description here







              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited May 18 at 19:14

























              answered May 18 at 18:52









              marmotmarmot

              131k6166316




              131k6166316












              • I have no idea what I just copy/pasted but it works. Could you kind of explain what you and @JouleV did? I understand the foreach, but what is `node and how do you get the |----| around it?

                – LooselySubtle
                May 18 at 19:36











              • @LooselySubtle node is a TikZ command that, well, defines a node. This node has a main argument, its content, which is often a text (but can also be a graphics etc.). And these nodes have anchors, which we are using when we draw the hat over them. TikZ has a lot of functions, but the good news is that the pgfmanual has a nice tutorial, and this site many examples from which one can learn.

                – marmot
                May 18 at 19:40






              • 1





                @LooselySubtle, the TikZ manual can be a bit scary for its size, but I think you should at least read the first tutorial. It has been my starting point and it's so well written you can't not understand it (double negative on purpose).

                – Rmano
                May 18 at 19:49

















              • I have no idea what I just copy/pasted but it works. Could you kind of explain what you and @JouleV did? I understand the foreach, but what is `node and how do you get the |----| around it?

                – LooselySubtle
                May 18 at 19:36











              • @LooselySubtle node is a TikZ command that, well, defines a node. This node has a main argument, its content, which is often a text (but can also be a graphics etc.). And these nodes have anchors, which we are using when we draw the hat over them. TikZ has a lot of functions, but the good news is that the pgfmanual has a nice tutorial, and this site many examples from which one can learn.

                – marmot
                May 18 at 19:40






              • 1





                @LooselySubtle, the TikZ manual can be a bit scary for its size, but I think you should at least read the first tutorial. It has been my starting point and it's so well written you can't not understand it (double negative on purpose).

                – Rmano
                May 18 at 19:49
















              I have no idea what I just copy/pasted but it works. Could you kind of explain what you and @JouleV did? I understand the foreach, but what is `node and how do you get the |----| around it?

              – LooselySubtle
              May 18 at 19:36





              I have no idea what I just copy/pasted but it works. Could you kind of explain what you and @JouleV did? I understand the foreach, but what is `node and how do you get the |----| around it?

              – LooselySubtle
              May 18 at 19:36













              @LooselySubtle node is a TikZ command that, well, defines a node. This node has a main argument, its content, which is often a text (but can also be a graphics etc.). And these nodes have anchors, which we are using when we draw the hat over them. TikZ has a lot of functions, but the good news is that the pgfmanual has a nice tutorial, and this site many examples from which one can learn.

              – marmot
              May 18 at 19:40





              @LooselySubtle node is a TikZ command that, well, defines a node. This node has a main argument, its content, which is often a text (but can also be a graphics etc.). And these nodes have anchors, which we are using when we draw the hat over them. TikZ has a lot of functions, but the good news is that the pgfmanual has a nice tutorial, and this site many examples from which one can learn.

              – marmot
              May 18 at 19:40




              1




              1





              @LooselySubtle, the TikZ manual can be a bit scary for its size, but I think you should at least read the first tutorial. It has been my starting point and it's so well written you can't not understand it (double negative on purpose).

              – Rmano
              May 18 at 19:49





              @LooselySubtle, the TikZ manual can be a bit scary for its size, but I think you should at least read the first tutorial. It has been my starting point and it's so well written you can't not understand it (double negative on purpose).

              – Rmano
              May 18 at 19:49











              6














              documentclass[tikz]standalone
              tikzsetmynode/.style=draw,minimum size=1.5cm,text depth=2baselineskip
              begindocument
              begintikzpicture
              foreach i/ins in 1/I,2/II,3/III,4/IV,5/V
              node[mynode] (i) at (2*i,0) ins;
              draw ([xshift=-.5cm]1.west) |- ([shift=(.5cm,.5cm)]5.north east) -- ++ (0,-1);
              endtikzpicture
              enddocument


              enter image description here






              share|improve this answer



























                6














                documentclass[tikz]standalone
                tikzsetmynode/.style=draw,minimum size=1.5cm,text depth=2baselineskip
                begindocument
                begintikzpicture
                foreach i/ins in 1/I,2/II,3/III,4/IV,5/V
                node[mynode] (i) at (2*i,0) ins;
                draw ([xshift=-.5cm]1.west) |- ([shift=(.5cm,.5cm)]5.north east) -- ++ (0,-1);
                endtikzpicture
                enddocument


                enter image description here






                share|improve this answer

























                  6












                  6








                  6







                  documentclass[tikz]standalone
                  tikzsetmynode/.style=draw,minimum size=1.5cm,text depth=2baselineskip
                  begindocument
                  begintikzpicture
                  foreach i/ins in 1/I,2/II,3/III,4/IV,5/V
                  node[mynode] (i) at (2*i,0) ins;
                  draw ([xshift=-.5cm]1.west) |- ([shift=(.5cm,.5cm)]5.north east) -- ++ (0,-1);
                  endtikzpicture
                  enddocument


                  enter image description here






                  share|improve this answer













                  documentclass[tikz]standalone
                  tikzsetmynode/.style=draw,minimum size=1.5cm,text depth=2baselineskip
                  begindocument
                  begintikzpicture
                  foreach i/ins in 1/I,2/II,3/III,4/IV,5/V
                  node[mynode] (i) at (2*i,0) ins;
                  draw ([xshift=-.5cm]1.west) |- ([shift=(.5cm,.5cm)]5.north east) -- ++ (0,-1);
                  endtikzpicture
                  enddocument


                  enter image description here







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered May 18 at 18:50









                  The old JouleVThe old JouleV

                  19.5k43175




                  19.5k43175





















                      2














                      With employing of TikZ libraries chains and positioning:



                      documentclass[tikz, margin=3mm]standalone
                      usetikzlibrarychains, positioning

                      begindocument
                      begintikzpicture[
                      node distance = 4mm,
                      start chain = A going right,
                      box/.style = draw, minimum size=1.5cm,
                      label=[anchor=north,font=large]:#1,
                      on chain=A
                      ]
                      foreach i in I, II, III, IV, V
                      node[box=i] ;
                      draw ([xshift=-5mm] A-1.west) |- ([yshift=5mm] A-1.north) -| ([xshift=5mm] A-5.east);
                      endtikzpicture
                      enddocument


                      enter image description here



                      and with use of Stefan Kottwitz answer on for Roman numerals, which enable to draw arbitrary long chain of nodes:



                      documentclass[tikz, margin=3mm]standalone
                      usetikzlibrarychains, positioning
                      makeatletter
                      newcommand*rom[1]expandafter@slowromancapromannumeral #1@
                      makeatother

                      begindocument
                      begintikzpicture[
                      node distance = 4mm,
                      start chain = A going right,
                      box/.style = draw, minimum size=1.5cm,
                      label=[anchor=north,font=large]:rom#1, % <---
                      on chain=A
                      ]
                      defNmax5 % <---
                      foreach i in 1,...,Nmax % <---
                      node[box=i] ;
                      draw ([xshift=-5mm] A-1.west) |-
                      ([yshift=5mm] A-1.north) -| ([xshift=5mm] A-Nmax.east); % <---
                      endtikzpicture
                      enddocument


                      Result is the same as before.






                      share|improve this answer





























                        2














                        With employing of TikZ libraries chains and positioning:



                        documentclass[tikz, margin=3mm]standalone
                        usetikzlibrarychains, positioning

                        begindocument
                        begintikzpicture[
                        node distance = 4mm,
                        start chain = A going right,
                        box/.style = draw, minimum size=1.5cm,
                        label=[anchor=north,font=large]:#1,
                        on chain=A
                        ]
                        foreach i in I, II, III, IV, V
                        node[box=i] ;
                        draw ([xshift=-5mm] A-1.west) |- ([yshift=5mm] A-1.north) -| ([xshift=5mm] A-5.east);
                        endtikzpicture
                        enddocument


                        enter image description here



                        and with use of Stefan Kottwitz answer on for Roman numerals, which enable to draw arbitrary long chain of nodes:



                        documentclass[tikz, margin=3mm]standalone
                        usetikzlibrarychains, positioning
                        makeatletter
                        newcommand*rom[1]expandafter@slowromancapromannumeral #1@
                        makeatother

                        begindocument
                        begintikzpicture[
                        node distance = 4mm,
                        start chain = A going right,
                        box/.style = draw, minimum size=1.5cm,
                        label=[anchor=north,font=large]:rom#1, % <---
                        on chain=A
                        ]
                        defNmax5 % <---
                        foreach i in 1,...,Nmax % <---
                        node[box=i] ;
                        draw ([xshift=-5mm] A-1.west) |-
                        ([yshift=5mm] A-1.north) -| ([xshift=5mm] A-Nmax.east); % <---
                        endtikzpicture
                        enddocument


                        Result is the same as before.






                        share|improve this answer



























                          2












                          2








                          2







                          With employing of TikZ libraries chains and positioning:



                          documentclass[tikz, margin=3mm]standalone
                          usetikzlibrarychains, positioning

                          begindocument
                          begintikzpicture[
                          node distance = 4mm,
                          start chain = A going right,
                          box/.style = draw, minimum size=1.5cm,
                          label=[anchor=north,font=large]:#1,
                          on chain=A
                          ]
                          foreach i in I, II, III, IV, V
                          node[box=i] ;
                          draw ([xshift=-5mm] A-1.west) |- ([yshift=5mm] A-1.north) -| ([xshift=5mm] A-5.east);
                          endtikzpicture
                          enddocument


                          enter image description here



                          and with use of Stefan Kottwitz answer on for Roman numerals, which enable to draw arbitrary long chain of nodes:



                          documentclass[tikz, margin=3mm]standalone
                          usetikzlibrarychains, positioning
                          makeatletter
                          newcommand*rom[1]expandafter@slowromancapromannumeral #1@
                          makeatother

                          begindocument
                          begintikzpicture[
                          node distance = 4mm,
                          start chain = A going right,
                          box/.style = draw, minimum size=1.5cm,
                          label=[anchor=north,font=large]:rom#1, % <---
                          on chain=A
                          ]
                          defNmax5 % <---
                          foreach i in 1,...,Nmax % <---
                          node[box=i] ;
                          draw ([xshift=-5mm] A-1.west) |-
                          ([yshift=5mm] A-1.north) -| ([xshift=5mm] A-Nmax.east); % <---
                          endtikzpicture
                          enddocument


                          Result is the same as before.






                          share|improve this answer















                          With employing of TikZ libraries chains and positioning:



                          documentclass[tikz, margin=3mm]standalone
                          usetikzlibrarychains, positioning

                          begindocument
                          begintikzpicture[
                          node distance = 4mm,
                          start chain = A going right,
                          box/.style = draw, minimum size=1.5cm,
                          label=[anchor=north,font=large]:#1,
                          on chain=A
                          ]
                          foreach i in I, II, III, IV, V
                          node[box=i] ;
                          draw ([xshift=-5mm] A-1.west) |- ([yshift=5mm] A-1.north) -| ([xshift=5mm] A-5.east);
                          endtikzpicture
                          enddocument


                          enter image description here



                          and with use of Stefan Kottwitz answer on for Roman numerals, which enable to draw arbitrary long chain of nodes:



                          documentclass[tikz, margin=3mm]standalone
                          usetikzlibrarychains, positioning
                          makeatletter
                          newcommand*rom[1]expandafter@slowromancapromannumeral #1@
                          makeatother

                          begindocument
                          begintikzpicture[
                          node distance = 4mm,
                          start chain = A going right,
                          box/.style = draw, minimum size=1.5cm,
                          label=[anchor=north,font=large]:rom#1, % <---
                          on chain=A
                          ]
                          defNmax5 % <---
                          foreach i in 1,...,Nmax % <---
                          node[box=i] ;
                          draw ([xshift=-5mm] A-1.west) |-
                          ([yshift=5mm] A-1.north) -| ([xshift=5mm] A-Nmax.east); % <---
                          endtikzpicture
                          enddocument


                          Result is the same as before.







                          share|improve this answer














                          share|improve this answer



                          share|improve this answer








                          edited May 18 at 20:15

























                          answered May 18 at 19:41









                          ZarkoZarko

                          136k872180




                          136k872180



























                              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%2f491520%2ftikz-5-squares-on-a-row-roman-numbered-1-5%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

                              How to write a 12-bar blues melodyI-IV-V blues progressionHow to play the bridges in a standard blues progressionHow does Gdim7 fit in C# minor?question on a certain chord progressionMusicology of Melody12 bar blues, spread rhythm: alternative to 6th chord to avoid finger stretchChord progressions/ Root key/ MelodiesHow to put chords (POP-EDM) under a given lead vocal melody (starting from a good knowledge in music theory)Are there “rules” for improvising with the minor pentatonic scale over 12-bar shuffle?Confusion about blues scale and chords

                              What if the end-user didn't have the required library?What is setup.py?What is a clean, pythonic way to have multiple constructors in Python?What does Ruby have that Python doesn't, and vice versa?What is the reason for having '//' in Python?How do I create a namespace package in Python?How to package shared objects that python modules depend on?setuptools vs. distutils: why is distutils still a thing?Navigation in Windows 10 vs code not going to virtualenv library when the same library is installed at user levelPython create package for local usePackaging a project that uses multiple python versionsWhy is permission denied on pip install except for when “--user” is included at end of command?

                              Esgonzo ibérico Índice Descrición Distribución Hábitat Ameazas Notas Véxase tamén "Acerca dos nomes dos anfibios e réptiles galegos""Chalcides bedriagai"Chalcides bedriagai en Carrascal, L. M. Salvador, A. (Eds). Enciclopedia virtual de los vertebrados españoles. Museo Nacional de Ciencias Naturales, Madrid. España.Fotos