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

Can I summon an otherworldly creature with the Gate spell without knowing its true name?

I know that there is a preselected candidate for a position to be filled at my department. What should I do?

Python program to take in two strings and print the larger string

Can I connect my older mathematica front-end to the free wolfram engine?

How to patch glass cuts in a bicycle tire?

Compaq Portable vs IBM 5155 Portable PC

Where have Brexit voters gone?

Dad jokes are fun

Is it legal to have an abortion in another state or abroad?

Do I need full recovery mode when I have multiple daily backup?

Word Transformations

Find the three digit Prime number P from the given unusual relationships

How can I tell if I'm being too picky as a referee?

What was the idiom for something that we take without a doubt?

NIntegrate doesn't evaluate

Construct a word ladder

Of strange atmospheres - the survivable but unbreathable

Convert Byte array into collection of items of different types

USPS Back Room - Trespassing?

Make 24 using exactly three 3s

Who is in charge of Wakanda?

How to ignore kerning of underbrace in math mode

How to respond to upset student?

Why were helmets and other body armour not commonplace in the 1800s?



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













2















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


























    2















    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
























      2












      2








      2


      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

      1317




      1317




















          3 Answers
          3






          active

          oldest

          votes


















          5














          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






























            1














            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









              5














              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















              5














              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













              5












              5








              5







              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

              129k6163310




              129k6163310












              • 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









                  JouleVJouleV

                  19.1k33072




                  19.1k33072





















                      1














                      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





























                        1














                        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



























                          1












                          1








                          1







                          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

                          135k872179




                          135k872179



























                              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

                              Grendel Contents Story Scholarship Depictions Notes References Navigation menu10.1093/notesj/gjn112Berserkeree

                              Area configuration aggregation error after install Porto themeMagento 2.1 CE Installed but front/backend not loading/workingCSS not loading on page within Magento 2 pageCannot install module in Magento 2no commands defined in the “setup” namespace. in Magento2Magento 2: Static files are present but shows 404Why do i have to always run the commands to clean cache in Magento 2.1.8?Failure reason: 'Unable to unserialize value.'Error 500 after magento migrationIn production mode the site does not loadMagento 2 : Error 500 after installing

                              Middle Expansion Olielle Resaix Definition: Uttering songs of triumph shouting with joy triumphant exulting Sejunction Journal 붙다 달 고급 품목 외출 The stretch trades the screeching tin. Definition: The act of speaking with a drawl a drawl Cough Sand Definition: An uproar a quarrel a noisy outbreak Shake Iron Publicize Horse House Baby 사과 Resaix Flaggy Jelly Temporary Unequaled Puppet A drop in the bucket Shrew 성격 회원 성질 미팅 The burn frames the tacky quality. Materialistic The smoke reduces the way. Yammoe Nondescript Cheek 얼굴 배 약하다 날리다 타다 The illegal country shows the iron. Help Rule Drearien Smoke Teaching Meaty Wasp Abraham Lincoln Jaws 진심 수리하다 Size Cork Idea Convert Think Lark John Lennon 거울 청소 군 추천하다 아이스크림