Re: [NTG-context] libertine otf file not recognised

2010-04-09 Thread Salil Sayed
Amazing! the fonts from CTAN work perfect. And they are also so much more. I 
wonder why the main site of libertine is so out of date.

Thanks a lot. That takes my move from mkII to mkVI one step further. I have 
another issue for which I will start a new thread.

Best regards,

Salil





From: Wolfgang Schuster schuster.wolfg...@googlemail.com
To: mailing list for ConTeXt users ntg-context@ntg.nl
Sent: Thu, April 8, 2010 11:58:03 PM
Subject: Re: [NTG-context] libertine otf file not recognised

Am 08.04.10 20:23, schrieb Taco Hoekwater:
 All other otf fonts in the same directory work. The libertine fonts
 (from the same files) work with other applications such as gedit,
 inkscape etc. (obviously not with openoffice)

 What can be the problem?
 Perhaps the version number in the file name (which contains dots).
 IIRC, this or a similar issue popped up a few months ago. Perhaps
 I even replied then.
http://tracker.luatex.org/view.php?id=278

I haven't checked this since i wrote the bug report because i use now
the libertine fonts from ctan what i suggest for Salil too, the libertine
fonts from sourceforge are more than a year old and the ctan version
was updated recently and has also more styles for biolinum.

http://www.ctan.org/tex-archive/fonts/libertine/

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
___



  ___
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] streams! atleast the left||right synchronization mechanism

2010-04-09 Thread Salil Sayed


Hi,

As I am moving from mkII to mkIV with my thesis manuscript, I need to make the 
'left||right synchronization mechanism' to work. I worked beautifully in mkII. 
I looked in the source of the module but could not make out where the issue is. 
I errors I get today begin like this.

(/home/me/context/tex/texmf-context/tex/context/base/m-streams.tex
! Undefined control sequence.
l.19 \defineoutputstream
 [\v!left]
? 
! Undefined control sequence.
l.20 \defineoutputstream
 [\v!right]
? 
! Undefined control sequence.
l.22 \definemarknote
[\v!left]
? 
! Undefined control sequence.
l.23 \definemarknote
[\v!right]
? 
)
system  : module streams loaded
___

what is this (  \v!  ) thing? where can I get the clues? Does it come from Tex 
or LuaTex programming?

Thanks,

Salil



  ___
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] streams! atleast the left||right synchronization mechanism

2010-04-09 Thread Wolfgang Schuster

Am 09.04.10 09:45, schrieb Salil Sayed:

Hi,

As I am moving from mkII to mkIV with my thesis manuscript, I need to 
make the 'left||right synchronization mechanism' to work. I worked 
beautifully in mkII. I looked in the source of the module but could 
not make out where the issue is. I errors I get today begin like this.
Remove the \endinput at the begin of the file (line 28) in page-str.mkiv 
and remake the format.
what is this (  \v!  ) thing? where can I get the clues? Does it come 
from Tex or LuaTex programming?

http://wiki.contextgarden.net/System_Macros/Scratch_Variables

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] streams! atleast the left||right synchronization mechanism

2010-04-09 Thread Salil Sayed
Thanks Wolfgang, this works. I knew this from a previous discussion but I was 
trying the line in m-streams.tex

regards,

Salil





From: Wolfgang Schuster schuster.wolfg...@googlemail.com
To: mailing list for ConTeXt users ntg-context@ntg.nl
Cc: Hans Hagen pra...@wxs.nl
Sent: Fri, April 9, 2010 10:53:19 AM
Subject: Re: [NTG-context] streams! atleast the left||right synchronization 
mechanism

 Am 09.04.10 09:45, schrieb Salil Sayed: 
 
Hi,

As I am moving from mkII to mkIV with my thesis manuscript, I need to
make the 'left||right synchronization mechanism' to work. I worked
beautifully in mkII. I looked in the source of the module but could not
make out where the issue is. I errors I get today begin like this.

Remove the \endinput at the begin of the file (line 28) in page-str.mkiv
and remake the format.

what
is this (  \v!  ) thing? where can I get the clues? Does it come from
Tex or LuaTex programming?
http://wiki.contextgarden.net/System_Macros/Scratch_Variables

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
___


[NTG-context] code

2010-04-09 Thread R. Bastian
Hello,

how to translate in context the following plain tex:

\font\fgras = cmbtt10
{\tt
{\obeylines
{\fgras def} ra():
\ \ \ \ a = 3
\ \ \ \ b = 4
}
}

