ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Placing (numbered) figures side-by-side
@ 2014-07-04  8:21 Mojca Miklavec
  2014-07-04 14:13 ` Wolfgang Schuster
  0 siblings, 1 reply; 7+ messages in thread
From: Mojca Miklavec @ 2014-07-04  8:21 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi,

When placing figures side-by-side I usually use

\placefigure[force][label]{}{\startcombination[2*1]
{\externalfigure[A]}{Some description of A}
{\externalfigure[B]}{Some description of B}
\stopcombination}

But this time I would like to get two separate figures with two separate titles:

              [figure]                            [figure]
Figure 1.1: Long description of A   Figure 1.2: Long description of B

with those long descriptions being "justified" (they split in multiple
line already), not centered.

What is the best way to achieve that?

Thank you,
   Mojca
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Placing (numbered) figures side-by-side
  2014-07-04  8:21 Placing (numbered) figures side-by-side Mojca Miklavec
@ 2014-07-04 14:13 ` Wolfgang Schuster
  2014-07-04 15:31   ` Mojca Miklavec
  0 siblings, 1 reply; 7+ messages in thread
From: Wolfgang Schuster @ 2014-07-04 14:13 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 04.07.2014 um 10:21 schrieb Mojca Miklavec <mojca.miklavec.lists@gmail.com>:

> Hi,
> 
> When placing figures side-by-side I usually use
> 
> \placefigure[force][label]{}{\startcombination[2*1]
> {\externalfigure[A]}{Some description of A}
> {\externalfigure[B]}{Some description of B}
> \stopcombination}
> 
> But this time I would like to get two separate figures with two separate titles:
> 
>              [figure]                            [figure]
> Figure 1.1: Long description of A   Figure 1.2: Long description of B
> 
> with those long descriptions being "justified" (they split in multiple
> line already), not centered.
> 
> What is the best way to achieve that?

Use the floatcombination environment.

\useMPlibrary[dum]

\starttext

\startplacefigure[location=nonumber]
	\startfloatcombination%[width=\textwidth,distance=0pt]
		\startplacefigure[title={Some description of A}]
			%\externalfigure[A][width=4cm]
			\framed[frame=off,offset=none,width=.5\textwidth]{\externalfigure[A][width=4cm]}
		\stopplacefigure
		\startplacefigure[title={Some description of B}]
			%\externalfigure[B][width=4cm]
			\framed[frame=off,offset=none,width=.5\textwidth]{\externalfigure[B][width=4cm]}
		\stopplacefigure
	\stopfloatcombination
\stopplacefigure

\stoptext

Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Placing (numbered) figures side-by-side
  2014-07-04 14:13 ` Wolfgang Schuster
@ 2014-07-04 15:31   ` Mojca Miklavec
  2014-07-04 15:40     ` Mojca Miklavec
  2014-07-04 15:53     ` Wolfgang Schuster
  0 siblings, 2 replies; 7+ messages in thread
From: Mojca Miklavec @ 2014-07-04 15:31 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Fri, Jul 4, 2014 at 4:13 PM, Wolfgang Schuster
<schuster.wolfgang@gmail.com> wrote:
>
> Am 04.07.2014 um 10:21 schrieb Mojca Miklavec <mojca.miklavec.lists@gmail.com>:
>
>> Hi,
>>
>> When placing figures side-by-side I usually use
>>
>> \placefigure[force][label]{}{\startcombination[2*1]
>> {\externalfigure[A]}{Some description of A}
>> {\externalfigure[B]}{Some description of B}
>> \stopcombination}
>>
>> But this time I would like to get two separate figures with two separate titles:
>>
>>              [figure]                            [figure]
>> Figure 1.1: Long description of A   Figure 1.2: Long description of B
>>
>> with those long descriptions being "justified" (they split in multiple
>> line already), not centered.
>>
>> What is the best way to achieve that?
>
> Use the floatcombination environment.
>
> \useMPlibrary[dum]
>
> \starttext
>
> \startplacefigure[location=nonumber]
>         \startfloatcombination%[width=\textwidth,distance=0pt]
>                 \startplacefigure[title={Some description of A}]
>                         %\externalfigure[A][width=4cm]
>                         \framed[frame=off,offset=none,width=.5\textwidth]{\externalfigure[A][width=4cm]}
>                 \stopplacefigure
>                 \startplacefigure[title={Some description of B}]
>                         %\externalfigure[B][width=4cm]
>                         \framed[frame=off,offset=none,width=.5\textwidth]{\externalfigure[B][width=4cm]}
>                 \stopplacefigure
>         \stopfloatcombination
> \stopplacefigure
>
> \stoptext

Thank you, but there are some serious problems with the layout. I
managed to find some very dirty workaround, so I can get the desired
effect, but nonetheless:

- titles are wider than the figure, so titles from left and right
overlap; what I ended up doing was
    \framed[frame=off,offset=none,width=.2\textwidth]{\externalfigure[cow][width=.4\textwidth]}

- titles are of different length (and have a different number of
lines), so I need to manually add \crlf in one of the titles to
achieve equal height and proper alignment;

- width=... and distance=... are weird; once I set some width,
distance only shifts the right figure outside of the page margin

Mojca
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Placing (numbered) figures side-by-side
  2014-07-04 15:31   ` Mojca Miklavec
