[NTG-context] \showgrid not working right

2018-05-23 Thread Marcus Vinicius Mesquita
Dear list,

The frame around text area is appearing way below where it should be.
​​


Minimal working example:

\setuplayout[grid=yes]
\showgrid

\starttext
\input knuth.tex
\stoptext


My context version:

mtx-context | current version: 2018.05.19 21:46
mkiv lua stats  > used platform: linux-64, type: unix, binary subtree:
texmf-linux-64
mkiv lua stats  > used engine: luatex version 1.08 with functionality level
6731, banner: this is luatex, version 1.08.0 (tex live 2018)

Marcus Vinicius


mwe.pdf
Description: Adobe PDF document
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] question about followtext in MP

2018-05-23 Thread Alan Braslau
On Wed, 23 May 2018 21:06:42 +0200
Pablo Rodriguez  wrote:

> On 05/23/2018 07:19 PM, Alan Braslau wrote:
> > On Wed, 23 May 2018 18:40:14 +0200 Pablo Rodriguez wrote:  
> >>
> >> I have tried to add the shifted option to the path definition and
> >> drawing and there was no shift in the MP page.  
> > 
> > (If you only have one MPpage, then there is no need for
> > \starttext\stoptext).
> > 
> >   \edef\TextInside{Just follow the tokens}
> >   \startMPpage
> > path p ; p := reverse halfcircle scaled .6TextWidth;
> > path q ; q := halfcircle rotatedaround (origin, 180)
> > scaled (.6TextWidth + .75LineHeight);
> > %~ draw fullcircle scaled .6TextWidth;
> > draw followtext(p, "·\TextInside") ;
> > draw followtext(q, "\TextInside·") ;
> > path s ; s := (dir30--dir150--dir315--dir90--dir225--cycle)
> > scaled .3TextWidth ; for i=0 upto 500 :
> >   draw textext("\utfchar{"EB09}") scaled .5
> > shifted point (i/500*length s) of s ;
> > endfor
> >   \stopMPpage  
> 
> Many thanks for your help, Alan.
> 
> I didn’t know that dir even existed.
> 
> So I get a much better star that the one I tried before.
> 
> Many thanks for your help,
> 
> Pablo

If you are going to use MP, why not read the manual (mpman.pdf) or
better yet, refer to the MetaFun manual that is even available in
printed form at http://www.h2o-books.com/catalog/context/metafun

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] question about followtext in MP

2018-05-23 Thread Pablo Rodriguez
On 05/23/2018 07:19 PM, Alan Braslau wrote:
> On Wed, 23 May 2018 18:40:14 +0200 Pablo Rodriguez wrote:
>>
>> I have tried to add the shifted option to the path definition and
>> drawing and there was no shift in the MP page.
> 
> (If you only have one MPpage, then there is no need for \starttext\stoptext).
> 
>   \edef\TextInside{Just follow the tokens}
>   \startMPpage
> path p ; p := reverse halfcircle scaled .6TextWidth;
> path q ; q := halfcircle rotatedaround (origin, 180)
> scaled (.6TextWidth + .75LineHeight);
> %~ draw fullcircle scaled .6TextWidth;
> draw followtext(p, "·\TextInside") ;
> draw followtext(q, "\TextInside·") ;
> path s ; s := (dir30--dir150--dir315--dir90--dir225--cycle) scaled 
> .3TextWidth ;
> for i=0 upto 500 :
>   draw textext("\utfchar{"EB09}") scaled .5
> shifted point (i/500*length s) of s ;
> endfor
>   \stopMPpage

Many thanks for your help, Alan.

I didn’t know that dir even existed.

So I get a much better star that the one I tried before.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] question about followtext in MP

2018-05-23 Thread Alan Braslau
On Wed, 23 May 2018 18:40:14 +0200
Pablo Rodriguez  wrote:

> I have the following sample:
> 
>   \starttext
>   \edef\TextInside{Just follow the tokens}
>   \startMPpage
> path p ; p := reverse halfcircle scaled .6TextWidth;
> path q ; q := halfcircle rotatedaround (origin, 180)
> scaled (.6TextWidth + .75LineHeight);
> %~ draw fullcircle scaled .6TextWidth;
> draw followtext(p, "·\TextInside") ;
> draw followtext(q, "\TextInside·") ;
> path c ; c := (origin -- (6, 0) -- (0.5, -4) -- (3, 2) --
> (5.5, -4) -- cycle) scaled 1.25cm ;
> %~ c := c shifted (-3,-3) ;
> draw followtext(c, "\dorecurse{500}{\utfchar{"EB09}}") ;
>   \stopMPpage
>   \stoptext
> 
> How can I shift the path c (I mean, the one that draws a star?
> 
> I have tried to add the shifted option to the path definition and
> drawing and there was no shift in the MP page.

(If you only have one MPpage, then there is no need for \starttext\stoptext).

  \edef\TextInside{Just follow the tokens}
  \startMPpage
path p ; p := reverse halfcircle scaled .6TextWidth;
path q ; q := halfcircle rotatedaround (origin, 180)
scaled (.6TextWidth + .75LineHeight);
%~ draw fullcircle scaled .6TextWidth;
draw followtext(p, "·\TextInside") ;
draw followtext(q, "\TextInside·") ;
path s ; s := (dir30--dir150--dir315--dir90--dir225--cycle) scaled 
.3TextWidth ;
for i=0 upto 500 :
  draw textext("\utfchar{"EB09}") scaled .5
shifted point (i/500*length s) of s ;
endfor
  \stopMPpage
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] question about followtext in MP

2018-05-23 Thread Pablo Rodriguez
On 05/23/2018 06:05 PM, Hans Hagen wrote:
> On 5/23/2018 5:50 PM, Pablo Rodriguez wrote:
>>
>> Many thanks for your reply, Hans.
>>
>> Is there any way to set origin to another value than (0, 0) in MP?
>>
>> I realize it might sound weird, but it would make things easier in an
>> example that I’m working on.
> 
> redefining origin is a bad idea (don't expect help if you do that)
> 
> you can alway sdo
> 
> currentpicture := currentpicture shifted - center currentpicture;

Many thanks for your replies, Hans and Alan.

Geometry isn’t one of my strengths (and this is almost my first contact
with MP).

I have the following sample:

  \starttext
  \edef\TextInside{Just follow the tokens}
  \startMPpage
path p ; p := reverse halfcircle scaled .6TextWidth;
path q ; q := halfcircle rotatedaround (origin, 180)
scaled (.6TextWidth + .75LineHeight);
%~ draw fullcircle scaled .6TextWidth;
draw followtext(p, "·\TextInside") ;
draw followtext(q, "\TextInside·") ;
path c ; c := (origin -- (6, 0) -- (0.5, -4) -- (3, 2) --
(5.5, -4) -- cycle) scaled 1.25cm ;
%~ c := c shifted (-3,-3) ;
draw followtext(c, "\dorecurse{500}{\utfchar{"EB09}}") ;
  \stopMPpage
  \stoptext

How can I shift the path c (I mean, the one that draws a star?

I have tried to add the shifted option to the path definition and
drawing and there was no shift in the MP page.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] question about followtext in MP

2018-05-23 Thread Alan Braslau
On Wed, 23 May 2018 18:05:07 +0200
Hans Hagen  wrote:

> > Is there any way to set origin to another value than (0, 0) in MP?
> > 
> > I realize it might sound weird, but it would make things easier in
> > an example that I’m working on.  
> redefining origin is a bad idea (don't expect help if you do that)

pair origin ; origin = (0,0) ;
is used in many places in the MP macros, and redefining this "constant"
would cause all sorts of problems, as Hans indicates.

> you can alway sdo
> 
> currentpicture := currentpicture shifted - center currentpicture;

I do this a lot, but recognize that it only makes a difference with
respect to subsequent drawing actions: The MP graphic, when "sent back"
to ConTeXt is treated as a box (defined by its bounding box) and placed
by ConTeXt according to its context (no pun intended)!

One could always play with this bounding box for interesting effects:

setbounds currentpicture to ((bbox currentpicture) shifted (xx,yy)) ;

for example.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] question about followtext in MP