-- 
René Bastian
www.pythoneon.org
www.musiques-rb.org
http://www.soundsurvey.org.uk/


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

2010-04-09 Thread luigi scarso
On Fri, Apr 9, 2010 at 11:20 AM, R. Bastian rbast...@free.fr wrote:
 Hello,

 how to translate in context the following plain tex:

 \font\fgras = cmbtt10
 {\tt
 {\obeylines
 {\fgras def} ra():
 \ \ \ \ a = 3
 \ \ \ \ b = 4
 }
 }
not a solution, but this works

\starttext
\font\fgras = lmmonolt10-bold.otf
{\tt
{\obeylines
{\fgras def} ra():
\ \ \ \ a = 3
\ \ \ \ b = 4
}
}
\stoptext


-- 
luigi
___
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] callback.register

2010-04-09 Thread Wolfgang Werners-Lucchini
  I tried the following
 
  --
  \starttext
  \startluacode
  local OldPreLB
 
  function MyPreLB(head,gc)
  ?texio.write_nl(### Here I am!)
  ?OldPreLB(head,gc)
  end
 
  OldPreLB = callback.find('pre_linebreak_filter')
  callback.register('pre_linebreak_filter',MyPreLB)
  \stopluacode
 
  Test
  \stoptext
  --
 
  but MyPreLB() is not called.
  What I am doing wrong here?
 
 Hi Wolfgang,
 
 see http://www.ntg.nl/pipermail/ntg-context/2010/047018.html
 
 -- 
 Best regards,
 
 Li Yanrui (???)

I see!

From the info found there
-
there are two user hooks:

tasks.appendaction(processors,before,modules.mine.whatever_a)
tasks.appendaction(processors,after,modules.mine.whatever_b)
-
it is not clear for me how to use this.

So it seems that the luatex reference is useless for a context user.
Is there an other documentation on this?

I have found an other mechanism in 'luat-cbk.lua' which offers a pair 
of functions 'callbacks.push()' and 'callbacks.pop()'. But I have not 
made any attempts to use them. Are they useable or are they disabled 
too?

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] code

2010-04-09 Thread Wolfgang Schuster

Am 09.04.10 11:20, schrieb R. Bastian:

Hello,

how to translate in context the following plain tex:

\font\fgras = cmbtt10
{\tt
{\obeylines
{\fgras def} ra():
\ \ \ \ a = 3
\ \ \ \ b = 4
}
}
   

MkII:

\setuplines[space=on]

\starttext
\startlines\tt
%\startlines[style=mono] % works only in MkIV
{\bf def} ra():
a = 3
b = 4
\stoplines
\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
___


[NTG-context] error messages for callback.register

2010-04-09 Thread Peter Münster
Hello,

Here a patch for luat-cbk.lua:

function callbacks.register(name,func,freeze)
if frozen[name] then
if trace_callbacks then
frozenmessage(registering,name)
end
return nil, name ..  is frozen
elseif freeze then
frozen[name] = (type(freeze) == string and freeze) or registered
return register_callback(name,func)
else
return register_callback(name,func)
end
end

function callback.register(name,func) -- original
if frozen[name] then
if trace_callbacks then
frozenmessage(registering,name)
end
return nil, name ..  is frozen
else
return register_callback(name,func)
end
end

(Untested...)

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] code

2010-04-09 Thread R. Bastian
On Fri, 9 Apr 2010 11:27:38 +0200
luigi scarso luigi.sca...@gmail.com scribit:

 On Fri, Apr 9, 2010 at 11:20 AM, R. Bastian rbast...@free.fr wrote:
  Hello,
 
  how to translate in context the following plain tex:
 
  \font\fgras = cmbtt10
  {\tt
  {\obeylines
  {\fgras def} ra():
  \ \ \ \ a = 3
  \ \ \ \ b = 4
  }
  }
 not a solution, but this works
 
 \starttext
 \font\fgras = lmmonolt10-bold.otf
 {\tt
 {\obeylines
 {\fgras def} ra():
 \ \ \ \ a = 3
 \ \ \ \ b = 4
 }
 }
 \stoptext
 
 
 -- 
 luigi

thanks luigi, it compiles with 'context 2010.01.26' but:
- the def is not in bold
- context adds \n between every line.

my 76 pages of Python code rewritten in plain tex by a python
script are accetabile (compile by pdftex) - so i will try to 


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


