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
Having never worked with tkiz before, I can't even begin to understand how to draw this simple thing.

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
add a comment |
Having never worked with tkiz before, I can't even begin to understand how to draw this simple thing.

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
add a comment |
Having never worked with tkiz before, I can't even begin to understand how to draw this simple thing.

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
Having never worked with tkiz before, I can't even begin to understand how to draw this simple thing.

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
tikz-pgf draw
asked May 18 at 18:42
LooselySubtleLooselySubtle
1367
1367
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
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

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

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
@LooselySubtlenodeis 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
add a comment |
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

add a comment |
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

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.
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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

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

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
@LooselySubtlenodeis 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
add a comment |
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

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

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
@LooselySubtlenodeis 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
add a comment |
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

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

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

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

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
@LooselySubtlenodeis 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
add a comment |
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
@LooselySubtlenodeis 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
add a comment |
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

add a comment |
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

add a comment |
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

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

answered May 18 at 18:50
The old JouleVThe old JouleV
19.5k43175
19.5k43175
add a comment |
add a comment |
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

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.
add a comment |
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

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.
add a comment |
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

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.
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

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.
edited May 18 at 20:15
answered May 18 at 19:41
ZarkoZarko
136k872180
136k872180
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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