Re: [NTG-context] Lilypond

2011-08-20 Thread David Wooten
Hi Aditya & Hraban,

I'm very glad to see improved Lilypond integration being discussed. I can't 
offer too much besides moral support, but would just point out one solution 
I've found for proper width/alignment of a snippet with extra-staff material 
(e.g. a piano staff marker { ): If the ConTeXt textwidth is equal to the 
Lilypond line-width, aligning the float to the right gives you a snippet nicely 
aligned with flush text (extra-staff material being pushed towards the left 
margin). 

Something like this (as in the example in the garden):

\def\readlilypondoutput#1{\setupfloats[location=right,frame=off]\placefigure[]{}}{\externalfigure[#1]}}

Regards,
David


On Aug 20, 2011, at 1:19 AM, Aditya Mahajan wrote:

> On Fri, 19 Aug 2011, Henning Hraban Ramm wrote:
> 
>> Am 2011-08-19 um 17:08 schrieb Aditya Mahajan:
>> 
>> But - can you even support different setups, say
>> 
>> \startlilypondpreamble
>> global settings for everything
>> \stoplilypondpreamble
>> 
>> \startlilypondpreamble[snippet]
>> global settings for snippets
>> \stoplilypondpreamble
>> 
>> \startlilypondpreamble[fullscore]
>> global settings for full scores
>> \stoplilypondpreamble
>> 
>> \startlilypond[setup=fullscore]
>> the score
>> \stoplilypond
>> 
>> etc.
> 
> Yes. I can support the following syntax:
> 
> \startbuffer[snippets] ... \stopbuffer
> 
> \startbuffer[fullscore] ... \stopbuffer
> 
> \startbuffer[common] ... \stopbuffer
> 
> \startlilypond[bufferbefore={snippets,common}, bufferafter={}]
>  \stoplilypond
> 
> (In fact, provide similar support for anything defined using the filter 
> module).
> 
>>> The other thing is to be able to change linespace, papersize, offset, etc 
>>> using parameters, so that one can say:
>>> \startlilypond[linespace=...]
>>> ...
>>> \stoplilypond
>>> This will require some lua side processing.
>> 
>> You mean, translate ConTeXt-style settings to LilyPond settings, like we did 
>> with the old module?
> 
> Yes.
> 
>> That wouldn’t make much sense. LilyPond just has too much settings. And most 
>> of them you can set in different ways. To fully support this, you’d need a 
>> complete LilyPond parser including Scheme. And a small set of settings is 
>> never the right set for everyone.
> 
> OK.
> 
>> Ok, there are a few settings that we could translate, e.g. set ConTeXt’s 
>> main fonts also for LilyPond.
> 
> Agreed. Does anyone know how to get the name of the current font in MkIV?
> 
>> We don’t need LilyPond's layout settings, as long as we go the 
>> \externalfigure path.
> 
> But I think that at least automatic paper size settings (set paper size to be 
> equal to text area) are needed.
> 
>> I don’t know a solution for line breaking of scores - if you’d set 
>> LilyPond’s page size to ConTeXt’s remaining space, it would stay the same 
>> for the second page. Perhaps we can get single lines (systems) and let 
>> ConTeXt to the page breaking. I’ll look into that.
> 
> OK.
> 
>> But I don’t know how we can make it "right" WRT LilyPond snippets - I’d want 
>> to align a note systems’s base line with ConTeXt’s text baseline, but the 
>> height and clipping of a snippet depends on the visible elements. Without 
>> some picture analysis (or runtime data from LilyPond, that doesn’t exist 
>> AFAIK) you need to adjust your snippets manually.
> 
> Does lilypond-book handle this at all? It does not appear to. Manually 
> adjusting each inline snippet will be too much work, IMO.
> 
>>> Do you know how lilypond numbers its output files. In some cases I get 
>>> filename-1.pdf sometimes not. Can I force it to always give filename-1.pdf 
>>> or always give filename.pdf
>> 
>> LilyPond adds a number to EPS, if there’s more that one page.
>> But in my songbook setup, I always get a filename-temp-lilypond-##.eps plus 
>> an identical filename-temp-lilypond-##-1.eps
>> 
>> When you order more than one \midi{} in several \score blocks, the first 
>> MIDI file is unnumbered, the second gets number 1 etc.; didn’t try with 
>> different \layout blocks yet.
>> 
>> Seems like I must do some tests with multipage scores.
> 
> Look at the current version on github. It should be able to handle multi-page 
> snippets.
> 
> 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://te

Re: [NTG-context] A [paragraph] parameter to \startitemize seems not to work

2011-08-20 Thread Marcin Borkowski
Up;)

