Hi all, (especially Jens-Uwe) I just started to use the piechartMP package. I have succeeded in producing some quite nice charts using standalone metapost. But I am unable to convert these graphics to pdf via mptopdf, nor can I integrate them into context files. As soon as I try to switch to typesetting the labels using some TeX format, I get errors like 'Unable to make mpx file', or all labels simply show the same text, or... I have experimented with various setups, but I can't really locate the problem, sorry for this imprecise problem description. Can anybody provide me with some setup tips or a working setup? It would of course be best to have the labels typeset by context, respecting the MP environment of the document, but for the moment, a simply working setup would be a good start. Thanks, Eckhart
At 09:39 AM 1/23/2003 +0100, Eckhart Guthöhrlein wrote:
Hi all, (especially Jens-Uwe)
I just started to use the piechartMP package. I have succeeded in producing some quite nice charts using standalone metapost. But I am unable to convert these graphics to pdf via mptopdf, nor can I integrate them into context files. As soon as I try to switch to typesetting the labels using some TeX format, I get errors like 'Unable to make mpx file', or all labels simply show the same text, or... I have experimented with various setups, but I can't really locate the problem, sorry for this imprecise problem description. Can anybody provide me with some setup tips or a working setup? It would of course be best to have the labels typeset by context, respecting the MP environment of the document, but for the moment, a simply working setup would be a good start.
can you prepare a simple example + set of files needed 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 -------------------------------------------------------------------------
On Thursday 23 January 2003 13:19, Hans Hagen wrote:
can you prepare a simple example + set of files needed
attached: pie.mp, extfig.tex, incontext.tex 1. mpost pie.mp works well, graphics can be included as external figure in extfig.tex. 2. mptopdf pie.mp or texexec incontext complains about being unable to produce mpx file As far as I understood the piechartmp manual, the line SetupText(1,this,this); should activate TeX typesetting without changing the default parameters for which TeX to use and which setup commands to execute. Removing this line removes all problems, but of course no more TeX labels... -- Eckhart
At 02:26 PM 1/23/2003 +0100, you wrote:
As far as I understood the piechartmp manual, the line SetupText(1,this,this); should activate TeX typesetting without changing the default parameters for which TeX to use and which setup commands to execute.
Removing this line removes all problems, but of course no more TeX labels...
So, the trick is to overload Setuptext to feed the string into the metafun textext macro 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 -------------------------------------------------------------------------
At 02:26 PM 1/23/2003 +0100, you wrote:
On Thursday 23 January 2003 13:19, Hans Hagen wrote:
can you prepare a simple example + set of files needed
attached: pie.mp, extfig.tex, incontext.tex
1. mpost pie.mp works well, graphics can be included as external figure in extfig.tex.
2. mptopdf pie.mp or texexec incontext complains about being unable to produce mpx file
As far as I understood the piechartmp manual, the line SetupText(1,this,this); should activate TeX typesetting without changing the default parameters for which TeX to use and which setup commands to execute.
The trick is to overload the piechart text handler: \startMPinclusions input piechartmp ; let normal_makeText = _makeText ; vardef _makeText primary s = if pc_Metafun : textext(s) else : normal_makeText(s) fi enddef \stopMPinclusions \forceMPTEXcheck{Segment} \starttext \startMPpage[offset=2pt] SetupText(1,this,this); Segment(1674,"$\sqrt x$",(.8,.0,.0),"16740"); Segment(305.3,"\TeX",(.0,.6,.0),"3053"); Segment(55.2,"help",(.6,.8,.8),"552"); PieChart(6cm,0.1,65,330,0); Label.auto(0)(name)(outwards,0); \stopMPpage \stoptext This produces a piechart with typeset text The force can go into a module, say m-mppie.tex, which also loads the piechart module, say: \appendtoks input piechartmp ; \to \everyMPinitializations \forceMPTEXcheck{Segment} \endinput but the vardef redefiniton can best go into the mp file, if not it can also go into the module, or be one of the options of SetupText 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 -------------------------------------------------------------------------
On Thursday 23 January 2003 15:55, Hans Hagen wrote:
The force can go into a module, say m-mppie.tex, which also loads the piechart module, say:
\appendtoks input piechartmp ; \to \everyMPinitializations
\forceMPTEXcheck{Segment}
\endinput
but the vardef redefiniton can best go into the mp file, if not it can also go into the module, or be one of the options of SetupText
So, Jens-Uwe and you should sort out what to put where, include the module in the distribution and add an adequate section "use with context" in the piechartmp docs. I don't quite understand what exactly happened, but anyway: thank you for the quick help! Eckhart
On Thu, 23 Jan 2003 17:04:32 +0100
Eckhart Guthöhrlein
On Thursday 23 January 2003 15:55, Hans Hagen wrote:
The force can go into a module, say m-mppie.tex, which also loads the piechart module, say:
\appendtoks input piechartmp ; \to \everyMPinitializations
\forceMPTEXcheck{Segment}
\endinput
but the vardef redefiniton can best go into the mp file, if not it can also go into the module, or be one of the options of SetupText
So, Jens-Uwe and you should sort out what to put where, include the module in the distribution and add an adequate section "use with context" in the piechartmp docs.
The next release of piechartMP will provide ConTeXt support. In text-mode 1 (SetupText) it will detect ConTeXt automatically, and will use textext instead of current _makeText. Hans, can you give me a hint how i can test that piechartMP is used "inside" ConTeXt? It is not enough to test for the MetaFun macro/variables, since MetaFun can be used without ConTeXt too. BTW, i would recommend to use piechartMP stand-alone. Currently i'm working on a new release that allows labels to be typeset using ConText. You only have to call MetaPost like: mpost --tex=texexec ... Since this release features a completely rewritten, key-value-based user-interface it needs still some time to update the documentation. The work-around Hans gave in the previous mail will not work with the new release anymore. So please don't change anything in ConTeXt. Jens
On Friday 24 January 2003 16:04, Jens-Uwe Morawski wrote:
BTW, i would recommend to use piechartMP stand-alone.
Hm, this will certainly avoid problems like this and the other one. But I have come to like the tight integration of text and graphics in context, so it appears to me as a drawback.
Since this release features a completely rewritten, key-value-based user-interface it needs still some time to update the documentation.
This sounds good! Eckhart
At 04:04 PM 1/24/2003 +0100, you wrote:
The next release of piechartMP will provide ConTeXt support. In text-mode 1 (SetupText) it will detect ConTeXt automatically, and will use textext instead of current _makeText.
ok
Hans, can you give me a hint how i can test that piechartMP is used "inside" ConTeXt? It is not enough to test for the MetaFun macro/variables, since MetaFun can be used without ConTeXt too.
In what sense? You do check duplicate loading yourself, so where is the test needed for (or: what info do you need from context)?
BTW, i would recommend to use piechartMP stand-alone. Currently i'm working on a new release that allows labels to be typeset using ConText. You only have to call MetaPost like: mpost --tex=texexec ...
or texexec --mptex somefile.mp since it does some testing/cleanup on the mp file.
Since this release features a completely rewritten, key-value-based user-interface it needs still some time to update the documentation.
ok, will you also use a namespace prefix (i saw a variable called K which will probably clash with user vars)
The work-around Hans gave in the previous mail will not work with the new release anymore. So please don't change anything in ConTeXt.
-) if you need a specific kind of support ... [btw, i suppose that you're aware of the fact that you can use cmyk colors and transparencies, think of overlapping pies in transparent colors] 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 -------------------------------------------------------------------------
On Fri, 24 Jan 2003 16:33:22 +0100
Hans Hagen
At 04:04 PM 1/24/2003 +0100, you wrote:
The next release of piechartMP will provide ConTeXt support. In text-mode 1 (SetupText) it will detect ConTeXt automatically, and will use textext instead of current _makeText.
ok
Hans, can you give me a hint how i can test that piechartMP is used "inside" ConTeXt? It is not enough to test for the MetaFun macro/variables, since MetaFun can be used without ConTeXt too.
In what sense? You do check duplicate loading yourself, so where is the test needed for (or: what info do you need from context)?
It should be possible to use MetaFun and piechartMP together in
a stand-alone MP file. In this case piechartMP writes depending
on the TeX-mode (i.e. TeX,LaTeX,ConTeXT) a MP file <jobname>.pct
that will be input again. The file looks like
verbatimtex
BTW, i would recommend to use piechartMP stand-alone. Currently i'm working on a new release that allows labels to be typeset using ConText. You only have to call MetaPost like: mpost --tex=texexec ...
or
texexec --mptex somefile.mp
since it does some testing/cleanup on the mp file.
Does not work. Gives "Unable to make mpx file" message. Will investigate in this later, since the key-value interface troubles me much more.
Since this release features a completely rewritten, key-value-based user-interface it needs still some time to update the documentation.
ok, will you also use a namespace prefix (i saw a variable called K which will probably clash with user vars)
in the new release all internal variables are prefixed with "pc_" and all internal macros have the postfix "_pc".
[btw, i suppose that you're aware of the fact that you can use cmyk colors and transparencies, think of overlapping pies in transparent colors]
I know, but the colors of the outsides of the segments are calculated depending on the observation angle. Currently i don't understand how cmyk-colors are implemented, so i dont know how to deal with. transparencies will be available/used for drop-shadows if MetaFun is loaded. Jens
At 05:56 PM 1/24/2003 +0100, you wrote:
So, is there a variable set in the ConTeXt-MP-file that is _not_ provided by MetaFun?
Ok, i added: string contextversion ; contextversion := "\contextversion" ; Does not work. Gives "Unable to make mpx file" message.
Will investigate in this later, since the key-value interface troubles me much more.
hm, let me know if it keeps failing; (this mpx thing is giving me headaches, esp since it is so silently operating) I know, but the colors of the outsides of the segments are calculated
depending on the observation angle. Currently i don't understand how cmyk-colors are implemented, so i dont know how to deal with.
as other things: special trickery, so color xyz ; xyz = cmyk(1,0,1,0) ; 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 -------------------------------------------------------------------------
On Sun, 26 Jan 2003 21:27:01 +0100
Hans Hagen
At 05:56 PM 1/24/2003 +0100, you wrote:
So, is there a variable set in the ConTeXt-MP-file that is _not_ provided by MetaFun?
Ok, i added:
string contextversion ; contextversion := "\contextversion" ;
Thanks.
I know, but the colors of the outsides of the segments are calculated
depending on the observation angle. Currently i don't understand how cmyk-colors are implemented, so i dont know how to deal with.
as other things: special trickery, so
color xyz ; xyz = cmyk(1,0,1,0) ;
okay, but if the user specifies a color (0,1,0) as a segment-color then piechartMP has no chance to see a difference between (0,1,0) and cmyk(1,0,1,0). Since i have to draw the segment-outsides in the same color-model as the main segment-color is, i need a way to lookup which color-model has been used. An other way is to have a switch that tells piechartMP to always use cmyk-colors. Is there a variable passed to the ConTeXt-MP-file that specifies that cmyk should be used? What function is used for the cmyk-->rgb transformation, so i can re-transform rgb to cmyk? Best, Jens
participants (3)
-
Eckhart Guthöhrlein
-
Hans Hagen
-
Jens-Uwe Morawski