Changes

Jump to navigation Jump to search
3,382 bytes added ,  23:20, 10 April 2023
Combinations are ConTeXt's way to align several pictures (preferrably at same size):
 
== Combinations ==
<texcode>
\startcombination[x*y]%% x=columns, y=rows
{something}{caption} ...
...
\stopcombination
</texcode>
 
or using the newer interface:
 
<texcode>
\startcombination [nx=3, ny=2] %% 3 columns, 2 rows
\startcontent something \stopcontent
\startcaption caption \stopcaption
\startcontent something \stopcontent
\startcaption caption \stopcaption
\startcontent something \stopcontent
\startcaption caption \stopcaption
\startcontent something \stopcontent
\startcaption caption \stopcaption
\startcontent something \stopcontent
\startcaption caption \stopcaption
\startcontent something \stopcontent
\startcaption caption \stopcaption
\stopcombination
 
</texcode>
 
means:
You define, how much figures in columns * rows you'd like to align.
You must provide one "figure something" (e.g. an <{{cmd>|externalfigure</cmd>}}) and a caption for every "cell".
The sample, from the manual, shows how to define a caption for the whole group and use it as float (see [[Floating Objects]]):
<context source=yes>
\placefigureuseMPlibrary [dum] %% sample images \startplacefigure [title=An example of a combination] \startcombination [herenx=3, ny=2] % placement option \startcontent \externalfigure [dummy] \stopcontent \startcaption a \stopcaption \startcontent \externalfigure [dummy] \stopcontent \startcaption b \stopcaption \startcontent \externalfigure [dummy] \stopcontent \startcaption c \stopcaption \startcontent \externalfigure [dummy] \stopcontent \startcaption d \stopcaption \startcontent \externalfigure [figdummy] \stopcontent \startcaption e \stopcaption \startcontent \externalfigure [dummy] \stopcontent \startcaption f \stopcaption \stopcombination\stopplacefigure</context> === Image Width === The image widths aren’t calculated automatically:combinations <context source="yes">\startcombination[3*1] % reference {\externalfigure[cow]}{cow} {\externalfigure[mill]}{An example of combinationmill} % caption for whole group {\externalfigure[hacker]}{hacker}\stopcombination</context> You could define them on your own: <texcode>\startcombination[3*21] {\externalfigure[cow] % [width=.3 columns, 2 rows\textwidth]}{cow} {\externalfigure[lb00220mill] [width=.3\textwidth]} {amill} {\externalfigure[lb00221hacker][width=.3\textwidth]} {bhacker} % picture \stopcombination</texcode> But that’s ugly and caption tedious. Hans did it for two figures you in first row{{src|grph-inc.mkxl}}: <texcode>\definemeasure[combination][ (\textwidth -\effectiveleftskip -\effectiverightskip -\numexpr\combinationparameter\nx-\plusone\relax\dimexpr\combinationparameter\distance\relax )/\combinationparameter]</texcode> So you can say: <texcode>\startcombination[3*1] {\externalfigure[cow] [width=\measure{combination}]}{cow} {\externalfigure[lb00222mill] [width=\measure{combination}]}{mill} {\externalfigure[hacker][width=\measure{combination}]} {chacker}\stopcombination</texcode> But that’s still tedious. With the power of {{cmd|defineexternalfigure}}: <texcode>\defineexternalfigure[combination][width=\measure{combination} ]</texcode>(That’s predefined, no need to copy!) <context source="yes">\startcombination[3*1] {\externalfigure[lb00223cow] [combination]} {dcow} {\externalfigure[lb00225mill] [combination]} {emill} {\externalfigure[lb00226hacker][combination]} {fhacker}
\stopcombination
</context> Beautiful. ;) == Floatcombinations == When combination contain floats, the command {{cmd|startfloatcombination}} is used. Here an example using float combinations as well as subfloatnumbering that creates subfigures sharing a mutual figure prefix and an individual subfigure designator (e.g. figure 1a), figure 1b, etc.). <context source=yes>\useMPlibrary [dum] \startplacefigure [location=none] \startfloatcombination [nx=2] \startplacefigure [title=Left, reference=ref:left, group=one, groupsuffix=a] \externalfigure \stopplacefigure \startplacefigure [title=Right, reference=ref:right, group=one, groupsuffix=b] \externalfigure \stopplacefigure \stopfloatcombination\stopplacefigure See \in{image} % whole combination [ref:right] (right) and \in braces of placefigure{image}[ref:left] (left).
</context>
== Setup ==
There is the {{cmd|setupcombinations}} command. [[Category:Graphics]][[Category:Text elements]]
== Referencing ==
This would produce something like 'figure 2.4d'. The content of the second parameter simply gets appended to the end of the figure's reference-number, thus the example above would still work even if the caption would be 'd) An awesome subfigure'.
 
== See also ==
[[Floating_Objects#Subfloats]], {{cmd|startfloatcombination}}, {{cmd|startsubfloatnumbering}}
 
[[Category:Graphics]]
18

edits

Navigation menu