ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Runtime graphics
@ 2003-06-13  5:34 Pierre VINET
  2003-06-14  9:06 ` Hans Hagen
  2003-07-01 10:20 ` bib module/cite Martin Moncrieffe
  0 siblings, 2 replies; 11+ messages in thread
From: Pierre VINET @ 2003-06-13  5:34 UTC (permalink / raw)



 Hi,

       I run this simple test file test.tex :

%&cont-en
\setupoutput[pdftex]
\runMPgraphicstrue
\starttext
\startMPrun
  input graphserieA
\stopMPrun
\externalfigure[mprun.1]
\externalfigure[mprun.2]
%
\startMPrun
  input graphserieB
\stopMPrun
\externalfigure[mprun.1]
\externalfigure[mprun.2]
\stoptext
\end .

  In the logfile, I got the messages :

figures        : figureobject test-mprun.1 is reused
figures        : figureobject test-mprun.2 is reused

 and twice the figures of graphserieA.mp on test.pdf.

 Is there a way to avoid the re-use of test-mprun.1 and test-mprun.2, I mean
a way to overwrite the files test-mprun.1 and test-mprun.2 ?

 Or a way to get different names for each metapost output as, for example,
graphserieA-mprun.1, graphserieA-mprun.2 and graphserieB-mprun.1,
graphserieB-mprun.2 ?
 
 I could also give a different number to each of the figures in all of the
*.mp files, but this solution is not pacticable since I have plenty of
metapost files to process, each of it containing a lot of figures already
numbered with almost the same numbers. Moreover, those numbers can not be
modified because the figures are elsewhere referenced by their number and by
the name of the metapost file.

Thanks,

 --pv

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Runtime graphics
  2003-06-13  5:34 Runtime graphics Pierre VINET
@ 2003-06-14  9:06 ` Hans Hagen
  2003-06-15  6:45   ` Pierre VINET
  2003-07-01 10:20 ` bib module/cite Martin Moncrieffe
  1 sibling, 1 reply; 11+ messages in thread
From: Hans Hagen @ 2003-06-14  9:06 UTC (permalink / raw)


At 01:34 13/06/2003 -0400, you wrote:

>  Hi,
>
>        I run this simple test file test.tex :
>
>%&cont-en
>\setupoutput[pdftex]
>\runMPgraphicstrue
>\starttext
>\startMPrun
>   input graphserieA
>\stopMPrun
>\externalfigure[mprun.1]
>\externalfigure[mprun.2]
>%
>\startMPrun
>   input graphserieB
>\stopMPrun
>\externalfigure[mprun.1]
>\externalfigure[mprun.2]
>\stoptext
>\end .
>
>   In the logfile, I got the messages :
>
>figures        : figureobject test-mprun.1 is reused
>figures        : figureobject test-mprun.2 is reused
>
>  and twice the figures of graphserieA.mp on test.pdf.
>
>  Is there a way to avoid the re-use of test-mprun.1 and test-mprun.2, I mean
>a way to overwrite the files test-mprun.1 and test-mprun.2 ?
>
>  Or a way to get different names for each metapost output as, for example,
>graphserieA-mprun.1, graphserieA-mprun.2 and graphserieB-mprun.1,
>graphserieB-mprun.2 ?
>
>  I could also give a different number to each of the figures in all of the
>*.mp files, but this solution is not pacticable since I have plenty of
>metapost files to process, each of it containing a lot of figures already
>numbered with almost the same numbers. Moreover, those numbers can not be
>modified because the figures are elsewhere referenced by their number and by
>the name of the metapost file.

You can redefine:

   \def\MPrunfile#1{\bufferprefix mprun.#1}

to for instance

   \def\MPrunfile#1{\bufferprefix \MyMpRunFile.#1}

   \def\MyMpRunFile{mprun}


and them change the definition of \MyMpRunFile whenever you want

Hans
-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                        information: http://www.pragma-ade.com/roadmap.pdf
                     documentation: http://www.pragma-ade.com/showcase.pdf
-------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Runtime graphics
  2003-06-14  9:06 ` Hans Hagen
