Re: [NTG-context] A problem with units

2012-11-23 Thread Romain Diss
Hi,

Le vendredi 23 novembre 2012, Marcin Borkowski a écrit :
> being quite happy with things like \unit{10 km/h}, once I did \unit{45
> min}, only to get "45 m" in the resulting file.  I suspect that \unit
> does not know about minutes; is there any way to teach it;)?
One can add units with \registerunit[unit] and \setupunittext (see line 652 in 
phys-dim.mkiv):

\starttext
\registerunit
  [unit]
  [minute=minute]

\setupunittext
  [minute=min]

\unit{45 minute}
\stoptext

However, I'm unable to explain what exactly \registerunit or \setupunittext 
does.


-- 
Romain Diss

___
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] \unit problem with powers of ten.

2012-11-23 Thread Romain Diss
Le samedi 24 novembre 2012, Sietse Brouwer a écrit :
> > > The '^' and 'e' all print a '10 ×' at the begining. It's what is
> > > expected for
> > > 'e' but not for '^'. 
> >
> > well, until now ^ and e were equivalent so if that has to change (say ^
> > no 10) then there need to be agreement about this as it's an
> > incompatible change
> 
> I, for one, would expect 2^3 to mean '2 cubed', not 2x10^3. So I'd be
> in favour of this change. Then again, I have no code that depends on
> the old meaning...
Of course, I'm also in favour of 2^3 to mean '2 cubed'.

-- 
Romain Diss

___
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] \unit problem with powers of ten.

2012-11-23 Thread Sietse Brouwer
>> The '^' and 'e' all print a '10 ×' at the begining. It's what is expected
>> for
>> 'e' but not for '^'. Did I miss something?
>
>
> well, until now ^ and e were equivalent so if that has to change (say ^ no
> 10) then there need to be agreement about this as it's an incompatible
> change

I, for one, would expect 2^3 to mean '2 cubed', not 2x10^3. So I'd be
in favour of this change. Then again, I have no code that depends on
the old meaning...
--Sietse

P.s. Isn't MkIV known to be unstable? I thought the official advice
was "If you want stability, use (a) MkII, or (b) a stable version of
MkIV, or (c) a dedicated standalone install that you do not update.
___
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] A problem with units

2012-11-23 Thread Sietse Brouwer
Marcin wrote:
> being quite happy with things like \unit{10 km/h}, once I did \unit{45
> min}, only to get "45 m" in the resulting file.  I suspect that \unit
> does not know about minutes; is there any way to teach it;)?

I think 'min' is parsed as 'meter nil nil', because (1) min is not
found in the list of short or long unit names, so it's assumed to be
composite; and (2) once processed composite, m-->meter-->m, while
i-->nil and n-->nil.
Solution: add 'min' to the list of short unit names (below).

Cheers,
Sietse

% phys-dim.lua

local short_units = { -- I'm not sure about casing

m  = "meter",
Hz = "hertz",
hz = "hertz",
B  = "bel",
b  = "bel",
lx = "lux",
 -- da = "dalton",
h  = "hour",
s  = "second",
g  = "gram",
n  = "newton",
v  = "volt",
t  = "tonne",
l  = "liter",
 -- w  = "watt",
W  = "watt",
 -- a  = "ampere",
A  = "ampere",
+min = "minute",

[utfchar(0x2103)] = "celsius",
[utfchar(0x2109)] = "fahrenheit",
}
___
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] ConTeXt Standalone/Suite in Windows

2012-11-23 Thread Mojca Miklavec
On Fri, Nov 23, 2012 at 5:40 PM, Pablo Rodríguez wrote:
>
> I understood
> http://wiki.contextgarden.net/ConTeXt_Standalone#Moving_the_installation_tree_around_.28linux.29
> so that non-Unix trees weren't impossible to move.

I have no clue why "linux" is mentioned. Moving the trees around is
possible for any platform.

Mojca
___
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] Images in MultiMarkdown -> context -> PDF

2012-11-23 Thread Guy Stalnaker
In case anyone else has been following this thread, here is the shell 
script I wrote to resize an image width to 6.5x72dpi so they fit in the 
standard letter pagesize \textwidth with 1-inch margins and add image 
density/resolution information so that context correctly sizes them in 
the PDF output file.



#!/bin/bash
#set -x

TEXTWIDTH="438" #6.5inches x 72 dpi

for i in *.jpg ;
do
SIZEX="$(exiftool -imagewidth $i | awk '{print $4}')"
SIZEY="$(exiftool -imageheight $i | awk '{print $4}')"
echo "Image $i is $SIZEX x $SIZEY, max X is $TEXTWIDTH ..."
if [[ $SIZEX > $TEXTWIDTH ]] ; then
convert $i -resize $TEXTWIDTH -density 72 $i
echo "resized image $i from $SIZEX to $TEXTWIDTH."
fi
done


Regards,

Guy

On 11/21/2012 02:36 PM, Sietse Brouwer wrote:

Guy wrote:

Well, that lead to an interesting experiment. I used convert to -resample a
set of images to 300dpi and redid the compile. They are all now too bod,
many off the right side of the page. Then did the same but set to 72. They
are still too big. Odd, from too small to too big.