-- 
René Bastian
www.pythoneon.org
www.musiques-rb.org
http://www.soundsurvey.org.uk/


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

2010-04-09 Thread R. Bastian
On Fri, 09 Apr 2010 12:00:05 +0200
Wolfgang Schuster schuster.wolfg...@googlemail.com scribit:

 Am 09.04.10 11:20, schrieb R. Bastian:
  Hello,
 
  how to translate in context the following plain tex:
 
  \font\fgras = cmbtt10
  {\tt
  {\obeylines
  {\fgras def} ra():
  \ \ \ \ a = 3
  \ \ \ \ b = 4
  }
  }
 
 MkII:
 
 \setuplines[space=on]
 
 \starttext
 \startlines\tt
 %\startlines[style=mono] % works only in MkIV
 {\bf def} ra():
  a = 3
  b = 4
 \stoplines
 \stoptext
 
 Wolfgang
 

Thanks Wolfhang. It goes better, but there is still a little bug:

{\bf def} inserts a white space in front of the line

Compare:
{\bf def} ra():
def ra():
a = 3
b = 4



-- 
René Bastian
www.pythoneon.org
www.musiques-rb.org
http://www.soundsurvey.org.uk/


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

2010-04-09 Thread luigi scarso
On Fri, Apr 9, 2010 at 1:35 PM, R. Bastian rbast...@free.fr wrote:
 On Fri, 9 Apr 2010 11:27:38 +0200
 luigi scarso luigi.sca...@gmail.com scribit:

 On Fri, Apr 9, 2010 at 11:20 AM, R. Bastian rbast...@free.fr wrote:
  Hello,
 
  how to translate in context the following plain tex:
 
  \font\fgras = cmbtt10
  {\tt
  {\obeylines
  {\fgras def} ra():
  \ \ \ \ a = 3
  \ \ \ \ b = 4
  }
  }
 not a solution, but this works

 \starttext
 \font\fgras = lmmonolt10-bold.otf
 {\tt
 {\obeylines
 {\fgras def} ra():
 \ \ \ \ a = 3
 \ \ \ \ b = 4
 }
 }
 \stoptext


 --
 luigi

 thanks luigi, it compiles with 'context 2010.01.26' but:
 - the def is not in bold
def is bold (you can see it with  pdffonts) only it's loaded at
10pt, while body font is 12pt (I believe)

 - context adds \n between every line.
hmm, If I cut-and-paste to vim I see the same as pdf , ie no extra \n
anyway you can play with interlinespace

\starttext
\font\fgras = lmmonolt10-bold.otf at 12pt
{\tt\setupinterlinespace[line=1ex]
{\obeylines
{\fgras def} ra():
\ \ \ \ a = 3
\ \ \ \ b = 4
}
}
\stoptext



 my 76 pages of Python code rewritten in plain tex by a python
 script are accetabile (compile by pdftex) - so i will try to

thank you to remember me that I'm always on late with python pretty printer ...
-- 
luigi
___
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] code

2010-04-09 Thread R. Bastian
On Fri, 9 Apr 2010 14:32:08 +0200
luigi scarso luigi.sca...@gmail.com scribit:

 On Fri, Apr 9, 2010 at 1:35 PM, R. Bastian rbast...@free.fr wrote:
  On Fri, 9 Apr 2010 11:27:38 +0200
  luigi scarso luigi.sca...@gmail.com scribit:
 
  On Fri, Apr 9, 2010 at 11:20 AM, R. Bastian rbast...@free.fr wrote:
   Hello,
  
   how to translate in context the following plain tex:
  
   \font\fgras = cmbtt10
   {\tt
   {\obeylines
   {\fgras def} ra():
   \ \ \ \ a = 3
   \ \ \ \ b = 4
   }
   }
  not a solution, but this works
 
  \starttext
  \font\fgras = lmmonolt10-bold.otf
  {\tt
  {\obeylines
  {\fgras def} ra():
  \ \ \ \ a = 3
  \ \ \ \ b = 4
  }
  }
  \stoptext
 
 
  --
  luigi
 
  thanks luigi, it compiles with 'context 2010.01.26' but:
  - the def is not in bold
 def is bold (you can see it with  pdffonts) only it's loaded at
 10pt, while body font is 12pt (I believe)

it is true - i saw it just after sending the mail.


 
  - context adds \n between every line.
 hmm, If I cut-and-paste to vim I see the same as pdf , ie no extra \n
 anyway you can play with interlinespace
 