Dnia 2011-08-07, o godz. 02:34:40
Marcin Borkowski  napisał(a):

> Hi,
> 
> the manual says that
> \startitemize[paragraph]
> \item doesn't
> \item leave
> \item blank space
> \item before the paragraph.
> \stopitemize
> But as the above example shows, this doesn't work.
> 
> Is it a bug in ConTeXt, a bug in the manual or a bug in my brain?
> 
> Regards,
> 


-- 
Marcin Borkowski
___
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] How to typeset ellipsis (=three dots)?

2011-08-20 Thread Marcin Borkowski
Dnia 2011-08-07, o godz. 11:35:39
Steffen Wolfrum  napisał(a):

> 
> Am 06.08.2011 um 23:39 schrieb Marcin Borkowski:
> 
> > Hi,
> > 
> > I looked into the \dots macro: I can see how it works in math mode,
> > but in text mode it puts a thin space (\,) after the dots.  So what
> > is the right way to type, say, this sentence:
> > 
> > "I like ConTeXt... but the learning curve is steep!"
> > 
> > A. I like \CONTEXT\dots but the learning curve is steep!
> > 
> > or
> > 
> > B. I like \CONTEXT\dots\ but the learning curve is steep!
> 
> 
> What about this?
> 
> I like \CONTEXT{\dots} but the learning curve is steep!

This I consider equivalent to "\dots\ " (at least in this, well,
context;)).

> 
> 
> Steffen
> 

-- 
Marcin Borkowski
___
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] How to typeset ellipsis (=three dots)?

2011-08-20 Thread Marcin Borkowski
Dnia 2011-08-07, o godz. 08:07:24
Wolfgang Schuster  napisał(a):

> 
> Am 06.08.2011 um 23:39 schrieb Marcin Borkowski:
> 
> > Hi,
> > 
> > I looked into the \dots macro: I can see how it works in math mode,
> > but in text mode it puts a thin space (\,) after the dots.  So what
> > is the right way to type, say, this sentence:
> > 
> > "I like ConTeXt... but the learning curve is steep!"
> > 
> > A. I like \CONTEXT\dots but the learning curve is steep!
> > 
> > or
> > 
> > B. I like \CONTEXT\dots\ but the learning curve is steep!
> > 
> > ?
> 
> “\CONTEXT\unknown” or “\CONTEXT …”
> 
> Wolfgang

Thanks!

Do I get it correctly that \unknown yields three characters (dots) in
the resulting pdf and … one (if it's available in the font, at least)?

Regards,

-- 
Marcin Borkowski
___
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] Fw: Pretty printing ConTeXt sources

2011-08-20 Thread Marcin Borkowski
Any ideas, please?

Data: Sat, 6 Aug 2011 01:34:05 +0200
Od: Marcin Borkowski 
Do: ntg-context@ntg.nl
Temat: Re: [NTG-context] Pretty printing ConTeXt sources


Dnia 2011-08-05, o godz. 14:24:56
Wolfgang Schuster  napisał(a):

> 
> Am 04.08.2011 um 22:53 schrieb Marcin Borkowski:
> 
> > Hi,
> > 
> > I'm sure it was answered before, but I couldn't find it: how to
> > pretty-print ConTeXt (and lua) files (I mean especially ConTeXt
> > sources, but also module sources)?
> 
> TeX: context --ctx=s-mod 
> Lua: context --ctx=x-ldx 

OK.

So I switched to a /tmp directory and did
context --ctx=s-mod pack-rul.mkiv
and no pdf was produced.