I think you don't want -resample, but -density:

# density given in dpi
convert pic.jpg -density 72 pic-out.jpg

convert -density keeps the pixel size and changes the display size by
setting the density metadata.
convert -resample keeps the display size and changes the pixel size by
resampling at a certain density. (This explains why the picture
remained the same too-large size when you resampled at 72 and 300
dpi.)

Because you want to change the display size (and also because
resampling is a lossy process), I think you want -density.

As for the density value you want to use:
Your picture is 547px wide, so if you want it to display it 3 inches
wide you should set its density metadata to 547/3 = 183 dpi.

Does this work?
All the best,
Sietse


--

"There is only love, and then oblivion. Love is all we have
to set against hatred." (paraphrased) Ian McEwan

Guy Stalnaker, I^2@DOIT, 1210 West Dayton Street, Room 3209 CSS, Madison
WI 53719-1220, jstal...@wisc.edu, work 608.263.8035, cell 608.235.4718,
fax 608.265.6681, page page-...@watchdog.doit.wisc.edu

___
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] ConTeXt: Page numbering in words for spanish

2012-11-23 Thread Alan BRASLAU
On Fri, 23 Nov 2012 23:46:44 +0100
Hans Hagen  wrote:

> first we need working prototypes for several languages, then I can
> wrap it into some general mechanism. I think all languages are
> somewhat different so 'general' is 'sort of general'.

For example, in French, 1000 can be une brique, une patate or un bâton,
but I guess that this is not quite the same thing as the subject
of this thread... :)

___
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] A problem with units

2012-11-23 Thread Marcin Borkowski
Hi all,

being quite happy with things like \unit{10 km/h}, once I did \unit{45
min}, only to get "45 m" in the resulting file.  I suspect that \unit
does not know about minutes; is there any way to teach it;)?

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Adam Mickiewicz University
___
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] \unit problem with powers of ten.

2012-11-23 Thread Hans Hagen

On 11/23/2012 8:25 PM, Romain Diss wrote:

Hi,

Le jeudi 22 novembre 2012, Hans Hagen a écrit :

On 11/19/2012 11:44 PM, Romain Diss wrote:

Hi all,

I got some problems to express powers of ten in the \unit command. See
the strange behaviour with these two minimal examples.

\starttext
\unit{10^2 meter}\\
\unit{10^{-12} second}
\stoptext
Is this a bug or are these expressions not supported?


not supported .. i've added it to the upcoming beta:

Thank you very much.


needs testing as usual (and wiki adaption as well)

I have upgraded my context version few minutes ago:
$ context --version
mtx-context | ConTeXt Process Management 0.60
mtx-context | current version: 2012.11.23 17:35

but your following code doesn't work completely:


\starttext

\startlines
\unit{10^12 meter}
\unit{10^{-12} second}
\unit{10^{12} second}
\unit{10e12 meter}
\unit{10e{-12} second}
\unit{10e{12} second}
\stoplines

\stoptext


The '^' and 'e' all print a '10 ×' at the begining. It's what is expected for
'e' but not for '^'. Did I miss something?


well, until now ^ and e were equivalent so if that has to change (say ^ 
no 10) then there need to be agreement about this as it's an 
incompatible change


i only added support for {..}

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


Re: [NTG-context] ConTeXt: Page numbering in words for spanish

2012-11-23 Thread Hans Hagen

On 11/23/2012 9:50 PM, Marcin Borkowski wrote:

Dnia 2012-11-22, o godz. 11:55:17
Mojca Miklavec  napisał(a):


On Thu, Nov 22, 2012 at 1:03 AM, Acidrums4 wrote:


* 100 before 'millón' -- should that be 'cien millón', or 'ciento
millón'? -> It should be 'cien millones'. 'Millones', plural for
'Millón'. Maybe it should be a variable for plurals for millions
(the only plural used for numbers in spanish).


Singular and plural don't always suffice.

1M: en milijon
2M: dva milijona
3/4M: [tri|štiri] milijone
5M: pet milijonov


Similarly for Polish (which is no surprise), so a more general mechanism
might be a good idea.

1M: (jeden) milion
2/3/4M: dwa/trzy/cztery miliony
5/6/7/8/9M: pięć/sześć/siedem/osiem/dziewięć milionów

32M: trzydzieści dwa miliony
57M: pięćdziesiąt siedem milionów

And similarly for thousands.


first we need working prototypes for several languages, then I can wrap 
it into some general mechanism. I think all languages are somewhat 
different so 'general' is 'sort of general'.


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

Re: [NTG-context] disable expansion for one single component

2012-11-23 Thread Hans Hagen

On 11/23/2012 11:24 PM, Thomas A. Schmitz wrote:

On 10/02/2012 03:31 PM, Wolfgang Schuster wrote:

>  Hi all,
>
>  for a book I'm typesetting, I use adobe minion and have enabled
protrusion=pure,expansion=quality in the typescript and then
>
>  \setupalign[hanging,hz]
>
>  in the main environment. Now it turns out that in one of the
components/chapters of the book, this messes up the spacing of some
characters. Is there a way to disable expansion (but not of course
protrusion) for one single chapter?