@ 2003-06-15  6:45   ` Pierre VINET
  2003-06-15 18:03     ` Hans Hagen
  0 siblings, 1 reply; 11+ messages in thread
From: Pierre VINET @ 2003-06-15  6:45 UTC (permalink / raw)



Hi Hans,

Thank you for your reply. Here is the modified test.tex file following your
indications :

\starttext
\def\MPrunfile#1{\bufferprefix \MyMpRunFile.#1}
\def\MyMpRunFile{graphserieA}
\startMPrun
  input graphserieA
\stopMPrun
\externalfigure[\MyMpRunFile.1]
\externalfigure[\MyMpRunFile.2]
%
\def\MyMpRunFile{graphserieB}
\startMPrun
  input graphserieB
\stopMPrun
\externalfigure[\MyMpRunFile.1]
\externalfigure[\MyMpRunFile.2]
\stoptext
\end .

The test.pdf output now show four gray boxes with the following messages in
their center
"
    name: dummy
file: graphserieA.1
   state: unknown
"
(with graphserieA.2 in the 2nd box, graphserieB.1 in the 3rd, etc.)

The test.log file tell
"
\openout5 = `test-mprun.mp'.
system(mpost -progname=mpost -mem=metafun test-mprun)...executed.

figures        : figure graphserieA can not be found
figures        : figure graphserieA can not be found
\openout5 = `test-mprun.mp'.

system(mpost -progname=mpost -mem=metafun test-mprun)...executed.

figures        : figure graphserieB can not be found
figures        : figure graphserieB can not be found
"

The figures are not found because a file named "test-mprun.mp" is still
created and metapost's output are still named "test-mprun.*" instead of
"\MyMpRunFile.*". Obviously, \externalfigure can not found any
"\MyMpRunFile.*" files.

If I use \externalfigure[mprun.*] instead of
\externalfigure[\MyMpRunFile.*], then the first metapost's output files
"test-mprun.1" and "test-mprun.2" are still re-used -?by \externalfigure?-
after the second \startMPrun .. \stopMPrun call. (A -?simple?- way to avoid
this systematic re-use of metapost's output would be, in my opinion, the
best of all solutions).

In the present case, I think the problem could be resolved if the
"*-mprun.mp" files were labeled with the prefix name of the metapost file
instead of the "jobname". Thus, for instance, we may read in the log file
after the first \startMPrun .. \stopMPrun call

\openout5 = `graphserieA-mprun.mp'.
system(mpost -progname=mpost -mem=metafun graphserieA-mprun)...executed.

and after the second \startMPrun .. \stopMPrun call

\openout5 = `graphserieB-mprun.mp'.
system(mpost -progname=mpost -mem=metafun graphserieB-mprun)...executed.

Afterwards, metapost's output files named "graphserieA-mprun.1",
"graphserieA-mprun.2", "graphserieB-mprun.1" and "graphserieB-mprun.2" would
be created and then normally found by \externalfigure.

Thanks again,

-- pv

> 
> You can redefine:
> 
> \def\MPrunfile#1{\bufferprefix mprun.#1}
> 
> to for instance
> 
> \def\MPrunfile#1{\bufferprefix \MyMpRunFile.#1}
> 
> \def\MyMpRunFile{mprun}
> 
> 
> and them change the definition of \MyMpRunFile whenever you want
> 
> Hans

