Changes

Jump to navigation Jump to search
2,336 bytes added ,  23:20, 10 April 2023
Combinations are ConTeXt's way to align several pictures (preferrably at same size):
 
== Combinations ==
<texcode>
\stopcombination
\stopplacefigure
</context>
 
=== Image Width ===
 
The image widths aren’t calculated automatically:
 
<context source="yes">
\startcombination[3*1]
{\externalfigure[cow]}{cow}
{\externalfigure[mill]}{mill}
{\externalfigure[hacker]}{hacker}
\stopcombination
</context>
 
You could define them on your own:
 
<texcode>
\startcombination[3*1]
{\externalfigure[cow] [width=.3\textwidth]}{cow}
{\externalfigure[mill] [width=.3\textwidth]}{mill}
{\externalfigure[hacker][width=.3\textwidth]}{hacker}
\stopcombination
</texcode>
 
But that’s ugly and tedious. Hans did it for you in {{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[mill] [width=\measure{combination}]}{mill}
{\externalfigure[hacker][width=\measure{combination}]}{hacker}
\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[cow] [combination]}{cow}
{\externalfigure[mill] [combination]}{mill}
{\externalfigure[hacker][combination]}{hacker}
\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}[ref:right] (right) and \in{image}[ref:left] (left).
</context>
== Setup ==
There is the {{cmd|setupcombinations}} command.
== Referencing ==
18

edits

Navigation menu