@ 2014-07-04 15:40     ` Mojca Miklavec
  2014-07-04 15:53     ` Wolfgang Schuster
  1 sibling, 0 replies; 7+ messages in thread
From: Mojca Miklavec @ 2014-07-04 15:40 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Fri, Jul 4, 2014 at 5:31 PM, Mojca Miklavec wrote:
> On Fri, Jul 4, 2014 at 4:13 PM, Wolfgang Schuster wrote:
>> Am 04.07.2014 um 10:21 schrieb Mojca Miklavec :
>>
>>> Hi,
>>>
>>> When placing figures side-by-side I usually use
>>>
>>> \placefigure[force][label]{}{\startcombination[2*1]
>>> {\externalfigure[A]}{Some description of A}
>>> {\externalfigure[B]}{Some description of B}
>>> \stopcombination}
>>>
>>> But this time I would like to get two separate figures with two separate titles:
>>>
>>>              [figure]                            [figure]
>>> Figure 1.1: Long description of A   Figure 1.2: Long description of B
>>>
>>> with those long descriptions being "justified" (they split in multiple
>>> line already), not centered.
>>>
>>> What is the best way to achieve that?
>>
>> Use the floatcombination environment.
>>
>> \useMPlibrary[dum]
>>
>> \starttext
>>
>> \startplacefigure[location=nonumber]
>>         \startfloatcombination%[width=\textwidth,distance=0pt]
>>                 \startplacefigure[title={Some description of A}]
>>                         %\externalfigure[A][width=4cm]
>>                         \framed[frame=off,offset=none,width=.5\textwidth]{\externalfigure[A][width=4cm]}
>>                 \stopplacefigure
>>                 \startplacefigure[title={Some description of B}]
>>                         %\externalfigure[B][width=4cm]
>>                         \framed[frame=off,offset=none,width=.5\textwidth]{\externalfigure[B][width=4cm]}
>>                 \stopplacefigure
>>         \stopfloatcombination
>> \stopplacefigure
>>
>> \stoptext
>
> Thank you, but there are some serious problems with the layout. I
> managed to find some very dirty workaround, so I can get the desired
> effect, but nonetheless:
>
> - titles are wider than the figure, so titles from left and right
> overlap; what I ended up doing was
>     \framed[frame=off,offset=none,width=.2\textwidth]{\externalfigure[cow][width=.4\textwidth]}
>
> - titles are of different length (and have a different number of
> lines), so I need to manually add \crlf in one of the titles to
> achieve equal height and proper alignment;
>
> - width=... and distance=... are weird; once I set some width,
> distance only shifts the right figure outside of the page margin

Here's an example:

\starttext

\startplacefigure[location=nonumber]
\startfloatcombination[2*1]
    \startplacefigure[title={This is some text spanning two lines.
Some text spanning two lines.}]
        \framed[width=.4\textwidth,height=3cm]{}
    \stopplacefigure
    \startplacefigure[title={This is some text spanning four lines.
Some text spanning four lines. Some text spanning four lines. Some
text spanning four lines.}]
        \framed[width=.4\textwidth,height=3cm]{}
    \stopplacefigure
\stopfloatcombination
\stopplacefigure

\startplacefigure[location=nonumber]
\startfloatcombination[width=\textwidth,distance=5cm]
    \startplacefigure[title={This is some text spanning two lines.
Some text spanning two lines.}]
        \framed[width=.4\textwidth,height=3cm]{}
    \stopplacefigure
    \startplacefigure[title={This is some text spanning four lines.
Some text spanning four lines. Some text spanning four lines. Some
text spanning four lines.}]
        \framed[width=.4\textwidth,height=3cm]{}
    \stopplacefigure
\stopfloatcombination
\stopplacefigure

\input tufte

\stoptext