>> Hi,
>> 
>> I run this simple test file test.tex :
>> 
>> %&cont-en
>> \setupoutput[pdftex]
>> \runMPgraphicstrue
>> \starttext
>> \startMPrun
>> input graphserieA
>> \stopMPrun
>> \externalfigure[mprun.1]
>> \externalfigure[mprun.2]
>> %
>> \startMPrun
>> input graphserieB
>> \stopMPrun
>> \externalfigure[mprun.1]
>> \externalfigure[mprun.2]
>> \stoptext
>> \end .
>> 
>> In the logfile, I got the messages :
>> 
>> figures        : figureobject test-mprun.1 is reused
>> figures        : figureobject test-mprun.2 is reused
>> 
>> and twice the figures of graphserieA.mp on test.pdf.
>> 
>> Is there a way to avoid the re-use of test-mprun.1 and test-mprun.2, I mean
>> a way to overwrite the files test-mprun.1 and test-mprun.2 ?
>> 
>> Or a way to get different names for each metapost output as, for example,
>> graphserieA-mprun.1, graphserieA-mprun.2 and graphserieB-mprun.1,
>> graphserieB-mprun.2 ?
>> 
>> I could also give a different number to each of the figures in all of the
>> *.mp files, but this solution is not pacticable since I have plenty of
>> metapost files to process, each of it containing a lot of figures already
>> numbered with almost the same numbers. Moreover, those numbers can not be
>> modified because the figures are elsewhere referenced by their number and by
>> the name of the metapost file.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Runtime graphics
  2003-06-15  6:45   ` Pierre VINET
@ 2003-06-15 18:03     ` Hans Hagen
  2003-06-16  5:09       ` Pierre VINET
  0 siblings, 1 reply; 11+ messages in thread
From: Hans Hagen @ 2003-06-15 18:03 UTC (permalink / raw)


At 02:45 15/06/2003 -0400, you wrote:

>Hi Hans,
>
>Thank you for your reply. Here is the modified test.tex file following your
>indications :
>
>\starttext
>\def\MPrunfile#1{\bufferprefix \MyMpRunFile.#1}
>\def\MyMpRunFile{graphserieA}
>\startMPrun
>   input graphserieA
>\stopMPrun
>\externalfigure[\MyMpRunFile.1]
>\externalfigure[\MyMpRunFile.2]

\externalfigure[\MPrunfile{1}]

since you need the prefix

Hans
-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                        information: http://www.pragma-ade.com/roadmap.pdf
                     documentation: http://www.pragma-ade.com/showcase.pdf
-------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Runtime graphics
  2003-06-15 18:03     ` Hans Hagen
@ 2003-06-16  5:09       ` Pierre VINET
  0 siblings, 0 replies; 11+ messages in thread
From: Pierre VINET @ 2003-06-16  5:09 UTC (permalink / raw)



> \externalfigure[\MPrunfile{1}]
> 
> since you need the prefix

This does not work either.
But digging almost everywhere in ConTeXt, I finally found the macro
\executeMETAPOST{myfile.mp} in supp-mps.tex who drive the command
  
  mpost -progname=mpost -mem=metafun myfile.mp

and do the right job for me.

\executeMETAPOST can be used as many times you want, on the contrary of the
set \startMPrun ... \stopMPrun .

-- pv

^ permalink raw reply	[flat|nested] 11+ messages in thread

* bib module/cite
  2003-06-13  5:34 Runtime graphics Pierre VINET
  2003-06-14  9:06 ` Hans Hagen
@ 2003-07-01 10:20 ` Martin Moncrieffe
  2003-07-11 13:01   ` bib module/cite (Context bug) Taco Hoekwater
  1 sibling, 1 reply; 11+ messages in thread
From: Martin Moncrieffe @ 2003-07-01 10:20 UTC (permalink / raw)


Hi All

I have a question which I hope someone can answer.

If I do \cite[number][ref1, ref2, ref3], the references are formatted
correctly, for example [1,2,3].

If however, I do \cite [ref1, ref2, ref3], then I get [1-2], not
[1-3]. How can I fix this? I've searched the ConTeXt mail archives
but haven't seen this behavior reported.

Regards.

__martin

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: bib module/cite (Context bug)
  2003-07-01 10:20 ` bib module/cite Martin Moncrieffe
@ 2003-07-11 13:01   ` Taco Hoekwater
  0 siblings, 0 replies; 11+ messages in thread
