Re: [NTG-context] docbook(5) to context conversion

2016-04-12 Thread Henning Hraban Ramm
Am 2016-04-13 um 02:12 schrieb Jan Tosovsky :

> As promised, I've published a set of XSLT stylesheets for DocBook to ConTeXt 
> conversion.
> Details can be found at http://doctribute.com/blog/

Thank you very much. I wikified it: http://wiki.contextgarden.net/DocBook

I found also your other blog postings very interesting, since I work with 
InDesign a lot and used or at least tried to work with other typesetting/layout 
systems (LinoSetting, 3B2, QuarkXPress, Ventura P., Scribus et al.).
(ConTeXt works mostly in the background, as long as updates don’t break 
compatibility…)


Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
https://www.cacert.org (I'm an assurer)
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] RTL section heads

2016-04-12 Thread Mohammad Hossein Bateni
As far as I remember, it was working fine with betas in December 2015 and
January 2016.

On Tue, Apr 12, 2016 at 10:15 PM, Otared Kavian  wrote:

> Hi Hans and Mohammad Reza,
>
> I can confirm that the wrong behaviour of numbers and digits in Right to
> Left (more specifically Persian) is recent: indeed with
>
> ConTeXt  ver: 2015.05.18 12:26 MKIV current  fmt: 2015.6.18  int:
> english/english
>
> from TeXLive 2015 the numbers and digits are rendered as they should. Is
> it related to some changes in LuaTeX?
>
> Best regards: OK
>
> > On 13 Apr 2016, at 02:46, Mohammad Hossein Bateni 
> wrote:
> >
> > Unfortunately when I use method=two for bidi, the numbers in the main
> body are written from right to left.  I'm starting to wonder whether it
> does anything nontrivial at all.
> >
> > \usemodule[simplefonts]
> > \setmainfont[ALM Fixed][features=arabic,range=arabic]
> >
> > \setupdirections[bidi=global,method=two]
> > \setupalign[r2l]
> >
> > \starttext
> >
> > سال ۲۰۱۶
> >
> > 2016
> >
> > \stoptext
> >
> >
> > I'm pretty sure this used to work (for example in version 2016.01.18 22:21).
> A similar piece of code is working fine on the website.  I'm using CONTEXT
> version: 2016.04.01 13:01.  I also verified that it is not working in
> version: 2016.04.10 23:52.
> >
> > On Mon, Apr 11, 2016 at 11:47 AM, Mohammad Hossein Bateni <
> bat...@gmail.com> wrote:
> > Thanks, Hans!  This does solve the problem with the list of numbers.
> And actually if I add a numberstyle field, I can the section heads the way
> I like.  Here is the setup that worked.  (I will update Wiki later.)
> >
> > \setupdirections[bidi=global,method=two]
> > \setupalign[r2l]
> >
> > \def\LTR#1{{\lefttoright#1}}
> > \def\leftpersiandecimals#1{\LTR{\persiandecimals{#1}}}
> > \defineconversion[leftpersiandecimals][\leftpersiandecimals]
> > \setuphead[chapter,title,section,subject]
> [conversion=leftpersiandecimals,numberstyle=\righttoleft]
> >
> > \defineseparatorset[dashsep][-,-,-,-]
> > \setuphead[section][sectionseparatorset=dashsep]
> >
> > On Mon, Apr 11, 2016 at 10:46 AM, Hans Hagen  wrote:
> > On 4/11/2016 4:25 AM, Mohammad Hossein Bateni wrote:
> > Hans & Wolfgang,
> >
> > Do you have suggestions here?  How can I get the behavior I want for the
> > section head numbers?
> >
> > In fact, the following may be quite relevant.
> >
> > \usemodule[simplefonts]
> > \setmainfont[ALM Fixed][features=arabic,range=arabic]
> >
> > \setupdirections[bidi=global,method=default]
> > \setupalign[r2l]
> >
> > \starttext
> >
> > اعداد ۱، ۲، ۳ و ۴ را در نظر بگیرید.
> >
> > اعداد 1، 2، 3 و 4 را در نظر بگیرید.
> >
> > اعداد 1, 2, 3 و 4 را در نظر بگیرید.
> >
> > \stoptext
> >
> >
> > I expect the numbers 1, 2, 3 and 4 to appear in the same order from
> > right to left.  However, the visual order that I observe (regardless of
> > whether I use Persian digits or English digits, or whether I use Persian
> > or English commas) is 4, 1, 2, 3 (from left to right).  Is this a bug in
> > the bidi code?  If so, are there any workarounds?
> >
> > method=two
> >
> > Thanks,
> > Hossein
> >
> > On Fri, Apr 8, 2016 at 5:20 PM, Mohammad Hossein Bateni
> > > wrote:
> >
> > Hi,
> >
> > This is concerning an RTL text.  I have one chapter and 10 sections
> > under that.  My goal is to achieve the following.
> > 1) The number 10 should appear correctly with '1' visually to the
> > left of '0'.
> > 2) The chapter number should visually appear to the right of the
> > section number.
> > 3) Chapter and section numbers should be separated with a dash.
> >   (This is ignored in this email and I will follow up about it in
> > another thread.  To get a minimal working example, I also do not try
> > to change the numbers to use Persian digits.)
> >
> > In particular, the headings will be visually something like the
> > following (aligned to the right).
> > elpmas 1
> > txet 1-1
> > txet 2-1
> > txet 3-1
> > ...
> > txet 10-1
> >
> > Here's the first attempt.
> >
> > %% Attempt 1
> > \setupalign[r2l]
> >
> > \starttext
> > \placecontent
> >
> > \chapter{sample}
> > \dorecurse{10}{\section{text}}
> > \stoptext
> >
> > The result is:
> > elpmas 1
> > txet 1-1
> > ...
> > txet 01-1
> >
> >
> > Then I add "\setupdirections[bidi=global,method=default]" to the
> > beginning and I get the most strange result (number right-aligned
> > but texts left-aligned):
> > sample1
> > text   1.1
> > ...
> > text 1.10
> >
> >
> > A third attempt gives almost what I want (without period as the
> > separator).
> >
> > %% Attempt 3
> > \setupalign[r2l]
> >
> > \def\LTR#1{{\lefttoright#1}}
> > 

Re: [NTG-context] RTL section heads

2016-04-12 Thread Otared Kavian
Hi Hans and Mohammad Reza,

I can confirm that the wrong behaviour of numbers and digits in Right to Left 
(more specifically Persian) is recent: indeed with 

ConTeXt  ver: 2015.05.18 12:26 MKIV current  fmt: 2015.6.18  int: 
english/english

from TeXLive 2015 the numbers and digits are rendered as they should. Is it 
related to some changes in LuaTeX?

Best regards: OK

> On 13 Apr 2016, at 02:46, Mohammad Hossein Bateni  wrote:
> 
> Unfortunately when I use method=two for bidi, the numbers in the main body 
> are written from right to left.  I'm starting to wonder whether it does 
> anything nontrivial at all.
> 
> \usemodule[simplefonts]
> \setmainfont[ALM Fixed][features=arabic,range=arabic]
> 
> \setupdirections[bidi=global,method=two]
> \setupalign[r2l]
> 
> \starttext
> 
> سال ۲۰۱۶
> 
> 2016
> 
> \stoptext
> 
> 
> I'm pretty sure this used to work (for example in version 2016.01.18 22:21).  
> A similar piece of code is working fine on the website.  I'm using CONTEXT 
> version: 2016.04.01 13:01.  I also verified that it is not working in 
> version: 2016.04.10 23:52.
> 
> On Mon, Apr 11, 2016 at 11:47 AM, Mohammad Hossein Bateni  
> wrote:
> Thanks, Hans!  This does solve the problem with the list of numbers.  And 
> actually if I add a numberstyle field, I can the section heads the way I 
> like.  Here is the setup that worked.  (I will update Wiki later.)
> 
> \setupdirections[bidi=global,method=two]
> \setupalign[r2l]
> 
> \def\LTR#1{{\lefttoright#1}}
> \def\leftpersiandecimals#1{\LTR{\persiandecimals{#1}}}
> \defineconversion[leftpersiandecimals][\leftpersiandecimals]
> \setuphead[chapter,title,section,subject] 
> [conversion=leftpersiandecimals,numberstyle=\righttoleft]
> 
> \defineseparatorset[dashsep][-,-,-,-]
> \setuphead[section][sectionseparatorset=dashsep]
> 
> On Mon, Apr 11, 2016 at 10:46 AM, Hans Hagen  wrote:
> On 4/11/2016 4:25 AM, Mohammad Hossein Bateni wrote:
> Hans & Wolfgang,
> 
> Do you have suggestions here?  How can I get the behavior I want for the
> section head numbers?
> 
> In fact, the following may be quite relevant.
> 
> \usemodule[simplefonts]
> \setmainfont[ALM Fixed][features=arabic,range=arabic]
> 
> \setupdirections[bidi=global,method=default]
> \setupalign[r2l]
> 
> \starttext
> 
> اعداد ۱، ۲، ۳ و ۴ را در نظر بگیرید.
> 
> اعداد 1، 2، 3 و 4 را در نظر بگیرید.
> 
> اعداد 1, 2, 3 و 4 را در نظر بگیرید.
> 
> \stoptext
> 
> 
> I expect the numbers 1, 2, 3 and 4 to appear in the same order from
> right to left.  However, the visual order that I observe (regardless of
> whether I use Persian digits or English digits, or whether I use Persian
> or English commas) is 4, 1, 2, 3 (from left to right).  Is this a bug in
> the bidi code?  If so, are there any workarounds?
> 
> method=two
> 
> Thanks,
> Hossein
> 
> On Fri, Apr 8, 2016 at 5:20 PM, Mohammad Hossein Bateni
> > wrote:
> 
> Hi,
> 
> This is concerning an RTL text.  I have one chapter and 10 sections
> under that.  My goal is to achieve the following.
> 1) The number 10 should appear correctly with '1' visually to the
> left of '0'.
> 2) The chapter number should visually appear to the right of the
> section number.
> 3) Chapter and section numbers should be separated with a dash.
>   (This is ignored in this email and I will follow up about it in
> another thread.  To get a minimal working example, I also do not try
> to change the numbers to use Persian digits.)
> 
> In particular, the headings will be visually something like the
> following (aligned to the right).
> elpmas 1
> txet 1-1
> txet 2-1
> txet 3-1
> ...
> txet 10-1
> 
> Here's the first attempt.
> 
> %% Attempt 1
> \setupalign[r2l]
> 
> \starttext
> \placecontent
> 
> \chapter{sample}
> \dorecurse{10}{\section{text}}
> \stoptext
> 
> The result is:
> elpmas 1
> txet 1-1
> ...
> txet 01-1
> 
> 
> Then I add "\setupdirections[bidi=global,method=default]" to the
> beginning and I get the most strange result (number right-aligned
> but texts left-aligned):
> sample1
> text   1.1
> ...
> text 1.10
> 
> 
> A third attempt gives almost what I want (without period as the
> separator).
> 
> %% Attempt 3
> \setupalign[r2l]
> 
> \def\LTR#1{{\lefttoright#1}}
> \def\leftnumbers#1{\LTR{\numbers{#1}}}
> \defineconversion[leftnumbers][\leftnumbers]
> \setuphead[chapter,title,section,subject] [conversion=leftnumbers]
> 
> \starttext
> \placecontent
> 
> \chapter{sample}
> \dorecurse{10}{\section{text}}
> \stoptext
> 
> 
> The big problem is that in my RTL documents, I always have the
> setupdirections command, which messes things up here.  (This 

Re: [NTG-context] RTL section heads

2016-04-12 Thread Mohammad Hossein Bateni
Unfortunately when I use method=two for bidi, the numbers in the main body
are written from right to left.  I'm starting to wonder whether it does
anything nontrivial at all.

\usemodule[simplefonts]
\setmainfont[ALM Fixed][features=arabic,range=arabic]

\setupdirections[bidi=global,method=two]
\setupalign[r2l]

\starttext

سال ۲۰۱۶

2016

\stoptext


I'm pretty sure this used to work (for example in version 2016.01.18
22:21).  A similar piece of code is working fine on the website
.  I'm using CONTEXT version: 2016.04.01
13:01.  I also verified that it is not working in version: 2016.04.10 23:52.

