Aligned boxes without exceeding textwidth
Clash Royale CLAN TAG#URR8PPP
up vote
2
down vote
favorite
I have this:
newcommandbpic[2]
makebox[textwidth][l]
fboxmakebox[.1textwidth][r]includegraphics[width=20pt]#1hspace*5ptfboxparbox.9textwidth#2newline%
bpicresilience.pngResilience, in that broken nodes do not compromise the network entirely;
bpicspontaneity.pngSpontaneity, a feature empowered by the network's capacity to form and heal itself;
bpicdecentralization.pngDecentralization, in the sense that having devices connect directly the need for Internet providers is alleviated;
bpicscale.pngScale, as a consequence of the fact that such networks benefit from node density to form a greater number of alternative paths;
bpicthroughput.pngThroughput, an attribute achieved by enabling multiple paths simultaneously to transmit data to a given destination;
bpicbalancing.pngLoad balancing, with several alternatives being used to leverage traffic on the network;
bpiccosts.pngReduced costs of infrastructure, due to the nodes connecting directly, thereby alleviating the need for central authorities.
That is resulting in this:
All fbox
s are there only for the sake of understanding the layout. There a few things wrong with what I want:
The boxes are exceeding the text width in comparison with the rest of the text. Notice that at the right.
I wanted the picture and text boxes to be the same height and with the text centered vertically.
If the text needs more vertically space than what is used by the image, the image below should adjust by being lowerâÂÂâÂÂjust as with a bullet list.
How can I do this?
boxes bullets
add a comment |Â
up vote
2
down vote
favorite
I have this:
newcommandbpic[2]
makebox[textwidth][l]
fboxmakebox[.1textwidth][r]includegraphics[width=20pt]#1hspace*5ptfboxparbox.9textwidth#2newline%
bpicresilience.pngResilience, in that broken nodes do not compromise the network entirely;
bpicspontaneity.pngSpontaneity, a feature empowered by the network's capacity to form and heal itself;
bpicdecentralization.pngDecentralization, in the sense that having devices connect directly the need for Internet providers is alleviated;
bpicscale.pngScale, as a consequence of the fact that such networks benefit from node density to form a greater number of alternative paths;
bpicthroughput.pngThroughput, an attribute achieved by enabling multiple paths simultaneously to transmit data to a given destination;
bpicbalancing.pngLoad balancing, with several alternatives being used to leverage traffic on the network;
bpiccosts.pngReduced costs of infrastructure, due to the nodes connecting directly, thereby alleviating the need for central authorities.
That is resulting in this:
All fbox
s are there only for the sake of understanding the layout. There a few things wrong with what I want:
The boxes are exceeding the text width in comparison with the rest of the text. Notice that at the right.
I wanted the picture and text boxes to be the same height and with the text centered vertically.
If the text needs more vertically space than what is used by the image, the image below should adjust by being lowerâÂÂâÂÂjust as with a bullet list.
How can I do this?
boxes bullets
Have you thought using a tabular for this? (And well, if you add dimensions that exceed the text width, it is perhaps not too surprising that things run over. E.g.tabularx
takes care of this.)
â marmot
46 mins ago
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I have this:
newcommandbpic[2]
makebox[textwidth][l]
fboxmakebox[.1textwidth][r]includegraphics[width=20pt]#1hspace*5ptfboxparbox.9textwidth#2newline%
bpicresilience.pngResilience, in that broken nodes do not compromise the network entirely;
bpicspontaneity.pngSpontaneity, a feature empowered by the network's capacity to form and heal itself;
bpicdecentralization.pngDecentralization, in the sense that having devices connect directly the need for Internet providers is alleviated;
bpicscale.pngScale, as a consequence of the fact that such networks benefit from node density to form a greater number of alternative paths;
bpicthroughput.pngThroughput, an attribute achieved by enabling multiple paths simultaneously to transmit data to a given destination;
bpicbalancing.pngLoad balancing, with several alternatives being used to leverage traffic on the network;
bpiccosts.pngReduced costs of infrastructure, due to the nodes connecting directly, thereby alleviating the need for central authorities.
That is resulting in this:
All fbox
s are there only for the sake of understanding the layout. There a few things wrong with what I want:
The boxes are exceeding the text width in comparison with the rest of the text. Notice that at the right.
I wanted the picture and text boxes to be the same height and with the text centered vertically.
If the text needs more vertically space than what is used by the image, the image below should adjust by being lowerâÂÂâÂÂjust as with a bullet list.
How can I do this?
boxes bullets
I have this:
newcommandbpic[2]
makebox[textwidth][l]
fboxmakebox[.1textwidth][r]includegraphics[width=20pt]#1hspace*5ptfboxparbox.9textwidth#2newline%
bpicresilience.pngResilience, in that broken nodes do not compromise the network entirely;
bpicspontaneity.pngSpontaneity, a feature empowered by the network's capacity to form and heal itself;
bpicdecentralization.pngDecentralization, in the sense that having devices connect directly the need for Internet providers is alleviated;
bpicscale.pngScale, as a consequence of the fact that such networks benefit from node density to form a greater number of alternative paths;
bpicthroughput.pngThroughput, an attribute achieved by enabling multiple paths simultaneously to transmit data to a given destination;
bpicbalancing.pngLoad balancing, with several alternatives being used to leverage traffic on the network;
bpiccosts.pngReduced costs of infrastructure, due to the nodes connecting directly, thereby alleviating the need for central authorities.
That is resulting in this:
All fbox
s are there only for the sake of understanding the layout. There a few things wrong with what I want:
The boxes are exceeding the text width in comparison with the rest of the text. Notice that at the right.
I wanted the picture and text boxes to be the same height and with the text centered vertically.
If the text needs more vertically space than what is used by the image, the image below should adjust by being lowerâÂÂâÂÂjust as with a bullet list.
How can I do this?
boxes bullets
boxes bullets
asked 51 mins ago
André Fratelli
1606
1606
Have you thought using a tabular for this? (And well, if you add dimensions that exceed the text width, it is perhaps not too surprising that things run over. E.g.tabularx
takes care of this.)
â marmot
46 mins ago
add a comment |Â
Have you thought using a tabular for this? (And well, if you add dimensions that exceed the text width, it is perhaps not too surprising that things run over. E.g.tabularx
takes care of this.)
â marmot
46 mins ago
Have you thought using a tabular for this? (And well, if you add dimensions that exceed the text width, it is perhaps not too surprising that things run over. E.g.
tabularx
takes care of this.)â marmot
46 mins ago
Have you thought using a tabular for this? (And well, if you add dimensions that exceed the text width, it is perhaps not too surprising that things run over. E.g.
tabularx
takes care of this.)â marmot
46 mins ago
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
3
down vote
Your desired output looks like a table to me. (If you want to run over page breaks with it, you may want to use longtable
instead of tabularx
.)
documentclassarticle
usepackagetabularx,graphicx,lipsum
% raisebox-.5height... from https://tex.stackexchange.com/a/19083/121799
newcommandbpic[1]raisebox-.5heightincludegraphics[width=16pt]#1
begindocument
lipsum[1]
noindent
begintabularxtextwidthm20ptX
bpicexample-image-a & Resilience, in that broken nodes do not compromise the
network entirely\
bpicexample-image-b & Spontaneity, a feature empowered by the network's capacity to form and heal itself;\
endtabularx
lipsum[2]
enddocument
Of course, I do not have your figures.
EDIT: I'm confused about your comment. So maybe an even simpler thing will do?
documentclassarticle
usepackagelipsum,graphicx
newcommandbpic[1]includegraphics[width=16pt]#1
begindocument
lipsum[1]
beginitemize
item[bpicexample-image-a] Resilience, in that broken nodes do not compromise the
network entirely
item[bpicexample-image-b] Spontaneity, a feature empowered by the network's capacity to form and heal itself;
enditemize
lipsum[2]
enddocument
Works in terms of not exceeding textwidth and adjusting to the contents of the previous point, but what about centering text vertically?
â André Fratelli
25 mins ago
1
@AndréFratelli I am not sure I understand your comment because in the table the texts are centered, aren't they? (For more options see e.g. this post and its answers). Rereading your question, especially "just as with a bullet list.", I added a second option.
â marmot
16 mins ago
add a comment |Â
up vote
3
down vote
As marmot suggests, I'd wrap this in a table. In fact, to ensure consistent formatting I would wrap everything into a nice little macro so that you can write your table as
ImageTable{
example-image-aResilience, in that broken nodes ...,
example-image-bSpontaneity, a feature empowered...,
example-image-cDecentralization, in the sense...,
example-image-aScale, as a consequence of the fact...,
example-image-bThroughput, an attribute achieved...,
example-image-cLoad balancing, with several alternatives...,
example-imageReduced costs of infrastructure, due...
to produce:
So, ImageTable
accepts a comma separated list of pairs that give the image and the corresponding text.
Normally. I would do this using docsvlist
from the etoolbox package but I found it tricky to pass two arguments (the image and the text) through to the do
command (newcomanddo[2]...
didn't work). Instead I have used the slightly fancier and scarier looking LaTeX3 package together with the etoolbox package to align the images (this adds a few extra options to the includegraphics
command such as the align=?
used below). If you want to tweak the image alignment have a look at the other options available in the package documentation.
Here is the full code:
documentclassarticle
usepackagetabularx
usepackageexpl3
usepackagegraphbox
usepackagemwe% for images
ExplSyntaxOn
clist_new:N l_image_table_list
cs_new_protected:Npn image_table_row #1 #2
includegraphics[width=20pt, align=t]#1 & #2\
cs_new:Npn ImageTable #1 %
noindent
clist_set:Nn l_image_table_list #1
begintabularxtextwidthcX
clist_map_inline:Nn l_image_table_list image_table_row ##1
endtabularx
ExplSyntaxOff
begindocument
ImageTable
example-image-aResilience, in that broken nodes do not compromise the network entirely;,
example-image-bSpontaneity, a feature empowered by the network's capacity to form and heal itself;,
example-image-cDecentralization, in the sense that having devices connect directly the need for Internet providers is alleviated;,
example-image-aScale, as a consequence of the fact that such networks benefit from node density to form a greater number of alternative paths;,
example-image-bThroughput, an attribute achieved by enabling multiple paths simultaneously to transmit data to a given destination;,
example-image-cLoad balancing, with several alternatives being used to leverage traffic on the network;,
example-imageReduced costs of infrastructure, due to the nodes connecting directly, thereby alleviating the need for central authorities.
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
Your desired output looks like a table to me. (If you want to run over page breaks with it, you may want to use longtable
instead of tabularx
.)
documentclassarticle
usepackagetabularx,graphicx,lipsum
% raisebox-.5height... from https://tex.stackexchange.com/a/19083/121799
newcommandbpic[1]raisebox-.5heightincludegraphics[width=16pt]#1
begindocument
lipsum[1]
noindent
begintabularxtextwidthm20ptX
bpicexample-image-a & Resilience, in that broken nodes do not compromise the
network entirely\
bpicexample-image-b & Spontaneity, a feature empowered by the network's capacity to form and heal itself;\
endtabularx
lipsum[2]
enddocument
Of course, I do not have your figures.
EDIT: I'm confused about your comment. So maybe an even simpler thing will do?
documentclassarticle
usepackagelipsum,graphicx
newcommandbpic[1]includegraphics[width=16pt]#1
begindocument
lipsum[1]
beginitemize
item[bpicexample-image-a] Resilience, in that broken nodes do not compromise the
network entirely
item[bpicexample-image-b] Spontaneity, a feature empowered by the network's capacity to form and heal itself;
enditemize
lipsum[2]
enddocument
Works in terms of not exceeding textwidth and adjusting to the contents of the previous point, but what about centering text vertically?
â André Fratelli
25 mins ago
1
@AndréFratelli I am not sure I understand your comment because in the table the texts are centered, aren't they? (For more options see e.g. this post and its answers). Rereading your question, especially "just as with a bullet list.", I added a second option.
â marmot
16 mins ago
add a comment |Â
up vote
3
down vote
Your desired output looks like a table to me. (If you want to run over page breaks with it, you may want to use longtable
instead of tabularx
.)
documentclassarticle
usepackagetabularx,graphicx,lipsum
% raisebox-.5height... from https://tex.stackexchange.com/a/19083/121799
newcommandbpic[1]raisebox-.5heightincludegraphics[width=16pt]#1
begindocument
lipsum[1]
noindent
begintabularxtextwidthm20ptX
bpicexample-image-a & Resilience, in that broken nodes do not compromise the
network entirely\
bpicexample-image-b & Spontaneity, a feature empowered by the network's capacity to form and heal itself;\
endtabularx
lipsum[2]
enddocument
Of course, I do not have your figures.
EDIT: I'm confused about your comment. So maybe an even simpler thing will do?
documentclassarticle
usepackagelipsum,graphicx
newcommandbpic[1]includegraphics[width=16pt]#1
begindocument
lipsum[1]
beginitemize
item[bpicexample-image-a] Resilience, in that broken nodes do not compromise the
network entirely
item[bpicexample-image-b] Spontaneity, a feature empowered by the network's capacity to form and heal itself;
enditemize
lipsum[2]
enddocument
Works in terms of not exceeding textwidth and adjusting to the contents of the previous point, but what about centering text vertically?
â André Fratelli
25 mins ago
1
@AndréFratelli I am not sure I understand your comment because in the table the texts are centered, aren't they? (For more options see e.g. this post and its answers). Rereading your question, especially "just as with a bullet list.", I added a second option.
â marmot
16 mins ago
add a comment |Â
up vote
3
down vote
up vote
3
down vote
Your desired output looks like a table to me. (If you want to run over page breaks with it, you may want to use longtable
instead of tabularx
.)
documentclassarticle
usepackagetabularx,graphicx,lipsum
% raisebox-.5height... from https://tex.stackexchange.com/a/19083/121799
newcommandbpic[1]raisebox-.5heightincludegraphics[width=16pt]#1
begindocument
lipsum[1]
noindent
begintabularxtextwidthm20ptX
bpicexample-image-a & Resilience, in that broken nodes do not compromise the
network entirely\
bpicexample-image-b & Spontaneity, a feature empowered by the network's capacity to form and heal itself;\
endtabularx
lipsum[2]
enddocument
Of course, I do not have your figures.
EDIT: I'm confused about your comment. So maybe an even simpler thing will do?
documentclassarticle
usepackagelipsum,graphicx
newcommandbpic[1]includegraphics[width=16pt]#1
begindocument
lipsum[1]
beginitemize
item[bpicexample-image-a] Resilience, in that broken nodes do not compromise the
network entirely
item[bpicexample-image-b] Spontaneity, a feature empowered by the network's capacity to form and heal itself;
enditemize
lipsum[2]
enddocument
Your desired output looks like a table to me. (If you want to run over page breaks with it, you may want to use longtable
instead of tabularx
.)
documentclassarticle
usepackagetabularx,graphicx,lipsum
% raisebox-.5height... from https://tex.stackexchange.com/a/19083/121799
newcommandbpic[1]raisebox-.5heightincludegraphics[width=16pt]#1
begindocument
lipsum[1]
noindent
begintabularxtextwidthm20ptX
bpicexample-image-a & Resilience, in that broken nodes do not compromise the
network entirely\
bpicexample-image-b & Spontaneity, a feature empowered by the network's capacity to form and heal itself;\
endtabularx
lipsum[2]
enddocument
Of course, I do not have your figures.
EDIT: I'm confused about your comment. So maybe an even simpler thing will do?
documentclassarticle
usepackagelipsum,graphicx
newcommandbpic[1]includegraphics[width=16pt]#1
begindocument
lipsum[1]
beginitemize
item[bpicexample-image-a] Resilience, in that broken nodes do not compromise the
network entirely
item[bpicexample-image-b] Spontaneity, a feature empowered by the network's capacity to form and heal itself;
enditemize
lipsum[2]
enddocument
edited 19 mins ago
answered 36 mins ago
marmot
70.7k476151
70.7k476151
Works in terms of not exceeding textwidth and adjusting to the contents of the previous point, but what about centering text vertically?
â André Fratelli
25 mins ago
1
@AndréFratelli I am not sure I understand your comment because in the table the texts are centered, aren't they? (For more options see e.g. this post and its answers). Rereading your question, especially "just as with a bullet list.", I added a second option.
â marmot
16 mins ago
add a comment |Â
Works in terms of not exceeding textwidth and adjusting to the contents of the previous point, but what about centering text vertically?
â André Fratelli
25 mins ago
1
@AndréFratelli I am not sure I understand your comment because in the table the texts are centered, aren't they? (For more options see e.g. this post and its answers). Rereading your question, especially "just as with a bullet list.", I added a second option.
â marmot
16 mins ago
Works in terms of not exceeding textwidth and adjusting to the contents of the previous point, but what about centering text vertically?
â André Fratelli
25 mins ago
Works in terms of not exceeding textwidth and adjusting to the contents of the previous point, but what about centering text vertically?
â André Fratelli
25 mins ago
1
1
@AndréFratelli I am not sure I understand your comment because in the table the texts are centered, aren't they? (For more options see e.g. this post and its answers). Rereading your question, especially "just as with a bullet list.", I added a second option.
â marmot
16 mins ago
@AndréFratelli I am not sure I understand your comment because in the table the texts are centered, aren't they? (For more options see e.g. this post and its answers). Rereading your question, especially "just as with a bullet list.", I added a second option.
â marmot
16 mins ago
add a comment |Â
up vote
3
down vote
As marmot suggests, I'd wrap this in a table. In fact, to ensure consistent formatting I would wrap everything into a nice little macro so that you can write your table as
ImageTable{
example-image-aResilience, in that broken nodes ...,
example-image-bSpontaneity, a feature empowered...,
example-image-cDecentralization, in the sense...,
example-image-aScale, as a consequence of the fact...,
example-image-bThroughput, an attribute achieved...,
example-image-cLoad balancing, with several alternatives...,
example-imageReduced costs of infrastructure, due...
to produce:
So, ImageTable
accepts a comma separated list of pairs that give the image and the corresponding text.
Normally. I would do this using docsvlist
from the etoolbox package but I found it tricky to pass two arguments (the image and the text) through to the do
command (newcomanddo[2]...
didn't work). Instead I have used the slightly fancier and scarier looking LaTeX3 package together with the etoolbox package to align the images (this adds a few extra options to the includegraphics
command such as the align=?
used below). If you want to tweak the image alignment have a look at the other options available in the package documentation.
Here is the full code:
documentclassarticle
usepackagetabularx
usepackageexpl3
usepackagegraphbox
usepackagemwe% for images
ExplSyntaxOn
clist_new:N l_image_table_list
cs_new_protected:Npn image_table_row #1 #2
includegraphics[width=20pt, align=t]#1 & #2\
cs_new:Npn ImageTable #1 %
noindent
clist_set:Nn l_image_table_list #1
begintabularxtextwidthcX
clist_map_inline:Nn l_image_table_list image_table_row ##1
endtabularx
ExplSyntaxOff
begindocument
ImageTable
example-image-aResilience, in that broken nodes do not compromise the network entirely;,
example-image-bSpontaneity, a feature empowered by the network's capacity to form and heal itself;,
example-image-cDecentralization, in the sense that having devices connect directly the need for Internet providers is alleviated;,
example-image-aScale, as a consequence of the fact that such networks benefit from node density to form a greater number of alternative paths;,
example-image-bThroughput, an attribute achieved by enabling multiple paths simultaneously to transmit data to a given destination;,
example-image-cLoad balancing, with several alternatives being used to leverage traffic on the network;,
example-imageReduced costs of infrastructure, due to the nodes connecting directly, thereby alleviating the need for central authorities.
enddocument
add a comment |Â
up vote
3
down vote
As marmot suggests, I'd wrap this in a table. In fact, to ensure consistent formatting I would wrap everything into a nice little macro so that you can write your table as
ImageTable{
example-image-aResilience, in that broken nodes ...,
example-image-bSpontaneity, a feature empowered...,
example-image-cDecentralization, in the sense...,
example-image-aScale, as a consequence of the fact...,
example-image-bThroughput, an attribute achieved...,
example-image-cLoad balancing, with several alternatives...,
example-imageReduced costs of infrastructure, due...
to produce:
So, ImageTable
accepts a comma separated list of pairs that give the image and the corresponding text.
Normally. I would do this using docsvlist
from the etoolbox package but I found it tricky to pass two arguments (the image and the text) through to the do
command (newcomanddo[2]...
didn't work). Instead I have used the slightly fancier and scarier looking LaTeX3 package together with the etoolbox package to align the images (this adds a few extra options to the includegraphics
command such as the align=?
used below). If you want to tweak the image alignment have a look at the other options available in the package documentation.
Here is the full code:
documentclassarticle
usepackagetabularx
usepackageexpl3
usepackagegraphbox
usepackagemwe% for images
ExplSyntaxOn
clist_new:N l_image_table_list
cs_new_protected:Npn image_table_row #1 #2
includegraphics[width=20pt, align=t]#1 & #2\
cs_new:Npn ImageTable #1 %
noindent
clist_set:Nn l_image_table_list #1
begintabularxtextwidthcX
clist_map_inline:Nn l_image_table_list image_table_row ##1
endtabularx
ExplSyntaxOff
begindocument
ImageTable
example-image-aResilience, in that broken nodes do not compromise the network entirely;,
example-image-bSpontaneity, a feature empowered by the network's capacity to form and heal itself;,
example-image-cDecentralization, in the sense that having devices connect directly the need for Internet providers is alleviated;,
example-image-aScale, as a consequence of the fact that such networks benefit from node density to form a greater number of alternative paths;,
example-image-bThroughput, an attribute achieved by enabling multiple paths simultaneously to transmit data to a given destination;,
example-image-cLoad balancing, with several alternatives being used to leverage traffic on the network;,
example-imageReduced costs of infrastructure, due to the nodes connecting directly, thereby alleviating the need for central authorities.
enddocument
add a comment |Â
up vote
3
down vote
up vote
3
down vote
As marmot suggests, I'd wrap this in a table. In fact, to ensure consistent formatting I would wrap everything into a nice little macro so that you can write your table as
ImageTable{
example-image-aResilience, in that broken nodes ...,
example-image-bSpontaneity, a feature empowered...,
example-image-cDecentralization, in the sense...,
example-image-aScale, as a consequence of the fact...,
example-image-bThroughput, an attribute achieved...,
example-image-cLoad balancing, with several alternatives...,
example-imageReduced costs of infrastructure, due...
to produce:
So, ImageTable
accepts a comma separated list of pairs that give the image and the corresponding text.
Normally. I would do this using docsvlist
from the etoolbox package but I found it tricky to pass two arguments (the image and the text) through to the do
command (newcomanddo[2]...
didn't work). Instead I have used the slightly fancier and scarier looking LaTeX3 package together with the etoolbox package to align the images (this adds a few extra options to the includegraphics
command such as the align=?
used below). If you want to tweak the image alignment have a look at the other options available in the package documentation.
Here is the full code:
documentclassarticle
usepackagetabularx
usepackageexpl3
usepackagegraphbox
usepackagemwe% for images
ExplSyntaxOn
clist_new:N l_image_table_list
cs_new_protected:Npn image_table_row #1 #2
includegraphics[width=20pt, align=t]#1 & #2\
cs_new:Npn ImageTable #1 %
noindent
clist_set:Nn l_image_table_list #1
begintabularxtextwidthcX
clist_map_inline:Nn l_image_table_list image_table_row ##1
endtabularx
ExplSyntaxOff
begindocument
ImageTable
example-image-aResilience, in that broken nodes do not compromise the network entirely;,
example-image-bSpontaneity, a feature empowered by the network's capacity to form and heal itself;,
example-image-cDecentralization, in the sense that having devices connect directly the need for Internet providers is alleviated;,
example-image-aScale, as a consequence of the fact that such networks benefit from node density to form a greater number of alternative paths;,
example-image-bThroughput, an attribute achieved by enabling multiple paths simultaneously to transmit data to a given destination;,
example-image-cLoad balancing, with several alternatives being used to leverage traffic on the network;,
example-imageReduced costs of infrastructure, due to the nodes connecting directly, thereby alleviating the need for central authorities.
enddocument
As marmot suggests, I'd wrap this in a table. In fact, to ensure consistent formatting I would wrap everything into a nice little macro so that you can write your table as
ImageTable{
example-image-aResilience, in that broken nodes ...,
example-image-bSpontaneity, a feature empowered...,
example-image-cDecentralization, in the sense...,
example-image-aScale, as a consequence of the fact...,
example-image-bThroughput, an attribute achieved...,
example-image-cLoad balancing, with several alternatives...,
example-imageReduced costs of infrastructure, due...
to produce:
So, ImageTable
accepts a comma separated list of pairs that give the image and the corresponding text.
Normally. I would do this using docsvlist
from the etoolbox package but I found it tricky to pass two arguments (the image and the text) through to the do
command (newcomanddo[2]...
didn't work). Instead I have used the slightly fancier and scarier looking LaTeX3 package together with the etoolbox package to align the images (this adds a few extra options to the includegraphics
command such as the align=?
used below). If you want to tweak the image alignment have a look at the other options available in the package documentation.
Here is the full code:
documentclassarticle
usepackagetabularx
usepackageexpl3
usepackagegraphbox
usepackagemwe% for images
ExplSyntaxOn
clist_new:N l_image_table_list
cs_new_protected:Npn image_table_row #1 #2
includegraphics[width=20pt, align=t]#1 & #2\
cs_new:Npn ImageTable #1 %
noindent
clist_set:Nn l_image_table_list #1
begintabularxtextwidthcX
clist_map_inline:Nn l_image_table_list image_table_row ##1
endtabularx
ExplSyntaxOff
begindocument
ImageTable
example-image-aResilience, in that broken nodes do not compromise the network entirely;,
example-image-bSpontaneity, a feature empowered by the network's capacity to form and heal itself;,
example-image-cDecentralization, in the sense that having devices connect directly the need for Internet providers is alleviated;,
example-image-aScale, as a consequence of the fact that such networks benefit from node density to form a greater number of alternative paths;,
example-image-bThroughput, an attribute achieved by enabling multiple paths simultaneously to transmit data to a given destination;,
example-image-cLoad balancing, with several alternatives being used to leverage traffic on the network;,
example-imageReduced costs of infrastructure, due to the nodes connecting directly, thereby alleviating the need for central authorities.
enddocument
edited 11 mins ago
answered 21 mins ago
Andrew
28.7k34075
28.7k34075
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%2f457959%2faligned-boxes-without-exceeding-textwidth%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
Have you thought using a tabular for this? (And well, if you add dimensions that exceed the text width, it is perhaps not too surprising that things run over. E.g.
tabularx
takes care of this.)â marmot
46 mins ago