[NTG-context] PageSetup

2016-04-14 Thread Aidan Nichol
I’ve been have been having a couple of problems with swapping pages and so I 
went back to the example in Context Garden using the latest beta

\definepapersize[main] [A4]
\definepapersize[extra][A4,landscape]

\setuppapersize[main]
\starttext
Page 1. Portrait \page
Page 2. Portrait \page
\adaptpapersize[extra]
Page 3. Landscape \page
Page 4. Portrait \page
\stoptext

The main problem I have is that \adaptpapersize is working as though I had 
entered \setuppapersize. Page 3 was created as landscape and but it didn’t 
revert to main to give page 4 as portrait.

The secondary issue is that the landscape page is not as expected in that it is 
a square page. Inserting a \showsetups and \showframe into page 3 I can see 
that it is layed out Ok but on a large piece of paper. \printpaperwidth and 
\printpaperheight are both set to 29.7cm.

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

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

[NTG-context] Show the results of XML mapping

2016-03-11 Thread Aidan Nichol
When I map from XML to ConTeXt there are lots of rules mapping lots of small 
bit of XML to small bits of ConTeXt and it is hard get the big picture. If 
something doesn’t work in the final PDF document it can be hard to know if the 
mapping failed to match the XML or if the generated ConTeXt was wrong.

Is there a way to capture the ConTeXt generated from the mapping rules before 
it goes on to produce the final document?

Thanks
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] Table of Contents

2016-03-11 Thread Aidan Nichol
Thanks Pablo

That did it. I found the \placebookmarks in the pandoc template once I knew 
what I was looking for. 
I also found
  \setupinteractionscreen[option=bookmark]
so I get it displayed when the document is opened.

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
___

[NTG-context] Table of Contents

2016-03-10 Thread Aidan Nichol
I’m using using pandoc and ConTeXt to generate pdf documentation from markdown.

I started with the option to use latex (xetex) and swapped to ConTeXt, letting 
pandoc create the conTeXt file and invoke ConTeXt on it.C
Both produce a table of contents active links etc. which is pretty much 
identical but the xetex version in my various pdf readers can show it in side 
panel referred to as Table of Contents or outline. This is really nice because 
it makes it just a click or swipe away.

Following advice from Pablo I’ve swapped over to generating XHTML and using the 
XML mapping ability to generate ConTeXt and the PDF. Using this route the TOC 
looks the same but it’s no longer there in the outline panel.

What do I need in addition to 
\completecontent
to get this feature to work?

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
___

[NTG-context] References on the same page

2016-03-02 Thread Aidan Nichol
Is there a way to detect if two references are on the same page? I looking for 
a way to determine if I should print a single page number or a range of numbers.
___
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] Controlling \at output

2016-03-01 Thread Aidan Nichol
SOLVED: I cut and pasted the code from the original response and failed to 
notice that the very first character i.e. the ‘\’ was missing in the message. 
It all executed with no error messages!! Works fine with the minor correction.

Thanks for your help.

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] Controlling \at output

2016-03-01 Thread Aidan Nichol
I must be doing something stupid. I’ve just installed the standalone version. 
Saved the code as test3.tex and invoked it with
  context test3.tex

It reports the version as 

ConTeXt  ver: 2016.03.01 14:03 MKIV beta  fmt: 2016.3.1  int: english/english

And still no output from \thispage


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] Controlling \at output

2016-02-28 Thread Aidan Nichol
Thanks for the reply. \thispage is producing no output in all the places it is 
being invoked

Aidan 

> On 24 Feb 2016, at 15:35, ntg-context-requ...@ntg.nl wrote:
> 
> startsetups[referenceformat:thispage]
>\doifelse{\filterreference{page}}{\rawcountervalue[userpage]}
>{{\tttf !?}}
>{\filterreference{page}}
> \stopsetups
> 
> \definereferenceformat[thispage][setups=referenceformat:thispage]
> 
> \starttext
> 
> \chapter[one]{First chapter}
> 
> First: \thispage[one]
> 
> Second: \thispage[two]
> 
> \chapter[two]{Second chapter}
> 
> First: \thispage[one]
> 
> Second: \thispage[two]

___
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] ntg-context Digest, Vol 140, Issue 59

2016-02-24 Thread Aidan Nichol
Thanks for the reply. \thispage is producing no output in all the places it is 
being invoked

Aidan 

> On 24 Feb 2016, at 15:35, ntg-context-requ...@ntg.nl wrote:
> 
> startsetups[referenceformat:thispage]
> \doifelse{\filterreference{page}}{\rawcountervalue[userpage]}
> {{\tttf !?}}
> {\filterreference{page}}
> \stopsetups
> 
> \definereferenceformat[thispage][setups=referenceformat:thispage]
> 
> \starttext
> 
> \chapter[one]{First chapter}
> 
> First: \thispage[one]
> 
> Second: \thispage[two]
> 
> \chapter[two]{Second chapter}
> 
> First: \thispage[one]
> 
> Second: \thispage[two]

___
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] Controlling \at output

2016-02-24 Thread Aidan Nichol
I’m trying to create something (like varioref in latex) that suppresses \at 
output if the referenced item is on the current page. The main decision point 
is with

\doifelse{\at[ref2]}{\rawcountervalue[page]}{ same page }{ different page }

no matter what I try (expdoifelse and other ways to get the current page) the 
values never match.

\doifelse{\at[ref2]}{\at[ref1]}….. (ref1 and ref2 are on the same page but 
don’t match

\doifelse{\rawcountervalue[page]}{1}…  it is page 1 but always fails.

The only match I get is with

\doifelse{\at[ref2]}{\at[ref2]}….  which is pretty useless

Presumably I’m doing something stupid. Or do i have to go for a much lower 
level approach
___
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
___