On Mon, Apr 11, 2016 at 11:47 AM, Mohammad Hossein Bateni 
wrote:

> Thanks, Hans!  This does solve the problem with the list of numbers.  And
> actually if I add a numberstyle field, I can the section heads the way I
> like.  Here is the setup that worked.  (I will update Wiki later.)
>
> \setupdirections[bidi=global,method=two]
> \setupalign[r2l]
>
> \def\LTR#1{{\lefttoright#1}}
> \def\leftpersiandecimals#1{\LTR{\persiandecimals{#1}}}
> \defineconversion[leftpersiandecimals][\leftpersiandecimals]
> \setuphead[chapter,title,section,subject]
> [conversion=leftpersiandecimals,numberstyle=\righttoleft]
>
> \defineseparatorset[dashsep][-,-,-,-]
> \setuphead[section][sectionseparatorset=dashsep]
>
> On Mon, Apr 11, 2016 at 10:46 AM, Hans Hagen  wrote:
>
>> On 4/11/2016 4:25 AM, Mohammad Hossein Bateni wrote:
>>
>>> Hans & Wolfgang,
>>>
>>> Do you have suggestions here?  How can I get the behavior I want for the
>>> section head numbers?
>>>
>>> In fact, the following may be quite relevant.
>>>
>>> \usemodule[simplefonts]
>>> \setmainfont[ALM Fixed][features=arabic,range=arabic]
>>>
>>> \setupdirections[bidi=global,method=default]
>>> \setupalign[r2l]
>>>
>>> \starttext
>>>
>>> اعداد ۱، ۲، ۳ و ۴ را در نظر بگیرید.
>>>
>>> اعداد 1، 2، 3 و 4 را در نظر بگیرید.
>>>
>>> اعداد 1, 2, 3 و 4 را در نظر بگیرید.
>>>
>>> \stoptext
>>>
>>>
>>> I expect the numbers 1, 2, 3 and 4 to appear in the same order from
>>> right to left.  However, the visual order that I observe (regardless of
>>> whether I use Persian digits or English digits, or whether I use Persian
>>> or English commas) is 4, 1, 2, 3 (from left to right).  Is this a bug in
>>> the bidi code?  If so, are there any workarounds?
>>>
>>
>> method=two
>>
>> Thanks,
>>> Hossein
>>>
>>> On Fri, Apr 8, 2016 at 5:20 PM, Mohammad Hossein Bateni
>>> > wrote:
>>>
>>> Hi,
>>>
>>> This is concerning an RTL text.  I have one chapter and 10 sections
>>> under that.  My goal is to achieve the following.
>>> 1) The number 10 should appear correctly with '1' visually to the
>>> left of '0'.
>>> 2) The chapter number should visually appear to the right of the
>>> section number.
>>> 3) Chapter and section numbers should be separated with a dash.
>>>   (This is ignored in this email and I will follow up about it in
>>> another thread.  To get a minimal working example, I also do not try
>>> to change the numbers to use Persian digits.)
>>>
>>> In particular, the headings will be visually something like the
>>> following (aligned to the right).
>>> elpmas 1
>>> txet 1-1
>>> txet 2-1
>>> txet 3-1
>>> ...
>>> txet 10-1
>>>
>>> Here's the first attempt.
>>>
>>> %% Attempt 1
>>> \setupalign[r2l]
>>>
>>> \starttext
>>> \placecontent
>>>
>>> \chapter{sample}
>>> \dorecurse{10}{\section{text}}
>>> \stoptext
>>>
>>> The result is:
>>> elpmas 1
>>> txet 1-1
>>> ...
>>> txet 01-1
>>>
>>>
>>> Then I add "\setupdirections[bidi=global,method=default]" to the
>>> beginning and I get the most strange result (number right-aligned
>>> but texts left-aligned):
>>> sample1
>>> text   1.1
>>> ...
>>> text 1.10
>>>
>>>
>>> A third attempt gives almost what I want (without period as the
>>> separator).
>>>
>>> %% Attempt 3
>>> \setupalign[r2l]
>>>
>>> \def\LTR#1{{\lefttoright#1}}
>>> \def\leftnumbers#1{\LTR{\numbers{#1}}}
>>> \defineconversion[leftnumbers][\leftnumbers]
>>> \setuphead[chapter,title,section,subject] [conversion=leftnumbers]
>>>
>>> \starttext
>>> \placecontent
>>>
>>> \chapter{sample}
>>> \dorecurse{10}{\section{text}}
>>> \stoptext
>>>
>>>
>>> The big problem is that in my RTL documents, I always have the
>>> setupdirections command, which messes things up here.  (This makes
>>> it difficult to one section name with English title, which should
>>> still be typeset on the right-hand side of the page.)  Note that in
>>> attempt 2 above, there were two issues:
>>> (1) Text and numbers appeared on the two far ends of the screen
>>> instead of being 

