Re: [NTG-context] Centering the last line in combination subcaptions

2014-02-08 Thread Wolfgang Schuster

Am 08.02.2014 um 12:22 schrieb Jan Tosovsky :

> 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
___


Re: [NTG-context] Centering the last line in combination subcaptions

2014-02-08 Thread Jan Tosovsky
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
___


Re: [NTG-context] Centering the last line in combination subcaptions

2014-02-07 Thread Wolfgang Schuster

Am 08.02.2014 um 00:07 schrieb Jan Tosovsky :

> 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
___


Re: [NTG-context] Centering the last line in combination subcaptions

2014-02-07 Thread Jan Tosovsky
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
___


Re: [NTG-context] Centering the last line in combination subcaptions

2014-02-07 Thread Jan Tosovsky
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
___