ok  \interlinespace works 
 \starttext
 \font\fgras = lmmonolt10-bold.otf at 12pt
 {\tt\setupinterlinespace[line=1ex]
 {\obeylines
 {\fgras def} ra():
 \ \ \ \ a = 3
 \ \ \ \ b = 4
 }
 }
 \stoptext
 

but remains that every {\bf } introduces a white space;
how to force context to make a backspace ?

 
 
  my 76 pages of Python code rewritten in plain tex by a python
  script are accetabile (compile by pdftex) - so i will try to
 
 thank you to remember me that I'm always on late with python pretty printer ..

it would be fine 
 -- 
 luigi
 ___
 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
 ___
 


-- 
René Bastian
www.pythoneon.org
www.musiques-rb.org
http://www.soundsurvey.org.uk/


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

2010-04-09 Thread Peter Münster
On Fri, Apr 09 2010, R. Bastian wrote:

 but remains that every {\bf } introduces a white space;
 how to force context to make a backspace ?

\setuplines[space=on]
\starttext
\startlines[style=mono]
{\bf{}def} ra():
a = 3
b = 4
\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] code

2010-04-09 Thread luigi scarso
On Fri, Apr 9, 2010 at 5:24 PM, Peter Münster pmli...@free.fr wrote:
 On Fri, Apr 09 2010, R. Bastian wrote:

 but remains that every {\bf } introduces a white space;
 how to force context to make a backspace ?

 \setuplines[space=on]
 \starttext
 \startlines[style=mono]
 {\bf{}def} ra():
    a = 3
    b = 4
 \stoplines
 \stoptext

 Cheers, Peter

I'm not able to see any white space in mkiv

\showframe
\starttext
\font\fgras = lmmonolt10-bold.otf at 12pt
\ruledvbox{\tt\setupinterlinespace[line=1ex]
{\obeylines
{\fgras def} ra():
\ \ \ \ a = 3
\ \ \ \ b = 4
\vskip1\lineheight
{\fgras def} ra():
\ \ \ \ a = 3
\ \ \ \ b = 4
}
}

\stoptext
-- 
luigi
___
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] code

2010-04-09 Thread Peter Münster
On Fri, Apr 09 2010, luigi scarso wrote:

  On Fri, Apr 09 2010, R. Bastian wrote:
 
  but remains that every {\bf } introduces a white space;

 I'm not able to see any white space in mkiv


Bastian refers to Wolfgang's solution with \setuplines[space=on].

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
___


[NTG-context] Building a guitar chord using MP

2010-04-09 Thread Vyatcheslav Yatskovsky

Hello,

I have interesting task. I want to build a picture of a guitar chord 
using metapost.


For now, I only knew how to make a chord grid:

\startreusableMPgraphic{chordgrid}
drawoptions(withpen pencircle scaled 0.4pt withcolor black) ;
draw hlingrid(0, 5, 1, 0.8cm, 1cm) ;
draw vlingrid(0, 4, 1, 1cm, 0.8cm) ;
\stopreusableMPgraphic

\define[0]\ChGrid{\dontleavehmode\useMPgraphic{chordgrid}\hskip2mm}

\starttext
\ChGrid
\stoptext

I need to change it so that I  could specify fret numbers, i.e. six 
numbers for each string, and draw a filled circles in these positions.


I've started with a command like this

\define[6]\Ch{\dontleavehmode\useMPgraphic{chordgrid}...

I'm not sure what to do next... How to pass these parameters into MP, 
how to organize the loop...


For a test, \Ch[1][3][1][2][1][1] should produce

|-O-|---|---|---|
|-O-|---|---|---|
|---|-O-|---|---|
|-O-|---|---|---|
|---|---|-O-|---|
|-O-|---|---|---|

Please, help me with it.

--
Best Regards,
Vyatcheslav Yatskovsky
___
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] callback.register

2010-04-09 Thread Wolfgang Werners-Lucchini
 Hello,
 
 Here a patch for luat-cbk.lua:
 
 function callbacks.register(name,func,freeze)
 if frozen[name] then
 if trace_callbacks then
 frozenmessage(registering,name)
 end
 return nil, name ..  is frozen
 elseif freeze then
 frozen[name] = (type(freeze) == string and freeze) or
 registered
 return register_callback(name,func)
 else
 return register_callback(name,func)
 end
 end
 
 function callback.register(name,func) -- original
 if frozen[name] then
 if trace_callbacks then
 frozenmessage(registering,name)
 end
 return nil, name ..  is frozen
 else
 return register_callback(name,func)
 end
 end
 
 (Untested...)
 
 Cheers, Peter