Put \setupalign[nohz] before and \setupalign[hz] after your chapter.

Wolfgang


Hi all, Wolfgang,

coming back to a pretty old question because it doesn't appear to work.
For the book I'm currently typesetting, I had to disable expansion for
the entire document because it messed up spacing with Greek letters and
certain accents. Now the question is the other way round: can I enable
expansion only for certain passages? I'm in the final revision, and
expansion would help me take care of a few overfull hboxes. But while
setting \setupalign[hanging,hz] for the entire document does take care
of those, doing something like

\start
\setupalign[hanging,hz]
blablabla
\stop

doesn't have any effect. Is this possible at all, or am I barking up the
wrong tree?


You need to load a font with the expension feature enabled. After that 
you can enable/disable it using setupalign.


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


Re: [NTG-context] disable expansion for one single component

2012-11-23 Thread Thomas A. Schmitz

On 10/02/2012 03:31 PM, Wolfgang Schuster wrote:

>  Hi all,
>
>  for a book I'm typesetting, I use adobe minion and have enabled 
protrusion=pure,expansion=quality in the typescript and then
>
>  \setupalign[hanging,hz]
>
>  in the main environment. Now it turns out that in one of the 
components/chapters of the book, this messes up the spacing of some characters. Is 
there a way to disable expansion (but not of course protrusion) for one single 
chapter?

Put \setupalign[nohz] before and \setupalign[hz] after your chapter.

Wolfgang


Hi all, Wolfgang,

coming back to a pretty old question because it doesn't appear to work. 
For the book I'm currently typesetting, I had to disable expansion for 
the entire document because it messed up spacing with Greek letters and 
certain accents. Now the question is the other way round: can I enable 
expansion only for certain passages? I'm in the final revision, and 
expansion would help me take care of a few overfull hboxes. But while 
setting \setupalign[hanging,hz] for the entire document does take care 
of those, doing something like


\start
\setupalign[hanging,hz]
blablabla
\stop

doesn't have any effect. Is this possible at all, or am I barking up the 
wrong tree?


Thanks

Thomas
___
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] Images in MultiMarkdown -> context -> PDF

2012-11-23 Thread Aditya Mahajan

On Fri, 23 Nov 2012, Guy Stalnaker wrote:

But I'm left with another problem, again something that becomes apparent as 
the difference between having two output formats in my document workflow: 
markdown -> pandoc -> html/text -> context tex -> pdf. This time it's images 
that are too wide for the available textarea in the pdf document. Now that 
the dpi is set, they display at the expected full resolution, yet if they are 
greater than 6.5*72=438 pixels, they go over the right margin. I know I can, 
individually, modify each /externalfigure directive and add 
'width=\textwidth', but that really is a PITA. This document will have close 
to a hundred images.


I will investigate using a commandline script, exif data, and convert to work 
through all of the images in the folder to scale/resize them so that they fit 
in the PDF document margin width. I don't think that the html version will 
suffer if I do this.


\setupexternalfigures[maxwidth=\textwidth]

Aditya
___
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] Images in MultiMarkdown -> context -> PDF

2012-11-23 Thread Guy Stalnaker

Sietse,

I have confirmed, after significant testing, that 'convert -density 72' 
against existing non-png images produces the expected results in context 
output pdf documents.


But I'm left with another problem, again something that becomes apparent 
as the difference between having two output formats in my document 
workflow: markdown -> pandoc -> html/text -> context tex -> pdf. This 
time it's images that are too wide for the available textarea in the pdf 
document. Now that the dpi is set, they display at the expected full 
resolution, yet if they are greater than 6.5*72=438 pixels, they go over 
the right margin. I know I can, individually, modify each 
/externalfigure directive and add 'width=\textwidth', but that really is 
a PITA. This document will have close to a hundred images.


I will investigate using a commandline script, exif data, and convert to 
work through all of the images in the folder to scale/resize them so 
that they fit in the PDF document margin width. I don't think that the 
html version will suffer if I do this.


So, again, thanks for your help!

Best regards,

Guy S.

On 11/21/2012 02:36 PM, Sietse Brouwer wrote:

Guy wrote:

Well, that lead to an interesting experiment. I used convert to -resample a
set of images to 300dpi and redid the compile. They are all now too bod,
many off the right side of the page. Then did the same but set to 72. They
are still too big. Odd, from too small to too big.

I think you don't want -resample, but -density:

# density given in dpi
convert pic.jpg -density 72 pic-out.jpg

convert -density keeps the pixel size and changes the display size by
setting the density metadata.
convert -resample keeps the display size and changes the pixel size by
resampling at a certain density. (This explains why the picture
remained the same too-large size when you resampled at 72 and 300
dpi.)

Because you want to change the display size (and also because
resampling is a lossy process), I think you want -density.

As for the density value you want to use:
Your picture is 547px wide, so if you want it to display it 3 inches
wide you should set its density metadata to 547/3 = 183 dpi.

Does this work?
All the best,
Sietse


