Difference between revisions of "Command/startcombination"

From Wiki
Jump to navigation Jump to search
 
(6 intermediate revisions by one other user not shown)
Line 6: Line 6:
 
== [[Help:Reference|Syntax]] (autogenerated) ==
 
== [[Help:Reference|Syntax]] (autogenerated) ==
 
<syntax>startcombination</syntax>
 
<syntax>startcombination</syntax>
== [[Help:Reference|Syntax]] (autogenerated)] ==
 
<syntax>startcombination</syntax>
 
== [[Help:Reference|Syntax]] ==
 
<table cellspacing="4" cellpadding="2" class="cmd">
 
  <tr>
 
    <td colspan="2" class="cmd">\startcombination<span class="first" >[''c''*''r'']</span> ... \stopcombination</td>
 
  </tr>
 
  <tr valign="top" class="first">
 
    <td class="cmd">[''c''*''r'']</td>
 
    <td>'' columns * rows''</td>
 
  </tr>
 
</table>
 
  
 
== Description ==  
 
== Description ==  
Line 23: Line 11:
 
A combination is a number of objects arranged in a matrix, with a caption below each object. (The captions may be empty.)
 
A combination is a number of objects arranged in a matrix, with a caption below each object. (The captions may be empty.)
  
== Example ==
+
== Examples ==
  
 
<context source=yes>
 
<context source=yes>
Line 75: Line 63:
 
</texcode>
 
</texcode>
 
[[Image:combinations.png]]
 
[[Image:combinations.png]]
 +
 +
=== Example for LMTX ===
 +
 +
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:
 +
 +
<texcode>
 +
\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
 +
</texcode>
  
 
== See also ==
 
== See also ==
* {{cmd|setupcombinations}}
+
* {{cmd|setupcombination}}
 
* {{cmd|placefloat}}
 
* {{cmd|placefloat}}
 
* {{cmd|defineparagraphs}} for non-floating side-by-side.
 
* {{cmd|defineparagraphs}} for non-floating side-by-side.

Latest revision as of 20:41, 22 May 2021

\startcombination

Syntax (autogenerated)

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


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


Description

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

Examples

\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}

This MkIV example shows how to autolabel figures with

\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

combinations.png

Example for LMTX

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

See also

Help from ConTeXt-Mailinglist/Forum

All issues with: