[NTG-context] Avoid double entries in ToC

2015-10-15 Thread Henning Hraban Ramm
Hi,
I got a very special case: In a booklet of forms, each form must appear twice, 
but only once in the ToC.

At the moment, every form is a chapter in a component that I include twice.

Do you have an idea how to get only the first identical entry in the ToC?


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
___

[NTG-context] Upvalue error pdfpaperheight

2015-10-15 Thread Ulrike Fischer
While trying out some things related to this bug
http://tracker.luatex.org/view.php?id=770

I got this error:

lua error   > lua error on line 76 in file
G:/Z-Test/test-utf8.tex:

.../context/tex/texmf-context/tex/context/base/lpdf-mis.lua:351:
attempt to perform arithmetic on upvalue 'pdfpaperheight' (a nil
value)


Imho it could be caused by the newest name changes in luatex 0.81

luatex, version beta-0.81.1 (tex live 2015/w32tex) (rev 5374)

The document which gaves the error is this one:

\setupinteraction[state=start,color=red]
\enabledirectives[destinations.log]
\enabledirectives[references.border]

\starttext

\font\myfont=cmr12\relax
\myfont
\setbox0=\hbox{%
  A %
  \hbox{%
\pdfstartlink attr{%
  /Border[0 0 2]%
  /H/I%
  /C[1 0 0]%
} user{%
  /Subtype/Link%
  /A<<%
/Type/Action%
/S/URI%
/URI(http://www.luatex.org/ [^])%
  >>%
}%
  LuaTeX%
\pdfendlink
  } link%
}
\wd0=0pt
\ht0=0pt
\dp0=0pt
\pageheight=100mm
\pagewidth=50mm
\shipout\vbox to \pageheight{%
  \hsize=\pagewidth
  \vfill
  \hbox{%
\kern10mm %
\pdfsave
\pdfsetmatrix{0 1 -1 0}%
\copy0 %
\pdfrestore
  }%
  \vfill
}

\textreference[myref]{blblbla} \textreference[myref2]{blub}

\about[myref] 

\scale[factor=30]{\about[myref]} 

\scale[factor=30]{\about[myref2]} 

\scale[width=4cm]{\about[myref]} 

\scale[width=4cm]{\about[myref2]} 

\rotate[rotation=45,offset=2pt]{\about[myref]} 

\stoptext



-- 
Ulrike Fischer 
http://www.troubleshooting-tex.de/

___
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] Upvalue error pdfpaperheight

2015-10-15 Thread Hans Hagen

On 10/15/2015 11:26 AM, Ulrike Fischer wrote:

\setupinteraction[state=start,color=red]
\enabledirectives[destinations.log]
\enabledirectives[references.border]


...

thanks for noticing, i'll fix it,

Hans

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

Re: [NTG-context] Rotating an image

2015-10-15 Thread Wolfgang Schuster

Fabrice Couvreur 
12. Oktober 2015 um 20:58
A small question not directly related context.
I would like to turn my image 15 degrees.
Thanks,
Fabrice

picture pic ;
pic := currentpicture ;
u := 0.5cm ;
z1 = origin ;
z2 = (9u, 0) ;
path p ;
p := fullcircle scaled 14u ;
path q ;
q := p shifted (9u,0) ;
pair A ;
A := p intersectionpoint q ;
path a ;
a := z1 -- z2 ;
path b ;
b := z1 -- A ;
path c ;
c := z2 -- A ;
draw a ;
draw b ;
draw c ;
pair I ;
pair J ;
I := point 0.6 of b ;
J := point 0.6 of c ;
draw I -- J ;
pair L ;
L := point 0.8 of b ;
label.top("A", A) ;
label.lrt("C", z2) ;
label.llft("B", origin) ;
label.ulft("I", I) ;
label.urt("J", J) ;
label.ulft("$x$", L) ;
draw pic rotated 15 ;


\startMPpage
picture pic ;
u := 0.5cm ;
z1 = origin ;
z2 = (9u, 0) ;
path p ;
p := fullcircle scaled 14u ;
path q ;
q := p shifted (9u,0) ;
pair A ;
A := p intersectionpoint q ;
path a ;
a := z1 -- z2 ;
path b ;
b := z1 -- A ;
path c ;
c := z2 -- A ;
draw a ;
draw b ;
draw c ;
pair I ;
pair J ;
I := point 0.6 of b ;
J := point 0.6 of c ;
draw I -- J ;
pair L ;
L := point 0.8 of b ;
label.top("A", A) ;
label.lrt("C", z2) ;
label.llft("B", origin) ;
label.ulft("I", I) ;
label.urt("J", J) ;
label.ulft("$x$", L) ;
pic := currentpicture ;
currentpicture := nullpicture;
draw pic rotated 15 ;
\stopMPpage

You can also rotate the image when you place it in your document with 
\rotate[rotation=15]{...}.


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] tex error in curent beta

