[NTG-context] Trimming strings and Lua string.trim question

2014-03-04 Thread Rik Kabel
I am trying to strip all leading and trailing whitespace from a string. 
I have tried two methods, neither of which is satisfactory.


The first method uses \ignorespaces and \removeunwantedspaces. This 
fails to strip leading and trailing newlines.


The second method uses the Lua string.strip function. The wiki description:

   Yields string with leading and trailing whitespace (spaces,
   horizontal and vertical tabs, newlines) removed

suggests that this should do what I want, but I find that it removes 
internal whitespace as well as the leading and trailing whitespace.


Can somebody suggest a better way of doing this?

The following code demonstrates the problem:

   % macros=mkvi
   \starttexdefinition StringStrip #STRING
  \startluacode
context(string.strip([==[#STRING]==]))
  \stopluacode
   \stoptexdefinition
   \long\def\test{

   This is a test. \quad

   And it has an unexpected result.

   With \tex{ignorespaces} and \tex{removeunwantedspaces}, the
   newlines remain.

   With Lua {\tt string.strip}, the \tex{quad} at the end of a
   paragraph is preserved,but the other internal whitespace
   (including newlines) is gone!

   }
   \starttext
   \subject{ignorespaces and removeunwantedspaces}
   ¦\ignorespaces\test\removeunwantedspaces¦

   \subject{Lua string.strip}
   ¦\StringStrip{\test}¦
   \stoptext

--
Rik
___
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] (critical edition) wrong page breaks with linenotes

2014-03-04 Thread Pablo Rodriguez
Hi Thomas, Luigi and Hans,

I have a sample (http://www.ousia.tk/hefestio-ctx.tex) that
shows problematic page breaks with notes in paragraph form. This is
especially relevant for linenotes in critical editions.

The compiled version (http://www.ousia.tk/hefestio-ctx.pdf) shows
results at twelve, thirteen and fourteen points.

I know I’m using a font that is not part of the ConTeXt Suite, but it
is the one that gives me the faulty results. Of course, it isn’t the
only problematic one.

In the source, \setupnote is set in both linenotes to
[split=verystrict, scope=page] to avoid having linenotes that refer to
a line from the previous page.

If I’m not missing something or doing something wrong, I think that a
way to solve this (sorry, I don’t know the internals, but the
suggestion might be a valid one) is to set a kind of penalty that does
the following: if the line in its final position doesn’t observe the
space before of the first apparatus, it should be moved to the next
page.

Isn’t this proposal similar to the way widow and orphans are avoided by
setting penalties?

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


Re: [NTG-context] (again) bug with bidi direction and \about references

2014-03-04 Thread Pablo Rodriguez
On 03/04/2014 05:07 PM, Khaled Hosny wrote:
> On Mon, Mar 03, 2014 at 07:49:07PM +0100, Pablo Rodriguez wrote:
>> Hi Hans,
>>
>> sorry for telling again, but I’m afraid that the following sample shows
>> a serious buggy interaction between \setupdirections[bidi=on] and \about
>> references.
>>
>> \setupdirections[bidi=on]
> 
> No problem with \setupdirections[bidi=on,method=two] (which I still
> think should be the default, but Hans is not convinced).

Many thanks, Khaled, for your quick reply that solves the issue.


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

Re: [NTG-context] (again) bug with bidi direction and \about references

2014-03-04 Thread Khaled Hosny
On Mon, Mar 03, 2014 at 07:49:07PM +0100, Pablo Rodriguez wrote:
> Hi Hans,
> 
> sorry for telling again, but I’m afraid that the following sample shows
> a serious buggy interaction between \setupdirections[bidi=on] and \about
> references.
> 
> \setupdirections[bidi=on]

No problem with \setupdirections[bidi=on,method=two] (which I still
think should be the default, but Hans is not convinced).

Regards,
Khaled
___
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] (again) bug with bidi direction and \about references

2014-03-04 Thread Pablo Rodriguez
On 03/04/2014 11:30 AM, Hans Hagen wrote:
> On 3/3/2014 7:49 PM, Pablo Rodriguez wrote:
>> [...]
>> \setupdirections[bidi=on]
>> \starttext
>>
>> \section[sectionone]{Section one}
>>
>> As said in \dorecurse{5}
>> {\about[sectionone]\footnote{Body reference misplaced.}, }
>> \stoptext
>>
>> Both \about and footnote references in body are misplaced.
>>
>> It would be great, if you could fix this.
> 
> what exactly is wrong

Well, text is misplaced in the lower left corner of the page (outside
margins). The attached PDF file shows it.

Many thanks for your help,


Pablo
-- 
http://www.ousia.tk


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

Re: [NTG-context] Presentation template

2014-03-04 Thread Wolfgang Schuster

Am 04.03.2014 um 16:01 schrieb Fabrice :

> Hi Thangalin,
>> do you mean
>> presentation material to help students?
> Rather lessons (Mathematics) I'll put in pdf format on the platform at my 
> high school.
> Thank you for the links, I'll take the time to look.

You should also take a look at chapter 12 of the metafun manual: 
http://pragma-ade.com/show-man-7.htm

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] Presentation template

2014-03-04 Thread Fabrice

Hi Thangalin,

do you mean
presentation material to help students?
Rather lessons (Mathematics) I'll put in pdf format on the platform at 
my high school.

Thank you for the links, I'll take the time to look.
Regards,
Fabrice
___
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] Margin notes

2014-03-04 Thread Wolfgang Schuster

Am 04.03.2014 um 01:31 schrieb S Barmeier :

> I am trying to compile a 2-year-old mkiv document with the latest beta
> and am getting an error on the line
> 
> \inleft[style=bold,stack=continue]
> 
> Two years ago, stacking of margin notes was still experimental, so I'm
> guessing something has changed since then. What is the correct way these
> days to typeset margin notes?


You have to make a minimal example because I can’t see a problem with \inleft.

\starttext
Text\inleft[style=bold,stack=continue]{Note 1} 
text\inleft[style=bold,stack=continue]{Note 2} text
\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
___


Re: [NTG-context] page numbering 'marginedge'

2014-03-04 Thread David Wooten
Exactly so, thanks Pablo. 

On Mar 3, 2014, at 10:44 AM, Pablo Rodriguez  wrote:

> On 03/03/2014 07:37 PM, David Wooten wrote:
>> Hello all, trying to get page numbers in the outer margin edge of a
>> double-sided document — marginedge as it is places the numbers to the
>> inside margin edge, is there an opposite command?
> 
> Hi David,
> 
> as far as I know, location=right is the option you want.
> 
> See minimal sample:
> 
> \setuppapersize[A6]
> \setuppagenumbering[alternative=doublesided, location=right]
> \starttext
> \input knuth\page
> \input zapf\page
> \input ward
> \stoptext
> 
> I hope it helps,
> 
> 
> 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://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] (again) bug with bidi direction and \about references

2014-03-04 Thread Hans Hagen

On 3/3/2014 7:49 PM, Pablo Rodriguez wrote:

Hi Hans,

sorry for telling again, but I’m afraid that the following sample shows
a serious buggy interaction between \setupdirections[bidi=on] and \about
references.

\setupdirections[bidi=on]
\starttext

\section[sectionone]{Section one}

As said in \dorecurse{5}
{\about[sectionone]\footnote{Body reference misplaced.}, }
\stoptext

Both \about and footnote references in body are misplaced.

It would be great, if you could fix this.


what exactly is wrong

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___