--

"There is only love, and then oblivion. Love is all we have
to set against hatred." (paraphrased) Ian McEwan

Guy Stalnaker, I^2@DOIT, 1210 West Dayton Street, Room 3209 CSS, Madison
WI 53719-1220, jstal...@wisc.edu, work 608.263.8035, cell 608.235.4718,
fax 608.265.6681, page page-...@watchdog.doit.wisc.edu

___
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] ConTeXt: Page numbering in words for spanish

2012-11-23 Thread Marcin Borkowski
Dnia 2012-11-22, o godz. 11:55:17
Mojca Miklavec  napisał(a):

> On Thu, Nov 22, 2012 at 1:03 AM, Acidrums4 wrote:
> >
> > * 100 before 'millón' -- should that be 'cien millón', or 'ciento
> > millón'? -> It should be 'cien millones'. 'Millones', plural for
> > 'Millón'. Maybe it should be a variable for plurals for millions
> > (the only plural used for numbers in spanish).
> 
> Singular and plural don't always suffice.
> 
> 1M: en milijon
> 2M: dva milijona
> 3/4M: [tri|štiri] milijone
> 5M: pet milijonov

Similarly for Polish (which is no surprise), so a more general mechanism
might be a good idea.

1M: (jeden) milion
2/3/4M: dwa/trzy/cztery miliony
5/6/7/8/9M: pięć/sześć/siedem/osiem/dziewięć milionów

32M: trzydzieści dwa miliony
57M: pięćdziesiąt siedem milionów

And similarly for thousands.

> Mojca

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Adam Mickiewicz University
___
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] \unit problem with powers of ten.

2012-11-23 Thread Romain Diss
Hi,

Le jeudi 22 novembre 2012, Hans Hagen a écrit :
> On 11/19/2012 11:44 PM, Romain Diss wrote:
> > Hi all,
> > 
> > I got some problems to express powers of ten in the \unit command. See
> > the strange behaviour with these two minimal examples.
> > 
> > \starttext
> > \unit{10^2 meter}\\
> > \unit{10^{-12} second}
> > \stoptext
> > Is this a bug or are these expressions not supported?
> 
> not supported .. i've added it to the upcoming beta:
Thank you very much.

> needs testing as usual (and wiki adaption as well)
I have upgraded my context version few minutes ago:
$ context --version
mtx-context | ConTeXt Process Management 0.60
mtx-context | current version: 2012.11.23 17:35

but your following code doesn't work completely:

> \starttext
> 
> \startlines
> \unit{10^12 meter}
> \unit{10^{-12} second}
> \unit{10^{12} second}
> \unit{10e12 meter}
> \unit{10e{-12} second}
> \unit{10e{12} second}
> \stoplines
> 
> \stoptext

The '^' and 'e' all print a '10 ×' at the begining. It's what is expected for 
'e' but not for '^'. Did I miss something?

-- 
Romain Diss

___
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] Narrower paragraphs

2012-11-23 Thread Aditya Mahajan

... I probably found it (how easy!):


\definestartstop
[Rek]
[before={\blank\setupnarrower[left=\parindent,right=\parindent]\startnarrower},
 after={\stopnarrower\blank},
 style=\em,
]



(Untested, as I don't know if narrower accepts indent and style keys; if 
not this should serve as a feature request :))


\definenarrower
[Rek]
[left=\parindent,
right=\parindent,
indenting=next,
after={\blank},
style=em]


Aditya
___
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] ConTeXt Standalone/Suite in Windows

2012-11-23 Thread Pablo Rodríguez
On 23/11/12 00:40, Mojca Miklavec wrote:
>>> ·
 [...]
 I would like to be able to use a ConTeXt Standalone on a computer with
 WinXP Pro and no internet connection and no administrative rights.

 Isn't it possible to install on a different computer (let's say
 c:\context) and then move that to the same directory on the other
 computer?
>  [...]
> One definitely doesn't need wine. If one only has a linux machine on
> the network, using
> ./first-setup.sh --platform=mswin
> should suffice (probably one only needs to run mtxrun/mktexlsr and
> "context --make" [texexec --make] for the first time on the new
> machine).
> 
> If you have windows computer, just fetch the files and copy them to
> the other machine. Actually, we also had zips
> (http://minimals.contextgarden.net/pragma/), but I stopped updating
> them.
> 
> The distribution is not "installed" in traditional sense. Only the
> files are fetched and nothing is written into global PATH or registry.

Many thanks for the replies, Hans, Philipp, Aditya and Mojca.

I understood
http://wiki.contextgarden.net/ConTeXt_Standalone#Moving_the_installation_tree_around_.28linux.29
so that non-Unix trees weren't impossible to move.

Many thanks for your help again,


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] "Hiding" columns in m-database & TABLE

2012-11-23 Thread Hans Hagen

On 11/23/2012 1:38 PM, Philipp Gesang wrote:


although csv is not a standard per se there is nevertheless an
rfc: . Can we have an
optional rfc-compliant parser as well? That entails interpreting
the first line as field header if it consists entirely of
unquoted fields -- neat feature as one can treat these as column
identifiers to query fields in a more natural fashion.


i patched your version a bit:

local mycsvsplitter = utilities.parsers.rfc4180splitter()

local crap = [[
first,second,third,fourth
"1","2","3","4"
"a","b","c","d"
"foo","bar""baz","boogie","xyzzy"
]]

-- local list, names = mycsvsplitter(crap,true)
-- local list  = mycsvsplitter(crap)

the flag tells to return a header

Hans

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


Re: [NTG-context] Arabic with ConTeXt

2012-11-23 Thread Philipp Gesang
·

> Am 23.11.2012 15:17, schrieb ntg-context-requ...@ntg.nl:
> >The table*is*  the workaround ;P As long as you don?t mind being
> >limited to columns on one page, the tabulate syntax and the
> >restrictions on the input order, you?ll definitely be fine.
> >
> >The additional code was supposed to show how to handle an issue
> >that is very likely to manifest itself with what you are doing:
> >translations of this kind are usually accompanied by some special
> >pagination. Using plain counters for that can have undesirable
> >side-effects.
> >
> >Regards
> >Philipp
> Ok, thanks, so I misunderstood :)
> 
> But now a different issue arises, it could be that for my purpose of
> the dual-languaged book, it is better to divide every page NOT into
> left and right, but into up and down. Of course now the tabluate
> does not work, is there a workaround for this?

This is one of the features that were proposed along with the
streams wishlist thread some time ago:

  http://archive.contextgarden.net/message/20100818.141221.4253769f.en.html

I can’t provide a workaround, though, sorry.

Philipp

Btw. can you please fix your mail client so that it won’t break
the thread? Thanks.


-- 
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments


pgpqQrVLXD05k.pgp
Description: PGP signature
___
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] Narrower paragraphs

2012-11-23 Thread Procházka Lukáš Ing . - Pontex s . r . o .

... I probably found it (how easy!):


\definestartstop
  [Rek]
  
[before={\blank\setupnarrower[left=\parindent,right=\parindent]\startnarrower},
   after={\stopnarrower\blank},
   style=\em,
  ]


Best regards,

Lukas


On Fri, 23 Nov 2012 16:00:54 +0100, Procházka Lukáš Ing. - Pontex s. r. o. 
 wrote:


Hello,

I need to temporary narrow the width in which text is typeset, to get something 
like:


Sdflsdf  sjldfg sjfdg sjdfg sjdfg   <- Normal (first) paragraph (no-indent).
sf sjlfg sjdgfjsgfjsdf sgdf jsdgf
sdfg gjh.
Lsdf  sjldfg sjfdg sjdfg sjdfg   <- Normal (other) paragraph (normal 
indent).
sf sjlfg sjdgfjsgfjsdf sgdf jsdgf
sdfg gjh.
 <- Blank line
   Sdfjhk  skjdhf kh skh fsk ks  <- Narrower (first) paragraph (no-indent);
   skfh  skf s ksk fk sf kh jhd its width e.g. 0.8 * 
 (\textwidth)
   dfs fsdf.
 Fjhk  skjdhf kh skh fsk ks  <- Narrower (other) paragraph (normal 
indent).
   skfh  skf s ksk fk sf kh jhd
   dfs fsdf.
 Fjhk  skjdhf kh skh fsk ks
   skfh  skf s ksk fk sf kh jhd
   dfs fsdf.
 <- Blank line
   Sdkf sks dfks fhf skdhf kshfk j   <- Normal (next) paragraph (normal indent).
f sfh skfhs kfh skfh skf skdhfkdf
fks fshf shf skhfd ksdhfhks djiuo
dsdhf k.
Lsdf  sjldfg sjfdg sjdfg sjdfg
sf sjlfg sjdgfjsgfjsdf sgdf jsdgf
sdfg gjh.


I tried to play somehow with \(setup)paragraph(s), but it seems the are 
intended for paragraph-side-by-side setting, like columns do.

Changing \pagelayout changes the whole page layout, whilst I need just to 
narrow some paragraphs.

Something like:

\defineSomethingLikeParagraph[MyPar][width=.8\textwidth,leftdistance=.1\textwidth,before=\blank,after=\blank,]

And later:

\startMyPar
   \input knuth
\stopMyPar

Is there something like that?

TIA.

Lukas





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

Tel: +420 244 062 238
Fax: +420 244 461 038

___
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] Narrower paragraphs

2012-11-23 Thread Procházka Lukáš Ing . - Pontex s . r . o .

Hello,

I need to temporary narrow the width in which text is typeset, to get something 
like:


Sdflsdf  sjldfg sjfdg sjdfg sjdfg   <- Normal (first) paragraph (no-indent).
sf sjlfg sjdgfjsgfjsdf sgdf jsdgf
sdfg gjh.
   Lsdf  sjldfg sjfdg sjdfg sjdfg   <- Normal (other) paragraph (normal indent).
sf sjlfg sjdgfjsgfjsdf sgdf jsdgf
sdfg gjh.
<- Blank line
  Sdfjhk  skjdhf kh skh fsk ks  <- Narrower (first) paragraph (no-indent);
  skfh  skf s ksk fk sf kh jhd its width e.g. 0.8 * 
 (\textwidth)
  dfs fsdf.
