Re: [NTG-context] Set PDF TrimBox

2015-08-23 Thread Henning Hraban Ramm
Am 2015-08-21 um 22:53 schrieb Hans Hagen pra...@wxs.nl:

 On 8/16/2015 6:33 AM, Henning Hraban Ramm wrote:
 Could you please implement this? Should be really easy…
 I’m tired of fixing the boxes in Acrobat every time.
 Thank you very much!
 
 The next beta will have this extra 'feature':
 
 \showframe
 
 \setuplayout
  [location=middle,
   width=middle,
   height=middle,
   cropoffset=auto,
   trimoffset=1bp,
   bleedoffset=2bp,
   artoffset=2bp]
 
 \starttext
 
 \definepapersize[TestA][width=100bp,height=200bp]
 \definepapersize[TestB][width=150bp,height=250bp]
 
 \setuppapersize[TestA][TestB]
 
 test
 
 \stoptext
 
 The auto option only works with layout=middle (message otherwise) as I'm not 
 going to add all kind of extra calculation code to an already bit overloaded 
 mechanism deep down. The offset are accumulative (so crop  trim  bleed  
 art). In Haralds case cropoffset=auto should be enough. The default crop and 
 trimbox handling is unchanged (as it would complicate my own workflows and 
 also breaks compatibility) so one really needs to set this when it's needed. 
 The already present interactionscreen cropping is unchanged.

Hi Hans, thank you very much for looking into that!
I wikified the box information plus your example at 
http://wiki.contextgarden.net/PDF_Boxes

Unfortunately, the order (crop  trim  bleed  art) is not so good, it should 
be (art  crop  trim  bleed) - as I wrote, in PDF/X, ArtBox must be the same 
as TrimBox, if defined at all. Would you please fix this?

(I don’t know any use of ArtBox - it was meant for imposition, but software 
will probably look for page contents itself, since ArtBox is mostly undefined.)

Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
https://www.cacert.org (I'm an assurer)

___
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] Split numbers in natural tables

2015-08-23 Thread Xan
Thanks.

On Fri, 21 Aug 2015 16:52:11 +0200
Xan xancor...@gmail.com ha escrit:

 Hi,
 
 I have a simple script in mako templates which generate this table:
 
 
 \starttext
 \bTABLE[align={lohi,middle}]
 
  \bTR
\bTD[width=2.8cm, height=2.8cm] 1 \eTD 
  \eTR
 
\bTD[width=2.8cm, height=2.8cm] 2 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 4 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 8 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 16 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 32 \eTD 
 
  \bTR
\bTD[width=2.8cm, height=2.8cm] 64 \eTD 
  \eTR
 
\bTD[width=2.8cm, height=2.8cm] 128 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 256 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 512 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 1024 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 2048 \eTD 
 
  \bTR
\bTD[width=2.8cm, height=2.8cm] 4096 \eTD 
  \eTR
 
\bTD[width=2.8cm, height=2.8cm] 8192 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 16384 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 32768 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 65536 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 131072 \eTD 
 
  \bTR
\bTD[width=2.8cm, height=2.8cm] 262144 \eTD 
  \eTR
 
\bTD[width=2.8cm, height=2.8cm] 524288 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 1048576 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 2097152 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 4194304 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 8388608 \eTD 
 
  \bTR
\bTD[width=2.8cm, height=2.8cm] 16777216 \eTD 
  \eTR
 
\bTD[width=2.8cm, height=2.8cm] 33554432 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 67108864 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 134217728 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 268435456 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 536870912 \eTD 
 
  \bTR
\bTD[width=2.8cm, height=2.8cm] 1073741824 \eTD 
  \eTR
 
\bTD[width=2.8cm, height=2.8cm] 2147483648 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 4294967296 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 8589934592 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 17179869184 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 34359738368 \eTD 
 
  \bTR
\bTD[width=2.8cm, height=2.8cm] 68719476736 \eTD 
  \eTR
 
\bTD[width=2.8cm, height=2.8cm] 137438953472 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 274877906944 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 549755813888 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 1099511627776 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 219902322 \eTD 
 
  \bTR
\bTD[width=2.8cm, height=2.8cm] 4398046511104 \eTD 
  \eTR
 
\bTD[width=2.8cm, height=2.8cm] 8796093022208 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 17592186044416 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 35184372088832 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 70368744177664 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 140737488355328 \eTD 
 
  \bTR
\bTD[width=2.8cm, height=2.8cm] 281474976710656 \eTD 
  \eTR
 
\bTD[width=2.8cm, height=2.8cm] 562949953421312 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 1125899906842624 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 2251799813685248 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 4503599627370496 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 9007199254740992 \eTD 
 
  \bTR
\bTD[width=2.8cm, height=2.8cm] 18014398509481984 \eTD 
  \eTR
 
\bTD[width=2.8cm, height=2.8cm] 36028797018963968 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 72057594037927936 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 144115188075855872 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 288230376151711744 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 576460752303423488 \eTD 
 
  \bTR
\bTD[width=2.8cm, height=2.8cm] 1152921504606846976 \eTD 
  \eTR
 
\bTD[width=2.8cm, height=2.8cm] 2305843009213693952 \eTD 
 
\bTD[width=2.8cm, height=2.8cm] 4611686018427387904 \eTD 
 
 
 \eTABLE
 \stoptext
 
 
 
 How can I do for, automatically, split the number in the cells? That is, I 
 want the numbers to fit all the cell size, not matter what return carriages 
 it needs.
 
 So some thing like   \bTD[width=2.8cm, height=2.8cm] 4611686018427387904 \eTD 
  would be transformed into:
 
\bTD[width=2.8cm, height=2.8cm] 4611
 
 686018427
 
 387904 \eTD 
 
 or something similar.
 
 
 Thanks,
 Xan
___
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] defining an alternate mono typeface

2015-08-23 Thread Pablo Rodriguez
Dear list,

I have the following sample:

 \definefontfamily
[mainface]
[rm]
[TeX Gyre Pagella]

 \definefontfamily
[mainface]
[tt]
[TeX Gyre Cursor]

 \definefontfamily
[anothermono]
[tt]
[DejaVu Sans Mono]

\setupbodyfont[mainface]

\starttext
\startTEXpage[offset=1em]
\tfxx smaller text with
  {\doifdefinedelse{anothermono}{\anothermono}{\tt} second mono}

\tfxx smaller text with
  {\doifdefinedelse{nomono}{\nomono}{\tt} second mono}
\stopTEXpage
\stoptext

I would like to have an optional monospaced font, but when switching
typefaces, font size isn’t retained.

Is this a bug or am I missing something?

Many thanks for your help,


Pablo
-- 
http://www.ousia.tk
___
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] xmlconcat

2015-08-23 Thread Hans Hagen

On 8/22/2015 1:29 PM, Meer, H. van der wrote:

