Creating a number pyramid with tabularx
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I am trying to create a simple number pyramid like this one using a tabularx table with six columns and `multicolumn' commands.
I tried
begintabularx0.5linewidthXXXXXX
cline3-4
multicolumn2c&multicolumn2c&multicolumn2c\
cline2-5
multicolumn1c&multicolumn2c&multicolumn2c&multicolumn1c\
hline
multicolumn2c$frac32$&multicolumn2c$frac13$&multicolumn2c$frac12$\
hline
endtabularx
.. which gives me a very distorted table.
However if I add a simple empty line to the table with
&&&&&&
everything looks perfect. My only issue now is that the table is too long, because of that extra empty line.
Is there a way to get a pretty pyramid without adding that extra line?
tables tabularx
add a comment |Â
up vote
1
down vote
favorite
I am trying to create a simple number pyramid like this one using a tabularx table with six columns and `multicolumn' commands.
I tried
begintabularx0.5linewidthXXXXXX
cline3-4
multicolumn2c&multicolumn2c&multicolumn2c\
cline2-5
multicolumn1c&multicolumn2c&multicolumn2c&multicolumn1c\
hline
multicolumn2c$frac32$&multicolumn2c$frac13$&multicolumn2c$frac12$\
hline
endtabularx
.. which gives me a very distorted table.
However if I add a simple empty line to the table with
&&&&&&
everything looks perfect. My only issue now is that the table is too long, because of that extra empty line.
Is there a way to get a pretty pyramid without adding that extra line?
tables tabularx
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I am trying to create a simple number pyramid like this one using a tabularx table with six columns and `multicolumn' commands.
I tried
begintabularx0.5linewidthXXXXXX
cline3-4
multicolumn2c&multicolumn2c&multicolumn2c\
cline2-5
multicolumn1c&multicolumn2c&multicolumn2c&multicolumn1c\
hline
multicolumn2c$frac32$&multicolumn2c$frac13$&multicolumn2c$frac12$\
hline
endtabularx
.. which gives me a very distorted table.
However if I add a simple empty line to the table with
&&&&&&
everything looks perfect. My only issue now is that the table is too long, because of that extra empty line.
Is there a way to get a pretty pyramid without adding that extra line?
tables tabularx
I am trying to create a simple number pyramid like this one using a tabularx table with six columns and `multicolumn' commands.
I tried
begintabularx0.5linewidthXXXXXX
cline3-4
multicolumn2c&multicolumn2c&multicolumn2c\
cline2-5
multicolumn1c&multicolumn2c&multicolumn2c&multicolumn1c\
hline
multicolumn2c$frac32$&multicolumn2c$frac13$&multicolumn2c$frac12$\
hline
endtabularx
.. which gives me a very distorted table.
However if I add a simple empty line to the table with
&&&&&&
everything looks perfect. My only issue now is that the table is too long, because of that extra empty line.
Is there a way to get a pretty pyramid without adding that extra line?
tables tabularx
tables tabularx
asked 1 hour ago
user1583209
25516
25516
add a comment |Â
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
3
down vote
drawing this number pyramid is much simpler than write it as table. especially if you like to use tabularx
table environment. by use of the tikz
package you can obtain:
documentclass[tikz, border=3mm]standalone
usetikzlibrarypositioning
begindocument
begintikzpicture[
node distance = 0pt,
every node/.style = draw, minimum size=7mm, inner sep=0pt, outer sep=0pt
]
node (n1) ;
%
node (n11) [below left=of n1.south] ;
node (n12) [right=of n11] ;
%
node (n21) [below left=of n11.south] $frac13$;
node (n22) [right=of n21] $frac13$;
node (n23) [right=of n22] $frac12$;
endtikzpicture
enddocument
add a comment |Â
up vote
2
down vote
With some low level programming:
documentclassarticle
usepackageamsmath
usepackagevarwidth
newcommandblock[1]%
begingroup
setlengthfboxsep0pt%
vrule width0pt height blockdim
ooalign%
framebox[blockdim]rule0ptblockdimcr
hidewidthraisebox0.5dimexprblockdim-heightraiseboxdepth#1hidewidthcr
%
endgroup
newcommandjoinblocksunskipkern-fboxruleignorespaces
newenvironmentblocks[1][1cm]
beginvarwidthtextwidthsetlengthblockdim#1makeblocks
endvarwidth
newcommandmakeblocks%
begingrouplccode`~=`&lowercaseendgrouplet~joinblocks
catcode`&=active
baselineskip=0pt
lineskiplimit=maxdimen
lineskip=0pt
centering
newlengthblockdim
begindocument
A pyramid
beginblocks
block1\
block2 & block3 \
block4 & block5 & block$dfrac366$
endblocks
in context
bigskip
A pyramid
beginblocks[1.5cm]
block1\
block2 & block3 \
block4 & block5 & block$dfrac366$
endblocks
in context
enddocument
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
drawing this number pyramid is much simpler than write it as table. especially if you like to use tabularx
table environment. by use of the tikz
package you can obtain:
documentclass[tikz, border=3mm]standalone
usetikzlibrarypositioning
begindocument
begintikzpicture[
node distance = 0pt,
every node/.style = draw, minimum size=7mm, inner sep=0pt, outer sep=0pt
]
node (n1) ;
%
node (n11) [below left=of n1.south] ;
node (n12) [right=of n11] ;
%
node (n21) [below left=of n11.south] $frac13$;
node (n22) [right=of n21] $frac13$;
node (n23) [right=of n22] $frac12$;
endtikzpicture
enddocument
add a comment |Â
up vote
3
down vote
drawing this number pyramid is much simpler than write it as table. especially if you like to use tabularx
table environment. by use of the tikz
package you can obtain:
documentclass[tikz, border=3mm]standalone
usetikzlibrarypositioning
begindocument
begintikzpicture[
node distance = 0pt,
every node/.style = draw, minimum size=7mm, inner sep=0pt, outer sep=0pt
]
node (n1) ;
%
node (n11) [below left=of n1.south] ;
node (n12) [right=of n11] ;
%
node (n21) [below left=of n11.south] $frac13$;
node (n22) [right=of n21] $frac13$;
node (n23) [right=of n22] $frac12$;
endtikzpicture
enddocument
add a comment |Â
up vote
3
down vote
up vote
3
down vote
drawing this number pyramid is much simpler than write it as table. especially if you like to use tabularx
table environment. by use of the tikz
package you can obtain:
documentclass[tikz, border=3mm]standalone
usetikzlibrarypositioning
begindocument
begintikzpicture[
node distance = 0pt,
every node/.style = draw, minimum size=7mm, inner sep=0pt, outer sep=0pt
]
node (n1) ;
%
node (n11) [below left=of n1.south] ;
node (n12) [right=of n11] ;
%
node (n21) [below left=of n11.south] $frac13$;
node (n22) [right=of n21] $frac13$;
node (n23) [right=of n22] $frac12$;
endtikzpicture
enddocument
drawing this number pyramid is much simpler than write it as table. especially if you like to use tabularx
table environment. by use of the tikz
package you can obtain:
documentclass[tikz, border=3mm]standalone
usetikzlibrarypositioning
begindocument
begintikzpicture[
node distance = 0pt,
every node/.style = draw, minimum size=7mm, inner sep=0pt, outer sep=0pt
]
node (n1) ;
%
node (n11) [below left=of n1.south] ;
node (n12) [right=of n11] ;
%
node (n21) [below left=of n11.south] $frac13$;
node (n22) [right=of n21] $frac13$;
node (n23) [right=of n22] $frac12$;
endtikzpicture
enddocument
answered 43 mins ago
Zarko
113k861150
113k861150
add a comment |Â
add a comment |Â
up vote
2
down vote
With some low level programming:
documentclassarticle
usepackageamsmath
usepackagevarwidth
newcommandblock[1]%
begingroup
setlengthfboxsep0pt%
vrule width0pt height blockdim
ooalign%
framebox[blockdim]rule0ptblockdimcr
hidewidthraisebox0.5dimexprblockdim-heightraiseboxdepth#1hidewidthcr
%
endgroup
newcommandjoinblocksunskipkern-fboxruleignorespaces
newenvironmentblocks[1][1cm]
beginvarwidthtextwidthsetlengthblockdim#1makeblocks
endvarwidth
newcommandmakeblocks%
begingrouplccode`~=`&lowercaseendgrouplet~joinblocks
catcode`&=active
baselineskip=0pt
lineskiplimit=maxdimen
lineskip=0pt
centering
newlengthblockdim
begindocument
A pyramid
beginblocks
block1\
block2 & block3 \
block4 & block5 & block$dfrac366$
endblocks
in context
bigskip
A pyramid
beginblocks[1.5cm]
block1\
block2 & block3 \
block4 & block5 & block$dfrac366$
endblocks
in context
enddocument
add a comment |Â
up vote
2
down vote
With some low level programming:
documentclassarticle
usepackageamsmath
usepackagevarwidth
newcommandblock[1]%
begingroup
setlengthfboxsep0pt%
vrule width0pt height blockdim
ooalign%
framebox[blockdim]rule0ptblockdimcr
hidewidthraisebox0.5dimexprblockdim-heightraiseboxdepth#1hidewidthcr
%
endgroup
newcommandjoinblocksunskipkern-fboxruleignorespaces
newenvironmentblocks[1][1cm]
beginvarwidthtextwidthsetlengthblockdim#1makeblocks
endvarwidth
newcommandmakeblocks%
begingrouplccode`~=`&lowercaseendgrouplet~joinblocks
catcode`&=active
baselineskip=0pt
lineskiplimit=maxdimen
lineskip=0pt
centering
newlengthblockdim
begindocument
A pyramid
beginblocks
block1\
block2 & block3 \
block4 & block5 & block$dfrac366$
endblocks
in context
bigskip
A pyramid
beginblocks[1.5cm]
block1\
block2 & block3 \
block4 & block5 & block$dfrac366$
endblocks
in context
enddocument
add a comment |Â
up vote
2
down vote
up vote
2
down vote
With some low level programming:
documentclassarticle
usepackageamsmath
usepackagevarwidth
newcommandblock[1]%
begingroup
setlengthfboxsep0pt%
vrule width0pt height blockdim
ooalign%
framebox[blockdim]rule0ptblockdimcr
hidewidthraisebox0.5dimexprblockdim-heightraiseboxdepth#1hidewidthcr
%
endgroup
newcommandjoinblocksunskipkern-fboxruleignorespaces
newenvironmentblocks[1][1cm]
beginvarwidthtextwidthsetlengthblockdim#1makeblocks
endvarwidth
newcommandmakeblocks%
begingrouplccode`~=`&lowercaseendgrouplet~joinblocks
catcode`&=active
baselineskip=0pt
lineskiplimit=maxdimen
lineskip=0pt
centering
newlengthblockdim
begindocument
A pyramid
beginblocks
block1\
block2 & block3 \
block4 & block5 & block$dfrac366$
endblocks
in context
bigskip
A pyramid
beginblocks[1.5cm]
block1\
block2 & block3 \
block4 & block5 & block$dfrac366$
endblocks
in context
enddocument
With some low level programming:
documentclassarticle
usepackageamsmath
usepackagevarwidth
newcommandblock[1]%
begingroup
setlengthfboxsep0pt%
vrule width0pt height blockdim
ooalign%
framebox[blockdim]rule0ptblockdimcr
hidewidthraisebox0.5dimexprblockdim-heightraiseboxdepth#1hidewidthcr
%
endgroup
newcommandjoinblocksunskipkern-fboxruleignorespaces
newenvironmentblocks[1][1cm]
beginvarwidthtextwidthsetlengthblockdim#1makeblocks
endvarwidth
newcommandmakeblocks%
begingrouplccode`~=`&lowercaseendgrouplet~joinblocks
catcode`&=active
baselineskip=0pt
lineskiplimit=maxdimen
lineskip=0pt
centering
newlengthblockdim
begindocument
A pyramid
beginblocks
block1\
block2 & block3 \
block4 & block5 & block$dfrac366$
endblocks
in context
bigskip
A pyramid
beginblocks[1.5cm]
block1\
block2 & block3 \
block4 & block5 & block$dfrac366$
endblocks
in context
enddocument
answered 19 mins ago
egreg
683k8418183064
683k8418183064
add a comment |Â
add a comment |Â
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
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f451446%2fcreating-a-number-pyramid-with-tabularx%23new-answer', 'question_page');
);
Post as a guest
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
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
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