Re: [NTG-context] Overfull annotations

2016-04-12 Thread Hans Hagen

On 4/12/2016 10:49 PM, Jan Tosovsky wrote:

On 2016-04-12 Hans Hagen wrote:

On 4/12/2016 9:11 PM, Jan Tosovsky wrote:


But to be honest, the best for me would be PDF annotations
(rectangles) placed to that occurrences. In Acrobat Reader
you can easily list them and automatically navigate to the
target location (and then jump to the prev/next).


\enabletrackers[builders.hpack.quality]
\enabletrackers[builders.hpack.overflow]

\starttext
  \hsize 8cm \input tufte
\stoptext



Nice. But..

My use case is 300+ pages book with several occurences. If those red rectangles 
were provided as annotations, I could efficiently jump from one to another, 
without browsing all the book (thanks to the special Annotation pane).
http://ptgmedia.pearsoncmg.com/images/chapter09_0321751256/elementLinks/rc_13.jpg

Both searching occurrences (in PDF) using the line number of the original 
source or visually by looking for red rectangles is IMHO inefficient.

However, I agree there are more important features to implement.


indeed ... also, i consider it featurecreep

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] Overfull annotations

2016-04-12 Thread Jan Tosovsky
On 2016-04-12 Hans Hagen wrote:
> On 4/12/2016 9:11 PM, Jan Tosovsky wrote:
> >
> > But to be honest, the best for me would be PDF annotations
> > (rectangles) placed to that occurrences. In Acrobat Reader 
> > you can easily list them and automatically navigate to the 
> > target location (and then jump to the prev/next).
> 
> \enabletrackers[builders.hpack.quality]
> \enabletrackers[builders.hpack.overflow]
> 
> \starttext
>  \hsize 8cm \input tufte
> \stoptext
> 

Nice. But..

My use case is 300+ pages book with several occurences. If those red rectangles 
were provided as annotations, I could efficiently jump from one to another, 
without browsing all the book (thanks to the special Annotation pane).
http://ptgmedia.pearsoncmg.com/images/chapter09_0321751256/elementLinks/rc_13.jpg

Both searching occurrences (in PDF) using the line number of the original 
source or visually by looking for red rectangles is IMHO inefficient.

However, I agree there are more important features to implement.

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] docbook(5) to context conversion

2016-04-12 Thread Jan Tosovsky
On 2016-02-25 Jan Tosovsky wrote:
> On 2016-02-23 David Nebauer wrote:
> > On 23/02/16 06:33, Jan Tosovsky wrote:
> > > On 2016-02-22 David Nebauer wrote:
> > > >
> > > > Are there any publicly available solutions for 
> > > > converting docbook/docbook5 to context? ...
> > > >
> > > > * dbcontext - part of dblatex, abandoned ~10 years ago
> > >
> > > I used this way some time ago, but it required tweaks in 
> > > approx 10 xslt files to make it compatible with Context MkIV
> >
> > Cool. Any chance you could post your amended xslt files to give a
> > newbie a head start?
> 
> Ok, I will publish it on my GitHub account later next week (after
> necessary cleanup).

