[NTG-context] macro expansion inside a block

2016-02-05 Thread Andrea De Michele
Hi all,
I want to expand a macro inside a block when the block is written and not when 
it is used.
Here a simple example:

\defineblock[myblock]
\hideblocks[myblock]

\starttext

\define\mynumber{1}
Some text: mynumber is :\mynumber 
\beginmyblock
  This is mynumber inside the first myblock, I want 1 and I obtain:  \mynumber
\endmyblock

\define\mynumber{2}
Some text: mynumber now is :\mynumber 
\beginmyblock
  This is mynumber inside the second myblock, I want 2 and I obtain:  \mynumber
\endmyblock

\useblocks[myblock]
\stoptext

This produce:

Some text: mynumber is :1
Some text: mynumber now is :2
This is mynumber inside the first myblock, I want 1 and I obtain: 2
This is mynumber inside the second myblock, I want 2 and I obtain: 2

instead I want:

Some text: mynumber is :1
Some text: mynumber now is :2
This is mynumber inside the first myblock, I want 1 and I obtain: 1
This is mynumber inside the second myblock, I want 2 and I obtain: 2

It is possible in some way?


-- 
Andrea De Michele

___
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] interactive reference

2016-02-05 Thread Wolfgang Schuster

Meer, Hans van der 
3. Februar 2016 um 19:10
In the ConTeXt reference manual in section 12.5 Cross references I 
find the following explanation:



I would like to set (interactive) references as the black triangles 
pointing forward and backward, as displayed here. Although I tried 
along the lines in the first example, as mentioned at the end of the 
text, I could not manage to get these triangles.
You can change the output from the \in and \at commands with 
\setupreferencing.


%\setupreferencing[interaction=all]
\setupreferencing[interaction=symbol]

\setupinteraction[state=start]

\starttext

\chapter[sec:1]{First chapter}

See \in{chapter}[sec:1].

See \in{chapter}[sec:2].

See \in{chapter}[sec:3].

\chapter[sec:2]{Second chapter}

See \in{chapter}[sec:1].

See \in{chapter}[sec:2].

See \in{chapter}[sec:3].

\chapter[sec:3]{Third chapter}

See \in{chapter}[sec:1].

See \in{chapter}[sec:2].

See \in{chapter}[sec:3].

\stoptext

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
___

[NTG-context] box'es do not spread out

2016-02-05 Thread Meer, Hans van der
I am struggling with the following problem:

Collect a number of boxes with:
\global\setbox\placexcontent=\hbox{%
\box\placexcontent % collection of previous boxes
\box\placexbox % next box affixed to previous onse
\hskip\placexdistanceskip % spearation, replacing by \hfill does not solve 
problem
}%
Thus the incoming \placexbox'es are strung together separated by a skip.
Later they are typeset centered as a whole with:
\hbox to\textwidth{% % will be wider than the sum of the original box collection
\hss
\box\placexcontent % or \unhbox, doesn't look different
\unskip % unskip removes the last (extra) \hskip
\hss % should succumb to \hskip 0pt plus1fill
}%

The problem is the following:
(1) \placexdistanceskip=10pt boxes are separated neatly
(2) \placexdistanceskip=0pt plus1fill BOXES DO NOT SPREAD OUT AS I EXPECTED 
THEM TO DO
The flexible component does sadly not carry over to the final box, apparently.

Clearly my misunderstanding of working with boxes.
Can this be solved easily?

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Floating split TABLE misaligned

2016-02-05 Thread Andreas Schneider

Hi,

I presume I found a bug in TABLE placement. The attached examples shows, 
that the split TABLE is not centered on the first page, bug centered on 
the second. I would expect it to be centered in both cases.


Best regards,
Andreas\setupTABLE[split=repeat, textwidth=.9\textwidth]
\setupTABLE[column][last][width=broad]
\setupTABLE[row][first][style=bold]
\setupTABLE[offset=.2em]

\setupwhitespace[medium]
\setuptolerance[verytolerant]

\starttext
	\dorecurse{2}{\input knuth\par}

	\placetable[here,split][]{Test}{
		\bTABLE
			\bTABLEhead
\bTR \bTD Col1 \eTD \bTD Col2 \eTD \eTR
			\eTABLEhead
			\bTABLEbody
\dorecurse{20}{\bTR \bTD Test \eTD \bTD Test \eTD \eTR}
			\eTABLEbody
		\eTABLE
	}
\stoptext___
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] Typesetting Arabic (Scheherazade)

2016-02-05 Thread Alan Bowen
Acch. Sorry for the noise. It should be

\definefallbackfamily[mainface][serif][Scheherazade][range=0600-077F,
features=arabic]

Alan

On Fri, Feb 5, 2016 at 6:28 AM, Alan Bowen  wrote:

>  currently have:
>
> \definefontfeature
>  [arabic]
>  [mode=node,language=dflt,script=arab,
>   init=yes,medi=yes,fina=yes,isol=yes,
>   liga=yes,dlig=yes,rlig=yes,tlig=yes,
>   calt=yes,trep=yes,mark=yes,mkmk=yes,
>   kern=yes,curs=yes]
>
>
> \definefallbackfamily[mainface][serif][Scheherazade][range=0600-077F][features=arabic]
>
> and get output in which the letters are not joined up into words but
> printed separately, as in
>
> ثم يتعرف وزن ما يحتاج اليه مع وزن الكفة لموازاة الافق بالعمود
> Is there a setting that I have missed?
>
> 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
___

[NTG-context] Typesetting Arabic (Scheherazade)

2016-02-05 Thread Alan Bowen
 currently have:

\definefontfeature
 [arabic]
 [mode=node,language=dflt,script=arab,
  init=yes,medi=yes,fina=yes,isol=yes,
  liga=yes,dlig=yes,rlig=yes,tlig=yes,
  calt=yes,trep=yes,mark=yes,mkmk=yes,
  kern=yes,curs=yes]

\definefallbackfamily[mainface][serif][Scheherazade][range=0600-077F][features=arabic]

and get output in which the letters are not joined up into words but
printed separately, as in

ثم يتعرف وزن ما يحتاج اليه مع وزن الكفة لموازاة الافق بالعمود
Is there a setting that I have missed?

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] (bug?) wrong hyphenation with external fonts

2016-02-05 Thread Hans Hagen

On 2/5/2016 8:47 AM, Pablo Rodriguez wrote:

On 02/04/2016 10:13 PM, Hans Hagen wrote:

On 2/4/2016 9:27 PM, Pablo Rodriguez wrote:

[...]
The ff-ligature prevents hyphenation with TeX Gyre Pagella, but not with
MinionPro. (This is the opposite of what I reported before.)


it depends on the complexity of the ligature .. ff is not so much an
issue but you can have ff + i = ffi etc and we need to deal with kerning
too (it depends a bit on how the opentype features are applied and we
can handle quite some weird ligature implementations)

the latest mechanism in context can deal with quite some situations but
at some point has to make decisions (in order not to loose for instance
kerns; double chained ligatures would result in way more overhead and is
not worth the trouble)

one might wonder if we never had these  f[fil] ligatures of if ancient
technology had provides hundreds of them combining upto 4 characters etc
etc.


Many thanks for the explanation, Hans.

I see the decisions ConTeXt has to make may be compromises in some cases.


the f + f can become a ff glyph but also a special first or second f or 
even two special f's and the same can happen with this result and the 
following i which can become a special i, or just the i partly overlayed 
or a ligature or break the ff into f and fi or there can be no 
replacements but just kerning


tex does have a concept of chained discretionary nodes (max 2) but that 
is pretty complex; such a chained discretionary node set + complex 
ligatures is no fun to deal with and because we also want to do other 
things in context (font handling is only one of the many things we do at 
that level)


we don't want to build a solution tree of thousands of possibilities to 
feed into the par builder (the current mechanism is already quite 
complex but still quite fast too) just for the sake of an occasional 
three character ligature in latin which is not even always permitted due 
to language constraints


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
-
___
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] box'es do not spread out

2016-02-05 Thread Wolfgang Schuster

Meer, Hans van der 
5. Februar 2016 um 20:34
I am struggling with the following problem:

Collect a number of boxes with:
\global\setbox\placexcontent=\hbox{%
\box\placexcontent% collection of previous boxes
\box\placexbox% next box affixed to previous onse
\hskip\placexdistanceskip% spearation, replacing by \hfill does not 
solve problem

}%
Thus the incoming \placexbox'es are strung together separated by a skip.
Later they are typeset centered as a whole with:
\hbox to\textwidth{%% will be wider than the sum of the original box 
collection

\hss
\box\placexcontent% or \unhbox, doesn't look different
\unskip% unskip removes the last (extra) \hskip
\hss% should succumb to \hskip 0pt plus1fill
}%

The problem is the following:
(1) \placexdistanceskip=10ptboxes are separated neatly
(2) \placexdistanceskip=0pt plus1fillBOXES DO NOT SPREAD OUT AS I 
EXPECTED THEM TO DO
The flexible component does sadly not carry over to the final box, 
apparently.


Clearly my misunderstanding of working with boxes.
Can this be solved easily?
It will really help when you send complete working examples and not only 
code snippets.


Maybe you're looking for the \spreadhbox command.

\starttext

\setbox\scratchbox\emptyhbox

\setbox\scratchbox\hbox{First box}
\setbox\scratchbox\hbox{\box\scratchbox\hbox{Second box}}
\setbox\scratchbox\hbox{\box\scratchbox\hbox{Third box}}

\maxaligned{\spreadhbox\scratchbox}

\stoptext

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
___