Mojca
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Placing (numbered) figures side-by-side
  2014-07-04 15:31   ` Mojca Miklavec
  2014-07-04 15:40     ` Mojca Miklavec
@ 2014-07-04 15:53     ` Wolfgang Schuster
  2014-07-04 16:05       ` Mojca Miklavec
  1 sibling, 1 reply; 7+ messages in thread
From: Wolfgang Schuster @ 2014-07-04 15:53 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 3310 bytes --]


Am 04.07.2014 um 17:31 schrieb Mojca Miklavec <mojca.miklavec.lists@gmail.com>:

> On Fri, Jul 4, 2014 at 4:13 PM, Wolfgang Schuster
> <schuster.wolfgang@gmail.com> wrote:
>> 
>> Am 04.07.2014 um 10:21 schrieb Mojca Miklavec <mojca.miklavec.lists@gmail.com>:
>> 
>>> Hi,
>>> 
>>> When placing figures side-by-side I usually use
>>> 
>>> \placefigure[force][label]{}{\startcombination[2*1]
>>> {\externalfigure[A]}{Some description of A}
>>> {\externalfigure[B]}{Some description of B}
>>> \stopcombination}
>>> 
>>> But this time I would like to get two separate figures with two separate titles:
>>> 
>>>             [figure]                            [figure]
>>> Figure 1.1: Long description of A   Figure 1.2: Long description of B
>>> 
>>> with those long descriptions being "justified" (they split in multiple
>>> line already), not centered.
>>> 
>>> What is the best way to achieve that?
>> 
>> Use the floatcombination environment.
>> 
>> \useMPlibrary[dum]
>> 
>> \starttext
>> 
>> \startplacefigure[location=nonumber]
>>        \startfloatcombination%[width=\textwidth,distance=0pt]
>>                \startplacefigure[title={Some description of A}]
>>                        %\externalfigure[A][width=4cm]
>>                        \framed[frame=off,offset=none,width=.5\textwidth]{\externalfigure[A][width=4cm]}
>>                \stopplacefigure
>>                \startplacefigure[title={Some description of B}]
>>                        %\externalfigure[B][width=4cm]
>>                        \framed[frame=off,offset=none,width=.5\textwidth]{\externalfigure[B][width=4cm]}
>>                \stopplacefigure
>>        \stopfloatcombination
>> \stopplacefigure
>> 
>> \stoptext
> 
> Thank you, but there are some serious problems with the layout. I
> managed to find some very dirty workaround, so I can get the desired
> effect, but nonetheless:
> 
> - titles are wider than the figure, so titles from left and right
> overlap; what I ended up doing was
>    \framed[frame=off,offset=none,width=.2\textwidth]{\externalfigure[cow][width=.4\textwidth]}
> 
> - titles are of different length (and have a different number of
> lines), so I need to manually add \crlf in one of the titles to
> achieve equal height and proper alignment;
> 
> - width=... and distance=... are weird; once I set some width,
> distance only shifts the right figure outside of the page margin


The caption can be forced to the same width as the image with the \setupcaption command,
the vertical alignment of the images/text can be controlled with the location key but you have
to ensure both images have the same height.

\useMPlibrary[dum]

\starttext

\startplacefigure[location=nonumber]
	\setupcaption[figure][width=max]
	\startfloatcombination[location=top]
		\startplacefigure[title={Some description of A which spans multiple lines}]
			\externalfigure[A][width=4cm]
			%\framed[frame=off,offset=none,width=.5\textwidth]{\externalfigure[A][width=4cm]}
		\stopplacefigure
		\startplacefigure[title={Some description of B}]
			\externalfigure[B][width=4cm]
			%\framed[frame=off,offset=none,width=.5\textwidth]{\externalfigure[B][width=4cm]}
		\stopplacefigure
	\stopfloatcombination
\stopplacefigure

\stoptext

Wolfgang