As promised, I've published a set of XSLT stylesheets for DocBook to ConTeXt 
conversion.

Details can be found at http://doctribute.com/blog/

There is also a step by step description how to test stylesheets on a sample 
DocBook v4 book.

As you can see, I've changed my mind and instead of patching dbcontext project 
I created a new one. It finally took more time than originally estimated.

If you encounter any misleading info or inclarity, let me know.

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
___

Re: [NTG-context] Overfull annotations

2016-04-12 Thread Hans Hagen

On 4/12/2016 9:11 PM, Jan Tosovsky wrote:

Dear All,

thanks to the following command I can already filter out everything except
under/overfull cases:
context --noconsole source.tex

It is nice, but would it be possible to print also affected page numbers of
the final PDF file?

But to be honest, the best for me would be PDF annotations (rectangles)
placed to that occurrences. In Acrobat Reader you can easily list them and
automatically navigate to the target location (and then jump to the
prev/next).

Thanks in advance for a new option :-)


impossible as it's an existing option

\enabletrackers[builders.hpack.quality]
\enabletrackers[builders.hpack.overflow]

\starttext
\hsize 8cm \input tufte
\stoptext

-
  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] automatically "smashing" È in xml typesetting

2016-04-12 Thread Hans Hagen

On 4/12/2016 6:42 PM, mass...@fastwebnet.it wrote:

Thank you Hans for your example:


so I'm looking for an automatic way to replace every "È" in the text with 
"\smash{È}".


\definefontfeature[default][default][dimensions={0,1.9,0}]



It took a while to understand how it works but it was worthy.

I try to summarize because others may find it useful:
- the "dimensions" feature is defined in font-ext.lua
- its parameters modify the footprint of the glyphs of a font
- its parameters are factors for glyph's width, height (over the baseline) and 
depth (under the baseline)
- they are factors of emwidth, exheight and exheight respectively
- a value of zero for any of them means "leave the default value untouched",
   dimensions={0,1.9,0} means that only the height of (the footprint of) glyphs 
is set to 1.9 times exheight,
   the other two dimensions stay untouched

Before looking at the code I started playing with the dimensions values
to understand what they controlled. One trial was this

\definefontfeature[default][default][dimensions={2,0,0}]

I got "spaced" text (glyphs have a larger footprint and appear spaced)

But this does not work:

\definefontfeature[spaced][dimensions={2,0,0}]
\starttext
Normal text and {\feature[+][spaced]spaced text}
\stoptext

Is it a feature that works only globally?


per font instance, so you can selectively use it


-
  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] automatically "smashing" È in xml typesetting

2016-04-12 Thread Hans Hagen

On 4/12/2016 6:42 PM, mass...@fastwebnet.it wrote:

Thank you Hans for your example:


so I'm looking for an automatic way to replace every "È" in the text with 
"\smash{È}".


\definefontfeature[default][default][dimensions={0,1.9,0}]



It took a while to understand how it works but it was worthy.

I try to summarize because others may find it useful:
- the "dimensions" feature is defined in font-ext.lua
- its parameters modify the footprint of the glyphs of a font
- its parameters are factors for glyph's width, height (over the baseline) and 
depth (under the baseline)
- they are factors of emwidth, exheight and exheight respectively
- a value of zero for any of them means "leave the default value untouched",
   dimensions={0,1.9,0} means that only the height of (the footprint of) glyphs 
is set to 1.9 times exheight,
   the other two dimensions stay untouched

Before looking at the code I started playing with the dimensions values
to understand what they controlled. One trial was this

\definefontfeature[default][default][dimensions={2,0,0}]

I got "spaced" text (glyphs have a larger footprint and appear spaced)

But this does not work:

\definefontfeature[spaced][dimensions={2,0,0}]
\starttext
Normal text and {\feature[+][spaced]spaced text}
\stoptext

Is it a feature that works only globally?


indeed, this feature gets applied to the glyphs and from then on tex 
uses those dimensions


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

[NTG-context] Overfull annotations

2016-04-12 Thread Jan Tosovsky
Dear All,

thanks to the following command I can already filter out everything except
under/overfull cases:
context --noconsole source.tex

It is nice, but would it be possible to print also affected page numbers of
the final PDF file?

But to be honest, the best for me would be PDF annotations (rectangles)
placed to that occurrences. In Acrobat Reader you can easily list them and
automatically navigate to the target location (and then jump to the
prev/next).

Thanks in advance for a new option :-)

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] Weird background colors in autogenerated index