From: Taco Hoekwater @ 2003-07-11 13:01 UTC (permalink / raw)



Hi Martin, Hans, rest of the group,

It took me a while to track down this bug. It is actually a bug in
the definition of \sortcommacommand in newer ConTeXt-es.

Minimal example:

\def\mylist{1,2,3}
\sortcommacommand[\mylist]\donumericcompare
\message{\sortedcommalist} % reports 1,2 !!



On Tue, 1 Jul 2003 11:20:54 +0100, Martin wrote:

> Hi All
> 
> I have a question which I hope someone can answer.
> 
> If I do \cite[number][ref1, ref2, ref3], the references are formatted
> correctly, for example [1,2,3].
> 
> If however, I do \cite [ref1, ref2, ref3], then I get [1-2], not
> [1-3]. How can I fix this? I've searched the ConTeXt mail archives
> but haven't seen this behavior reported.
> 
> Regards.
> 
> __martin
> 
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context


-- 
groeten,

Taco

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: bib module/cite (Context bug)
  2003-07-14  8:12   ` Taco Hoekwater
@ 2003-07-14  8:27     ` Martin Moncrieffe
  0 siblings, 0 replies; 11+ messages in thread
From: Martin Moncrieffe @ 2003-07-14  8:27 UTC (permalink / raw)


Hi,

Works for me now as well. I'd forgotten to regenerate the format.

Regards.

__martin

On Monday, Jul 14, 2003, at 09:12 Europe/London, Taco Hoekwater wrote:

>
> Hi,
>
> It works for me. (2003 jan 31 version)
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: bib module/cite (Context bug)
  2003-07-13 19:49 ` Martin Moncrieffe
@ 2003-07-14  8:12   ` Taco Hoekwater
  2003-07-14  8:27     ` Martin Moncrieffe
  0 siblings, 1 reply; 11+ messages in thread
From: Taco Hoekwater @ 2003-07-14  8:12 UTC (permalink / raw)
  Cc: mcm35


Hi,

It works for me. (2003 jan 31 version)

On Sun, 13 Jul 2003 20:49:10 +0100, Martin wrote:

> Hi Hans,
> 
> I've applied the patches but it still does not work. Additionally, Taco
> example still produces 1,2 instead of 1,2,3. I'm using the context ver
> 2003.3.11 if that helps.

-- 
groeten,

Taco

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: bib module/cite (Context bug)
  2003-07-12 17:22 Hans Hagen
@ 2003-07-13 19:49 ` Martin Moncrieffe
  2003-07-14  8:12   ` Taco Hoekwater
  0 siblings, 1 reply; 11+ messages in thread
From: Martin Moncrieffe @ 2003-07-13 19:49 UTC (permalink / raw)


Hi Hans,

I've applied the patches but it still does not work. Additionally, Taco
example still produces 1,2 instead of 1,2,3. I'm using the context ver
2003.3.11 if that helps.

Regards.

__martin

On Sat, 12 Jul 2003, Hans Hagen wrote:

> At 15:01 11/07/2003 +0200, Taco Hoekwater wrote:
>
> >Hi Martin, Hans, rest of the group,
> >
> >It took me a while to track down this bug. It is actually a bug in
> >the definition of \sortcommacommand in newer ConTeXt-es.
> >
> >Minimal example:
> >
> >\def\mylist{1,2,3}
> >\sortcommacommand[\mylist]\donumericcompare
> >\message{\sortedcommalist} % reports 1,2 !!
>
> Two patches are needed in syst-ext.tex:
>
> (1) change last line in:
>
> \def\docompareitems#1%
>    {\doifnotempty{#1}
>       {\@EA\comparecommand\@EA{\!!tempa}{#1}\relax
>        \ifnum\comparedresult<2
>          \ifnum\scratchcounter=\commalistsize
>            \@EA\@EA\@EA\def\@EA\@EA\@EA\sortedcommalist
>            \@EA\@EA\@EA{\@EA\sortedcommalist\@EA,\!!tempa}%
>          \fi
>        \else % old element larger
>          \@EA\def\@EA\newcommalistelement\@EA{\!!tempa,#1}%
>          \replaceincommalist\sortedcommalist\scratchcounter
>          \expandafter\quitcommalist
>        \fi}%
>        \advance\scratchcounter \plusone} % ! ! !
>
> (2) handle n=1 case in:
>
> \def\sortcommalist[#1]#2%
>    {\getcommalistsize[#1]%
>     \ifnum\commalistsize>1
>       \let\sortedcommalist\empty
>       \let\comparecommand#2%
>       \processcommalist[#1]\dosortcommacommand
>     \else
>       \def\sortedcommalist{#1}%
>     \fi}
>
> Hans
> -------------------------------------------------------------------------
>                                    Hans Hagen | PRAGMA ADE | pragma@wxs.nl
>                        Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>   tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
> -------------------------------------------------------------------------
>                         information: http://www.pragma-ade.com/roadmap.pdf
>                      documentation: http://www.pragma-ade.com/showcase.pdf
> -------------------------------------------------------------------------
>
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: bib module/cite (Context bug)
@ 2003-07-12 17:22 Hans Hagen
  2003-07-13 19:49 ` Martin Moncrieffe
  0 siblings, 1 reply; 11+ messages in thread