[-- Attachment #1.2: Type: text/html, Size: 6066 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Placing (numbered) figures side-by-side
  2014-07-04 15:53     ` Wolfgang Schuster
@ 2014-07-04 16:05       ` Mojca Miklavec
  2014-07-04 16:08         ` Wolfgang Schuster
  0 siblings, 1 reply; 7+ messages in thread
From: Mojca Miklavec @ 2014-07-04 16:05 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Fri, Jul 4, 2014 at 5:53 PM, Wolfgang Schuster wrote:
> Am 04.07.2014 um 17:31 schrieb Mojca Miklavec:
> On Fri, Jul 4, 2014 at 4:13 PM, Wolfgang Schuster wrote:
> Am 04.07.2014 um 10:21 schrieb Mojca Miklavec:
>
> Hi,
>
> When placing figures side-by-side I usually use
>
> \placefigure[force][label]{}{\startcombination[2*1]
> {\externalfigure[A]}{Some description of A}
> {\externalfigure[B]}{Some description of B}
> \stopcombination}
>
> But this time I would like to get two separate figures with two separate
> titles:
>
>             [figure]                            [figure]
> Figure 1.1: Long description of A   Figure 1.2: Long description of B
>
> with those long descriptions being "justified" (they split in multiple
> line already), not centered.
>
> What is the best way to achieve that?
>
>
> Use the floatcombination environment.
>
> \useMPlibrary[dum]
>
> \starttext
>
> \startplacefigure[location=nonumber]
>        \startfloatcombination%[width=\textwidth,distance=0pt]
>                \startplacefigure[title={Some description of A}]
>                        %\externalfigure[A][width=4cm]
>
> \framed[frame=off,offset=none,width=.5\textwidth]{\externalfigure[A][width=4cm]}
>                \stopplacefigure
>                \startplacefigure[title={Some description of B}]
>                        %\externalfigure[B][width=4cm]
>
> \framed[frame=off,offset=none,width=.5\textwidth]{\externalfigure[B][width=4cm]}
>                \stopplacefigure
>        \stopfloatcombination
> \stopplacefigure
>
> \stoptext
>
>
> Thank you, but there are some serious problems with the layout. I
> managed to find some very dirty workaround, so I can get the desired
> effect, but nonetheless:
>
> - titles are wider than the figure, so titles from left and right
> overlap; what I ended up doing was
>
> \framed[frame=off,offset=none,width=.2\textwidth]{\externalfigure[cow][width=.4\textwidth]}
>
> - titles are of different length (and have a different number of
> lines), so I need to manually add \crlf in one of the titles to
> achieve equal height and proper alignment;
>
> - width=... and distance=... are weird; once I set some width,
> distance only shifts the right figure outside of the page margin
>
>
> The caption can be forced to the same width as the image with the
> \setupcaption command,
> the vertical alignment of the images/text can be controlled with the
> location key but you have
> to ensure both images have the same height.
>
> \useMPlibrary[dum]
>
> \starttext
>
> \startplacefigure[location=nonumber]
> \setupcaption[figure][width=max]
> \startfloatcombination[location=top]
> \startplacefigure[title={Some description of A which spans multiple lines}]
> \externalfigure[A][width=4cm]
> %\framed[frame=off,offset=none,width=.5\textwidth]{\externalfigure[A][width=4cm]}
> \stopplacefigure
> \startplacefigure[title={Some description of B}]
> \externalfigure[B][width=4cm]
> %\framed[frame=off,offset=none,width=.5\textwidth]{\externalfigure[B][width=4cm]}
> \stopplacefigure
> \stopfloatcombination
> \stopplacefigure
>
> \stoptext

Perfect. \setupcaption[figure][width=max] or
\setupcaption[figure][width=.4\textwidth] does exactly what I want.

My figures are of the same height, so "location=top" is OK. (Can one
combine "location=top" with "[3*1]"?)
Even though a much nicer option would be to top-align the captions and
vertically center the images (or provide a location= option separately
for the image). The workaround to use \framed around the image
probably works though ...

Thank you,
    Mojca
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Placing (numbered) figures side-by-side
  2014-07-04 16:05       ` Mojca Miklavec
@ 2014-07-04 16:08         ` Wolfgang Schuster
  0 siblings, 0 replies; 7+ messages in thread
From: Wolfgang Schuster @ 2014-07-04 16:08 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 04.07.2014 um 18:05 schrieb Mojca Miklavec <mojca.miklavec.lists@gmail.com>:

> My figures are of the same height, so "location=top" is OK. (Can one
> combine "location=top" with "[3*1]“?)

You can set the number of rows and columns with the nx and ny keys, e.g. \startfloatcombination[location=top,nx=3,ny=1]

Wolfgang

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-07-04 16:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-04  8:21 Placing (numbered) figures side-by-side Mojca Miklavec
2014-07-04 14:13 ` Wolfgang Schuster
2014-07-04 15:31   ` Mojca Miklavec
2014-07-04 15:40     ` Mojca Miklavec
2014-07-04 15:53     ` Wolfgang Schuster
2014-07-04 16:05       ` Mojca Miklavec
2014-07-04 16:08         ` Wolfgang Schuster

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).