Re: [NTG-context] [tex-live] difference texlive 2008, 2009

2010-02-15 Thread Lubos Kolouch
Aditya Mahajan, Mon, 15 Feb 2010 12:29:58 -0500:

> On Mon, 15 Feb 2010, Lubos Kolouch wrote:
> 
>> I can, however it was already discussed here in this thread and fixed
>> once...
> 
> You can try the same solution again :)
> 
> source /opt/context-minimals/setuptex
> 
>> minimal file :
>> http://dpaste.com/159433/
>>
>> log:
>> http://dpaste.com/159432/
> 
> Notice that the files that are being sources are from
> /usr/share/texmf-dist and not from /opt/context-minimals/texmf-context
> 
> You can check that by running
> 
> which texexec
> 
> If you are using minimals, you should get something like
> /opt/context-minimals/texmf-linux-64/bin/texexec With texlive, you will
> get
> /usr/bin/texexec
> 
> Aditya
> 
Hi Aditya,

Right - thank you.

Pardon my ignorance, does it mean, I have to run it after every update of 
this package? Should that not be part of the install process?

Lubos

___
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] Formatting numbers in LuaTeX

2010-02-15 Thread Peter Münster
On Mon, Feb 15 2010, Andreas Harder wrote:
> 
> But the "$·$"-construct is problematic. It do not work in display style
> (\let\calcmath\displaycalcmath) and without the dollar-signs the placement
> and the spacing are wrong.

I don't know, why "·" doesn't work, but you can try this:

local exp_replacements = {["*"] = "cdot"}

Cheers, Peter

-- 
Contact information: http://pmrb.free.fr/contact/


___
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] Formatting numbers in LuaTeX

2010-02-15 Thread Andreas Harder

Am 15.02.2010 um 20:35 schrieb Peter Münster:

> On Sun, Feb 14 2010, Hans Hagen wrote:
> 
>>>   sqrt = math.sqrt
>>>   pi = math.pi
>>>   function my_equation(s, r)
>> 
>> beware, this creates (and possibly overloads) sqrt, pi and my_equation as 
>> gobals
> 
> Indeed...
> 
> The following hack was *not* so quick, but there is a bug somewhere
> (a digit is added at the end):
> 
> \usemodule[calcmath]
> \startluacode
> local exp_replacements = {["*"] = "$·$"}
> local res_replacements = {["sqrt"] = "math.sqrt", ["π"] = "math.pi"}
> userdata = userdata or {}
> function userdata.result_as_string(r)
>   r = math.floor(1000 * r + 0.5) / 1000
>   r = tostring(r)
>   tex.write(r:gsub("%.", ","))
> end
> function userdata.filter_expression(s)
>   for k, v in pairs(exp_replacements) do
>   s = s:gsub(k, v)
>   end
>   tex.write(s)
> end
> function userdata.filter_result(s)
>   for k, v in pairs(res_replacements) do
>   s = s:gsub(k, v)
>   end
>   tex.write(s)
> end
> \stopluacode
> \def\calculate#1{%
>  \start
>\def\Expression{\ctxlua{userdata.filter_expression("#1")}}
>\def\Result{\ctxlua{userdata.filter_result("#1")}}
>\calcmath{\Expression=\ctxlua{userdata.result_as_string(\Result)}}
>  \stop
> }
> \starttext
> \startlines
>  \calculate{1+2}
>  \calculate{3/2-1}
>  \calculate{3*2}
>  \calculate{sqrt(2)}
>  \calculate{2*π}
> \stoplines
> \stoptext

I've noticed that one can even use such things as \calculate{3^2},  
\calculate{2^3} out of the box and it's easy to add
["e"] = "math.exp(1)", ["sin"] = "math.sin", …

But the "$·$"-construct is problematic. It do not work in display style 
(\let\calcmath\displaycalcmath) and without the dollar-signs the placement and 
the spacing are wrong.

Thank you for your elaboration.

Greetings
Andreas




___
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] Formatting numbers in LuaTeX

2010-02-15 Thread Hans Hagen

On 15-2-2010 20:35, Peter Münster wrote:


tex.write(r:gsub("%.", ","))


tex.write((r:gsub("%.", ",")))

gsub returns two values

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | fax: 038 477 53 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] Formatting numbers in LuaTeX

