Re: [NTG-context] Paragraph breaking bug with BiDi text

2016-01-11 Thread Hans Hagen

On 1/11/2016 5:58 PM, Mohammad Hossein Bateni wrote:


Thanks for the explanation.  So the space after \textdir TLT is
meaningful but the one after \lefttoright isn't.  (I guess, I should
have used \textdir TLT\relax.  I'm going to use the high-level
\lefttoright command from now on.)


in addition to wolfgangs explanation: you can use grouping

foo {\righttoleft oof} foo

it's best to keep the spaces at the outer level so no

foo{ \righttoleft oof }foo

-
  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] spacing in notes

2016-01-11 Thread Wolfgang Schuster

Pablo Rodriguez 
11. Januar 2016 um 06:53
Dear list,

I have this sample:

\showframe
\setuppapersize[A7]
\setupnotation[footnote][width=broad]
\starttext
\footnote{\input zapf}
\stoptext

I need better spacing in footnotes (to avoid horizontal overflows).

I thought "width=broad" would improve the situation, but it didn’t
change anything.

What am I doing wrong here?
You have to change the alignment values. Instead of "stretch" which 
allows ConTeXt

to put larger spaces between word you can use font expansion.

\setupnotation[footnote][align={verytolerant,stretch}]

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] Fieldstacks are broken

2016-01-11 Thread Hans Hagen

On 1/10/2016 5:01 PM, Wolfgang Schuster wrote:

Hi Hans,

the fieldstack mechanism doesn’t work anymore.

\setupinteraction[state=start]

\starttext \showframe

\definesymbol[frame-1][\tt 1]
\definesymbol[frame-2][\tt 2]
\definesymbol[frame-3][\tt 3]

\definefieldstack[frame][frame-1,frame-2,frame-3]

\placeontopofeachother
{\framed[strut=no,offset=1ex]{\fieldstack[frame]}}
{\goto{Play}[Walk{frame}]}

\stoptext


fixed in next engine update


-
  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] Formula-numbering and \setuphead[...][number=no]

2016-01-11 Thread Jannik Voges
Thank you, Wolfgang, that works.


Best regards

Jannik
___
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] Paragraph breaking bug with BiDi text

2016-01-11 Thread Hans Hagen

On 1/9/2016 4:47 AM, Mohammad Hossein Bateni wrote:

Minor point: changing "\pardir TLT" to "\pardir TLT\textdir TLT" in the
last paragraph produces better visual, however, the previous paragraphs
already demonstrate the problem sufficiently.


It is a side effect of what the the par builder considers to be valid 
breakpoints. The current approach is playing very safe but after looking 
at it Taco and I decided that it can be a more tolerant with respect to 
end dirs so the next luatex version will have that.


Anyway: You need to code carefully: the space after "TRT" in "\textdir 
TRT x" is meaningful so in your example you introduce spaces.


Also, in context don't use \textdir etc directly, just use \lefttoright 
and \righttoleft in combination with \setupalign as I will not spend 
much time on side effects of interfering with these low level dir 
changers directly.



On Fri, Jan 8, 2016 at 10:40 PM, Mohammad Hossein Bateni
> wrote:

Hello,

When a line ends with a sequence whose direction differs from that
of the paragraph, we risk pushing some text into the margin (when
not necessary).  Here is an example with corresponding output:


\usemodule[simplefonts]
\setmainfont[ALM Fixed][features=arabic,range=arabic]
\setupalign[r2l]
\setupwhitespace[big]
\showframe

\starttext

% 10 copies of Persian word "hello" stay on one line.
\dorecurse{10}{سلام }
% 20 copies makes a 2-line paragraph.
\dorecurse{20}{سلام }

% one copy of the word goes into the margin although the Latin
letters perfectly fit the line.
\dorecurse{10}{سلام }
{\textdir TLT\dorecurse{20}{a}}
\dorecurse{10}{سلام }

% although the Latin string extends into the margin, TeX still puts
one copy of "hello" there as well.
\dorecurse{10}{سلام }
{\textdir TLT\dorecurse{30}{a}}
\dorecurse{10}{سلام }

% something similar happens here with the opposite par/text dir
\pardir TLT
\dorecurse{10}{bidi }
{\textdir TRT\dorecurse{20}{آ}}
\dorecurse{10}{bidi }

\stoptext


The problem seems to be that after typesetting the LTR text within
the RTL paragraph, TeX thinks the current text ends at the left end
of the LTR portion; hence, it tries to add something to the line;
it's only after that that it discovers we ran into the margin!

—MHB




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




--

-
  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] Backgrounds header and footers

2016-01-11 Thread Ursula Hermann
Hello evryone!

 

I have just a problem. 

 

I want the colored header only in the middle where the text is written, but
not in the margin. 

 

\setuppapersize[A4]

 

 

\setupbackgrounds[header][background=color, backgroundcolor=gray]

\setupbackgrounds[leftmargin][background=color, backgroundcolor=white]

This is me

 

Thanks 

 

Uschi 

___
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] Paragraph breaking bug with BiDi text

2016-01-11 Thread Mohammad Hossein Bateni
>
> It is a side effect of what the the par builder considers to be valid
> breakpoints. The current approach is playing very safe but after looking at
> it Taco and I decided that it can be a more tolerant with respect to end
> dirs so the next luatex version will have that.
>
> Anyway: You need to code carefully: the space after "TRT" in "\textdir TRT
> x" is meaningful so in your example you introduce spaces.
>

Thanks for the explanation.  So the space after \textdir TLT is meaningful
but the one after \lefttoright isn't.  (I guess, I should have used
\textdir TLT\relax.  I'm going to use the high-level \lefttoright command
from now on.)

Also, in context don't use \textdir etc directly, just use \lefttoright and
> \righttoleft in combination with \setupalign as I will not spend much time
> on side effects of interfering with these low level dir changers directly.
>

Great!  You partly answered another question I meant to ask: what is the
proper way to write \textdir and \pardir in CONTEXT?  So \lefttoright and
\righttoleft are replacements for \textdir TLT and \textdir TRT.  How
should I code in \pardir TRT in CONTEXT?  I couldn't find anything for that
in spac-ali.mkiv.

Those low-level LuaTeX directives were part of an attempt to come to the
core of a problem I'd run into with numbers at the end of a right-to-left
line.  The BiDi algorithm correctly gave left-to-right direction to that
digit sequence and the result was that the word following the number had
gone into the margin.

—MHB
___
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] Formula-numbering and \setuphead[...][number=no]

2016-01-11 Thread Alias 1


Hello,


I spotted a strange behavior when I use 
\setupformulas[way=bychapter,prefixsegments=chapter] to get formula numbers 
with the chapternumber as prefix and using \setuphead[…][number=no] to turn off 
the title number.

Minimal example:

\setupformulas[way=bychapter,prefixsegments=chapter]

\setuphead[section][number=no]

\starttext

\chapter{foo}

\placeformula
\startformula
E=mc^2
\stopformula

\section{bar}

\placeformula
\startformula
a^2+b^2=c^2
\stopformula

\stoptext

The second formula has only the formula number 2. I would expect the formula 
number 1.2 (or at least I would want to get this number).


Thanks for help

Jannik___
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] Formula-numbering and \setuphead[...][number=no]

2016-01-11 Thread Wolfgang Schuster

Alias 1 
11. Januar 2016 um 18:01


Hello,


I spotted a strange behavior when I 
use \setupformulas[way=bychapter,prefixsegments=chapter] to get 
formula numbers with the chapternumber as prefix and using 
\setuphead[…][number=no] to turn off the title number.


Minimal example:

\setupformulas[way=bychapter,prefixsegments=chapter]

\setuphead[section][number=no]

\setuphead[section][incrementnumber=no]


[…]

The second formula has only the formula number 2. I would expect the 
formula number 1.2 (or at least I would want to get this number).



Thanks for help

Jannik

Can you configure your mail client to show this name as well!

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] Paragraph breaking bug with BiDi text

2016-01-11 Thread Wolfgang Schuster

Mohammad Hossein Bateni 
11. Januar 2016 um 17:58
Great!  You partly answered another question I meant to ask: what is 
the proper way to write \textdir and \pardir in CONTEXT?  So 
\lefttoright and \righttoleft are replacements for \textdir TLT and 
\textdir TRT.  How should I code in \pardir TRT in CONTEXT?  I 
couldn't find anything for that in spac-ali.mkiv.
The \lefttoright and \righttoleft commands set the paragraph direction 
when you use the commands at the begin of a paragraph.


\setupwhitespace[line]

\starttext

\input ward

\righttoleft
\input ward

\lefttoright
\input ward

\stoptext

Still there is no need for \righttoleft because you can use the normal 
alignment commands {\setupalign and \startalignment) to change the text 
direction.


\setupwhitespace[line]

\starttext

\input ward

\startalignment[righttoleft]
\input ward
\stopalignment

\input ward

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