and

function callbacks.report()
local list = callback.list()
for name, func in table.sortedpairs(list) do
local str = frozen[name]
if str then
logs.report(callbacks,%s: %s - 
%s,state(name),name,str)
else
logs.report(callbacks,%s: %s,state(name),name)
end
end
end

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] Building a guitar chord using MP

2010-04-09 Thread Taco Hoekwater

Vyatcheslav Yatskovsky wrote:


Please, help me with it.


I usually tackle this sort of thing by first drawing the entire image
in metapost code alone. Then, when that works, write a tex command
that fills in bits and pieces of the metapost image.

Best wishes,
Taco





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

2010-04-09 Thread Wolfgang Schuster

Am 09.04.10 13:35, schrieb R. Bastian

Thanks Wolfhang. It goes better, but there is still a little bug:

{\bf def} inserts a white space in front of the line

Compare:
{\bf def} ra():
def ra():
 a = 3
 b = 4
   

\startlines
\bold{def} ra():
...
\stoplines

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] callback.register

2010-04-09 Thread Wolfgang Werners-Lucchini
 there are two user hooks:
 
 tasks.appendaction(processors,before,modules.mine.whatever_a)
 tasks.appendaction(processors,after,modules.mine.whatever_b)
 -

My example looks now

\starttext
\startluacode
function MyPreLB(head,gc)
  texio.write(\n)
  for n in node.traverse(head) do
if node.type(n.id) == glyph then
  texio.write(string.char(n.char))
elseif node.type(n.id) == glue then
  texio.write(' ')
end
  end
  texio.write(\n)
  return head
end
tasks.appendaction(processors,before,MyPreLB)
\stopluacode
Dies ist ein Test.
\stoptext

Is it correct to return 'head'?

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] Building a guitar chord using MP

2010-04-09 Thread Henning Hraban Ramm

Am 2010-04-09 um 20:30 schrieb Taco Hoekwater:


Vyatcheslav Yatskovsky wrote:

Please, help me with it.


I usually tackle this sort of thing by first drawing the entire image
in metapost code alone. Then, when that works, write a tex command
that fills in bits and pieces of the metapost image.



I wouldn't use MetaPost at all (because I can't) but use LilyPond's  
great possibilities...
(Never tried fret diagrams with the LilyPond module, but it should  
work.)



Greetlings from Lake Constance!
Hraban
---
http://www.fiee.net/texnique/
http://wiki.contextgarden.net
https://www.cacert.org (I'm an assurer)

___
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] regenerate database

2010-04-09 Thread Honza Pohanka

Hello,

which command regenerates the file database, please? I'm trying to add  
type-my.tex file to texmf-local tree in Context minimals. I found that  
luatools --generate should do that job, but it does not work for me.


regards Jan


--
Tato zpráva byla vytvořena převratným poštovním klientem Opery:  
http://www.opera.com/mail/

___
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] callback.register

2010-04-09 Thread 李延瑞
2010/4/10 Wolfgang Werners-Lucchini w...@musensturm.de:
 there are two user hooks:

 tasks.appendaction(processors,before,modules.mine.whatever_a)
 tasks.appendaction(processors,after,modules.mine.whatever_b)
 -

 My example looks now

 \starttext
 \startluacode
 function MyPreLB(head,gc)
  texio.write(\n)
  for n in node.traverse(head) do
    if node.type(n.id) == glyph then
      texio.write(string.char(n.char))
    elseif node.type(n.id) == glue then
      texio.write(' ')
    end
  end
  texio.write(\n)
  return head
 end
 tasks.appendaction(processors,before,MyPreLB)
 \stopluacode
 Dies ist ein Test.
 \stoptext

 Is it correct to return 'head'?


Maybe 'return head, true', because I found a few functions in the beta
do so. Such as 'scripts.preprocess'.

-- 
Best regards,

Li Yanrui (李延瑞)
___
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] regenerate database

2010-04-09 Thread 李延瑞
2010/4/10 Honza Pohanka xhpoha...@gmail.com:
 Hello,

 which command regenerates the file database, please? I'm trying to add
 type-my.tex file to texmf-local tree in Context minimals. I found that
 luatools --generate should do that job, but it does not work for me.


if you are using MkII, i think you can try 'mktexlsr'.

-- 
Best regards,

Li Yanrui (李延瑞)
___
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
___