Hello, I'd need to use the same color for text and drawing inside a MP code. The typical situation looks the following way: ---- \definecolor[COL][.7red] \starttext \startMPcode label(btex \color[COL]{Some text} etex, (0, 0)); color col; col := .7red; draw unitsquare scaled .5cm withcolor col; \stopMPcode \stoptext ---- The problem is that the color must be defined twice - first as TeX's 'COL', later as MP's 'col'. As far as I know, the 'COL' must be defined inside TeX code as colored text in MP is achieved *only* by calling TeX's "btex \a-color-family-command[a-color][some-text] etex". So that's why I think the color must be defined in TeX. But how to access the TeX's color in MP? Thanks in advance. Best regards, Lukas -- Ing. Lukáš Procházka [mailto:LPr@pontex.cz] Pontex s. r. o. [mailto:pontex@pontex.cz] [http://www.pontex.cz] Bezová 1658 147 14 Praha 4 Tel: +420 244 062 238 Fax: +420 244 461 038
Am 05.08.2011 09:07, schrieb Procházka Lukáš Ing. - Pontex s. r. o.:
Hello,
I'd need to use the same color for text and drawing inside a MP code.
The typical situation looks the following way:
---- \definecolor[COL][.7red] \starttext \startMPcode label(btex \color[COL]{Some text} etex, (0, 0)); color col; col := .7red; draw unitsquare scaled .5cm withcolor col; \stopMPcode \stoptext ----
The problem is that the color must be defined twice - first as TeX's 'COL', later as MP's 'col'.
As far as I know, the 'COL' must be defined inside TeX code as colored text in MP is achieved *only* by calling TeX's "btex \a-color-family-command[a-color][some-text] etex".
So that's why I think the color must be defined in TeX.
But how to access the TeX's color in MP?
\MPcolor{tex color name} Best wishes, Peter
Thanks in advance.
Best regards,
Lukas
On 5-8-2011 9:07, Procházka Lukáš Ing. - Pontex s. r. o. wrote:
Hello,
I'd need to use the same color for text and drawing inside a MP code.
The typical situation looks the following way:
---- \definecolor[COL][.7red] \starttext \startMPcode label(btex \color[COL]{Some text} etex, (0, 0)); color col; col := .7red; draw unitsquare scaled .5cm withcolor col; \stopMPcode \stoptext ----
The problem is that the color must be defined twice - first as TeX's 'COL', later as MP's 'col'.
As far as I know, the 'COL' must be defined inside TeX code as colored text in MP is achieved *only* by calling TeX's "btex \a-color-family-command[a-color][some-text] etex".
So that's why I think the color must be defined in TeX.
But how to access the TeX's color in MP?
it's all in the metafun manual and also in example code ... withcolor \MPcolor{COL} ; ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
participants (3)
-
Hans Hagen
-
Peter Rolf
-
Procházka Lukáš Ing. - Pontex s. r. o.