I copied pack-rul.mkiv to ~/tmp, did the same - then I got only the
title page and an error (log file below).

What am I doing wrong?

=== log file ===
(pack-rul.run

ConTeXt  ver: 2011.07.21 19:17 MKIV  fmt: 2011.7.22  int:
english/english

system  > cont-new.mkiv loaded
(/home/marcin/context/tex/texmf-context/tex/context/base/cont-new.mkiv
system  > beware: some patches loaded from cont-new.mkiv
)
system  > pack-rul.top loaded

system  > options > start used options

used options> % runtime options files (command line driven)
used options> \unprotect
used options> % feedback and basic job control
used options> % handy for special styles
used options> \startluacode
used options> document = document or { }
used options> document.arguments={
used options>  ["ctx"]="s-mod",
used options>  ["global"]=true,
used options>  ["prep"]=true,
used options> }
used options> document.files={
used options>  "pack-rul.mkiv",
used options> }
used options> \stopluacode
used options> % process info
used options> \setupsystem[inputfile=pack-rul.mkiv]
used options> \setupsystem[\c!n=1,\c!m=1]
used options> % modes
used options> % options (not that important)
used options> \startsetups *runtime:options
used options> \stopsetups
used options> % styles and modules
used options> \startsetups *runtime:modules
used options> \usemodule[mod-01]
used options> \stopsetups
used options> % done
used options> \protect \endinput

system  > options > stop used options

(pack-rul.top)
fonts   > latin modern fonts are not preloaded
languages   > language en is active
resolvers   > modules > loaded: 'mod-01'
(/home/marcin/context/tex/texmf-context/tex/context/base/s-mod-01.mkiv
resolvers   > modules > loaded: 'mod-00'
(/home/marcin/context/tex/texmf-context/tex/context/base/s-mod-00.mkiv
resolvers   > modules > loaded: 'units'
(/home/marcin/context/tex/texmf-context/tex/context/base/m-units.mkiv<+ 
/home/marcin/context/tex/texmf-context/tex/context/base/x-mathml.lua>)
resolvers   > modules > loaded: 'int-load'
(/home/marcin/context/tex/texmf-context/tex/context/base/x-set-11.mkiv))
resolvers   > modules > loaded: 'abr-01'
(/home/marcin/context/tex/texmf-context/tex/context/base/s-abr-01.tex)
fonts   > preloading latin modern fonts (third stage)
(/home/marcin/context/tex/texmf-context/tex/context/base/type-siz.mkiv)
(/home/marcin/context/tex/texmf-context/tex/context/base/type-otf.mkiv)
files   > readfile > asked name: 'loc', not found
{/home/marcin/context/tex/texmf/fonts/map/dvips/lm/lm-math.map}{/home/marcin/context/tex/texmf/fonts/map/dvips/lm/lm-rm.map}{/home/marcin/context/tex/texmf-context/fonts/map/pdftex/context/mkiv-base.map}
fonts   > virtual math > unable to resolve name mapsfromchar
fonts   > fallback modern rm 10pt is loaded )
system  > prepfiles > loading ctx log file (specified)
(pack-rul.mkiv.prep
backend > xmp > using file
'/home/marcin/context/tex/texmf-context/tex/context/base/lpdf-pdx.xml'
pages   > flushing realpage 1, userpage 1, subpage 1
pages   > flushing realpage 2, userpage 1 . . .
! Illegal parameter number in definition of \!!stringa.

system  > tex > error on line 50 in file pack-rul.run: Illegal
parameter number in definition of  ...


 
   }
\docommand #1->\edef \currentmargindata {#1}
\getparameters [\??mc
\currentma... \dodomargeaanduidingen [#1]#2->\def \docommand ##
 1{\indent \hbox {\ifx
#2\re...  ...gen [linewidth, setuplinewidth]\tex 
  \scratchcounter
=\NOfMargi... \doifelsenothing #1->\edef \!!stringa {#1
 }\ifx \!!stringa \empty
\expandafte... \domargindata ...ta ][#1]\fi \doifelsenothing {#3}
  \donefalse \donetrue
\ifdo... ...
l.50   {linewidth, setuplinewidth}
  
? x


system  > files > start used files

used files  >1: filename=pack-rul.run | foundname=pack-rul.run
| usedmethod=direct used files  >2: filename=cont-new.mkiv |
f

Re: [NTG-context] Lilypond

2011-08-20 Thread Aditya Mahajan

On Fri, 19 Aug 2011, Henning Hraban Ramm wrote:


Am 2011-08-19 um 17:08 schrieb Aditya Mahajan:

But - can you even support different setups, say

\startlilypondpreamble
global settings for everything
\stoplilypondpreamble

\startlilypondpreamble[snippet]
global settings for snippets
\stoplilypondpreamble

\startlilypondpreamble[fullscore]
global settings for full scores
\stoplilypondpreamble

\startlilypond[setup=fullscore]
the score
\stoplilypond

etc.


Yes. I can support the following syntax:

\startbuffer[snippets] ... \stopbuffer

\startbuffer[fullscore] ... \stopbuffer

\startbuffer[common] ... \stopbuffer

\startlilypond[bufferbefore={snippets,common}, bufferafter={}]
 
\stoplilypond


(In fact, provide similar support for anything defined using the filter 
module).


The other thing is to be able to change linespace, papersize, offset, etc 
using parameters, so that one can say:

\startlilypond[linespace=...]
...
\stoplilypond
This will require some lua side processing.


You mean, translate ConTeXt-style settings to LilyPond settings, like we did 
with the old module?


Yes.

That wouldn’t make much sense. LilyPond just has too much settings. And most 
of them you can set in different ways. To fully support this, you’d need a 
complete LilyPond parser including Scheme. And a small set of settings is 
never the right set for everyone.


OK.

Ok, there are a few settings that we could translate, e.g. set ConTeXt’s main 
fonts also for LilyPond.


Agreed. Does anyone know how to get the name of the current font in MkIV?

We don’t need LilyPond's layout settings, as long as we go the 
\externalfigure path.


But I think that at least automatic paper size settings (set paper 
size to be equal to text area) are needed.


I don’t know a solution for line breaking of scores - if you’d set LilyPond’s 
page size to ConTeXt’s remaining space, it would stay the same for the second 
page. Perhaps we can get single lines (systems) and let ConTeXt to the page 
breaking. I’ll look into that.


OK.

But I don’t know how we can make it "right" WRT LilyPond snippets - I’d want 
to align a note systems’s base line with ConTeXt’s text baseline, but the 
height and clipping of a snippet depends on the visible elements. Without 
some picture analysis (or runtime data from LilyPond, that doesn’t exist 
AFAIK) you need to adjust your snippets manually.


Does lilypond-book handle this at all? It does not appear to. Manually 
adjusting each inline snippet will be too much work, IMO.


Do you know how lilypond numbers its output files. In some cases I get 
filename-1.pdf sometimes not. Can I force it to always give filename-1.pdf 
or always give filename.pdf


LilyPond adds a number to EPS, if there’s more that one page.
But in my songbook setup, I always get a filename-temp-lilypond-##.eps plus 
an identical filename-temp-lilypond-##-1.eps


When you order more than one \midi{} in several \score blocks, the first MIDI 
file is unnumbered, the second gets number 1 etc.; didn’t try with different 
\layout blocks yet.


Seems like I must do some tests with multipage scores.


Look at the current version on github. It should be able to handle 
multi-page snippets.


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] combining characters in stretchednormalcase

2011-08-20 Thread Vyatcheslav Yatskovsky

Hi,

Hans, what is the opposite of the following recipe (to make letters 
shrink instead of stretch)?



\starttext

\definedfont[file:junicoderegular]

\kerncharacters{N.C.}

\stoptext



--
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] Errors installing ConTeXt on Windows

2011-08-20 Thread Cecil Westerhof
2011/8/20 Alasdair McAndrew 

> Well, I've now got linux reinstalled, so I no longer need Windows.  (Huge
> sigh of relief.)  Sorry about the anguished initial email!
>

I feel your pain. :-D

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