2015-10-15 Thread Wolfgang Schuster

Jan Tosovsky 
15. Oktober 2015 um 22:33
Hi Wolfgang, thanks,

you are right, I've created this MWE (but not sure if it still makes 
sense).



\setupcombinedlist[chapter][
before=,
distance=0.5cm,
width=-0.5cm,
margin=2cm,
numbercommand={\simplealignedbox{\listparameter{width}}{flushright}},
pageconversionset=pagenumber,
]

Create a command and apply it to the numbercommand key.

\define[1]\ChapterListNumbercommand
{\simplealignedbox{\listparameter{width}}{flushright}{#1}}

\setuplist
[chapter]
[
before=,
distance=0.5cm,
width=-0.5cm,
margin=2cm,
numbercommand=\ChapterListNumbercommand,
pageconversionset=pagenumber,
]

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] tex error in curent beta

2015-10-15 Thread Wolfgang Schuster

Jan Tosovsky 
15. Oktober 2015 um 20:05
Dear All,

I've updated context, tried to regenerate my tex source and it doesn't
compile any more. It was Ok in 0.79 (in March).

I am getting tex error after these 3 lines (followed by a blank line and
other lines):

...
\definestructureconversionset[frontpart:pagenumber][][romannumerals]
\definestructureconversionset[bodypart:pagenumber] [][numbers]
\definestructureconversionset[backpart:pagenumber] [][numbers]

\startsectionblockenvironment[frontpart]
\setupuserpagenumber[numberconversion=romannumerals]
\stopsectionblockenvironment
...

tex error > tex error on line 22 in file D:/source.tex: ! Missing {
inserted


\edef
\currentlistsymbol ->\edef
\p_symbol {\listparameter \c!symbol
}\doifelseins...
\14>:113>:abc ...numbercommand \currentlistsymbol
}\else \setbox
\b_strc_lis...
\strc_lists_apply_renderingsetup ...nderingsetup }
\relax \the
\t_lists_every...
\strc_lists_entry_process ...i \fi \fi \endcsname
\dostoptagged
\listextrapa...
\strclistsentryprocess ...trc_lists_entry_process
\clf_poplist
...
l.150

Any idea how to fix this?

Without a minimal example I can only guess.

What I can take from the error message is that you have a problem with 
the list mechanism.


To try fixing the problem comment first a list settings where you apply your
own commands (e.g. the pagecommand key) and when this doesn't help
(don't forget to delete the tuc-file) you can comment the complete
\setuplist setting.

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] tex error in curent beta

2015-10-15 Thread Jan Tosovsky
Hi Wolfgang, thanks,

On 2015-10-15 Wolfgang Schuster wrote:
> On 2015-10-15 Jan Tosovsky wrote:
> >
> > I am getting tex error > tex error on line 22 in file D:/source.tex: !
> > Missing { inserted
> >
> > 
> > \edef
> > \currentlistsymbol ->\edef
> > \p_symbol {\listparameter \c!symbol
> > }\doifelseins...
> > \14>:113>:abc ...numbercommand \currentlistsymbol
> 
>
> What I can take from the error message is that you have a problem with
> the list mechanism.

you are right, I've created this MWE (but not sure if it still makes sense).


\setupcombinedlist[chapter][
   before=,
   distance=0.5cm,
   width=-0.5cm,
   margin=2cm,   
   numbercommand={\simplealignedbox{\listparameter{width}}{flushright}},
   pageconversionset=pagenumber,
]

\starttext
\startfrontmatter
\title{TOC}
\placecontent
\chapter{Preface}
\stopfrontmatter
\stoptext

That list definition creates right aligned roman chapter numbers in the ToC,
see
http://www.ntg.nl/pipermail/ntg-context/2013/076154.html

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] use of preceding-sibling in xmlsetsetup

2015-10-15 Thread Thomas A. Schmitz

On 10/14/2015 01:34 PM, mass...@fastwebnet.it wrote:

I've found a better solution:

\startxmlsetups xml:p
   \doif{\xmlattribute{#1}{reverse-sibling::p[1]}{class}}{incipit}{\noindent}%
   \xmlflush{#1}\par
\stopxmlsetups

Still I did not manage to put that rule in a xmlsetsetup.
Tried this:

\xmlsetsetup{#1}{p[reverse-sibling::p[1]/attribute('class') == 
'incipit']}{xml:p:noindent}

but it does not work.


I'm not sure if the "sibling" part of xpath syntax has been integrated 
into context. The best I can come up with is a hack which may help:


\startbuffer[test]

  Dear list,
  this paragraph should not be indented, because it follows the 
“incipit”

  of the letter.
  This one and the following ones should be indented.
  You may question whether “Dear list,” should be a paragraph of his 
own,

  but my text is already formatted like that and I can’t do anything
  about it.

\stopbuffer

\startxmlsetups xml:somesetups
  \xmlsetsetup{#1}{text}{xml:text}
  \xmlsetsetup{#1}{p}{xml:p}
\stopxmlsetups

\xmlregistersetup{xml:somesetups}

\startxmlsetups xml:text
  \xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:p
\doifelse {\xmlatt {#1} {class}} {incipit}
  {\noindentation \xmlflush {#1}\par \noindentation}
  {\xmlflush {#1}\par \indentation}
\stopxmlsetups

\starttext
  \setupindenting [medium, yes]
  \xmlprocessbuffer{main}{test}{}
\stoptext

This will suppress indentation for paragraphs with class "incipit" and 
the following paragraph.


Thomas
___
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] Rotating an image

2015-10-15 Thread Alan BRASLAU
On Thu, 15 Oct 2015 18:36:56 +0200
Fabrice Couvreur  wrote:

> Why is it necessary to add currentpicture := nullpicture ; ?

Otherwise you will get both the unrotated as well as the rotated image!

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] Rotating an image

2015-10-15 Thread Fabrice Couvreur
Hi Wolfgang,
Why is it necessary to add currentpicture := nullpicture ; ?
Thank you,
Fabrice

2015-10-15 17:27 GMT+02:00 Wolfgang Schuster :

> Fabrice Couvreur 
> 12. Oktober 2015 um 20:58
> A small question not directly related context.
> I would like to turn my image 15 degrees.
> Thanks,
> Fabrice
>
> picture pic ;
> pic := currentpicture ;
> u := 0.5cm ;
> z1 = origin ;
> z2 = (9u, 0) ;
> path p ;
> p := fullcircle scaled 14u ;
> path q ;
> q := p shifted (9u,0) ;
> pair A ;
> A := p intersectionpoint q ;
> path a ;
> a := z1 -- z2 ;
> path b ;
> b := z1 -- A ;
> path c ;
> c := z2 -- A ;
> draw a ;
> draw b ;
> draw c ;
> pair I ;
> pair J ;
> I := point 0.6 of b ;
> J := point 0.6 of c ;
> draw I -- J ;
> pair L ;
> L := point 0.8 of b ;
> label.top("A", A) ;
> label.lrt("C", z2) ;
> label.llft("B", origin) ;
> label.ulft("I", I) ;
> label.urt("J", J) ;
> label.ulft("$x$", L) ;
> draw pic rotated 15 ;
>
> \startMPpage
> picture pic ;
>
> u := 0.5cm ;
> z1 = origin ;
> z2 = (9u, 0) ;
> path p ;
> p := fullcircle scaled 14u ;
> path q ;
> q := p shifted (9u,0) ;
> pair A ;
> A := p intersectionpoint q ;
> path a ;
> a := z1 -- z2 ;
> path b ;
> b := z1 -- A ;
> path c ;
> c := z2 -- A ;
> draw a ;
> draw b ;
> draw c ;
> pair I ;
> pair J ;
> I := point 0.6 of b ;
> J := point 0.6 of c ;
> draw I -- J ;
> pair L ;
> L := point 0.8 of b ;
> label.top("A", A) ;
> label.lrt("C", z2) ;
> label.llft("B", origin) ;
> label.ulft("I", I) ;
> label.urt("J", J) ;
> label.ulft("$x$", L) ;
> pic := currentpicture ;
> currentpicture := nullpicture;
> draw pic rotated 15 ;
> \stopMPpage
>
> You can also rotate the image when you place it in your document with
> \rotate[rotation=15]{...}.
>
> 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
>
> ___
>
___
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] tex error in curent beta

2015-10-15 Thread Jan Tosovsky
Dear All,

I've updated context, tried to regenerate my tex source and it doesn't
compile any more. It was Ok in 0.79 (in March).

I am getting tex error after these 3 lines (followed by a blank line and
other lines):
 
...
\definestructureconversionset[frontpart:pagenumber][][romannumerals]
\definestructureconversionset[bodypart:pagenumber] [][numbers]
\definestructureconversionset[backpart:pagenumber] [][numbers]

\startsectionblockenvironment[frontpart]
\setupuserpagenumber[numberconversion=romannumerals]
\stopsectionblockenvironment
...

tex error   > tex error on line 22 in file D:/source.tex: ! Missing {
inserted


\edef
\currentlistsymbol ->\edef
   \p_symbol {\listparameter \c!symbol
}\doifelseins...
\14>:113>:abc ...numbercommand \currentlistsymbol
  }\else \setbox
\b_strc_lis...
\strc_lists_apply_renderingsetup ...nderingsetup }
  \relax \the
\t_lists_every...
\strc_lists_entry_process ...i \fi \fi \endcsname
  \dostoptagged
\listextrapa...
\strclistsentryprocess ...trc_lists_entry_process
  \clf_poplist
...
l.150

Any idea how to fix this?

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
___