Hello again, I'm still stuck with the counter problem, unfortunately I got no response...

ConTeXts writes out all the LilyPond pieces as "myfile-lilypond- #.tmp", sequential numbered. Then it should run LilyPond and epstopdf on the snippets, but runs them always only on no.1
I.e. the counter doesn't behave like it should. Why?

I think, these are the regarding code snippets (sorry, can't think of a minimal example for I don't understand the code by Christopher):

\unprotect
\def\??lily{lilypond-}
%...
\newcount\lily!figures
%...
\long\def\dodostartlilypond[#1]#2\stoplilypond{%
   \egroup% from \dostartlilypond
   \bgroup%
%...
   \global\advance\lily!figures\plusone
   \startmode[*\v!first]%
   \def\obeyedlines{\string^^J}%
   \convertargument#2\to\ascii
   \expanded{%
   \setbuffer[lilypond-\the\lily!figures]%
%>> here it works, all buffers are numbered
% ...
   \ascii%
   \ifundefined{\??lily fragment}\else\lily!fragmentsuffix\fi
   }% expanded
   \endbuffer%

\def\LP{texmfstart --exec bin:lilypond -b eps -dno-gs-load-fonts - dinclude-eps-fonts }
   \def\PDF{texmfstart --ifchanged=}

%>> here the counter is always 1  
   \ifeof18
      \installprogram{\LP\bufferprefix lilypond-\the\lily!figures.tmp}%
%>> can someone explain this "installprogram"?
      \doif\jobsuffix{pdf}{%
\installprogram{\PDF\bufferprefix lilypond-\the\lily! figures.eps pstopdf \bufferprefix lilypond-\the\lily!figures.eps}%
      }%
   \else
\executesystemcommand{\LP\bufferprefix lilypond-\the\lily! figures.tmp}%
      \doif\jobsuffix{pdf}{%
\executesystemcommand{\PDF\bufferprefix lilypond-\the\lily! figures.eps pstopdf \bufferprefix lilypond-\the\lily!figures.eps}%
      }%
   \fi
   \stopmode% only first run
   \doifelse\jobsuffix{pdf}
      {\edef\lily!img{\bufferprefix lilypond-\the\lily!figures.pdf}}%
      {\edef\lily!img{\bufferprefix lilypond-\the\lily!figures.eps}}%

   \ifvmode
\getfiguredimensions[\bufferprefix lilypond-\the\lily! figures.pdf]%
%>> here it works again, image no.# is not found (besides no.1)
      \leavevmode%
      \newdimen\FigWidth
      \FigWidth=\figurewidth
      \ifdim\FigWidth>\localhsize
         \!!dimena=\localhsize
         \advance\!!dimena by-\FigWidth
         \noindent\hskip\!!dimena
      \fi
   \fi
   \externalfigure[\lily!img]%
   \egroup%
}%


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

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

Reply via email to