2016-04-12 Thread Jan Tosovsky
On 2016-04-12 Wolfgang Schuster wrote:
> On 2016-04-12 Jan Tosovsky wrote:
> 
> > I am completely lost. I found page-grd.mkiv, but I have 
> > no idea what to tweak here.
> 
> > By simple putting \showgrid[reset] at the beginning of 
> > the document no grid is shown, but those colored areas 
> > are present.
> 
> You can’t disable the backgrounds with the current beta but 
> in one of the coming betas you can use the "reset" key to 
> disable the grid visualizers and enable afterwards only
> the grid lines.
> 

Ah, thanks for clarification. No problem.

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] Weird background colors in autogenerated index

2016-04-12 Thread Wolfgang Schuster

Jan Tosovsky 
12. April 2016 um 20:07

I am completely lost. I found page-grd.mkiv, but I have no idea what 
to tweak here.


By simple putting \showgrid[reset] at the beginning of the document no 
grid is shown, but those colored areas are present.
You can’t disable the backgrounds with the current beta but in one of 
the coming betas
you can use the "reset" key to disable the grid visualizers and enable 
afterwards only

the grid lines.

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] Weird background colors in autogenerated index

2016-04-12 Thread Jan Tosovsky
On 2016-04-12 Hans Hagen wrote:
> On 4/11/2016 8:13 PM, Jan Tosovsky wrote:
> > On 2016-04-10 Hans Hagen wrote:
> >> On 4/10/2016 11:26 PM, Pablo Rodriguez wrote:
> >>> On 04/10/2016 11:00 PM, Jan Tosovsky wrote:
>  On 2016-04-10 Hans Hagen wrote:
> > On 4/9/2016 11:22 PM, Jan Tosovsky wrote:
> >>
> >> since LuaTeXt 0.81 my back-of-the-book index (register) is
> >> with generated strange background colors. The index title
> >> is typeset in yellowish background and the left column of
> >> the last index page has a blue background.
> >>>
> >>> here you have the minimal sample:
> >>>
> >>> \showgrid
> >>> \starttext
> >>> a\index{b}
> >>> \completeindex
> >>> \stoptext
> >>>
> >>> Comment the first line and colors background colors will 
> >>> disappear.
> >
> > My idea is to have a single PDF source to showcase some 
> > ConTeXt features, where displaying the grid is handy, yet 
> > allow disabling the grid on demand.
> 
> ... you can influence the grid a bit:
> 
> \showgrid[reset,...]
> 
> You're lucky that it's only a few lines to add 'columns' options 
> (so in some upcoming beta you have to mess with 'reset' 
> and whatever else).
> 

I am completely lost. I found page-grd.mkiv, but I have no idea what to tweak 
here.

By simple putting \showgrid[reset] at the beginning of the document no grid is 
shown, but those colored areas are present.

I am giving it up.

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] automatically "smashing" È in xml typesetting

2016-04-12 Thread massifr
Thank you Hans for your example:

> > so I'm looking for an automatic way to replace every "È" in the text with 
> > "\smash{È}".
> 
> \definefontfeature[default][default][dimensions={0,1.9,0}]
> 

It took a while to understand how it works but it was worthy.

I try to summarize because others may find it useful:
- the "dimensions" feature is defined in font-ext.lua
- its parameters modify the footprint of the glyphs of a font
- its parameters are factors for glyph's width, height (over the baseline) and 
depth (under the baseline)
- they are factors of emwidth, exheight and exheight respectively
- a value of zero for any of them means "leave the default value untouched",
  dimensions={0,1.9,0} means that only the height of (the footprint of) glyphs 
is set to 1.9 times exheight,
  the other two dimensions stay untouched

Before looking at the code I started playing with the dimensions values 
to understand what they controlled. One trial was this

\definefontfeature[default][default][dimensions={2,0,0}]

I got "spaced" text (glyphs have a larger footprint and appear spaced)

But this does not work:

\definefontfeature[spaced][dimensions={2,0,0}]
\starttext
Normal text and {\feature[+][spaced]spaced text}
\stoptext

Is it a feature that works only globally?
___
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] Fourier install fonts

2016-04-12 Thread Hans Hagen

On 4/12/2016 1:19 PM, Fabrice Couvreur wrote:


Hi Hans,
I downloaded the fonts in /home/fab/texmf/fonts/opentype/fourier-GUT then:

fab@debian:~$ mtxrun --script fonts --list --all --pattern=*fourier*

