Re: [NTG-context] Skipped figure numbers

2016-04-01 Thread Alan BRASLAU
On Fri, 1 Apr 2016 11:17:07 +0100
Aidan Nichol  wrote:

> combinations only give regular grid. Sometimes you want an irregular
> grid. 

Use a nested combination.

Alan
___
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] Skipped figure numbers

2016-04-01 Thread Aidan Nichol
> On Thu, 31 Mar 2016 21:49:56 -0400 (EDT)
> Aditya Mahajan  wrote:
> 
> On Thu, 31 Mar 2016, Alan BRASLAU wrote:
> 
>> On Thu, 31 Mar 2016 17:51:07 -0400
>> Aditya Mahajan  wrote:
>> 
>>> @Hans: Does it make sense to disable \incrementcounter if
>>> \trialtypesetting is active?
>> 
>> I was going to suggest such things...
> 
> My motivation is different. If you have any macro in a table (or anything 
> that requires multiple runs to get the size right) that uses a counter 
> (e.g., enumeration), then the numbers will be off. That would not happen 
> if a counter is frozen when trialtypesetting is on.
> 
>> P.S. Would not the use of \startcombination\stopcombination be an
>> alternative to the placefigures within a table?

And \startcombination\stopcombination fails when you use \placefigure instead 
of \externalfigure because you want the captions to be numbered and included in 
the list of figures. You get an error like this one 

  > tex error on line 7 in file virtual: . . .  ! You can't use 
`\prevdepth' in restricted horizontal mode

Using \startfloatcombinations\stopfloatcombination (which appears to be 
undocumented) avoids this error.


> 
> combinations only give regular grid. Sometimes you want an irregular grid. 
> For example, the OP wanted
> 
> +---+--+
> |  | |
> |  | Fig2 |
> | Fig1 +---+
> |  | Fig3 |
> |  | |
> +--+---+
> 
> Such layouts are not possible using combinations.

I thought that nesting combinations might enable this type of combination but 
it didn’t work. see
https://mailman.ntg.nl/pipermail/ntg-context/2016/084926.html 


Using tables is a better solution because it has the syntax to handle figures 
that span rows or columns

> 
> Aditya
> 
Lots of things seem to work well with external figures but as soon as you embed 
them in a \placefigure, which makes them a float, you make things more complex 
and run into the possibility of triggering the restricted horizontal mode  
error.

It seems to me that once you place an object that is normally a float inside 
another float you want the inner one to lose it floating characteristics. Is 
there a way do this explicitly i.e. instead of creating an inner float with

\placefigure[force][ref1]{this is the caption 
}{\externalfigure[cow][width=3in,height=1in]}

could we create a non-floating version with something explicit like

\externalfigure[cow][width=3in,height=1in]
\addcaption[figure][ref1]{this is the caption }

Aidan


___
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] Skipped figure numbers

2016-04-01 Thread Hans Hagen

On 3/31/2016 11:51 PM, Aditya Mahajan wrote:

On Thu, 31 Mar 2016, Aidan Nichol wrote:


On Wed, 30 Mar 2016, Aidan Nichol wrote:


I have been looking at various options for controlling how figures
are placed on a page and based on answers to similar questions in
this mailing list I  tried various options. The most flexible one
seems to be using tables e.g.

\setupexternalfigures[location={default}]

\starttext

\placefigure[]{}{\externalfigure[hacker][height=1in]}

\startxtable[frame=off,align=low]
\startxrow
\startxcell[ny=2]
\placefigure[force][]{left
twoup}{\externalfigure[mill][height=4in]}
 \stopxcell
 \startxcell
   \placefigure[force][]{the
first}{\externalfigure[spider][height=1.5in]}
 \stopxcell
\stopxrow
\startxrow
\startxcell
  \placefigure[force][]{the second}{\externalfigure[cow][height=1.5in]}
\stopxcell
\stopxrow
\stopxtable

It seems to work well except that figure numbers are being skipped.
In this example hacker=1 mill=8, spider=9 and cow=10.
Varying the contents of the table reveals that It is skipping two
times the number of figures in the table.

Is this an invalid combination of features I’m using or am I doing
something wrong?


The contents of a table are typeset multiple times to get an idea of the
height and width. Here is one option:

\useMPlibrary[dum]

\starttext

\bTABLE[frame=off,align=low]
\bTR
\bTD[ny=2]
 \placefigure[here,\iftrialtypesetting nonumber \fi]
 []{left
twoup}{\externalfigure[mill][width=2in,height=4in]}
\eTD
\bTD
 \placefigure[here,\iftrialtypesetting nonumber \fi]
 []{the
first}{\externalfigure[spider][width=2in,height=2in]}
\eTD
\eTR
\bTR
\bTD
 \placefigure[here,\iftrialtypesetting nonumber \fi]
 []{the
second}{\externalfigure[cow][width=2in,height=2in]}
\eTD
\eTR
\eTABLE
\stoptext


Thanks Aditya

That solved the problem


@Hans: Does it make sense to disable \incrementcounter if
\trialtypesetting is active?


btw, floats are just that: floats ...

\starttext

\useMPlibrary[dum]

\dorecurse{34}{test\par}

\bTABLE[split=yes]
\dorecurse{10}{
\bTR
\bTD \placefigure{}{\externalfigure[dummy][width=2cm]} \eTD
\bTD \placefigure{}{\externalfigure[dummy][width=2cm]} \eTD
\eTR
\bTR
\bTD[nx=2] 
\placefigure{}{\externalfigure[dummy][width=4cm]} \eTD

\eTR
}
\eTABLE

\stoptext


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: 038 477 53 69 | www.pragma-ade.com | www.pragma-pod.nl
-
___
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] Skipped figure numbers

2016-04-01 Thread Hans Hagen

On 3/31/2016 11:51 PM, Aditya Mahajan wrote:

On Thu, 31 Mar 2016, Aidan Nichol wrote:


On Wed, 30 Mar 2016, Aidan Nichol wrote:


I have been looking at various options for controlling how figures
are placed on a page and based on answers to similar questions in
this mailing list I  tried various options. The most flexible one
seems to be using tables e.g.

\setupexternalfigures[location={default}]

\starttext

\placefigure[]{}{\externalfigure[hacker][height=1in]}

\startxtable[frame=off,align=low]
\startxrow
\startxcell[ny=2]
\placefigure[force][]{left
twoup}{\externalfigure[mill][height=4in]}
 \stopxcell
 \startxcell
   \placefigure[force][]{the
first}{\externalfigure[spider][height=1.5in]}
 \stopxcell
\stopxrow
\startxrow
\startxcell
  \placefigure[force][]{the second}{\externalfigure[cow][height=1.5in]}
\stopxcell
\stopxrow
\stopxtable

It seems to work well except that figure numbers are being skipped.
In this example hacker=1 mill=8, spider=9 and cow=10.
Varying the contents of the table reveals that It is skipping two
times the number of figures in the table.

Is this an invalid combination of features I’m using or am I doing
something wrong?


The contents of a table are typeset multiple times to get an idea of the
height and width. Here is one option:

\useMPlibrary[dum]

\starttext

\bTABLE[frame=off,align=low]
\bTR
\bTD[ny=2]
 \placefigure[here,\iftrialtypesetting nonumber \fi]
 []{left
twoup}{\externalfigure[mill][width=2in,height=4in]}
\eTD
\bTD
 \placefigure[here,\iftrialtypesetting nonumber \fi]
 []{the
first}{\externalfigure[spider][width=2in,height=2in]}
\eTD
\eTR
\bTR
\bTD
 \placefigure[here,\iftrialtypesetting nonumber \fi]
 []{the
second}{\externalfigure[cow][width=2in,height=2in]}
\eTD
\eTR
\eTABLE
\stoptext


Thanks Aditya

That solved the problem


@Hans: Does it make sense to disable \incrementcounter if
\trialtypesetting is active?


depends a bit .. other mechanisms do a save, increment, restore, which 
better reflects the number to be rendered (otherwise you can get 
oscillating runs)


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: 038 477 53 69 | www.pragma-ade.com | www.pragma-pod.nl
-
___
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] Skipped figure numbers

2016-03-31 Thread Aditya Mahajan

On Thu, 31 Mar 2016, Alan BRASLAU wrote:


On Thu, 31 Mar 2016 17:51:07 -0400
Aditya Mahajan  wrote:


@Hans: Does it make sense to disable \incrementcounter if
\trialtypesetting is active?


I was going to suggest such things...


My motivation is different. If you have any macro in a table (or anything 
that requires multiple runs to get the size right) that uses a counter 
(e.g., enumeration), then the numbers will be off. That would not happen 
if a counter is frozen when trialtypesetting is on.



P.S. Would not the use of \startcombination\stopcombination be an
alternative to the placefigures within a table?


combinations only give regular grid. Sometimes you want an irregular grid. 
For example, the OP wanted


+--+--+
|  |  |
|  | Fig2 |
| Fig1 +--+
|  | Fig3 |
|  |  |
+--+--+

Such layouts are not possible using combinations.

Aditya
___
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] Skipped figure numbers

2016-03-31 Thread Alan BRASLAU
On Thu, 31 Mar 2016 17:51:07 -0400
Aditya Mahajan  wrote:

> @Hans: Does it make sense to disable \incrementcounter if 
> \trialtypesetting is active?

I was going to suggest such things...

Here is a case where a float is not being used as a floating object in
that we want to control placement through location=here or, better,
location=force. We do this as users for we want to produce a caption
as well as make an entry into the list.

However, floats have some limitations: for example they cannot usually
handle multiple pages (except for some table splits), nor can they take
\startcolumns \stopcolumns, and I am sure that there are others.

Does anyone have suggestions/ideas around these kinds of issues? Should
a float with location=force be treated any differently?

Another annoying issue with floats: \startplacefloat\stopplacefloat
initiates a paragraph break. If one refers to a float (figure or table)
somewhere in a long paragraph, one might like the float to be anchored
starting from that location. I achieve this using
\startpostponing [+0]
  \startplacefigure
  \stopplacefigure
\stoppostponing
but this does not always work well. In addition, this is not very
satisfying (as it makes for ugly source code). Also, one might want to
use location=right or location=left without using "hang" and counting
lines. Hans has repeated that floats are complicated beasts and such
features would interfere with paragraph building. OK (But dare I say
that LaTeX does not seem to have any problem with this.)

Alan

P.S. Would not the use of \startcombination\stopcombination be an
alternative to the placefigures within a table?
___
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] Skipped figure numbers

2016-03-31 Thread Aditya Mahajan

On Thu, 31 Mar 2016, Aidan Nichol wrote:


On Wed, 30 Mar 2016, Aidan Nichol wrote:


I have been looking at various options for controlling how figures are placed 
on a page and based on answers to similar questions in this mailing list I  
tried various options. The most flexible one seems to be using tables e.g.

\setupexternalfigures[location={default}]

\starttext

\placefigure[]{}{\externalfigure[hacker][height=1in]}

\startxtable[frame=off,align=low]
\startxrow
\startxcell[ny=2]
\placefigure[force][]{left twoup}{\externalfigure[mill][height=4in]}
 \stopxcell
 \startxcell
   \placefigure[force][]{the first}{\externalfigure[spider][height=1.5in]}
 \stopxcell
\stopxrow
\startxrow
\startxcell
  \placefigure[force][]{the second}{\externalfigure[cow][height=1.5in]}
\stopxcell
\stopxrow
\stopxtable

It seems to work well except that figure numbers are being skipped. In this 
example hacker=1 mill=8, spider=9 and cow=10.
Varying the contents of the table reveals that It is skipping two times the 
number of figures in the table.

Is this an invalid combination of features I’m using or am I doing something 
wrong?


The contents of a table are typeset multiple times to get an idea of the
height and width. Here is one option:

\useMPlibrary[dum]

\starttext

\bTABLE[frame=off,align=low]
\bTR
\bTD[ny=2]
 \placefigure[here,\iftrialtypesetting nonumber \fi]
 []{left twoup}{\externalfigure[mill][width=2in,height=4in]}
\eTD
\bTD
 \placefigure[here,\iftrialtypesetting nonumber \fi]
 []{the first}{\externalfigure[spider][width=2in,height=2in]}
\eTD
\eTR
\bTR
\bTD
 \placefigure[here,\iftrialtypesetting nonumber \fi]
 []{the second}{\externalfigure[cow][width=2in,height=2in]}
\eTD
\eTR
\eTABLE
\stoptext


Thanks Aditya

That solved the problem


@Hans: Does it make sense to disable \incrementcounter if 
\trialtypesetting is active?


Aditya___
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] Skipped figure numbers

2016-03-31 Thread Aidan Nichol
Thanks Aditya

That solved the problem
> 
> 
> On Wed, 30 Mar 2016, Aidan Nichol wrote:
> 
>> I have been looking at various options for controlling how figures are 
>> placed on a page and based on answers to similar questions in this mailing 
>> list I  tried various options. The most flexible one seems to be using 
>> tables e.g.
>> 
>> \setupexternalfigures[location={default}]
>> 
>> \starttext
>> 
>> \placefigure[]{}{\externalfigure[hacker][height=1in]}
>> 
>> \startxtable[frame=off,align=low]
>> \startxrow
>> \startxcell[ny=2]
>> \placefigure[force][]{left twoup}{\externalfigure[mill][height=4in]}
>>  \stopxcell
>>  \startxcell
>>\placefigure[force][]{the first}{\externalfigure[spider][height=1.5in]}
>>  \stopxcell
>> \stopxrow
>> \startxrow
>> \startxcell
>>   \placefigure[force][]{the second}{\externalfigure[cow][height=1.5in]}
>> \stopxcell
>> \stopxrow
>> \stopxtable
>> 
>> It seems to work well except that figure numbers are being skipped. In this 
>> example hacker=1 mill=8, spider=9 and cow=10.
>> Varying the contents of the table reveals that It is skipping two times the 
>> number of figures in the table.
>> 
>> Is this an invalid combination of features I’m using or am I doing something 
>> wrong?
> 
> The contents of a table are typeset multiple times to get an idea of the
> height and width. Here is one option:
> 
> \useMPlibrary[dum]
> 
> \starttext
> 
> \bTABLE[frame=off,align=low]
> \bTR
> \bTD[ny=2]
>  \placefigure[here,\iftrialtypesetting nonumber \fi]
>  []{left twoup}{\externalfigure[mill][width=2in,height=4in]}
> \eTD
> \bTD
>  \placefigure[here,\iftrialtypesetting nonumber \fi]
>  []{the first}{\externalfigure[spider][width=2in,height=2in]}
> \eTD
> \eTR
> \bTR
> \bTD
>  \placefigure[here,\iftrialtypesetting nonumber \fi]
>  []{the second}{\externalfigure[cow][width=2in,height=2in]}
> \eTD
> \eTR
> \eTABLE
> \stoptext
> 
> Aditya
> 

___
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] Skipped figure numbers

2016-03-30 Thread Aditya Mahajan

On Wed, 30 Mar 2016, Aidan Nichol wrote:


I have been looking at various options for controlling how figures are placed 
on a page and based on answers to similar questions in this mailing list I  
tried various options. The most flexible one seems to be using tables e.g.

\setupexternalfigures[location={default}]

\starttext

\placefigure[]{}{\externalfigure[hacker][height=1in]}

\startxtable[frame=off,align=low]
\startxrow
 \startxcell[ny=2]
 \placefigure[force][]{left twoup}{\externalfigure[mill][height=4in]}
  \stopxcell
  \startxcell
\placefigure[force][]{the first}{\externalfigure[spider][height=1.5in]}
  \stopxcell
\stopxrow
\startxrow
 \startxcell
   \placefigure[force][]{the second}{\externalfigure[cow][height=1.5in]}
 \stopxcell
\stopxrow
\stopxtable

It seems to work well except that figure numbers are being skipped. In this 
example hacker=1 mill=8, spider=9 and cow=10.
Varying the contents of the table reveals that It is skipping two times the 
number of figures in the table.

Is this an invalid combination of features I’m using or am I doing something 
wrong?


The contents of a table are typeset multiple times to get an idea of the
height and width. Here is one option:

\useMPlibrary[dum]

\starttext

\bTABLE[frame=off,align=low]
\bTR
\bTD[ny=2]
 \placefigure[here,\iftrialtypesetting nonumber \fi]
 []{left twoup}{\externalfigure[mill][width=2in,height=4in]}
\eTD
\bTD
 \placefigure[here,\iftrialtypesetting nonumber \fi]
 []{the first}{\externalfigure[spider][width=2in,height=2in]}
\eTD
\eTR
\bTR
\bTD
 \placefigure[here,\iftrialtypesetting nonumber \fi]
 []{the second}{\externalfigure[cow][width=2in,height=2in]}
\eTD
\eTR
\eTABLE
\stoptext

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

[NTG-context] Skipped figure numbers

2016-03-30 Thread Aidan Nichol
I have been looking at various options for controlling how figures are placed 
on a page and based on answers to similar questions in this mailing list I  
tried various options. The most flexible one seems to be using tables e.g.

\setupexternalfigures[location={default}]

\starttext

\placefigure[]{}{\externalfigure[hacker][height=1in]}

\startxtable[frame=off,align=low]
\startxrow
  \startxcell[ny=2]
  \placefigure[force][]{left twoup}{\externalfigure[mill][height=4in]}
   \stopxcell
   \startxcell
 \placefigure[force][]{the first}{\externalfigure[spider][height=1.5in]}
   \stopxcell
\stopxrow
\startxrow
  \startxcell
\placefigure[force][]{the second}{\externalfigure[cow][height=1.5in]}
  \stopxcell
\stopxrow
\stopxtable

It seems to work well except that figure numbers are being skipped. In this 
example hacker=1 mill=8, spider=9 and cow=10.
Varying the contents of the table reveals that It is skipping two times the 
number of figures in the table.

Is this an invalid combination of features I’m using or am I doing something 
wrong?
___
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
___