Re: [NTG-context] Skipped figure numbers
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
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
On Thu, 31 Mar 2016 17:51:07 -0400
Aditya Mahajan
@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?
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
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 -----------------------------------------------------------------
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 -----------------------------------------------------------------
participants (4)
-
Aditya Mahajan
-
Aidan Nichol
-
Alan BRASLAU
-
Hans Hagen