Fjhk  skjdhf kh skh fsk ks  <- Narrower (other) paragraph (normal 
indent).
  skfh  skf s ksk fk sf kh jhd
  dfs fsdf.
Fjhk  skjdhf kh skh fsk ks
  skfh  skf s ksk fk sf kh jhd
  dfs fsdf.
<- Blank line
  Sdkf sks dfks fhf skdhf kshfk j   <- Normal (next) paragraph (normal indent).
f sfh skfhs kfh skfh skf skdhfkdf
fks fshf shf skhfd ksdhfhks djiuo
dsdhf k.
   Lsdf  sjldfg sjfdg sjdfg sjdfg
sf sjlfg sjdgfjsgfjsdf sgdf jsdgf
sdfg gjh.


I tried to play somehow with \(setup)paragraph(s), but it seems the are 
intended for paragraph-side-by-side setting, like columns do.

Changing \pagelayout changes the whole page layout, whilst I need just to 
narrow some paragraphs.

Something like:

\defineSomethingLikeParagraph[MyPar][width=.8\textwidth,leftdistance=.1\textwidth,before=\blank,after=\blank,]

And later:

\startMyPar
  \input knuth
\stopMyPar

Is there something like that?

TIA.

Lukas


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

Tel: +420 244 062 238
Fax: +420 244 461 038

___
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] Degree sign

2012-11-23 Thread Marcin Borkowski
Dnia 2012-11-23, o godz. 15:43:56
Mojca Miklavec  napisał(a):

> On Fri, Nov 23, 2012 at 3:35 PM, Marcin Borkowski wrote:
> > Dnia 2012-11-23, o godz. 15:22:14 Mojca Miklavec napisał(a):
> >> On Fri, Nov 23, 2012 at 3:17 PM, Marcin Borkowski wrote:
> >> > Hi all,
> >> >
> >> > is there a "canonical" way to obtain a degree sign?  I'd best
> >> > like it to work in both text and math mode, and not use UTF-8
> >> > but some TeX-y \command (like \degree or so).
> >>
> >> \textdegree (see char-def.lua for example)
> >
> > Thanks!
> >
> > You might want to put this here:
> > http://tex.stackexchange.com/questions/22086/macro-for-degree-symbol
> > to keep up with Aditya's tradition of providing ConTeXt answers to
> > LaTeX questions;).
> 
> With something like:
> "If you switch to ConTeXt, \textdegree will work in both text and
> math mode."
> ? ;) ;) ;)

Well... kinda... yes. ;P

You might want to look here for inspiration:

http://tex.stackexchange.com/users/323/aditya?tab=answers

(Clarification: joking aside, I guess that Aditya's habit of giving
ConTeXt answers to LaTeX questions on TeX.SE is really great, since
it allows to spread the word about ConTeXt, and also may help ConTeXt
users.)

> Mojca

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Adam Mickiewicz University
___
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] Degree sign

2012-11-23 Thread Mojca Miklavec
On Fri, Nov 23, 2012 at 3:35 PM, Marcin Borkowski wrote:
> Dnia 2012-11-23, o godz. 15:22:14 Mojca Miklavec napisał(a):
>> On Fri, Nov 23, 2012 at 3:17 PM, Marcin Borkowski wrote:
>> > Hi all,
>> >
>> > is there a "canonical" way to obtain a degree sign?  I'd best like
>> > it to work in both text and math mode, and not use UTF-8 but some
>> > TeX-y \command (like \degree or so).
>>
>> \textdegree (see char-def.lua for example)
>
> Thanks!
>
> You might want to put this here:
> http://tex.stackexchange.com/questions/22086/macro-for-degree-symbol to
> keep up with Aditya's tradition of providing ConTeXt answers to LaTeX
> questions;).

With something like:
"If you switch to ConTeXt, \textdegree will work in both text and
math mode."
? ;) ;) ;)

Mojca
___
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] Degree sign

2012-11-23 Thread Marcin Borkowski
Dnia 2012-11-23, o godz. 15:22:14
Mojca Miklavec  napisał(a):

> On Fri, Nov 23, 2012 at 3:17 PM, Marcin Borkowski wrote:
> > Hi all,
> >
> > is there a "canonical" way to obtain a degree sign?  I'd best like
> > it to work in both text and math mode, and not use UTF-8 but some
> > TeX-y \command (like \degree or so).
> 
> \textdegree (see char-def.lua for example)

Thanks!

You might want to put this here:
http://tex.stackexchange.com/questions/22086/macro-for-degree-symbol to
keep up with Aditya's tradition of providing ConTeXt answers to LaTeX
questions;).

> Mojca

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Adam Mickiewicz University
___
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] Arabic with ConTeXt

2012-11-23 Thread H. Özoguz

Am 23.11.2012 15:17, schrieb ntg-context-requ...@ntg.nl:

The table*is*  the workaround ;P As long as you don?t mind being
limited to columns on one page, the tabulate syntax and the
restrictions on the input order, you?ll definitely be fine.

