Difference between revisions of "Command/startcombination"

From Wiki
Jump to navigation Jump to search
(Created page with "Documentation for \startcombination ... \stopcombination")
 
 
Line 40: Line 40:
 
         {\externalfigure[cow][height=1cm]} {a}  % subfigure and subcaption
 
         {\externalfigure[cow][height=1cm]} {a}  % subfigure and subcaption
 
         {\externalfigure[cow][height=1cm]} {b}
 
         {\externalfigure[cow][height=1cm]} {b}
         {\externalfigure[cow][height=1cm]} {c}  
+
         {\externalfigure[cow][height=1cm]} {c}
 
         % second row
 
         % second row
 
         {\externalfigure[cow][height=1cm]} {d}
 
         {\externalfigure[cow][height=1cm]} {d}
         {\externalfigure[cow][height=1cm]} {e}  
+
         {\externalfigure[cow][height=1cm]} {e}
 
         {\externalfigure[cow][height=1cm]} {f}
 
         {\externalfigure[cow][height=1cm]} {f}
 
     \stopcombination}
 
     \stopcombination}
Line 78: Line 78:
 
</context>
 
</context>
  
</cd:example></cd:examples>
+
</cd:example><cd:example title="Alternative input syntax">On the mailinglist Hans answered on 14 may 2021 what you can do with combinations and how to add captions in in a different way:
 +
 
 +
<context source="yes">
 +
\startplacefigure[location=here]
 +
  \startcombination[distance=2mm,after=,nx=2,ny=1,location=middle]
 +
      \startcontent
 +
          \externalfigure[mill.png]  [width=.4\textwidth]
 +
      \stopcontent
 +
      \startcaption
 +
          pic 1
 +
      \stopcaption
 +
      \startcontent
 +
          \externalfigure[hacker.jpg][width=.4\textwidth]
 +
      \stopcontent
 +
      \startcaption
 +
          pic 2
 +
      \stopcaption
 +
  \stopcombination
 +
\stopplacefigure
 +
</context></cd:example><cd:example title="grid alignment"><context source="yes">
 +
\setuppapersize[A7,landscape]
 +
\setuplayout[grid=yes]
 +
\useMPlibrary[dum]
 +
\showgrid
 +
\starttext
 +
before
 +
 
 +
\startcombination [nx=2,ny=1,continue=yes]   
 +
  {\externalfigure[dummy][width=4cm,height=1cm]} {}   
 +
  {\externalfigure[dummy][width=4cm,height=1cm]} {}
 +
\stopcombination
 +
 
 +
after
 +
 
 +
before
 +
 
 +
\startlinecorrection
 +
\startcombination [nx=2,ny=1,continue=yes]   
 +
  {\externalfigure[dummy][width=4cm,height=1cm]} {}   
 +
  {\externalfigure[dummy][width=4cm,height=1cm]} {}
 +
\stopcombination
 +
\stoplinecorrection
 +
 
 +
after
 +
\stoptext
 +
</context></cd:example></cd:examples>
 
<cd:notes></cd:notes>
 
<cd:notes></cd:notes>
 
<cd:seealso>
 
<cd:seealso>

Latest revision as of 09:49, 14 September 2023


\startcombination ... \stopcombination

Summary

The environment \startcombination ... \stopcombination is used for grouping visual objects

Settings

\startcombination[...][...=...,...] ... \stopcombination
[...]name
...=...,...inherits from \setupcombination

Settings matrix

\startcombination[...][...] ... \stopcombination
[...]name
[...]matrix

Description

A combination is a number of objects arranged in a matrix, with a caption below each object. (The captions may be empty.)

Examples

Example 1

\setupexternalfigures[location={local, default}]
\placefigure
    [here]                                       % figure placement
    [fig:combinations]                           % figure reference
    {An example of \type{\startcombination...}.} % figure caption
    {\startcombination[3*2]                      % contents of the figure: a combination
        % first row
        {\externalfigure[cow][height=1cm]} {a}   % subfigure and subcaption
        {\externalfigure[cow][height=1cm]} {b}
        {\externalfigure[cow][height=1cm]} {c}
        % second row
        {\externalfigure[cow][height=1cm]} {d}
        {\externalfigure[cow][height=1cm]} {e}
        {\externalfigure[cow][height=1cm]} {f}
     \stopcombination}

Automatic caption labels

This example shows how to autolabel figures

\useMPlibrary[dum]

\definecombination[mycombi][alternative=label]

\setuplabel[combination:mycombi][
    text={Item },
    numberconversion=character,
    stopper=!,
]

4 pics

\startcombination[mycombi][2*2]
    {\externalfigure[dummy][width=4cm,height=1cm]}
    {\externalfigure[dummy][width=4cm,height=1cm]}
    {\externalfigure[dummy][width=4cm,height=1cm]}
    {\externalfigure[dummy][width=4cm,height=1cm]}
\stopcombination

\blank[2*big]

2 more pics

\startcombination[mycombi][nx=2,ny=1,continue=yes]
    {\externalfigure[dummy][width=4cm,height=1cm]}
    {\externalfigure[dummy][width=4cm,height=1cm]}
\stopcombination


Alternative input syntax

On the mailinglist Hans answered on 14 may 2021 what you can do with combinations and how to add captions in in a different way:

\startplacefigure[location=here]
   \startcombination[distance=2mm,after=,nx=2,ny=1,location=middle]
       \startcontent
           \externalfigure[mill.png]  [width=.4\textwidth]
       \stopcontent
       \startcaption
           pic 1
       \stopcaption
       \startcontent
           \externalfigure[hacker.jpg][width=.4\textwidth]
       \stopcontent
       \startcaption
           pic 2
       \stopcaption
   \stopcombination
\stopplacefigure

grid alignment

\setuppapersize[A7,landscape]
\setuplayout[grid=yes]
\useMPlibrary[dum]
\showgrid
\starttext
before

\startcombination [nx=2,ny=1,continue=yes]
  {\externalfigure[dummy][width=4cm,height=1cm]} {}
  {\externalfigure[dummy][width=4cm,height=1cm]} {}
 \stopcombination

after

before

\startlinecorrection
 \startcombination [nx=2,ny=1,continue=yes]
  {\externalfigure[dummy][width=4cm,height=1cm]} {}
  {\externalfigure[dummy][width=4cm,height=1cm]} {}
 \stopcombination
\stoplinecorrection

after
\stoptext

Notes

See also

Help from ConTeXt-Mailinglist/Forum

All issues with: