ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Re: Centering the last line in combination subcaptions
       [not found] <008201cf0356$ccebf400$66c3dc00$@tosovsky@email.cz>
@ 2014-02-07 21:25 ` Jan Tosovsky
       [not found] ` <016201cf244b$29d9f210$7d8dd630$@tosovsky@email.cz>
  1 sibling, 0 replies; 6+ messages in thread
From: Jan Tosovsky @ 2014-02-07 21:25 UTC (permalink / raw)
  To: 'mailing list for ConTeXt users'

On 2013-12-27 Jan Tosovsky wrote:
> I try to fill the entire page with two images with their captions. The
> final page should be floating, keeping both images together and not
> containing any other text.
> 
> I found this solution. It work fine for short captions / wide images.
> 
> \starttext
> test
> \startplacefigure[location=page, number=no, title={}]
> 
> %\setupcombinations[align={hz, hanging}]
> %\setuptolerance[strict]
> 
> {\startcombination[1*2]
>    {\externalfigure[cow]} {\input{ward}}
>    {\externalfigure[cow]} {\input{ward}}
> \stopcombination}
> 
> \stopplacefigure
> \stoptext
> ...
> If captions are long and the image narrow, they are typeset on multiple
> lines. Default centering produces the ragged column - both not very
> nice and difficult to read. When the alignment is set to hanging, it 
> looks better except the last line which is not centered.
> 
> Is there any settings for centering the last line?

I've found it is a general problem with the centering the last line when
hanging alignment is set. Here is the similar thread, but with no response:
https://www.mail-archive.com/ntg-context@ntg.nl/msg32884.html

This is quite old thread. Are there any new possibilities in the Context
from that era?

Thanks, Jan

___________________________________________________________________________________
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] 6+ messages in thread

* Re: Centering the last line in combination subcaptions
       [not found] ` <016201cf244b$29d9f210$7d8dd630$@tosovsky@email.cz>
@ 2014-02-07 23:07   ` Jan Tosovsky
       [not found]   ` <52f56744.c8310f0a.7ef8.ffffb680SMTPIN_ADDED_BROKEN@mx.google.com>
  1 sibling, 0 replies; 6+ messages in thread
From: Jan Tosovsky @ 2014-02-07 23:07 UTC (permalink / raw)
  To: 'mailing list for ConTeXt users'

On 2014-02-07 Jan Tosovsky wrote:
> On 2013-12-27 Jan Tosovsky wrote:
> >
> > If captions are long and the image narrow, they are typeset on
> > multiple lines. Default centering produces the ragged column - 
> > both not very nice and difficult to read. When the alignment is 
> > set to hanging, it looks better except the last line which is 
> > not centered.

Finally fixed with align=last :-)

This is the improved example. The only remaining issue is an one empty line
between the image and the label when \startnarrower command is used.

Please compare two pages w/o this option set:


%\definefontfamily[palatino][rm][Palatino Linotype][features={default,
quality}]
%\setupbodyfont[palatino]
\setupnarrower[middle=-2.8cm]

\starttext
test
\startplacefigure[location=page, number=no, title={}]
\setupcombinations[align={last, hz, hanging}]
{\startcombination[1*2]
    {\externalfigure[cow]} {\startnarrower {\itx \input{tufte}}
\stopnarrower}
    {\externalfigure[cow]} {\startnarrower {\itx \input{lorem}}
\stopnarrower}
\stopcombination} 
\stopplacefigure

\startplacefigure[location=page, number=no, title={}]
\setupcombinations[align={last, hz, hanging}]
{\startcombination[1*2]
    {\externalfigure[cow]} {\itx \input{ward}}
    {\externalfigure[cow]} {\itx \input{ward}}
\stopcombination} 
\stopplacefigure

\stoptext

I haven't find any better way to extend the caption width than that negative
value for narrowed text. It works, but that empty space above looks weird
:-(

Thanks for any suggestions,

Jan

___________________________________________________________________________________
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] 6+ messages in thread

* Re: Centering the last line in combination subcaptions
       [not found]   ` <52f56744.c8310f0a.7ef8.ffffb680SMTPIN_ADDED_BROKEN@mx.google.com>
@ 2014-02-08  6:35     ` Wolfgang Schuster
  2014-02-08 11:22       ` Jan Tosovsky
       [not found]       ` <52f613a9.09240f0a.5c33.ffff9f93SMTPIN_ADDED_BROKEN@mx.google.com>
  0 siblings, 2 replies; 6+ messages in thread
From: Wolfgang Schuster @ 2014-02-08  6:35 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 08.02.2014 um 00:07 schrieb Jan Tosovsky <j.tosovsky@email.cz>:

> This is the improved example. The only remaining issue is an one empty line
> between the image and the label when \startnarrower command is used.
> 
> Please compare two pages w/o this option set:
> 
> 
> %\definefontfamily[palatino][rm][Palatino Linotype][features={default,
> quality}]
> %\setupbodyfont[palatino]
> \setupnarrower[middle=-2.8cm]
> 
> \starttext
> test
> \startplacefigure[location=page, number=no, title={}]
> \setupcombinations[align={last, hz, hanging}]
> {\startcombination[1*2]
>    {\externalfigure[cow]} {\startnarrower {\itx \input{tufte}}
> \stopnarrower}
>    {\externalfigure[cow]} {\startnarrower {\itx \input{lorem}}
> \stopnarrower}
> \stopcombination} 
> \stopplacefigure
> 
> \startplacefigure[location=page, number=no, title={}]
> \setupcombinations[align={last, hz, hanging}]
> {\startcombination[1*2]
>    {\externalfigure[cow]} {\itx \input{ward}}
>    {\externalfigure[cow]} {\itx \input{ward}}
> \stopcombination} 
> \stopplacefigure
> 
> \stoptext
> 
> I haven't find any better way to extend the caption width than that negative
> value for narrowed text. It works, but that empty space above looks weird

You have to force a certain width for your images because the width
of the text space depends on the width of the images. You can use
\framed (instead of loffset/roffset you can also set a fixed width) or
\simplealignedbox to set the width of the images.

\setupexternalfigures[location=default]

\defineframed[CombinationBox][frame=off,offset=none,loffset=3cm,roffset=3cm]

\starttext

\startplacefigure[location={force,none}]
  \startcombination[nx=1,ny=2,align={last,hz,hanging},style=\itx]
    % first image
    \startcontent
	  %\simplealignedbox{11cm}{middle}{\externalfigure[cow][width=5cm]}
	  \CombinationBox{\externalfigure[cow][width=5cm]}
	\stopcontent
	\startcaption
	  \input{ward}
	\stopcaption
	% second image
    \startcontent
	  %\simplealignedbox{11cm}{middle}{\externalfigure[cow][width=5cm]}
	  \CombinationBox{\externalfigure[cow][width=5cm]}
	\stopcontent
	\startcaption
	  \input{ward}
	\stopcaption
  \stopcombination
\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] 6+ messages in thread

* Re: Centering the last line in combination subcaptions
  2014-02-08  6:35     ` Wolfgang Schuster
@ 2014-02-08 11:22       ` Jan Tosovsky
       [not found]       ` <52f613a9.09240f0a.5c33.ffff9f93SMTPIN_ADDED_BROKEN@mx.google.com>
  1 sibling, 0 replies; 6+ messages in thread
From: Jan Tosovsky @ 2014-02-08 11:22 UTC (permalink / raw)
  To: 'mailing list for ConTeXt users'

On 2014-02-08 Wolfgang Schuster wrote:
> 
> > I haven't find any better way to extend the caption width than that
> > negative value for narrowed text. It works, but that empty space above 
> > looks weird
> 
> You have to force a certain width for your images because the width
> of the text space depends on the width of the images. You can use
> \framed (instead of loffset/roffset you can also set a fixed width) or
> \simplealignedbox to set the width of the images.
> 
> \setupexternalfigures[location=default]
> 
> \defineframed[CombinationBox][frame=off,offset=none,loffset=3cm,roffset
> =3cm]
> 
> \starttext
> 
> \startplacefigure[location={force,none}]
>   \startcombination[nx=1,ny=2,align={last,hz,hanging},style=\itx]
>     % first image
>     \startcontent
> 
> %\simplealignedbox{11cm}{middle}{\externalfigure[cow][width=5cm]}
> 	  \CombinationBox{\externalfigure[cow][width=5cm]}
> 	\stopcontent
> 	\startcaption
> 	  \input{ward}
> 	\stopcaption
> 	% second image
>     \startcontent
> 
> %\simplealignedbox{11cm}{middle}{\externalfigure[cow][width=5cm]}
> 	  \CombinationBox{\externalfigure[cow][width=5cm]}
> 	\stopcontent
> 	\startcaption
> 	  \input{ward}
> 	\stopcaption
>   \stopcombination
> \stopplacefigure
> 
> \stoptext

Thanks a lot, it is much simpler! I also like that \start \stop structure
which makes the code more clear.

Just for future reference: CombinationBox extends the current image width
with the fixed value. When different image widths are used in your document,
the caption width varies as well. To keep the consistency within the
document I've chosen that simplealignedbox instead. 

Jan

___________________________________________________________________________________
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] 6+ messages in thread

* Re: Centering the last line in combination subcaptions
       [not found]       ` <52f613a9.09240f0a.5c33.ffff9f93SMTPIN_ADDED_BROKEN@mx.google.com>
@ 2014-02-08 15:27         ` Wolfgang Schuster
  0 siblings, 0 replies; 6+ messages in thread
From: Wolfgang Schuster @ 2014-02-08 15:27 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 08.02.2014 um 12:22 schrieb Jan Tosovsky <j.tosovsky@email.cz>:

> On 2014-02-08 Wolfgang Schuster wrote:
>> 
>>> I haven't find any better way to extend the caption width than that
>>> negative value for narrowed text. It works, but that empty space above 
>>> looks weird
>> 
>> You have to force a certain width for your images because the width
>> of the text space depends on the width of the images. You can use
>> \framed (instead of loffset/roffset you can also set a fixed width) or
>> \simplealignedbox to set the width of the images.
>> 
>> \setupexternalfigures[location=default]
>> 
>> \defineframed[CombinationBox][frame=off,offset=none,loffset=3cm,roffset
>> =3cm]
>> 
>> \starttext
>> 
>> \startplacefigure[location={force,none}]
>>  \startcombination[nx=1,ny=2,align={last,hz,hanging},style=\itx]
>>    % first image
>>    \startcontent
>> 
>> %\simplealignedbox{11cm}{middle}{\externalfigure[cow][width=5cm]}
>> 	  \CombinationBox{\externalfigure[cow][width=5cm]}
>> 	\stopcontent
>> 	\startcaption
>> 	  \input{ward}
>> 	\stopcaption
>> 	% second image
>>    \startcontent
>> 
>> %\simplealignedbox{11cm}{middle}{\externalfigure[cow][width=5cm]}
>> 	  \CombinationBox{\externalfigure[cow][width=5cm]}
>> 	\stopcontent
>> 	\startcaption
>> 	  \input{ward}
>> 	\stopcaption
>>  \stopcombination
>> \stopplacefigure
>> 
>> \stoptext
> 
> Thanks a lot, it is much simpler! I also like that \start \stop structure
> which makes the code more clear.
> 
> Just for future reference: CombinationBox extends the current image width
> with the fixed value. When different image widths are used in your document,
> the caption width varies as well. To keep the consistency within the
> document I've chosen that simplealignedbox instead. 

When you want a fixed width for \CombinationBox you have to change the definition to

  \defineframed[CombinationBox][frame=off,offset=none,width=11cm]

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] 6+ messages in thread

* Centering the last line in combination subcaptions
@ 2013-12-27 22:55 Jan Tosovsky
  0 siblings, 0 replies; 6+ messages in thread
From: Jan Tosovsky @ 2013-12-27 22:55 UTC (permalink / raw)
  To: 'mailing list for ConTeXt users'

Hello Everyone,

I try to fill the entire page with two images with their captions. The final
page should be floating, keeping both images together and not containing any
other text.

I found this solution. It work fine for short captions / wide images.

\starttext
test
\startplacefigure[location=page, number=no, title={}]

%\setupcombinations[align={hz, hanging}]
%\setuptolerance[strict]

{\startcombination[1*2]
   {\externalfigure[cow]} {\input{ward}}
   {\externalfigure[cow]} {\input{ward}}
\stopcombination}

\stopplacefigure
\stoptext

If captions are long and the image narrow, they are typeset on multiple
lines. Default centering produces the ragged column - both not very nice and
difficult to read. When the alignment is set to hanging, it looks better
except the last line which is not centered.

Is there any settings for centering the last line?

Can the 'column' width be somehow extended to e.g. 80% of text width? If not
via the 'combination', are there any better alternatives for my use case?

Any hint is appreciated.

Thanks, Jan

___________________________________________________________________________________
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] 6+ messages in thread

end of thread, other threads:[~2014-02-08 15:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <008201cf0356$ccebf400$66c3dc00$@tosovsky@email.cz>
2014-02-07 21:25 ` Centering the last line in combination subcaptions Jan Tosovsky
     [not found] ` <016201cf244b$29d9f210$7d8dd630$@tosovsky@email.cz>
2014-02-07 23:07   ` Jan Tosovsky
     [not found]   ` <52f56744.c8310f0a.7ef8.ffffb680SMTPIN_ADDED_BROKEN@mx.google.com>
2014-02-08  6:35     ` Wolfgang Schuster
2014-02-08 11:22       ` Jan Tosovsky
     [not found]       ` <52f613a9.09240f0a.5c33.ffff9f93SMTPIN_ADDED_BROKEN@mx.google.com>
2014-02-08 15:27         ` Wolfgang Schuster
2013-12-27 22:55 Jan Tosovsky

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).