There is a behaviour of xmlconcat that I do not understand.
Calling as
 \xmlconcat{#1}{test}{xxx}
correctly interjects the xxx between the successive members, in
according with the documentation.

But using the command version for calling:
 \xmlconcat{#1}{test/command(xmltest:test)}{yyy}
does typeset the nodes but not the text from the third argument.

It might be the correct behaviour but it confuses me.
Any comments or enlightment? Thamks in advance.

Hans van der Meer

Minimal example:

\setuppapersize[A6][A6]
\startxmlsetups xmltest:setups
\xmlsetsetup{\xmldocument}{root|test}{xmltest:*}
\stopxmlsetups
\xmlregistersetup{xmltest:setups}
\startxmlsetups xmltest:root
\writestatus{TEST}{calling xmltest:root}
\xmlconcat{#1}{test}{xxx}\crlf
\xmlconcat{#1}{test/command(xmltest:test)}{yyy}\crlf
\stopxmlsetups
\startxmlsetups xmltest:test
\xmlflush{#1}
\stopxmlsetups
\startbuffer[xmlbuffer]
?xml version=1.0 encoding=UTF-8?
root
testnode-1/test
testnode-2/test
testnode-3/test
testnode-4/test
/root
\stopbuffer
\starttext
\xmlprocessbuffer{root}{xmlbuffer}{}
\stoptext
\endinput


\xmlconcat{#1}{test}{xxx}\crlf
\xmlconcat{#1}{test/command(xmltest:test)}{yyy}\crlf

command(...) is applied and is stronger than concat

you can also apply concat, compare this:

\startxmlsetups xmltest:root
\writestatus{TEST}{calling xmltest:root}
\xmlconcat{#1}{test}{xxx}\crlf
\xmlconcat{#1}{test/command(xmltest:test)}{yyy}\crlf
\xmlall   {#1}{test/concat('zzz')}\crlf
\stopxmlsetups

\startxmlsetups xmltest:test
[\xmlflush{#1}]
\stopxmlsetups


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | 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
___

[NTG-context] Expand a part of TOC

2015-08-23 Thread Eric Détrez

hello

Here is my problem :

I wish to write a TOC at the beginning of each chapter (that I can do).
But I want it to write every chapter and only the sections and 
subsections of the current chapter.

Like, at the head of chapter 3 (the style is not relevant)

Chapter 1   1
Chapter 2  15
Chapter 3  23
3.1 ...23
3.2 ...26
3.3 ...29
3.3.1 .29
3.3.2 .33
3.3.3 .36
Chapter 4  38

I tried to combine 2 lists with differents criterium but it doesn't 
seems to work.

Thank's for any indication ; I'll write the result in the wiki.


--
Eric Détrez
Informatique
Lycée Faidherbe, Lille
http://eric-detrez.fr
___
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] Issues of export (structure bug)

2015-08-23 Thread Henning Hraban Ramm
Am 2015-08-21 um 23:04 schrieb Hans Hagen pra...@wxs.nl:

 from
 
 
 \startchapter[title=Something]
 ...
 \stopchapter
 
 \startchapter[title={Something Else}]
 ...
 \stopchapter
 
 
 I get in *—raw.xml:
 
 ...
 /sectioncontent
sectiontitleSomething Else/sectiontitle
/section
   section detail=chapter chain=chapter level=2 implicit=4
sectioncontent
 …
 
 That means, the title of a section is at the end of the previous section. 
 Please fix!

Sorry, making a minimal example helps as usual.
My description was partly wrong: The section title is moved to the end of its 
own section.

It is caused by using a layer:

—
\setupbackend[export=yes]

\definelayer[satzspiegel][
width=\textwidth,height=\textheight,
location={left,bottom},
x=\textwidth,y=0mm]

\starttext

\startchapter[title={Chapter Two}]

%\input tufte

\setlayer[satzspiegel]{\externalfigure[koe]}
\setupbackgrounds[text][background=satzspiegel]

\input tufte

\stopchapter

\stoptext

—

from that I get:

—
document date=Mon Aug 24 10:32:56 2015 context=2015.08.21 19:57 
version=0.34 xmlns:m=http://www.w3.org/1998/Math/MathML; file=structurebug 
language=en
 metadata
 /metadata
 section detail=chapter chain=chapter implicit=1 level=2
  sectioncontent
   image label=3.054cm height=3.054cm id=image-1 width=4.072cm 
name=koe/image
We thrive in information ... from the goats.  /sectioncontent
  sectionnumber1/sectionnumber
   sectiontitleChapter Two/sectiontitle
  /section
/document
—

If I uncomment the first \input, the picture is still at the beginning of the 
chapter and its title at the end.



Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
https://www.cacert.org (I'm an assurer)

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