ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* EPS/PDF import and \underbrace in metaplay
@ 2004-08-04 14:07 Mojca Miklavec
  2004-08-04 15:42 ` Vit Zyka
  0 siblings, 1 reply; 5+ messages in thread
From: Mojca Miklavec @ 2004-08-04 14:07 UTC (permalink / raw)


I have two questions cencerning metapost/metaplay:

1.) EPS/PDF import

How do I make an existing EPS or PDF image a part of some other 
meta[post/play] graphic?

2.) \underbrace

I wrote the following two macros for drawing braces in graphics:

\def\underbracedescription#1#2{$\underbrace{\hbox{\vrule width#1 height
0bp}}_{\hbox{\strut #2}}$}
\def\rightbracedescription#1#2{$\displaystyle{\left.\vphantom{\hbox{\vrule
width0bp height#1 depth#1}}\right\}\hbox{\strut #2}}$}

However, the width has to be given manually - it doesn't care about the
actual size of the object it has to be applied to. How is it possible to
give the command some more flexibility?
(say, to be able to simply use 
\underbracedescription{pict}{description}, perhaps even without the need 
of specifying the coordinates explicitly, but)

Thanks a lot,
	Mojca Miklavec

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

* Re: EPS/PDF import and \underbrace in metaplay
  2004-08-04 14:07 EPS/PDF import and \underbrace in metaplay Mojca Miklavec
@ 2004-08-04 15:42 ` Vit Zyka
  2004-08-05 14:29   ` Mojca Miklavec
  0 siblings, 1 reply; 5+ messages in thread
From: Vit Zyka @ 2004-08-04 15:42 UTC (permalink / raw)


Mojca Miklavec wrote:

> 1.) EPS/PDF import
> 
> How do I make an existing EPS or PDF image a part of some other 
> meta[post/play] graphic?

Use externalfigure (Metafun manual, 8.4 Including graphics)

> 2.) \underbrace
> 
> I wrote the following two macros for drawing braces in graphics:
> 
> \def\underbracedescription#1#2{$\underbrace{\hbox{\vrule width#1 height
> 0bp}}_{\hbox{\strut #2}}$}
> \def\rightbracedescription#1#2{$\displaystyle{\left.\vphantom{\hbox{\vrule
> width0bp height#1 depth#1}}\right\}\hbox{\strut #2}}$}
> 
> However, the width has to be given manually - it doesn't care about the

I do not understand what is your desire. But in the case of obtaining 
real dimmensions:
   \setbox0=\hbox{ ... }%
then
   \wd0 is width
   \ht0 is height
   \dp0 is depth
   \box0 or \copy0 give the box contain

Vit Zyka

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

* Re: EPS/PDF import and \underbrace in metaplay
  2004-08-04 15:42 ` Vit Zyka
@ 2004-08-05 14:29   ` Mojca Miklavec
  2004-08-05 14:56     ` Hans Hagen
  2004-08-05 15:03     ` Vit Zyka
  0 siblings, 2 replies; 5+ messages in thread
From: Mojca Miklavec @ 2004-08-05 14:29 UTC (permalink / raw)




Vit Zyka wrote:
> Mojca Miklavec wrote:
> 
>> 1.) EPS/PDF import
>>
>> How do I make an existing EPS or PDF image a part of some other 
>> meta[post/play] graphic?
> 
> Use externalfigure (Metafun manual, 8.4 Including graphics)

Oh, thanks a lot. I was so stupid that I somehow overlooked that it was
a chapter about inclusion of figures in other graphics and not in text,
although I've seen these pages quite a couple of times.

>> 2.) \underbrace
>>
>> I wrote the following two macros for drawing braces in graphics:
>>
>> \def\underbracedescription#1#2{$\underbrace{\hbox{\vrule width#1 height
>> 0bp}}_{\hbox{\strut #2}}$}
>> \def\rightbracedescription#1#2{$\displaystyle{\left.\vphantom{\hbox{\vrule 
>> width0bp height#1 depth#1}}\right\}\hbox{\strut #2}}$}
>>
>> However, the width has to be given manually - it doesn't care about the
> 
> 
> I do not understand what is your desire.

I want to make something like

[start of TeX code]
    \displaystyle{\underbrace{x^2+y^2=z^2}_{\hbox{simple equation}}}
[end of tex code]

except that there has to be a metapost picture instead of "x^2+y^2=z^2"

Or, see page 22 of http://remote.science.uva.nl/~heck/Courses/mptut.pdf.
(The example is made by stretching normal braces, but that's ugly)

> But in the case of obtaining real dimmensions:
>   \setbox0=\hbox{ ... }%

Is it possible to place a graphic inside a \hbox in some btex ... etex
or textext expression? In that case this would help me a lot, otherwise
I'll keep playing with \[something]MP[something].

Thanks again,
	Mojca Miklavec

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

* Re: EPS/PDF import and \underbrace in metaplay
  2004-08-05 14:29   ` Mojca Miklavec
@ 2004-08-05 14:56     ` Hans Hagen
  2004-08-05 15:03     ` Vit Zyka
  1 sibling, 0 replies; 5+ messages in thread
From: Hans Hagen @ 2004-08-05 14:56 UTC (permalink / raw)


Mojca Miklavec wrote:

> Is it possible to place a graphic inside a \hbox in some btex ... etex
> or textext expression? In that case this would help me a lot, otherwise
> I'll keep playing with \[something]MP[something].

no, inside btex/etex only text will be handled; this is a feature/limitation of mp, since the result will become a mp picture

Hans  

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

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

* Re: EPS/PDF import and \underbrace in metaplay
  2004-08-05 14:29   ` Mojca Miklavec
  2004-08-05 14:56     ` Hans Hagen
@ 2004-08-05 15:03     ` Vit Zyka
  1 sibling, 0 replies; 5+ messages in thread
From: Vit Zyka @ 2004-08-05 15:03 UTC (permalink / raw)


> I want to make something like
> 
> [start of TeX code]
>    \displaystyle{\underbrace{x^2+y^2=z^2}_{\hbox{simple equation}}}
> [end of tex code]
> 
> except that there has to be a metapost picture instead of "x^2+y^2=z^2"

I did not test but I see no reason why not to use \...MP...
inside \underbrace, like
   $\underbrace{\hbox{\uniwueMPgraphic[pict]}_{\hbox{simple equation}}$
Is there any problem?

> Is it possible to place a graphic inside a \hbox in some btex ... etex
> or textext expression? In that case this would help me a lot, otherwise

Not. Process is:
1) mpost geterate from btex...etex construction TeX file.
2) tex: tex -> dvi (graphics is as \special)
3) makempx dvi -> mp !! problem how to handle graphics

Vit Zyka

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

end of thread, other threads:[~2004-08-05 15:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-04 14:07 EPS/PDF import and \underbrace in metaplay Mojca Miklavec
2004-08-04 15:42 ` Vit Zyka
2004-08-05 14:29   ` Mojca Miklavec
2004-08-05 14:56     ` Hans Hagen
2004-08-05 15:03     ` Vit Zyka

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).