resolvers   | trees | analyzing 'home:.texlive2015/texmf-config'
resolvers   | trees | analyzing 'home:texmf'
fourieralternateblack   fourieralternateblack
fourier-alt-black.afm
fourieralternateboldfourieralternatebold
fourier-alt-bold.afm
fourieralternatebolditalic  fourieralternatebolditalic
fourier-alt-boldita.afm
fourieralternatebolditalicbold  fourieralternatebolditalic
fourier-alt-boldita.afm
fourieralternateitalic  fourieralternateitalic
fourier-alt-ita.afm
fourieralternateitalicnormalfourieralternateitalic
fourier-alt-ita.afm
fourieralternateroman   fourieralternateroman
fourier-alt.afm
fourieralternateromannormal fourieralternateroman
fourier-alt.afm
fourieralternatesemiboldfourieralternatesemibold
fourier-alt-semi.afm
fourieralternatesemitalic   fourieralternatesemitalic
fourier-alt-semiita.afm
fourieralternatesemitalicsemibold   fourieralternatesemitalic
fourier-alt-semiita.afm
fouriermathblackboard   fouriermathblackboard
fourier-bb.afm
fouriermathblackboardblack  fouriermathblackboard
fourier-bb.afm
fouriermathcal  fouriermathcal
fourier-mcl.afm
fouriermathcalnormalfouriermathcal
fourier-mcl.afm
fouriermathextensionfouriermathextension
fourier-mex.afm
fouriermathextensionmedium  fouriermathextension
fourier-mex.afm
fouriermathletters  fouriermathletters
fourier-ml.afm
fouriermathlettersbold  fouriermathlettersbold
fourier-mlb.afm
fouriermathlettersbolditalicfouriermathlettersbolditalic
fourier-mlitb.afm
fouriermathlettersitalicfouriermathlettersitalic
fourier-mlit.afm
fouriermathlettersnormalfouriermathletters
fourier-ml.afm
fouriermathsymbols  fouriermathsymbols
fourier-ms.afm
fouriermathsymbolsbold  fouriermathsymbols
fourier-ms.afm
fourierorns fourierorns
fourier-orns.afm
fourierornsnormal   fourierorns
fourier-orns.afm
fab@debian:~$


I begin with the text without math:

\starttypescript [serif] [fourier]
 \setups[font:fallback:serif]
 \definefontsynonym [Fourier-Regular]
[file:fourier-alt-black.afm]
 \definefontsynonym [Fourier-Italic]  [file:fourier-alt-ita.afm]
 \definefontsynonym [Fourier-Bold]
[file:fourier-alt-bold.afm]
 \definefontsynonym [Fourier-BoldItalic]
[file:fourier-alt-boldita.afm]
\stoptypescript

\starttypescript [serif] [fourier] [name]
 \setups[font:fallback:serif]
 \definefontsynonym [Serif][Fourier-Regular]
 \definefontsynonym [SerifItalic]  [Fourier-Italic]
 \definefontsynonym [SerifBold][Fourier-Bold]
 \definefontsynonym [SerifBoldItalic]  [Fourier-BoldItalic]
\stoptypescript

\definetypeface [mainface] [rm] [serif] [fourier] [default]

\setupbodyfont[mainface]

\starttext
\input knuth
\stoptext

Unfortunately, the output file is empty.


these fonts are kind of special .. no text characters, so Serif should 
be normal utopia ... the fonts you use now are then later used for the 
math,


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] Fourier install fonts

2016-04-12 Thread Fabrice Couvreur
Hi Hans,
I downloaded the fonts in /home/fab/texmf/fonts/opentype/fourier-GUT then :

fab@debian:~$ mtxrun --script fonts --list --all --pattern=*fourier*

resolvers   | trees | analyzing 'home:.texlive2015/texmf-config'
resolvers   | trees | analyzing 'home:texmf'
fourieralternateblack   fourieralternateblack
fourier-alt-black.afm
fourieralternateboldfourieralternatebold
fourier-alt-bold.afm
fourieralternatebolditalic  fourieralternatebolditalic
fourier-alt-boldita.afm
fourieralternatebolditalicbold  fourieralternatebolditalic
fourier-alt-boldita.afm
fourieralternateitalic  fourieralternateitalic
fourier-alt-ita.afm
fourieralternateitalicnormalfourieralternateitalic
fourier-alt-ita.afm
fourieralternateroman   fourieralternateroman
fourier-alt.afm
fourieralternateromannormal fourieralternateroman
fourier-alt.afm
fourieralternatesemiboldfourieralternatesemibold
fourier-alt-semi.afm
fourieralternatesemitalic   fourieralternatesemitalic
fourier-alt-semiita.afm
fourieralternatesemitalicsemibold   fourieralternatesemitalic
fourier-alt-semiita.afm
fouriermathblackboard   fouriermathblackboard
fourier-bb.afm
fouriermathblackboardblack  fouriermathblackboard
fourier-bb.afm
fouriermathcal  fouriermathcal
fourier-mcl.afm
fouriermathcalnormalfouriermathcal
fourier-mcl.afm
fouriermathextensionfouriermathextension
fourier-mex.afm
fouriermathextensionmedium  fouriermathextension
fourier-mex.afm
fouriermathletters  fouriermathletters
fourier-ml.afm
fouriermathlettersbold  fouriermathlettersbold
fourier-mlb.afm
fouriermathlettersbolditalicfouriermathlettersbolditalic
fourier-mlitb.afm
fouriermathlettersitalicfouriermathlettersitalic
fourier-mlit.afm
fouriermathlettersnormalfouriermathletters
fourier-ml.afm
fouriermathsymbols  fouriermathsymbols
fourier-ms.afm
fouriermathsymbolsbold  fouriermathsymbols
fourier-ms.afm
fourierorns fourierorns
fourier-orns.afm
fourierornsnormal   fourierorns
fourier-orns.afm
fab@debian:~$