2010-02-15 Thread Peter Münster
On Sun, Feb 14 2010, Hans Hagen wrote:

>>sqrt = math.sqrt
>>pi = math.pi
>>function my_equation(s, r)
>
> beware, this creates (and possibly overloads) sqrt, pi and my_equation as 
> gobals

Indeed...

The following hack was *not* so quick, but there is a bug somewhere
(a digit is added at the end):

\usemodule[calcmath]
\startluacode
local exp_replacements = {["*"] = "$·$"}
local res_replacements = {["sqrt"] = "math.sqrt", ["π"] = "math.pi"}
userdata = userdata or {}
function userdata.result_as_string(r)
r = math.floor(1000 * r + 0.5) / 1000
r = tostring(r)
tex.write(r:gsub("%.", ","))
end
function userdata.filter_expression(s)
for k, v in pairs(exp_replacements) do
s = s:gsub(k, v)
end
tex.write(s)
end
function userdata.filter_result(s)
for k, v in pairs(res_replacements) do
s = s:gsub(k, v)
end
tex.write(s)
end
\stopluacode
\def\calculate#1{%
  \start
\def\Expression{\ctxlua{userdata.filter_expression("#1")}}
\def\Result{\ctxlua{userdata.filter_result("#1")}}
\calcmath{\Expression=\ctxlua{userdata.result_as_string(\Result)}}
  \stop
}
\starttext
\startlines
  \calculate{1+2}
  \calculate{3/2-1}
  \calculate{3*2}
  \calculate{sqrt(2)}
  \calculate{2*π}
\stoplines
\stoptext

Cheers, Peter

-- 
Contact information: http://pmrb.free.fr/contact/


___
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] [tex-live] difference texlive 2008, 2009

2010-02-15 Thread Aditya Mahajan

On Mon, 15 Feb 2010, Lubos Kolouch wrote:


I can, however it was already discussed here in this thread and fixed
once...


You can try the same solution again :)

source /opt/context-minimals/setuptex


minimal file :
http://dpaste.com/159433/

log:
http://dpaste.com/159432/


Notice that the files that are being sources are from 
/usr/share/texmf-dist and not from /opt/context-minimals/texmf-context


You can check that by running

which texexec

If you are using minimals, you should get something like 
/opt/context-minimals/texmf-linux-64/bin/texexec

With texlive, you will get
/usr/bin/texexec

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
___


[NTG-context] "\setuplabeltext [appendix=Appendix ]" broken mkiv

2010-02-15 Thread Alan BRASLAU
1. Setting the labeltext "appendix=Appendix " with \startappendices
   is broken in mkiv; somewhat works in mkii. What am I doing wrong?
2. How to set the label correctly in the TOC?

Alan

Minimal example

\setuplabeltext [chapter=Chapter ]   % with trailing space; blank by default
\setuplabeltext [appendix=Appendix ] % with trailing space; blank by default
\setuphead [chapter] [placehead=yes]
\setuplist [chapter] [label=yes,width=5em,alternative=c]

\starttext

\startfrontmatter
\completecontent
\stopfrontmatter

\startbodymatter
\chapter {one}
\input knuth
\stopbodymatter

\startappendices
\chapter {first}
\input knuth
\stopappendices

\stoptext
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] columns and whitespace

2010-02-15 Thread Wolfgang Schuster

Am 15.02.10 13:56, schrieb Wolfgang Werners-Lucchini:

Neither \setupwhitespace[halfline]nor \setupcolumns[blank=halfline]is
working. Grid is off by default, isn't it?
   

Set the whitespace after \startcolumns.

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] [tex-live] difference texlive 2008, 2009

2010-02-15 Thread Lubos Kolouch
I can, however it was already discussed here in this thread and fixed 
once...

minimal file :
http://dpaste.com/159433/

log:
http://dpaste.com/159432/

Here is how it should show, ie. correctly :
http://farm5.static.flickr.com/4021/4258250861_30120b1923_o.png
Here is the "incorrect" document:
http://farm3.static.flickr.com/2713/4259008582_dc05e21324_o.png

Thank you for any hint,

Lubos

Lubos


Aditya Mahajan, Fri, 12 Feb 2010 14:54:38 -0500:

> On Fri, 12 Feb 2010, Lubos Kolouch wrote:
> 
>> Sorry... the package installs fine, however the output is wrong again
>> (the text is behind/below the flag, not right to it)
> 
> Can you attach a minimal example and the log file?
> 
> 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
> 
___


___
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] showlayoutcomponents: amazing!

2010-02-15 Thread Steffen Wolfrum

Am 15.02.2010 um 14:07 schrieb Hans Hagen:

> On 15-2-2010 12:46, Steffen Wolfrum wrote:
>> 
>> Am 15.02.2010 um 12:39 schrieb Hans Hagen:
>> 
>>> On 15-2-2010 11:51, Steffen Wolfrum wrote:
>>> 
 I just read Otareds posting in the list (not knowing the background of his 
 thread):
 when I set \showlayoutcomponents at the beginning of a document running 
 with MkIV, I get this:
 
 
 ! Missing { inserted.
 
a
>>> 
>>> are you running an old version?
>> 
>> 
>> 
>> todays minimal (ConTeXt  ver: 2010.02.14 18:59 MKIV)
> 
> then i need a minimal example showing the problem


it interfered with this line (self-evident?)

\unprotect
\setupmodule[Info=yes]
\processaction[\currentmoduleparameter{Info}]
   [yes=> \def\InfoMark{Info},
no=> \def\InfoMark{},
\v!unknown=> \def\InfoMark{},
\v!default=> \def\InfoMark{}]
\setupbackgrounds[page][background={\InfoMark}]% <---
%\defineoverlay[Info][{\getbuffer[info]}]
% ...
\protect

\showlayoutcomponents

\starttext

Test.

\stoptext


Steffen
___
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] showlayoutcomponents: amazing!

2010-02-15 Thread Hans Hagen

On 15-2-2010 12:46, Steffen Wolfrum wrote:


Am 15.02.2010 um 12:39 schrieb Hans Hagen:


On 15-2-2010 11:51, Steffen Wolfrum wrote:


I just read Otareds posting in the list (not knowing the background of his 
thread):
when I set \showlayoutcomponents at the beginning of a document running with 
MkIV, I get this:


! Missing { inserted.

a


are you running an old version?




todays minimal (ConTeXt  ver: 2010.02.14 18:59 MKIV)


then i need a minimal example showing the problem

Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | fax: 038 477 53 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] columns and whitespace

2010-02-15 Thread Wolfgang Werners-Lucchini
> > is it possible to get a half line space after paragraphs in
> columns?
> > The default is no space. And
> >
> > \setupwhitespace[small]
> >
> > produces a whole line of space.
> 
> halfline should work unless the grid is forced (although in mkiv 
> different rules apply than in mkii)
> 
> Hans

Neither \setupwhitespace[halfline]nor \setupcolumns[blank=halfline]is 
working. Grid is off by default, isn't it?

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] ancient greek module

2010-02-15 Thread Thomas A. Schmitz

On Feb 13, 2010, at 6:16 PM, Steffen Wolfrum wrote:

> Hi,
> 
> is "t-greek-2008.08.11.zip" still valid (and recommended for MkIV?)
> 
>> From contextgarden:
> The requested URL /modules/t-greek/doc/greek/ancientgreek.pdf was not found 
> on this server.
> The requested URL /modules/t-greek/doc/greek/readme.txt was not found on this 
> server.
> 
> 
> Steffen

Sorry, I was away for the weekend. I just checked: the version should work both 
with mkii and mkiv. I have been working on a new version with improved mkiv 
support for a while now, but haven't gotten round to releasing it yet (and 
demand hasn't been very high); that's why the documentation is missing. If all 
you want is just a few Greek words and if you're using mkiv, however, you don't 
need the module: just use a font that has support for Greek (e.g. Gentium, 
which is part of the minimals for that reason) and just type your Greek, and 
everything should work (no hyphenation, however). Maybe I can get my act 
together and release something in the next weeks, but you can use this version.

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] interlineskip problem (mkiv)

2010-02-15 Thread Peter Rolf
Am 14.02.2010 13:13, schrieb Hans Hagen:
> On 12-2-2010 16:47, Peter Rolf wrote:
>> Hi,
>>
>> I get unwanted interline skips when using a MP based background. The
>> attached example works fine in mkii. In mkiv I only get the desired
>> result, if I don't use the MP background.
> 
> 
> solved in next beta
> 

looks good. thank you!
___
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
___