From: Hans Hagen @ 2003-07-12 17:22 UTC (permalink / raw)


At 15:01 11/07/2003 +0200, Taco Hoekwater wrote:

>Hi Martin, Hans, rest of the group,
>
>It took me a while to track down this bug. It is actually a bug in
>the definition of \sortcommacommand in newer ConTeXt-es.
>
>Minimal example:
>
>\def\mylist{1,2,3}
>\sortcommacommand[\mylist]\donumericcompare
>\message{\sortedcommalist} % reports 1,2 !!

Two patches are needed in syst-ext.tex:

(1) change last line in:

\def\docompareitems#1%
   {\doifnotempty{#1}
      {\@EA\comparecommand\@EA{\!!tempa}{#1}\relax
       \ifnum\comparedresult<2
         \ifnum\scratchcounter=\commalistsize
           \@EA\@EA\@EA\def\@EA\@EA\@EA\sortedcommalist
           \@EA\@EA\@EA{\@EA\sortedcommalist\@EA,\!!tempa}%
         \fi
       \else % old element larger
         \@EA\def\@EA\newcommalistelement\@EA{\!!tempa,#1}%
         \replaceincommalist\sortedcommalist\scratchcounter
         \expandafter\quitcommalist
       \fi}%
       \advance\scratchcounter \plusone} % ! ! !

(2) handle n=1 case in:

\def\sortcommalist[#1]#2%
   {\getcommalistsize[#1]%
    \ifnum\commalistsize>1
      \let\sortedcommalist\empty
      \let\comparecommand#2%
      \processcommalist[#1]\dosortcommacommand
    \else
      \def\sortedcommalist{#1}%
    \fi}

Hans
-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                        information: http://www.pragma-ade.com/roadmap.pdf
                     documentation: http://www.pragma-ade.com/showcase.pdf
-------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2003-07-14  8:27 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-13  5:34 Runtime graphics Pierre VINET
2003-06-14  9:06 ` Hans Hagen
2003-06-15  6:45   ` Pierre VINET
2003-06-15 18:03     ` Hans Hagen
2003-06-16  5:09       ` Pierre VINET
2003-07-01 10:20 ` bib module/cite Martin Moncrieffe
2003-07-11 13:01   ` bib module/cite (Context bug) Taco Hoekwater
2003-07-12 17:22 Hans Hagen
2003-07-13 19:49 ` Martin Moncrieffe
2003-07-14  8:12   ` Taco Hoekwater
2003-07-14  8:27     ` Martin Moncrieffe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).