The additional code was supposed to show how to handle an issue
that is very likely to manifest itself with what you are doing:
translations of this kind are usually accompanied by some special
pagination. Using plain counters for that can have undesirable
side-effects.

Regards
Philipp

Ok, thanks, so I misunderstood :)

But now a different issue arises, it could be that for my purpose of the 
dual-languaged book, it is better to divide every page NOT into left and 
right, but into up and down. Of course now the tabluate does not work, 
is there a workaround for this?


Huseyin
___
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] Degree sign

2012-11-23 Thread Mojca Miklavec
On Fri, Nov 23, 2012 at 3:17 PM, Marcin Borkowski wrote:
> Hi all,
>
> is there a "canonical" way to obtain a degree sign?  I'd best like it
> to work in both text and math mode, and not use UTF-8 but some TeX-y
> \command (like \degree or so).

\textdegree (see char-def.lua for example)

Mojca
___
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] Degree sign

2012-11-23 Thread Marcin Borkowski
Hi all,

is there a "canonical" way to obtain a degree sign?  I'd best like it
to work in both text and math mode, and not use UTF-8 but some TeX-y
\command (like \degree or so).

Best

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Adam Mickiewicz University
___
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] beta

2012-11-23 Thread Sietse Brouwer
Bill Meahan wrote:
> Strictly FYI, Arkandis Digital Foundry has a couple
> of math fonts available. I can't say how good/useful
> they are since I don't typeset > math but I noticed
> them while visiting the Arkandis site and thought
> I'd pass the information along.
> More info:  http://arkandis.tuxfamily.org/tugfonts.htm

By all means add it to
http://wiki.contextgarden.net/Math_fonts

That page is an overview of math+font issues in ConTeXt, from 'how to
use' to 'how to fix'; but math fonts are not that common, so it might
as well double as a list of math fonts per se.

--Sietse
___
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] \unit problem with powers of ten.

2012-11-23 Thread Sietse Brouwer
> needs testing as usual (and wiki adaption as well)

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

Wiki: adapted. (Page created, actually, as there was none.) Using the
fancy-schmancy {{since|2012|text=nov 2012}} template, which (1) marks
this as a recent feature, and as such not in the stable yet, and
(2) sticks it in the hidden categories [Since] and [Since 2012], so
that we may review (and remove) those tags when the new stable comes
out next year.

--Sietse

On Thu, Nov 22, 2012 at 7:09 PM, Hans Hagen  wrote:
> On 11/19/2012 11:44 PM, Romain Diss wrote:
>>
>> Hi all,
>>
>> I got some problems to express powers of ten in the \unit command. See the
>> strange behaviour with these two minimal examples.
>>
>> \starttext
>> \unit{10^2 meter}\\
>> \unit{10^{-12} second}
>> \stoptext
>>
>> However, there is no problem with this one: \unit{1e-4 kilogram}.
>>
>> Is this a bug or are these expressions not supported?
>
>
> not supported .. i've added it to the upcoming beta:
>
> \starttext
>
> \startlines
> \unit{10^12 meter}
> \unit{10^{-12} second}
> \unit{10^{12} second}
> \unit{10e12 meter}
> \unit{10e{-12} second}
> \unit{10e{12} second}
> \stoplines
>
> \stoptext
>
> needs testing as usual (and wiki adaption as well)
>
> Hans
>
>
> -
>   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
> ___
___
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] "Hiding" columns in m-database & TABLE

2012-11-23 Thread Philipp Gesang
·

> On 11/22/2012 3:36 PM, Marcin Borkowski wrote:
> >Dnia 2012-11-22, o godz. 13:26:52
> >Mojca Miklavec  napisał(a):
> >
> >>On Thu, Nov 22, 2012 at 12:57 PM, Marcin Borkowski wrote:
> >>>le) in order to
> >>>typeset a (nice) TABLE. However, I have a few columns I'd like to
> >>>omit.  I can (of course) hand-edit the csv file; but is there a way
> >>>to do it automatically?  Something like
> >>>
> >>>\setupTABLE[column][3,4,5][kill]
> >>>
> >>>I did [empty=yes,width=0pt] in place of [kill], and it worked, but
> >>>it seems like a hack (and I don't know whether it does actually
> >>>process the cells I'm omitting - which in my case wouldn't bother
> >>>me, but might be an additional layer of inelegance;)).  And better
> >>>ideas?
> >>
> >>If you have up to 9 columns, you could use
> >>
> >> \def\ProcessingLine#1#2#3#4#5#6#7{%
> >> \bTR\bTD#1\eTD\bTD#2\eTD\bTD#6\eTD\bTD#7\eTD}
> >>
> >>and then [command=\ProcessingLine]
> >
> >Well, something like 20 columns (on A4 landscape). ;)
> >
> >It turns out that my method somehow doesn't work well without setting
> >also height=0pt; then it's fine, but I'm still wondering about a
> >cleaner way.
> 
> I've added a splutter to the core:
> 
> \startluacode
> 
> local mycsvsplitter = utilities.parsers.csvsplitter {
> separator = ",",
> quote = '"',
> }
> 
> local crap = [[
> "1","2","3","4"
> "a","b","c","d"
> ]]
> 
> local mycrap = mycsvsplitter(crap)
> 
> context.bTABLE()
> for i=1,#mycrap do
> context.bTR()
> local c = mycrap[i]
> for i=1,#c do
> context.bTD()
> context(c[i])
> context.eTD()
> end
> context.eTR()
> end
> context.eTABLE()
> 
> \stopluacode