2018-05-23 Thread Alan Braslau
On Wed, 23 May 2018 17:50:27 +0200
Pablo Rodriguez  wrote:

> Is there any way to set origin to another value than (0, 0) in MP?

What does this mean, mathematically that is?

Of course, you can always shift an image anywhere (or in general apply
any transformation), thus effectively changing the origin:

currentpicture := currentpicture shifted (xx,yy) ;

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] question about followtext in MP

2018-05-23 Thread Hans Hagen

On 5/23/2018 5:50 PM, Pablo Rodriguez wrote:

On 05/22/2018 10:22 PM, Hans Hagen wrote:

On 5/22/2018 9:05 PM, Pablo Rodriguez wrote:

Dear list,
[...]
Is there any way to followtext in q without changing text direction?

I need to write the text counter-clockwise, but on outside of the path.

Reverse changes both text direction and side of the text (related to the
path) and I don’t want to change text direction.

it will probably always look bad

  \startMPcode
 path p ; p := reverse halfcircle scaled (5cm + 0.5LineHeight);
 path q ; q := reverse halfcircle rotatedaround (origin, 180)
 scaled (5cm +1.3LineHeight);
 draw fullcircle scaled 5cm;;
 draw followtext(p, "\strut just follow the tokens\enspace") ;
 draw followtext(reverse q, "\strut just follow the
tokens\enspace") ;
\stopMPcode


Many thanks for your reply, Hans.

Is there any way to set origin to another value than (0, 0) in MP?

I realize it might sound weird, but it would make things easier in an
example that I’m working on.

redefining origin is a bad idea (don't expect help if you do that)

you can alway sdo

currentpicture := currentpicture shifted - center currentpicture;

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Defining command with optional and mandatory arguments

2018-05-23 Thread Henning Hraban Ramm
Am 2018-05-23 um 16:01 schrieb Hans Hagen :

> On 5/23/2018 3:39 PM, Christoph Reller wrote:
>> Hi,
>> What is the right way to define a command with both mandatory and
>> optional arguments, e.g:
> i'm not sure wht happens at your end but this is the best way:

Also, there’s documentation at
http://wiki.contextgarden.net/Commands_with_optional_arguments

If there’s something wrong, please fix it yourself or come back to this list ;)


Greetlings, Hraban
---
https://www.fiee.net
http://wiki.contextgarden.net
https://www.dreiviertelhaus.de
GPG Key ID 1C9B22FD

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] question about followtext in MP