I begin with the text without math :

\starttypescript [serif] [fourier]
\setups[font:fallback:serif]
\definefontsynonym [Fourier-Regular]
[file:fourier-alt-black.afm]
\definefontsynonym [Fourier-Italic]  [file:fourier-alt-ita.afm]
\definefontsynonym [Fourier-Bold][file:fourier-alt-bold.afm]
\definefontsynonym [Fourier-BoldItalic]
[file:fourier-alt-boldita.afm]
\stoptypescript

\starttypescript [serif] [fourier] [name]
\setups[font:fallback:serif]
\definefontsynonym [Serif][Fourier-Regular]
\definefontsynonym [SerifItalic]  [Fourier-Italic]
\definefontsynonym [SerifBold][Fourier-Bold]
\definefontsynonym [SerifBoldItalic]  [Fourier-BoldItalic]
\stoptypescript

\definetypeface [mainface] [rm] [serif] [fourier] [default]

\setupbodyfont[mainface]

\starttext
\input knuth
\stoptext

Unfortunately, the output file is empty.

Thanks
Fabrice

2016-04-11 19:08 GMT+02:00 Hans Hagen :

> On 4/11/2016 12:43 PM, Fabrice Couvreur wrote:
>
>> Hi,
>> With Latex, just do it  :
>>
>> \usepackage[T1]{fontenc} \usepackage{fourier}
>>
>> I'm confused about how to do it with Context.
>> Thanks for your help.
>>
>
> you need a typescript file for it an dit being 8 bit fonts you also need a
> virtual font definition file (like the px, tx and mathdesign fonts have)
> ... no big deal (one time job) but someone has to do it
> (so far no one needed fourier i guess)
>
> 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
>
> ___
___
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 : 

Re: [NTG-context] Bug in enumeration?

2016-04-12 Thread Otared Kavian
Thanks for your attention, and the fix, Hans.

Best regards: OK

> On 12 Apr 2016, at 10:11, Hans Hagen  wrote:
> 
> […]
> 
> swapped arguments in ... (actually that was a fix for something else, a space 
> in captions)
> 
> \unexpanded\def\strc_enumerations_inject_extra_text
>  {\ifconditional\c_strc_constructions_title_state
> \clf_doifelselisthastitle{\currentconstructionmain}\numexpr\currentconstructionlistentry\relax
>   \strc_enumerations_inject_extra_text_indeed
>   \donothing
>   \fi}
> 
> 
> 
> -
>  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
> ___

___
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 in enumeration?

2016-04-12 Thread Hans Hagen

On 4/12/2016 9:42 AM, Otared Kavian wrote:

Hi Hans,

It seems that the new beta has introduced an issue with enumerations: the title 
does not show up as it did previously (until last Friday for instance).

Below is an example.
Best regards

%%% bug-enumeartion.tex
%%%
\defineframedtext[ProclaimFramed]
[width=\textwidth,
frame=off,
leftframe=on,
framecolor=darkred,
rulethickness=2pt,
offset=0pt,
loffset=4pt,
roffset=4pt,
]
\defineenumeration[proclaim]
[text=,
before={\startProclaimFramed},
after={\stopProclaimFramed},
style=slanted,
title=yes,
titleleft=,
titleright={.},
alternative=hanging,
width=fit,
right={~},
way=bysection,
prefix=yes,
prefixsegments={chapter:section}]
%%%

\starttext

\startproclaim{Definition}
The title of this \type{\startproclaim} does not show up.
Is this a bug?
\stopproclaim

\stoptext


swapped arguments in ... (actually that was a fix for something else, a 
space in captions)


\unexpanded\def\strc_enumerations_inject_extra_text
  {\ifconditional\c_strc_constructions_title_state

\clf_doifelselisthastitle{\currentconstructionmain}\numexpr\currentconstructionlistentry\relax
   \strc_enumerations_inject_extra_text_indeed
   \donothing
   \fi}



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

[NTG-context] Bug in enumeration?

2016-04-12 Thread Otared Kavian
Hi Hans,

It seems that the new beta has introduced an issue with enumerations: the title 
does not show up as it did previously (until last Friday for instance).

Below is an example.
Best regards

%%% bug-enumeartion.tex
%%%
\defineframedtext[ProclaimFramed]
[width=\textwidth,
frame=off,
leftframe=on,
framecolor=darkred,
rulethickness=2pt,
offset=0pt,
loffset=4pt,
roffset=4pt,
]
\defineenumeration[proclaim]
[text=,
before={\startProclaimFramed},
after={\stopProclaimFramed},
style=slanted,
title=yes,
titleleft=,
titleright={.},
alternative=hanging,
width=fit,
right={~},
way=bysection,
prefix=yes,
prefixsegments={chapter:section}]
%%%

\starttext

\startproclaim{Definition}
The title of this \type{\startproclaim} does not show up.
Is this a bug?
\stopproclaim

\stoptext
%%% end bug-enumeartion.tex

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