Hi Hans,

although csv is not a standard per se there is nevertheless an
rfc: . Can we have an
optional rfc-compliant parser as well? That entails interpreting
the first line as field header if it consists entirely of
unquoted fields -- neat feature as one can treat these as column
identifiers to query fields in a more natural fashion.

·

\starttext
\startluacode

local P, R, V, S, C, Ct, Cs, Carg, Cc, Cg, Cf = lpeg.P, lpeg.R, lpeg.V, lpeg.S, 
lpeg.C, lpeg.Ct, lpeg.Cs, lpeg.Carg, lpeg.Cc, lpeg.Cg, lpeg.Cf

local lpegmatch = lpeg.match
local patterns = lpeg.patterns
local newline  = patterns.newline

---
--RFC 4180 csv parser
---

-- based on http://tools.ietf.org/html/rfc4180
-- notable deviations from the RFC grammar:
--   · allow overriding “comma” and “quote” chars in spec
--   · the “textdata” rule is extrapolated to mean, basically,
-- “everything but the quote character”, not just the character
-- range as in the RFC
--   · newline from l-lpeg.lua instead of “crlf”

local rfc4180_spec = { separator = ",", quote = [["]] }

utilities.parsers.rfc4180_splitter = function (specification)
specification = specification or rfc4180_spec
local separator   = specification.separator --> rfc: COMMA
local quotechar   = P(specification.quote)  -->  DQUOTE
local dquotechar  = quotechar * quotechar   -->  2DQUOTE
  / specification.quote

local separator   = S(separator ~= "" and separator or ",")
local escaped = quotechar
  * Cs((dquotechar + (1 - quotechar))^0)
  * quotechar
local non_escaped = C((1 - quotechar - newline - separator)^1)
local field   = escaped + non_escaped
local record  = Ct(field * (separator * field)^0)
local name= field -- sic!
local header  = Cg(Ct(name * (separator * name)^0), "header")
local file= Ct((header * newline)^-1 -- optional header
 * record
 * (newline * record)^0
 * newline^0)
return function (data) return lpegmatch (file, data) end
end

---
--  example writer (natural table)
---

local print_csv_table = function (tab)
  local header = tab.header
  context.setupTABLE({ frame = "off" })
  context.setupTABLE({"header"}, { background  = "screen" })
  context.bTABLE()
if header then
  context.bTABLEhead()
  context.bTR()
  for i=1,#header do
context.bTH()
context(header[i])
context.eTH()
  end
  context.eTR()
  context.eTABLEhead()
end
context.bTABLEbody()
for i=1,#tab do
  context.bTR()
  local c = tab[i]
  for i=1,#c do
context.bTD()
context(c[i])
context.eTD()
  end
  context.eTR()
end
context.eTABLEbody()
  context.eTAB

Re: [NTG-context] mtxrun server help broken

2012-11-23 Thread Thomas A. Schmitz

On 11/21/2012 05:14 PM, Thomas A. Schmitz wrote:

nope, afraid I get the same error with 2012.11.21 16:11.

Thomas


OK, it works again with 2012.11.22 18:09. I'm just wondering: the help 
information is always at the very bottom of the list of commands, so one 
has to scroll all the way down (and there's no obvious way of seeing 
that something has happened at all unless one scrolls down) - has this 
always been the case? I seem to remember that it would open a frame in 
the main window, but I may be wrong.


Thomas
___
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] Arabic with ConTeXt

2012-11-23 Thread Philipp Gesang
Hi Huseyin,

·

> Am 21.11.2012 23:41, schrieb ntg-context-requ...@ntg.nl:
> >What you are looking for is text streams. They are not yet fully
> >functional in mkiv. But as long as you need the streams to appear
> >as columns on the same page, as seems to be the case, there is a
> >cheap workaround using the*tabulate*  environment (see below).
 
> Thank you. Why not simply a table without any workaround?
 
> \starttabulate[|p|p|]
> \NC \language[deo] Hallo, Welt!
> \NC \language[en] \input knuth
> \NC\NR
> \NC \language[deo] Nächster Abschnitt!
> \NC \language[en] \input ward
> \NC\NR
> \stoptabulate

The table *is* the workaround ;P As long as you don’t mind being
limited to columns on one page, the tabulate syntax and the
restrictions on the input order, you’ll definitely be fine.

The additional code was supposed to show how to handle an issue
that is very likely to manifest itself with what you are doing:
translations of this kind are usually accompanied by some special
pagination. Using plain counters for that can have undesirable
side-effects.

Regards
Philipp



-- 
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments


pgpQc7kJrZzYj.pgp
Description: PGP signature
___
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
___