2018-05-23 Thread Pablo Rodriguez
On 05/22/2018 10:22 PM, Hans Hagen wrote:
> On 5/22/2018 9:05 PM, Pablo Rodriguez wrote:
>> Dear list,
>> [...]
>> Is there any way to followtext in q without changing text direction?
>>
>> I need to write the text counter-clockwise, but on outside of the path.
>>
>> Reverse changes both text direction and side of the text (related to the
>> path) and I don’t want to change text direction.
> it will probably always look bad
> 
>  \startMPcode
> path p ; p := reverse halfcircle scaled (5cm + 0.5LineHeight);
> path q ; q := reverse halfcircle rotatedaround (origin, 180)
> scaled (5cm +1.3LineHeight);
> draw fullcircle scaled 5cm;;
> draw followtext(p, "\strut just follow the tokens\enspace") ;
> draw followtext(reverse q, "\strut just follow the 
> tokens\enspace") ;
>\stopMPcode

Many thanks for your reply, Hans.

Is there any way to set origin to another value than (0, 0) in MP?

I realize it might sound weird, but it would make things easier in an
example that I’m working on.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Trim blank space of a PDF page

2018-05-23 Thread Taco Hoekwater


> On 23 May 2018, at 16:44, Alan Braslau  wrote:
> 
> Do these tools work vectorally, that is identify the drawing extent
> and adjust the boundingbox appropriately, or do they (especially gs)
> convert to an image and then crop?

in pdfcrop, gs computes a boundingbox based on (one assumes) its
internal image representation. Then it creates a /CropBox that is
then read by the pdfcrop perl script to create occlusion margins 
for an external image include in a plain tex document.

I assume pdftrimwhite does the same.

That was what you wanted to know, right? Not the nitty gritty of
gs’ internal calculations?
 
Taco


> 
> I use MP to read the pdf and then crop, but to a fixed closed path.
> The problem here appears to seek an autocrop. 
> 
> Alan
> 
> On Wed, 23 May 2018 12:09:29 +0200
> Hans Hagen  wrote:
> 
>> On 5/23/2018 11:25 AM, Taco Hoekwater wrote:
>>> 
 
 On 05/23/2018 01:25 AM, Procházka Lukáš Ing. wrote:  
> Hello,
> 
> just curious - is threre a way how to crop a page of a PDF via
> ConTeXt?
> 
> Ideally - to process a single page PDF into another file, with
> the one page cropped...  
 
>>> 
>>> The ‘pdfcrop’ command from TeXLive can do that for you on the
>>> command line. It is based around ghostscript which can
>>> automatically find the crop area, then uses pdftex,luatex,or xetex
>>> to create a new pdf.
>>> 
>>> It is doable to come up with a solution in ConTeXt if you do not
>>> mind specifying the cropbox manually, but automatic cropping is
>>> probably too hard for ConTeXt itself (and likely would end up
>>> duplicating pdfcrop to some extent).  
>> there is a script
>> 
>> pdftrimwhite.pl
>> 
>> in the distribution
>> 
>> Hans
>> 
>> -
>>   Hans Hagen | PRAGMA ADE
>>   Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>>tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net archive  :
>> https://bitbucket.org/phg/context-mirror/commits/ 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> ___

Taco Hoekwater
Elvenkind BV




___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Trim blank space of a PDF page

2018-05-23 Thread Alan Braslau
Do these tools work vectorally, that is identify the drawing extent
and adjust the boundingbox appropriately, or do they (especially gs)
convert to an image and then crop?

I use MP to read the pdf and then crop, but to a fixed closed path.
The problem here appears to seek an autocrop. 

Alan

On Wed, 23 May 2018 12:09:29 +0200
Hans Hagen  wrote:

> On 5/23/2018 11:25 AM, Taco Hoekwater wrote:
> >   
> >>
> >> On 05/23/2018 01:25 AM, Procházka Lukáš Ing. wrote:  
> >>> Hello,
> >>>
> >>> just curious - is threre a way how to crop a page of a PDF via
> >>> ConTeXt?
> >>>
> >>> Ideally - to process a single page PDF into another file, with
> >>> the one page cropped...  
> >>  
> > 
> > The ‘pdfcrop’ command from TeXLive can do that for you on the
> > command line. It is based around ghostscript which can
> > automatically find the crop area, then uses pdftex,luatex,or xetex
> > to create a new pdf.
> > 
> > It is doable to come up with a solution in ConTeXt if you do not
> > mind specifying the cropbox manually, but automatic cropping is
> > probably too hard for ConTeXt itself (and likely would end up
> > duplicating pdfcrop to some extent).  
> there is a script
> 
> pdftrimwhite.pl
> 
> in the distribution
> 
> Hans
> 
> -
>Hans Hagen | PRAGMA ADE
>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net archive  :
> https://bitbucket.org/phg/context-mirror/commits/ 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Defining command with optional and mandatory arguments

2018-05-23 Thread Hans Hagen

On 5/23/2018 3:39 PM, Christoph Reller wrote:

Hi,

What is the right way to define a command with both mandatory and
optional arguments, e.g:

\MyCommand[optional][mandatory]

Consider the following MWE:

\unexpanded\def\MyCommand[#1]{
   \dosingleempty{\doMyCommand[#1]}}
\def\doMyCommand[#1][#2]{
   \doifsomething{#1}{number 1: #1\par}
   \doifsomething{#2}{number 2: #2}\blank[big]}
\starttext
\MyCommand[A][B]
\MyCommand[A]
\stoptext

In last year's versions of ConTeXt the output was

number 1: A
number 2: B
number 1: A

In the latest version of ConTeXt the output is

number 1: A
number 2: B
number 2: A

Is this behavior intended? How can I make a definition whose behavior
does not change in new versions of ConTeXt?

i'm not sure wht happens at your end but this is the best way:

\unexpanded\def\MyCommand
  {\dodoubleempty\doMyCommand}

\def\doMyCommand[#1][#2]%
  {\iffirstargument
 number 1: #1%
 \par
   \fi
   \ifsecondargument
 number 2: #2%
   \fi
   \blank[big]}

\starttext
\MyCommand[A][B]
\MyCommand[A]
\stoptext


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] Defining command with optional and mandatory arguments

2018-05-23 Thread Christoph Reller
Hi,

What is the right way to define a command with both mandatory and
optional arguments, e.g:

\MyCommand[optional][mandatory]

Consider the following MWE:

\unexpanded\def\MyCommand[#1]{
  \dosingleempty{\doMyCommand[#1]}}
\def\doMyCommand[#1][#2]{
  \doifsomething{#1}{number 1: #1\par}
  \doifsomething{#2}{number 2: #2}\blank[big]}
\starttext
\MyCommand[A][B]
\MyCommand[A]
\stoptext

In last year's versions of ConTeXt the output was

number 1: A
number 2: B
number 1: A

In the latest version of ConTeXt the output is

number 1: A
number 2: B
number 2: A

Is this behavior intended? How can I make a definition whose behavior
does not change in new versions of ConTeXt?

Cheers,

Christoph
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] referenceprefix=+ not working

2018-05-23 Thread Hans Hagen

On 5/23/2018 3:59 AM, Henri Menke wrote:

Dear list,

the option referenceprefix=+ for setuphead seems to not work.
https://tex.stackexchange.com/questions/432844
It works however if you put an explicit prefix.  See MWE below. 
Reproducible on TL2018 and latest beta.

fixed in next beta

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Referring to \head

2018-05-23 Thread Procházka Lukáš Ing .

Hello,

deducing:


\starttext
  \startitemize[i][stopper=),headstyle=bold]
\starthead[h]{Head}

  Some text.

\stophead

\item[i] Item.
  \stopitemize

  See \in[h] and \in[i].
\stoptext


Thank you.

Lukas


On Wed, 23 May 2018 13:18:27 +0200, Wolfgang Schuster 
 wrote:


\starthead takes takes the title as argument, i.e.

\starthead {…}
…
\stophead

Wolfgang

Procházka Lukáš Ing. 
23. Mai 2018 um 11:11
Hello,

referring to \head doesn't work in the ME bellow:


\starttext
  \startitemize[n][]
\item[a] A

\head[b] B

  bbb

\item See \in[a] and \in[b].
  \stopitemize

  \startitemize[n][]
\item See \in[a] and \in[b].
  \stopitemize
\stoptext


\head doesn't recongize its reference name (ignores [] after it),
although it should not:

http://wiki.contextgarden.net/Command/head

What am I doing wrong? - How to refer to a \head? (Referring to \item
works well.)

TIA.

Best regards,

Lukas


___
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://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___
Wolfgang Schuster 
23. Mai 2018 um 11:44
Use \starthead.

Wolfgang

Procházka Lukáš Ing. 
23. Mai 2018 um 12:53
Hello Wolfgang,

thank you for the answer, wikified:

http://wiki.contextgarden.net/Command/head

Best regards,

Lukas


On Wed, 23 May 2018 11:44:17 +0200, Wolfgang Schuster
 wrote:









--
Ing. Lukáš Procházka | mailto:l...@pontex.cz
Pontex s. r. o.  | mailto:pon...@pontex.cz | http://www.pontex.cz | 
IDDS:nrpt3sn
Bezová 1658
147 14 Praha 4

Mob.: +420 702 033 396

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Referring to \head

2018-05-23 Thread Wolfgang Schuster

\starthead takes takes the title as argument, i.e.

\starthead {…}
…
\stophead

Wolfgang

Procházka Lukáš Ing. 
23. Mai 2018 um 11:11
Hello,

referring to \head doesn't work in the ME bellow:


\starttext
  \startitemize[n][]
\item[a] A

\head[b] B

  bbb

\item See \in[a] and \in[b].
  \stopitemize

  \startitemize[n][]
\item See \in[a] and \in[b].
  \stopitemize
\stoptext


\head doesn't recongize its reference name (ignores [] after it), 
although it should not:


http://wiki.contextgarden.net/Command/head

What am I doing wrong? - How to refer to a \head? (Referring to \item 
works well.)


TIA.

Best regards,

Lukas


___
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://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___
Wolfgang Schuster 
23. Mai 2018 um 11:44
Use \starthead.

Wolfgang

Procházka Lukáš Ing. 
23. Mai 2018 um 12:53
Hello Wolfgang,

thank you for the answer, wikified:

http://wiki.contextgarden.net/Command/head

Best regards,

Lukas


On Wed, 23 May 2018 11:44:17 +0200, Wolfgang Schuster 
 wrote:






___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Referring to \head

2018-05-23 Thread Procházka Lukáš Ing .

Hello,

the "headstyle" option in \startitemize affect undesirably all text following 
\head in the itemize scope:


\starttext
  \startitemize[i][stopper=),headstyle=bold]
\starthead[h] Head \stophead

  Some text.

\item[i] Item.
  \stopitemize

  See \in[h] and \in[i].
\stoptext


- All text between \starthead and \stopitemize gets bold. Is it a bug or am I 
still missing something?

Lukas



On Wed, 23 May 2018 11:44:17 +0200, Wolfgang Schuster 
 wrote:


Use \starthead.

Wolfgang



--
Ing. Lukáš Procházka | mailto:l...@pontex.cz
Pontex s. r. o.  | mailto:pon...@pontex.cz | http://www.pontex.cz | 
IDDS:nrpt3sn
Bezová 1658
147 14 Praha 4

Mob.: +420 702 033 396

t3.mkiv
Description: Binary data


t3.pdf
Description: Adobe PDF document
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Referring to \head

2018-05-23 Thread Procházka Lukáš Ing .

Hello Wolfgang,

thank you for the answer, wikified:

http://wiki.contextgarden.net/Command/head

Best regards,

Lukas


On Wed, 23 May 2018 11:44:17 +0200, Wolfgang Schuster 
 wrote:


Use \starthead.

Wolfgang

Procházka Lukáš Ing. 
23. Mai 2018 um 11:11
Hello,

referring to \head doesn't work in the ME bellow:


\starttext
  \startitemize[n][]
\item[a] A

\head[b] B

  bbb

\item See \in[a] and \in[b].
  \stopitemize

  \startitemize[n][]
\item See \in[a] and \in[b].
  \stopitemize
\stoptext


\head doesn't recongize its reference name (ignores [] after it),
although it should not:

http://wiki.contextgarden.net/Command/head

What am I doing wrong? - How to refer to a \head? (Referring to \item
works well.)

TIA.

Best regards,

Lukas


___
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://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___






--
Ing. Lukáš Procházka | mailto:l...@pontex.cz
Pontex s. r. o.  | mailto:pon...@pontex.cz | http://www.pontex.cz | 
IDDS:nrpt3sn
Bezová 1658
147 14 Praha 4

Mob.: +420 702 033 396

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Trim blank space of a PDF page

2018-05-23 Thread Hans Hagen

On 5/23/2018 11:25 AM, Taco Hoekwater wrote:




On 05/23/2018 01:25 AM, Procházka Lukáš Ing. wrote:

Hello,

just curious - is threre a way how to crop a page of a PDF via ConTeXt?

Ideally - to process a single page PDF into another file, with the one
page cropped...




The ‘pdfcrop’ command from TeXLive can do that for you on the command line.
It is based around ghostscript which can automatically find the crop area,
then uses pdftex,luatex,or xetex to create a new pdf.

It is doable to come up with a solution in ConTeXt if you do not mind
specifying the cropbox manually, but automatic cropping is probably too
hard for ConTeXt itself (and likely would end up duplicating pdfcrop
to some extent).

there is a script

pdftrimwhite.pl

in the distribution

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Referring to \head

2018-05-23 Thread Wolfgang Schuster

Use \starthead.

Wolfgang

Procházka Lukáš Ing. 
23. Mai 2018 um 11:11
Hello,

referring to \head doesn't work in the ME bellow:


\starttext
  \startitemize[n][]
\item[a] A

\head[b] B

  bbb

\item See \in[a] and \in[b].
  \stopitemize

  \startitemize[n][]
\item See \in[a] and \in[b].
  \stopitemize
\stoptext


\head doesn't recongize its reference name (ignores [] after it), 
although it should not:


http://wiki.contextgarden.net/Command/head

What am I doing wrong? - How to refer to a \head? (Referring to \item 
works well.)


TIA.

Best regards,

Lukas


___
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://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Trim blank space of a PDF page

2018-05-23 Thread Taco Hoekwater

> 
> On 05/23/2018 01:25 AM, Procházka Lukáš Ing. wrote:
>> Hello,
>> 
>> just curious - is threre a way how to crop a page of a PDF via ConTeXt?
>> 
>> Ideally - to process a single page PDF into another file, with the one
>> page cropped...
> 

The ‘pdfcrop’ command from TeXLive can do that for you on the command line.
It is based around ghostscript which can automatically find the crop area,
then uses pdftex,luatex,or xetex to create a new pdf.

It is doable to come up with a solution in ConTeXt if you do not mind
specifying the cropbox manually, but automatic cropping is probably too
hard for ConTeXt itself (and likely would end up duplicating pdfcrop
to some extent).

Best wishes,
Taco



___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Trim blank space of a PDF page

2018-05-23 Thread Henri Menke
On 05/23/2018 01:25 AM, Procházka Lukáš Ing. wrote:
> Hello,
> 
> just curious - is threre a way how to crop a page of a PDF via ConTeXt?
> 
> Ideally - to process a single page PDF into another file, with the one
> page cropped...

It's not really clear what you want.  Are you looking for
\start...\stopTEXpage?

> 
> Best regards,
> 
> Lukas
> 
> 

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] Referring to \head

2018-05-23 Thread Procházka Lukáš Ing .

Hello,

referring to \head doesn't work in the ME bellow:


\starttext
  \startitemize[n][]
\item[a] A

\head[b] B

  bbb

\item See \in[a] and \in[b].
  \stopitemize

  \startitemize[n][]
\item See \in[a] and \in[b].
  \stopitemize
\stoptext


\head doesn't recongize its reference name (ignores [] after it), although it 
should not:

http://wiki.contextgarden.net/Command/head

What am I doing wrong? - How to refer to a \head? (Referring to \item works 
well.)

TIA.

Best regards,

Lukas


--
Ing. Lukáš Procházka | mailto:l...@pontex.cz
Pontex s. r. o.  | mailto:pon...@pontex.cz | http://www.pontex.cz | 
IDDS:nrpt3sn
Bezová 1658
147 14 Praha 4

Mob.: +420 702 033 396

t3.mkiv
Description: Binary data


t3.pdf
Description: Adobe PDF document
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] DTD's and XML-ConTeXt question

2018-05-23 Thread Hans van der Meer
Here is a sample xml-document:


]>


The file setup/xmp.dtd contains the line:


My 1st question, why does this fail for ? The  is substituted 
but  is not. 

My 2nd question is why included files do not substitute either of these two 
entities. 
Thus in: xml-document-included processed by 
\xmlprocessfile{}{included-file}{}
nor  nor  is substituted.

So, what am I doing wrong here?

Hans van der Meer

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___