ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* exported figures from DIA to Metapost including in document
@ 2008-11-24 12:28 Jan-Erik Hägglöf
  2008-11-24 14:08 ` Aditya Mahajan
  2008-11-24 14:09 ` Peter Rolf
  0 siblings, 2 replies; 10+ messages in thread
From: Jan-Erik Hägglöf @ 2008-11-24 12:28 UTC (permalink / raw)
  To: ntg-context

[-- Attachment #1: Type: text/plain, Size: 1609 bytes --]

Hi All!

I'm in beginning to write a thesis in physics(undergraduate level) and
one of many things I wanna do is, cause I create much illustrations in
DIA http://www.gnome.org/projects/dia/   
and the program can export to figure.mp, to include these in my
document.

I've read the instructions on http://wiki.contextgarden.net/Mpgraphic

I do not get this working. How is the best way to accomplish this?

The reason is why I want to do in this way is to input tex code in the
figure (especially math and symbol definitions) and optionally place
them in specific places inside the figure. By this method I can even do
better illustrations, hopefully.

My workflow has been like this:

1. Create the desired figure in DIA and choose the export option. TeX
metapost *.mp(see attached file ).

2. Tryed to do inclusion in a TeX-document like this

\startstaticMPfigure{magflux}
  the code in the attached file
\stopstaticMPfigure

\starttext

Here is my figure \usestaticMPfigure[magflux][width=0.8\textwidth]

\stoptext

But it fails with errormessage:

!Paragraph ended before \startstaticMPfigure was complete .....

Should I place part of the code in some definitions?

3. To input textlabels in mathnotation optionally anywhere I want inside
the figure. 

And also do something like

\placefigure[][fig:metapostfigure]{Here is the figure I made in DIA
converted to metapost}{\usestaticMPfigure[magflux][width=0.8\textwidth]}

so it also can be referred to in the text.

All best and thanks in advance!

Janneman



-- 
TeX Engine : LuaTeX

current version: 2008.10.23 17:32

OS : Ubuntu 8.10 Intrepid Ibex

[-- Attachment #2: magfluxdensity.mp --]
[-- Type: text/x-matlab, Size: 13471 bytes --]

% Metapost TeX macro
% Title: /home/djsameman/Dokument/fysikC/uppsats/FysikC15HP/bilder/magfluxdensity.dia
% Creator: Dia v0.96.1
% CreationDate: Mon Nov 24 13:07:01 2008
% For: djsameman


beginfig(1);
verbatimtex
%&latex
\documentclass{minimal}
\begin{document}
etex
% Define macro for horizontal centering.
vardef hcentered primary P =
  P shifted -(xpart center P, 0)
enddef;
% Define macro for right justification.
vardef rjust primary P =
  P shifted -(xpart (lrcorner P - llcorner P), 0)
enddef;
  % picture(3.815239,-25.950081)(46.421315,6.984149)
  x = 1.000000cm; y = -1.000000cm;

  t = 1.000000;

% set_line_color 0.000000, 0.000000, 0.000000
% set_line_color 1.000000, 1.000000, 1.000000
% set_linewidth 0.100000
  path p;
  p = (15.400000x,5.150000y)--(15.400000x,22.900000y)--(46.100000x,22.900000y)--(46.100000x,5.150000y)--cycle;
  fill p withcolor (1.000000,1.000000,1.000000);
%metapost_arc
% center->x = 15.400000% center->y = 5.150000% width = 0.000000% height = 0.000000% angle1 = 90.000000% angle2 = 180.000000% set_line_color 1.000000, 1.000000, 1.000000
  draw (15.400000x,5.150000y)..(15.400000x,5.150000y)..(15.400000x,5.150000y)
    withpen pencircle scaled 0.1000x
    withcolor (1.0000, 1.0000, 1.0000);
%metapost_arc
% center->x = 46.100000% center->y = 5.150000% width = 0.000000% height = 0.000000% angle1 = 0.000000% angle2 = 90.000000% set_line_color 1.000000, 1.000000, 1.000000
  draw (46.100000x,5.150000y)..(46.100000x,5.150000y)..(46.100000x,5.150000y)
    withpen pencircle scaled 0.1000x
    withcolor (1.0000, 1.0000, 1.0000);
  path p;
  p = (15.400000x,5.150000y)--(15.400000x,22.900000y)--(46.100000x,22.900000y)--(46.100000x,5.150000y)--cycle;
  fill p withcolor (1.000000,1.000000,1.000000);
%metapost_arc
% center->x = 15.400000% center->y = 22.900000% width = 0.000000% height = 0.000000% angle1 = 180.000000% angle2 = 270.000000% set_line_color 1.000000, 1.000000, 1.000000
  draw (15.400000x,22.900000y)..(15.400000x,22.900000y)..(15.400000x,22.900000y)
    withpen pencircle scaled 0.1000x
    withcolor (1.0000, 1.0000, 1.0000);
%metapost_arc
% center->x = 46.100000% center->y = 22.900000% width = 0.000000% height = 0.000000% angle1 = 270.000000% angle2 = 360.000000% set_line_color 1.000000, 1.000000, 1.000000
  draw (46.100000x,22.900000y)..(46.100000x,22.900000y)..(46.100000x,22.900000y)
    withpen pencircle scaled 0.1000x
    withcolor (1.0000, 1.0000, 1.0000);
% set_line_color 0.000000, 0.000000, 0.000000
  draw (15.400000x,5.150000y)--(46.100000x,5.150000y)
    withpen pencircle scaled 0.1000x;
% set_line_color 0.000000, 0.000000, 0.000000
  draw (15.400000x,22.900000y)--(46.100000x,22.900000y)
    withpen pencircle scaled 0.1000x;
%metapost_arc
% center->x = 15.400000% center->y = 5.150000% width = 0.000000% height = 0.000000% angle1 = 90.000000% angle2 = 180.000000% set_line_color 0.000000, 0.000000, 0.000000
  draw (15.400000x,5.150000y)..(15.400000x,5.150000y)..(15.400000x,5.150000y)
    withpen pencircle scaled 0.1000x;
%metapost_arc
% center->x = 46.100000% center->y = 5.150000% width = 0.000000% height = 0.000000% angle1 = 0.000000% angle2 = 90.000000% set_line_color 0.000000, 0.000000, 0.000000
  draw (46.100000x,5.150000y)..(46.100000x,5.150000y)..(46.100000x,5.150000y)
    withpen pencircle scaled 0.1000x;
% set_line_color 0.000000, 0.000000, 0.000000
  draw (15.400000x,5.150000y)--(15.400000x,22.900000y)
    withpen pencircle scaled 0.1000x;
% set_line_color 0.000000, 0.000000, 0.000000
  draw (46.100000x,5.150000y)--(46.100000x,22.900000y)
    withpen pencircle scaled 0.1000x;
%metapost_arc
% center->x = 15.400000% center->y = 22.900000% width = 0.000000% height = 0.000000% angle1 = 180.000000% angle2 = 270.000000% set_line_color 0.000000, 0.000000, 0.000000
  draw (15.400000x,22.900000y)..(15.400000x,22.900000y)..(15.400000x,22.900000y)
    withpen pencircle scaled 0.1000x;
%metapost_arc
% center->x = 46.100000% center->y = 22.900000% width = 0.000000% height = 0.000000% angle1 = 270.000000% angle2 = 360.000000% set_line_color 0.000000, 0.000000, 0.000000
  draw (46.100000x,22.900000y)..(46.100000x,22.900000y)..(46.100000x,22.900000y)
    withpen pencircle scaled 0.1000x;
% set_linewidth 0.100000
% set_line_color 1.000000, 1.000000, 1.000000
% fill_polygon
  path p;
  p = (9.950000x,1.150000y)--(40.000000x,1.050000y)--(46.250000x,5.050000y)--(15.450000x,5.000000y)--cycle;
  fill p 
    withpen pencircle scaled 0.1000x
    withcolor (1.0000, 1.0000, 1.0000);
% set_line_color 0.000000, 0.000000, 0.000000
  draw (9.950000x,1.150000y)--(40.000000x,1.050000y)--(46.250000x,5.050000y)--(15.450000x,5.000000y)--cycle
    withpen pencircle scaled 0.1000x;
% set_linewidth 0.100000
% set_line_color 0.749020, 0.749020, 0.749020
% fill_polygon
  path p;
  p = (10.000000x,1.100000y)--(15.350000x,4.950000y)--(15.450000x,22.850000y)--(10.050000x,18.800000y)--cycle;
  fill p 
    withpen pencircle scaled 0.1000x
    withcolor (0.7490, 0.7490, 0.7490);
% set_line_color 0.000000, 0.000000, 0.000000
  draw (10.000000x,1.100000y)--(15.350000x,4.950000y)--(15.450000x,22.850000y)--(10.050000x,18.800000y)--cycle
    withpen pencircle scaled 0.1000x;
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (10.000000x,18.800000y)--(40.000000x,18.850000y)
    withpen pencircle scaled 0.1000x
    dashed dashpattern (on 0.050000x off 0.050000x);
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (40.000000x,1.200000y)--(39.950000x,18.700000y)
    withpen pencircle scaled 0.1000x
    dashed dashpattern (on 0.050000x off 0.050000x);
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (39.950000x,18.800000y)--(46.100000x,22.800000y)
    withpen pencircle scaled 0.1000x
    dashed dashpattern (on 0.050000x off 0.050000x);
  path p;
  p = (19.100000x,20.000000y)..(18.600000x,20.500000y)..(18.100000x,20.000000y)..(18.600000x,19.500000y)..cycle;
  fill p withcolor (1.000000,1.000000,1.000000);
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (19.100000x,20.000000y)..(18.600000x,20.500000y)..(18.100000x,20.000000y)..(18.600000x,19.500000y)..cycle
    withpen pencircle scaled 0.1000x;
  path p;
  p = (17.000000x,3.150000y)..(16.500000x,3.650000y)..(16.000000x,3.150000y)..(16.500000x,2.650000y)..cycle;
  fill p withcolor (1.000000,1.000000,1.000000);
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (17.000000x,3.150000y)..(16.500000x,3.650000y)..(16.000000x,3.150000y)..(16.500000x,2.650000y)..cycle
    withpen pencircle scaled 0.1000x;
  path p;
  p = (34.500000x,4.100000y)..(34.000000x,4.600000y)..(33.500000x,4.100000y)..(34.000000x,3.600000y)..cycle;
  fill p withcolor (1.000000,1.000000,1.000000);
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (34.500000x,4.100000y)..(34.000000x,4.600000y)..(33.500000x,4.100000y)..(34.000000x,3.600000y)..cycle
    withpen pencircle scaled 0.1000x;
  path p;
  p = (23.600100x,6.975000y)..(23.100100x,7.475000y)..(22.600100x,6.975000y)..(23.100100x,6.475000y)..cycle;
  fill p withcolor (1.000000,1.000000,1.000000);
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (23.600100x,6.975000y)..(23.100100x,7.475000y)..(22.600100x,6.975000y)..(23.100100x,6.475000y)..cycle
    withpen pencircle scaled 0.1000x;
  path p;
  p = (20.590000x,12.350000y)..(20.090000x,12.850000y)..(19.590000x,12.350000y)..(20.090000x,11.850000y)..cycle;
  fill p withcolor (1.000000,1.000000,1.000000);
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (20.590000x,12.350000y)..(20.090000x,12.850000y)..(19.590000x,12.350000y)..(20.090000x,11.850000y)..cycle
    withpen pencircle scaled 0.1000x;
  path p;
  p = (28.225000x,12.000000y)..(27.725000x,12.500000y)..(27.225000x,12.000000y)..(27.725000x,11.500000y)..cycle;
  fill p withcolor (1.000000,1.000000,1.000000);
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (28.225000x,12.000000y)..(27.725000x,12.500000y)..(27.225000x,12.000000y)..(27.725000x,11.500000y)..cycle
    withpen pencircle scaled 0.1000x;
  path p;
  p = (27.850000x,16.250000y)..(27.350000x,16.750000y)..(26.850000x,16.250000y)..(27.350000x,15.750000y)..cycle;
  fill p withcolor (1.000000,1.000000,1.000000);
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (27.850000x,16.250000y)..(27.350000x,16.750000y)..(26.850000x,16.250000y)..(27.350000x,15.750000y)..cycle
    withpen pencircle scaled 0.1000x;
  path p;
  p = (35.245000x,21.200000y)..(34.745000x,21.700000y)..(34.245000x,21.200000y)..(34.745000x,20.700000y)..cycle;
  fill p withcolor (1.000000,1.000000,1.000000);
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (35.245000x,21.200000y)..(34.745000x,21.700000y)..(34.245000x,21.200000y)..(34.745000x,20.700000y)..cycle
    withpen pencircle scaled 0.1000x;
  path p;
  p = (39.300000x,16.050000y)..(38.800000x,16.550000y)..(38.300000x,16.050000y)..(38.800000x,15.550000y)..cycle;
  fill p withcolor (1.000000,1.000000,1.000000);
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (39.300000x,16.050000y)..(38.800000x,16.550000y)..(38.300000x,16.050000y)..(38.800000x,15.550000y)..cycle
    withpen pencircle scaled 0.1000x;
  path p;
  p = (44.550000x,16.500000y)..(44.050000x,17.000000y)..(43.550000x,16.500000y)..(44.050000x,16.000000y)..cycle;
  fill p withcolor (1.000000,1.000000,1.000000);
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (44.550000x,16.500000y)..(44.050000x,17.000000y)..(43.550000x,16.500000y)..(44.050000x,16.000000y)..cycle
    withpen pencircle scaled 0.1000x;
  path p;
  p = (35.250100x,9.625000y)..(34.750100x,10.125000y)..(34.250100x,9.625000y)..(34.750100x,9.125000y)..cycle;
  fill p withcolor (1.000000,1.000000,1.000000);
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (35.250100x,9.625000y)..(34.750100x,10.125000y)..(34.250100x,9.625000y)..(34.750100x,9.125000y)..cycle
    withpen pencircle scaled 0.1000x;
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (33.600100x,22.850000y)--(21.805237x,-2.533529y)
    withpen pencircle scaled 0.1000x;
% set_line_color 0.000000, 0.000000, 0.000000
% fill_polygon
  path p;
  p = (21.647213x,-2.873608y)--(22.084630x,-2.525518y)--(21.805237x,-2.533529y)--(21.631192x,-2.314821y)--cycle;
  fill p 
    withpen pencircle scaled 0.1000x;
% set_line_color 0.000000, 0.000000, 0.000000
  draw (21.647213x,-2.873608y)--(22.084630x,-2.525518y)--(21.805237x,-2.533529y)--(21.631192x,-2.314821y)--cycle
    withpen pencircle scaled 0.1000x;
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (45.900100x,25.500000y)--(15.936903x,25.450799y)
    withpen pencircle scaled 0.1000x;
% set_line_color 0.000000, 0.000000, 0.000000
% fill_polygon
  path p;
  p = (15.561903x,25.450184y)--(16.062313x,25.201005y)--(15.936903x,25.450799y)--(16.061492x,25.701004y)--cycle;
  fill p 
    withpen pencircle scaled 0.1000x;
% set_line_color 0.000000, 0.000000, 0.000000
  draw (15.561903x,25.450184y)--(16.062313x,25.201005y)--(15.936903x,25.450799y)--(16.061492x,25.701004y)--cycle
    withpen pencircle scaled 0.1000x;
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (15.350100x,23.300000y)--(15.350100x,25.550000y)
    withpen pencircle scaled 0.1000x;
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (46.035100x,23.150000y)--(46.035100x,25.400000y)
    withpen pencircle scaled 0.1000x;
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (12.700100x,12.175000y)--(5.036903x,12.175000y)
    withpen pencircle scaled 0.1000x;
% set_line_color 0.000000, 0.000000, 0.000000
% fill_polygon
  path p;
  p = (4.661903x,12.175000y)--(5.161903x,11.925000y)--(5.036903x,12.175000y)--(5.161903x,12.425000y)--cycle;
  fill p 
    withpen pencircle scaled 0.1000x;
% set_line_color 0.000000, 0.000000, 0.000000
  draw (4.661903x,12.175000y)--(5.161903x,11.925000y)--(5.036903x,12.175000y)--(5.161903x,12.425000y)--cycle
    withpen pencircle scaled 0.1000x;
% set_linewidth 0.050000
%metapost_arc
% center->x = 16.044451% center->y = 29.643274% width = 29.161250% height = 29.161250% angle1 = 104.068771% angle2 = 146.755563% set_line_color 0.000000, 0.000000, 0.000000
  draw (12.500100x,15.500000y)..(7.595646x,17.759995y)..(3.850100x,21.650000y)
    withpen pencircle scaled 0.0500x;
% set_linewidth 0.050000
%metapost_arc
% center->x = 46.858720% center->y = 3.886073% width = 25.384589% height = 25.384589% angle1 = 121.377854% angle2 = 178.640130% set_line_color 0.000000, 0.000000, 0.000000
  draw (40.250100x,-6.950000y)..(35.865875x,-2.458349y)..(34.170000x,3.584860y)
    withpen pencircle scaled 0.0500x;
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (14.350100x,24.250000y)--(7.786891x,24.203452y)
    withpen pencircle scaled 0.1000x;
% set_line_color 0.000000, 0.000000, 0.000000
% fill_polygon
  path p;
  p = (7.411901x,24.200793y)--(7.913661x,23.954345y)--(7.786891x,24.203452y)--(7.910115x,24.454333y)--cycle;
  fill p 
    withpen pencircle scaled 0.1000x;
% set_line_color 0.000000, 0.000000, 0.000000
  draw (7.411901x,24.200793y)--(7.913661x,23.954345y)--(7.786891x,24.203452y)--(7.910115x,24.454333y)--cycle
    withpen pencircle scaled 0.1000x;
endfig;
end;

[-- Attachment #3: Type: text/plain, Size: 487 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: exported figures from DIA to Metapost including in document
  2008-11-24 12:28 exported figures from DIA to Metapost including in document Jan-Erik Hägglöf
@ 2008-11-24 14:08 ` Aditya Mahajan
  2008-11-24 15:20   ` Jan-Erik Hägglöf
  2008-11-24 14:09 ` Peter Rolf
  1 sibling, 1 reply; 10+ messages in thread
From: Aditya Mahajan @ 2008-11-24 14:08 UTC (permalink / raw)
  To: janerik.hagglof, mailing list for ConTeXt users

[-- Attachment #1: Type: TEXT/PLAIN, Size: 2108 bytes --]

On Mon, 24 Nov 2008, Jan-Erik Hägglöf wrote:

> Hi All!
>
> I'm in beginning to write a thesis in physics(undergraduate level) and
> one of many things I wanna do is, cause I create much illustrations in
> DIA http://www.gnome.org/projects/dia/
> and the program can export to figure.mp, to include these in my
> document.
>
> I've read the instructions on http://wiki.contextgarden.net/Mpgraphic
>
> I do not get this working. How is the best way to accomplish this?

See the attached file. Dia exports the figure with
verbatimtex
&latex
etex

which tells metapost to run labels through latex. I guess that this is 
what causes the errors. If you simply remove some of the boiler plate, the 
figure compiles fine (see attached file)

> The reason is why I want to do in this way is to input tex code in the
> figure (especially math and symbol definitions) and optionally place
> them in specific places inside the figure. By this method I can even do
> better illustrations, hopefully.
>
> My workflow has been like this:
>
> 1. Create the desired figure in DIA and choose the export option. TeX
> metapost *.mp(see attached file ).
>
> 2. Tryed to do inclusion in a TeX-document like this
>
> \startstaticMPfigure{magflux}
>  the code in the attached file
> \stopstaticMPfigure
>
> \starttext
>
> Here is my figure \usestaticMPfigure[magflux][width=0.8\textwidth]
>
> \stoptext
>
> But it fails with errormessage:
>
> !Paragraph ended before \startstaticMPfigure was complete .....
>
> Should I place part of the code in some definitions?

I do not get this error, but staticMPfigure is not working for me. I would 
recomment not to use staticMPfigure, rather use useMPfigure.

(I had asked Hans for staticMPfigure a few years ago when TeX-MP 
interaction was slow. Now, with MPLib I do not think that we need the 
staticMPfigure mechanism. Personally, I haven't used it for a while)

I also had to add

save x, y, t, p ; %%%% Added this line

to include the figure multiple times (or to include multiple figures, I 
would imagine).

Aditya

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: TEXT/x-tex; name=dia.tex, Size: 13654 bytes --]

\startuseMPgraphic{mag}
% Define macro for horizontal centering.
vardef hcentered primary P =
  P shifted -(xpart center P, 0)
enddef;
% Define macro for right justification.
vardef rjust primary P =
  P shifted -(xpart (lrcorner P - llcorner P), 0)
enddef;
  save x, y, t, p ; %%%% Added this line

  % picture(3.815239,-25.950081)(46.421315,6.984149)
  x = 1.000000cm; y = -1.000000cm;

  t = 1.000000;

% set_line_color 0.000000, 0.000000, 0.000000
% set_line_color 1.000000, 1.000000, 1.000000
% set_linewidth 0.100000
  path p;
  p = (15.400000x,5.150000y)--(15.400000x,22.900000y)--(46.100000x,22.900000y)--(46.100000x,5.150000y)--cycle;
  fill p withcolor (1.000000,1.000000,1.000000);
%metapost_arc
% center->x = 15.400000% center->y = 5.150000% width = 0.000000% height = 0.000000% angle1 = 90.000000% angle2 = 180.000000% set_line_color 1.000000, 1.000000, 1.000000
  draw (15.400000x,5.150000y)..(15.400000x,5.150000y)..(15.400000x,5.150000y)
    withpen pencircle scaled 0.1000x
    withcolor (1.0000, 1.0000, 1.0000);
%metapost_arc
% center->x = 46.100000% center->y = 5.150000% width = 0.000000% height = 0.000000% angle1 = 0.000000% angle2 = 90.000000% set_line_color 1.000000, 1.000000, 1.000000
  draw (46.100000x,5.150000y)..(46.100000x,5.150000y)..(46.100000x,5.150000y)
    withpen pencircle scaled 0.1000x
    withcolor (1.0000, 1.0000, 1.0000);
  path p;
  p = (15.400000x,5.150000y)--(15.400000x,22.900000y)--(46.100000x,22.900000y)--(46.100000x,5.150000y)--cycle;
  fill p withcolor (1.000000,1.000000,1.000000);
%metapost_arc
% center->x = 15.400000% center->y = 22.900000% width = 0.000000% height = 0.000000% angle1 = 180.000000% angle2 = 270.000000% set_line_color 1.000000, 1.000000, 1.000000
  draw (15.400000x,22.900000y)..(15.400000x,22.900000y)..(15.400000x,22.900000y)
    withpen pencircle scaled 0.1000x
    withcolor (1.0000, 1.0000, 1.0000);
%metapost_arc
% center->x = 46.100000% center->y = 22.900000% width = 0.000000% height = 0.000000% angle1 = 270.000000% angle2 = 360.000000% set_line_color 1.000000, 1.000000, 1.000000
  draw (46.100000x,22.900000y)..(46.100000x,22.900000y)..(46.100000x,22.900000y)
    withpen pencircle scaled 0.1000x
    withcolor (1.0000, 1.0000, 1.0000);
% set_line_color 0.000000, 0.000000, 0.000000
  draw (15.400000x,5.150000y)--(46.100000x,5.150000y)
    withpen pencircle scaled 0.1000x;
% set_line_color 0.000000, 0.000000, 0.000000
  draw (15.400000x,22.900000y)--(46.100000x,22.900000y)
    withpen pencircle scaled 0.1000x;
%metapost_arc
% center->x = 15.400000% center->y = 5.150000% width = 0.000000% height = 0.000000% angle1 = 90.000000% angle2 = 180.000000% set_line_color 0.000000, 0.000000, 0.000000
  draw (15.400000x,5.150000y)..(15.400000x,5.150000y)..(15.400000x,5.150000y)
    withpen pencircle scaled 0.1000x;
%metapost_arc
% center->x = 46.100000% center->y = 5.150000% width = 0.000000% height = 0.000000% angle1 = 0.000000% angle2 = 90.000000% set_line_color 0.000000, 0.000000, 0.000000
  draw (46.100000x,5.150000y)..(46.100000x,5.150000y)..(46.100000x,5.150000y)
    withpen pencircle scaled 0.1000x;
% set_line_color 0.000000, 0.000000, 0.000000
  draw (15.400000x,5.150000y)--(15.400000x,22.900000y)
    withpen pencircle scaled 0.1000x;
% set_line_color 0.000000, 0.000000, 0.000000
  draw (46.100000x,5.150000y)--(46.100000x,22.900000y)
    withpen pencircle scaled 0.1000x;
%metapost_arc
% center->x = 15.400000% center->y = 22.900000% width = 0.000000% height = 0.000000% angle1 = 180.000000% angle2 = 270.000000% set_line_color 0.000000, 0.000000, 0.000000
  draw (15.400000x,22.900000y)..(15.400000x,22.900000y)..(15.400000x,22.900000y)
    withpen pencircle scaled 0.1000x;
%metapost_arc
% center->x = 46.100000% center->y = 22.900000% width = 0.000000% height = 0.000000% angle1 = 270.000000% angle2 = 360.000000% set_line_color 0.000000, 0.000000, 0.000000
  draw (46.100000x,22.900000y)..(46.100000x,22.900000y)..(46.100000x,22.900000y)
    withpen pencircle scaled 0.1000x;
% set_linewidth 0.100000
% set_line_color 1.000000, 1.000000, 1.000000
% fill_polygon
  path p;
  p = (9.950000x,1.150000y)--(40.000000x,1.050000y)--(46.250000x,5.050000y)--(15.450000x,5.000000y)--cycle;
  fill p 
    withpen pencircle scaled 0.1000x
    withcolor (1.0000, 1.0000, 1.0000);
% set_line_color 0.000000, 0.000000, 0.000000
  draw (9.950000x,1.150000y)--(40.000000x,1.050000y)--(46.250000x,5.050000y)--(15.450000x,5.000000y)--cycle
    withpen pencircle scaled 0.1000x;
% set_linewidth 0.100000
% set_line_color 0.749020, 0.749020, 0.749020
% fill_polygon
  path p;
  p = (10.000000x,1.100000y)--(15.350000x,4.950000y)--(15.450000x,22.850000y)--(10.050000x,18.800000y)--cycle;
  fill p 
    withpen pencircle scaled 0.1000x
    withcolor (0.7490, 0.7490, 0.7490);
% set_line_color 0.000000, 0.000000, 0.000000
  draw (10.000000x,1.100000y)--(15.350000x,4.950000y)--(15.450000x,22.850000y)--(10.050000x,18.800000y)--cycle
    withpen pencircle scaled 0.1000x;
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (10.000000x,18.800000y)--(40.000000x,18.850000y)
    withpen pencircle scaled 0.1000x
    dashed dashpattern (on 0.050000x off 0.050000x);
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (40.000000x,1.200000y)--(39.950000x,18.700000y)
    withpen pencircle scaled 0.1000x
    dashed dashpattern (on 0.050000x off 0.050000x);
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (39.950000x,18.800000y)--(46.100000x,22.800000y)
    withpen pencircle scaled 0.1000x
    dashed dashpattern (on 0.050000x off 0.050000x);
  path p;
  p = (19.100000x,20.000000y)..(18.600000x,20.500000y)..(18.100000x,20.000000y)..(18.600000x,19.500000y)..cycle;
  fill p withcolor (1.000000,1.000000,1.000000);
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (19.100000x,20.000000y)..(18.600000x,20.500000y)..(18.100000x,20.000000y)..(18.600000x,19.500000y)..cycle
    withpen pencircle scaled 0.1000x;
  path p;
  p = (17.000000x,3.150000y)..(16.500000x,3.650000y)..(16.000000x,3.150000y)..(16.500000x,2.650000y)..cycle;
  fill p withcolor (1.000000,1.000000,1.000000);
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (17.000000x,3.150000y)..(16.500000x,3.650000y)..(16.000000x,3.150000y)..(16.500000x,2.650000y)..cycle
    withpen pencircle scaled 0.1000x;
  path p;
  p = (34.500000x,4.100000y)..(34.000000x,4.600000y)..(33.500000x,4.100000y)..(34.000000x,3.600000y)..cycle;
  fill p withcolor (1.000000,1.000000,1.000000);
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (34.500000x,4.100000y)..(34.000000x,4.600000y)..(33.500000x,4.100000y)..(34.000000x,3.600000y)..cycle
    withpen pencircle scaled 0.1000x;
  path p;
  p = (23.600100x,6.975000y)..(23.100100x,7.475000y)..(22.600100x,6.975000y)..(23.100100x,6.475000y)..cycle;
  fill p withcolor (1.000000,1.000000,1.000000);
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (23.600100x,6.975000y)..(23.100100x,7.475000y)..(22.600100x,6.975000y)..(23.100100x,6.475000y)..cycle
    withpen pencircle scaled 0.1000x;
  path p;
  p = (20.590000x,12.350000y)..(20.090000x,12.850000y)..(19.590000x,12.350000y)..(20.090000x,11.850000y)..cycle;
  fill p withcolor (1.000000,1.000000,1.000000);
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (20.590000x,12.350000y)..(20.090000x,12.850000y)..(19.590000x,12.350000y)..(20.090000x,11.850000y)..cycle
    withpen pencircle scaled 0.1000x;
  path p;
  p = (28.225000x,12.000000y)..(27.725000x,12.500000y)..(27.225000x,12.000000y)..(27.725000x,11.500000y)..cycle;
  fill p withcolor (1.000000,1.000000,1.000000);
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (28.225000x,12.000000y)..(27.725000x,12.500000y)..(27.225000x,12.000000y)..(27.725000x,11.500000y)..cycle
    withpen pencircle scaled 0.1000x;
  path p;
  p = (27.850000x,16.250000y)..(27.350000x,16.750000y)..(26.850000x,16.250000y)..(27.350000x,15.750000y)..cycle;
  fill p withcolor (1.000000,1.000000,1.000000);
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (27.850000x,16.250000y)..(27.350000x,16.750000y)..(26.850000x,16.250000y)..(27.350000x,15.750000y)..cycle
    withpen pencircle scaled 0.1000x;
  path p;
  p = (35.245000x,21.200000y)..(34.745000x,21.700000y)..(34.245000x,21.200000y)..(34.745000x,20.700000y)..cycle;
  fill p withcolor (1.000000,1.000000,1.000000);
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (35.245000x,21.200000y)..(34.745000x,21.700000y)..(34.245000x,21.200000y)..(34.745000x,20.700000y)..cycle
    withpen pencircle scaled 0.1000x;
  path p;
  p = (39.300000x,16.050000y)..(38.800000x,16.550000y)..(38.300000x,16.050000y)..(38.800000x,15.550000y)..cycle;
  fill p withcolor (1.000000,1.000000,1.000000);
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (39.300000x,16.050000y)..(38.800000x,16.550000y)..(38.300000x,16.050000y)..(38.800000x,15.550000y)..cycle
    withpen pencircle scaled 0.1000x;
  path p;
  p = (44.550000x,16.500000y)..(44.050000x,17.000000y)..(43.550000x,16.500000y)..(44.050000x,16.000000y)..cycle;
  fill p withcolor (1.000000,1.000000,1.000000);
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (44.550000x,16.500000y)..(44.050000x,17.000000y)..(43.550000x,16.500000y)..(44.050000x,16.000000y)..cycle
    withpen pencircle scaled 0.1000x;
  path p;
  p = (35.250100x,9.625000y)..(34.750100x,10.125000y)..(34.250100x,9.625000y)..(34.750100x,9.125000y)..cycle;
  fill p withcolor (1.000000,1.000000,1.000000);
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (35.250100x,9.625000y)..(34.750100x,10.125000y)..(34.250100x,9.625000y)..(34.750100x,9.125000y)..cycle
    withpen pencircle scaled 0.1000x;
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (33.600100x,22.850000y)--(21.805237x,-2.533529y)
    withpen pencircle scaled 0.1000x;
% set_line_color 0.000000, 0.000000, 0.000000
% fill_polygon
  path p;
  p = (21.647213x,-2.873608y)--(22.084630x,-2.525518y)--(21.805237x,-2.533529y)--(21.631192x,-2.314821y)--cycle;
  fill p 
    withpen pencircle scaled 0.1000x;
% set_line_color 0.000000, 0.000000, 0.000000
  draw (21.647213x,-2.873608y)--(22.084630x,-2.525518y)--(21.805237x,-2.533529y)--(21.631192x,-2.314821y)--cycle
    withpen pencircle scaled 0.1000x;
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (45.900100x,25.500000y)--(15.936903x,25.450799y)
    withpen pencircle scaled 0.1000x;
% set_line_color 0.000000, 0.000000, 0.000000
% fill_polygon
  path p;
  p = (15.561903x,25.450184y)--(16.062313x,25.201005y)--(15.936903x,25.450799y)--(16.061492x,25.701004y)--cycle;
  fill p 
    withpen pencircle scaled 0.1000x;
% set_line_color 0.000000, 0.000000, 0.000000
  draw (15.561903x,25.450184y)--(16.062313x,25.201005y)--(15.936903x,25.450799y)--(16.061492x,25.701004y)--cycle
    withpen pencircle scaled 0.1000x;
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (15.350100x,23.300000y)--(15.350100x,25.550000y)
    withpen pencircle scaled 0.1000x;
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (46.035100x,23.150000y)--(46.035100x,25.400000y)
    withpen pencircle scaled 0.1000x;
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (12.700100x,12.175000y)--(5.036903x,12.175000y)
    withpen pencircle scaled 0.1000x;
% set_line_color 0.000000, 0.000000, 0.000000
% fill_polygon
  path p;
  p = (4.661903x,12.175000y)--(5.161903x,11.925000y)--(5.036903x,12.175000y)--(5.161903x,12.425000y)--cycle;
  fill p 
    withpen pencircle scaled 0.1000x;
% set_line_color 0.000000, 0.000000, 0.000000
  draw (4.661903x,12.175000y)--(5.161903x,11.925000y)--(5.036903x,12.175000y)--(5.161903x,12.425000y)--cycle
    withpen pencircle scaled 0.1000x;
% set_linewidth 0.050000
%metapost_arc
% center->x = 16.044451% center->y = 29.643274% width = 29.161250% height = 29.161250% angle1 = 104.068771% angle2 = 146.755563% set_line_color 0.000000, 0.000000, 0.000000
  draw (12.500100x,15.500000y)..(7.595646x,17.759995y)..(3.850100x,21.650000y)
    withpen pencircle scaled 0.0500x;
% set_linewidth 0.050000
%metapost_arc
% center->x = 46.858720% center->y = 3.886073% width = 25.384589% height = 25.384589% angle1 = 121.377854% angle2 = 178.640130% set_line_color 0.000000, 0.000000, 0.000000
  draw (40.250100x,-6.950000y)..(35.865875x,-2.458349y)..(34.170000x,3.584860y)
    withpen pencircle scaled 0.0500x;
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (14.350100x,24.250000y)--(7.786891x,24.203452y)
    withpen pencircle scaled 0.1000x;
% set_line_color 0.000000, 0.000000, 0.000000
% fill_polygon
  path p;
  p = (7.411901x,24.200793y)--(7.913661x,23.954345y)--(7.786891x,24.203452y)--(7.910115x,24.454333y)--cycle;
  fill p 
    withpen pencircle scaled 0.1000x;
% set_line_color 0.000000, 0.000000, 0.000000
  draw (7.411901x,24.200793y)--(7.913661x,23.954345y)--(7.786891x,24.203452y)--(7.910115x,24.454333y)--cycle
    withpen pencircle scaled 0.1000x;

\stopuseMPgraphic

\starttext

\scale[width=\textwidth]{\useMPgraphic{mag}}
\scale[width=\textwidth]{\useMPgraphic{mag}}

\stoptext

[-- Attachment #3: Type: text/plain, Size: 487 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: exported figures from DIA to Metapost including in document
  2008-11-24 12:28 exported figures from DIA to Metapost including in document Jan-Erik Hägglöf
  2008-11-24 14:08 ` Aditya Mahajan
@ 2008-11-24 14:09 ` Peter Rolf
  1 sibling, 0 replies; 10+ messages in thread
From: Peter Rolf @ 2008-11-24 14:09 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi Jan-Erik,

Jan-Erik Hägglöf schrieb:
> Hi All!
> 
> I'm in beginning to write a thesis in physics(undergraduate level) and
> one of many things I wanna do is, cause I create much illustrations in
> DIA http://www.gnome.org/projects/dia/   
> and the program can export to figure.mp, to include these in my
> document.
> 
> I've read the instructions on http://wiki.contextgarden.net/Mpgraphic
> 
> I do not get this working. How is the best way to accomplish this?
> 
> The reason is why I want to do in this way is to input tex code in the
> figure (especially math and symbol definitions) and optionally place
> them in specific places inside the figure. By this method I can even do
> better illustrations, hopefully.
> 
> My workflow has been like this:
> 
> 1. Create the desired figure in DIA and choose the export option. TeX
> metapost *.mp(see attached file ).
>
1.1 remove all latex related code from the mp file

verbatimtex
%&latex
\documentclass{minimal}
\begin{document}
etex

> 2. Tryed to do inclusion in a TeX-document like this
> 
> \startstaticMPfigure{magflux}
>   the code in the attached file
    \input magfluxdensity.mp
> \stopstaticMPfigure
> 
> \starttext
> 
> Here is my figure \usestaticMPfigure[magflux][width=0.8\textwidth]
> 
> \stoptext
> 
> But it fails with errormessage:
> 
> !Paragraph ended before \startstaticMPfigure was complete .....
> 
> Should I place part of the code in some definitions?
> 
> 3. To input textlabels in mathnotation optionally anywhere I want inside
> the figure. 
>
\startMPenvironment[global]
... global font defintions (esp. a math font), so metapost can also use them

\stopMPenvironment

Hope that helps...


Best wishes, Peter

> And also do something like
> 
> \placefigure[][fig:metapostfigure]{Here is the figure I made in DIA
> converted to metapost}{\usestaticMPfigure[magflux][width=0.8\textwidth]}
> 
> so it also can be referred to in the text.
> 
> All best and thanks in advance!
> 
> Janneman
> 
> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
> archive  : https://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: exported figures from DIA to Metapost including in document
  2008-11-24 14:08 ` Aditya Mahajan
@ 2008-11-24 15:20   ` Jan-Erik Hägglöf
  2008-11-24 15:40     ` Aditya Mahajan
  0 siblings, 1 reply; 10+ messages in thread
From: Jan-Erik Hägglöf @ 2008-11-24 15:20 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 2511 bytes --]

mån 2008-11-24 klockan 09:08 -0500 skrev Aditya Mahajan:
> On Mon, 24 Nov 2008, Jan-Erik Hägglöf wrote:
> 
> > Hi All!
> >
> > I'm in beginning to write a thesis in physics(undergraduate level) and
> > one of many things I wanna do is, cause I create much illustrations in
> > DIA http://www.gnome.org/projects/dia/
> > and the program can export to figure.mp, to include these in my
> > document.
> >
> > I've read the instructions on http://wiki.contextgarden.net/Mpgraphic
> >
> > I do not get this working. How is the best way to accomplish this?
> 
> See the attached file. Dia exports the figure with
> verbatimtex
> &latex
> etex
> 
> which tells metapost to run labels through latex. I guess that this is 
> what causes the errors. If you simply remove some of the boiler plate, the 
> figure compiles fine (see attached file)
> 
> > The reason is why I want to do in this way is to input tex code in the
> > figure (especially math and symbol definitions) and optionally place
> > them in specific places inside the figure. By this method I can even do
> > better illustrations, hopefully.
> >
> > My workflow has been like this:
> >
> > 1. Create the desired figure in DIA and choose the export option. TeX
> > metapost *.mp(see attached file ).
> >
> > 2. Tryed to do inclusion in a TeX-document like this
> >
> > \startstaticMPfigure{magflux}
> >  the code in the attached file
> > \stopstaticMPfigure
> >
> > \starttext
> >
> > Here is my figure \usestaticMPfigure[magflux][width=0.8\textwidth]
> >
> > \stoptext
> >
> > But it fails with errormessage:
> >
> > !Paragraph ended before \startstaticMPfigure was complete .....
> >
> > Should I place part of the code in some definitions?
> 
> I do not get this error, but staticMPfigure is not working for me. I would 
> recomment not to use staticMPfigure, rather use useMPfigure.
> 
> (I had asked Hans for staticMPfigure a few years ago when TeX-MP 
> interaction was slow. Now, with MPLib I do not think that we need the 
> staticMPfigure mechanism. Personally, I haven't used it for a while)
> 
> I also had to add
> 
> save x, y, t, p ; %%%% Added this line
> 
> to include the figure multiple times (or to include multiple figures, I 
> would imagine).
> 
> Aditya
Thanks to all answers. I got it work, though a minor problem left, it
seems that "calligraphy" is not working.

 line 108 draw btex { $ \vec{\cal B }$} etex.....

see the new attached file.

Janneman

[-- Attachment #2: dia-2.tex --]
[-- Type: text/x-tex, Size: 14362 bytes --]

\usetypescriptfile[type-gyr]
\usetypescript[Adventor] % leave out 'ec' when using XeTeX/luaTeX
\setupbodyfont[Adventor,14.4pt,ss]
\startMPenvironment
\usetypescript[Adventor] % leave out 'ec' when using XeTeX/luaTeX
\setupbodyfont[Adventor,14.4pt,ss]
\stopMPenvironment



\startuseMPgraphic{mag2}
% Define macro for horizontal centering.
vardef hcentered primary P =
  P shifted -(xpart center P, 0)
enddef;
% Define macro for right justification.
vardef rjust primary P =
  P shifted -(xpart (lrcorner P - llcorner P), 0)
enddef;
save x, y, t, p ;
  % picture(3.436250,-29.212500)(46.421315,9.246250)
  x = 1.000000cm; y = -1.000000cm;

  t = 1.000000;

% set_line_color 0.000000, 0.000000, 0.000000
% set_line_color 1.000000, 1.000000, 1.000000
% set_linewidth 0.100000
  path p;
  p = (15.400000x,5.150000y)--(15.400000x,22.900000y)--(46.100000x,22.900000y)--(46.100000x,5.150000y)--cycle;
  fill p withcolor (1.000000,1.000000,1.000000);
%metapost_arc
% center->x = 15.400000% center->y = 5.150000% width = 0.000000% height = 0.000000% angle1 = 90.000000% angle2 = 180.000000% set_line_color 1.000000, 1.000000, 1.000000
  draw (15.400000x,5.150000y)..(15.400000x,5.150000y)..(15.400000x,5.150000y)
    withpen pencircle scaled 0.1000x
    withcolor (1.0000, 1.0000, 1.0000);
%metapost_arc
% center->x = 46.100000% center->y = 5.150000% width = 0.000000% height = 0.000000% angle1 = 0.000000% angle2 = 90.000000% set_line_color 1.000000, 1.000000, 1.000000
  draw (46.100000x,5.150000y)..(46.100000x,5.150000y)..(46.100000x,5.150000y)
    withpen pencircle scaled 0.1000x
    withcolor (1.0000, 1.0000, 1.0000);
  path p;
  p = (15.400000x,5.150000y)--(15.400000x,22.900000y)--(46.100000x,22.900000y)--(46.100000x,5.150000y)--cycle;
  fill p withcolor (1.000000,1.000000,1.000000);
%metapost_arc
% center->x = 15.400000% center->y = 22.900000% width = 0.000000% height = 0.000000% angle1 = 180.000000% angle2 = 270.000000% set_line_color 1.000000, 1.000000, 1.000000
  draw (15.400000x,22.900000y)..(15.400000x,22.900000y)..(15.400000x,22.900000y)
    withpen pencircle scaled 0.1000x
    withcolor (1.0000, 1.0000, 1.0000);
%metapost_arc
% center->x = 46.100000% center->y = 22.900000% width = 0.000000% height = 0.000000% angle1 = 270.000000% angle2 = 360.000000% set_line_color 1.000000, 1.000000, 1.000000
  draw (46.100000x,22.900000y)..(46.100000x,22.900000y)..(46.100000x,22.900000y)
    withpen pencircle scaled 0.1000x
    withcolor (1.0000, 1.0000, 1.0000);
% set_line_color 0.000000, 0.000000, 0.000000
  draw (15.400000x,5.150000y)--(46.100000x,5.150000y)
    withpen pencircle scaled 0.1000x;
% set_line_color 0.000000, 0.000000, 0.000000
  draw (15.400000x,22.900000y)--(46.100000x,22.900000y)
    withpen pencircle scaled 0.1000x;
%metapost_arc
% center->x = 15.400000% center->y = 5.150000% width = 0.000000% height = 0.000000% angle1 = 90.000000% angle2 = 180.000000% set_line_color 0.000000, 0.000000, 0.000000
  draw (15.400000x,5.150000y)..(15.400000x,5.150000y)..(15.400000x,5.150000y)
    withpen pencircle scaled 0.1000x;
%metapost_arc
% center->x = 46.100000% center->y = 5.150000% width = 0.000000% height = 0.000000% angle1 = 0.000000% angle2 = 90.000000% set_line_color 0.000000, 0.000000, 0.000000
  draw (46.100000x,5.150000y)..(46.100000x,5.150000y)..(46.100000x,5.150000y)
    withpen pencircle scaled 0.1000x;
% set_line_color 0.000000, 0.000000, 0.000000
  draw (15.400000x,5.150000y)--(15.400000x,22.900000y)
    withpen pencircle scaled 0.1000x;
% set_line_color 0.000000, 0.000000, 0.000000
  draw (46.100000x,5.150000y)--(46.100000x,22.900000y)
    withpen pencircle scaled 0.1000x;
%metapost_arc
% center->x = 15.400000% center->y = 22.900000% width = 0.000000% height = 0.000000% angle1 = 180.000000% angle2 = 270.000000% set_line_color 0.000000, 0.000000, 0.000000
  draw (15.400000x,22.900000y)..(15.400000x,22.900000y)..(15.400000x,22.900000y)
    withpen pencircle scaled 0.1000x;
%metapost_arc
% center->x = 46.100000% center->y = 22.900000% width = 0.000000% height = 0.000000% angle1 = 270.000000% angle2 = 360.000000% set_line_color 0.000000, 0.000000, 0.000000
  draw (46.100000x,22.900000y)..(46.100000x,22.900000y)..(46.100000x,22.900000y)
    withpen pencircle scaled 0.1000x;
% set_linewidth 0.100000
% set_line_color 1.000000, 1.000000, 1.000000
% fill_polygon
  path p;
  p = (9.950000x,1.150000y)--(40.000000x,1.050000y)--(46.250000x,5.050000y)--(15.450000x,5.000000y)--cycle;
  fill p 
    withpen pencircle scaled 0.1000x
    withcolor (1.0000, 1.0000, 1.0000);
% set_line_color 0.000000, 0.000000, 0.000000
  draw (9.950000x,1.150000y)--(40.000000x,1.050000y)--(46.250000x,5.050000y)--(15.450000x,5.000000y)--cycle
    withpen pencircle scaled 0.1000x;
% set_linewidth 0.100000
% set_line_color 0.749020, 0.749020, 0.749020
% fill_polygon
  path p;
  p = (10.000000x,1.100000y)--(15.350000x,4.950000y)--(15.450000x,22.850000y)--(10.050000x,18.800000y)--cycle;
  fill p 
    withpen pencircle scaled 0.1000x
    withcolor (0.7490, 0.7490, 0.7490);
% set_line_color 0.000000, 0.000000, 0.000000
  draw (10.000000x,1.100000y)--(15.350000x,4.950000y)--(15.450000x,22.850000y)--(10.050000x,18.800000y)--cycle
    withpen pencircle scaled 0.1000x;
% set_line_color 0.000000, 0.000000, 0.000000
  draw btex {$n$} etex scaled 6.15t shifted (40.550000x,-7.150000y);
% set_line_color 0.000000, 0.000000, 0.000000
  draw btex { $ \vec{\cal B }$} etex scaled 6.15t shifted (21.400000x,-3.375000y);
% set_line_color 0.000000, 0.000000, 0.000000
  draw btex {$ A $} etex scaled 6.15t shifted (3.500000x,21.825000y);
% set_line_color 0.000000, 0.000000, 0.000000
  draw btex {${\vec{u}}$} etex scaled 6.15t shifted (5.950000x,10.325000y);
% set_line_color 0.000000, 0.000000, 0.000000
  draw btex {$ \vec{l}$}  etex scaled 6.15t shifted (10.400000x,26.400000y);
% set_line_color 0.000000, 0.000000, 0.000000
  draw btex {$ dl $} etex scaled 6.15t shifted (30.000000x,27.600000y);
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (10.000000x,18.800000y)--(40.000000x,18.850000y)
    withpen pencircle scaled 0.1000x
    dashed dashpattern (on 0.050000x off 0.050000x);
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (40.000000x,1.200000y)--(39.950000x,18.700000y)
    withpen pencircle scaled 0.1000x
    dashed dashpattern (on 0.050000x off 0.050000x);
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (39.950000x,18.800000y)--(46.100000x,22.800000y)
    withpen pencircle scaled 0.1000x
    dashed dashpattern (on 0.050000x off 0.050000x);
  path p;
  p = (19.100000x,20.000000y)..(18.600000x,20.500000y)..(18.100000x,20.000000y)..(18.600000x,19.500000y)..cycle;
  fill p withcolor (1.000000,1.000000,1.000000);
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (19.100000x,20.000000y)..(18.600000x,20.500000y)..(18.100000x,20.000000y)..(18.600000x,19.500000y)..cycle
    withpen pencircle scaled 0.1000x;
  path p;
  p = (17.000000x,3.150000y)..(16.500000x,3.650000y)..(16.000000x,3.150000y)..(16.500000x,2.650000y)..cycle;
  fill p withcolor (1.000000,1.000000,1.000000);
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (17.000000x,3.150000y)..(16.500000x,3.650000y)..(16.000000x,3.150000y)..(16.500000x,2.650000y)..cycle
    withpen pencircle scaled 0.1000x;
  path p;
  p = (34.500000x,4.100000y)..(34.000000x,4.600000y)..(33.500000x,4.100000y)..(34.000000x,3.600000y)..cycle;
  fill p withcolor (1.000000,1.000000,1.000000);
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (34.500000x,4.100000y)..(34.000000x,4.600000y)..(33.500000x,4.100000y)..(34.000000x,3.600000y)..cycle
    withpen pencircle scaled 0.1000x;
  path p;
  p = (23.600100x,6.975000y)..(23.100100x,7.475000y)..(22.600100x,6.975000y)..(23.100100x,6.475000y)..cycle;
  fill p withcolor (1.000000,1.000000,1.000000);
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (23.600100x,6.975000y)..(23.100100x,7.475000y)..(22.600100x,6.975000y)..(23.100100x,6.475000y)..cycle
    withpen pencircle scaled 0.1000x;
  path p;
  p = (20.590000x,12.350000y)..(20.090000x,12.850000y)..(19.590000x,12.350000y)..(20.090000x,11.850000y)..cycle;
  fill p withcolor (1.000000,1.000000,1.000000);
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (20.590000x,12.350000y)..(20.090000x,12.850000y)..(19.590000x,12.350000y)..(20.090000x,11.850000y)..cycle
    withpen pencircle scaled 0.1000x;
  path p;
  p = (28.225000x,12.000000y)..(27.725000x,12.500000y)..(27.225000x,12.000000y)..(27.725000x,11.500000y)..cycle;
  fill p withcolor (1.000000,1.000000,1.000000);
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (28.225000x,12.000000y)..(27.725000x,12.500000y)..(27.225000x,12.000000y)..(27.725000x,11.500000y)..cycle
    withpen pencircle scaled 0.1000x;
  path p;
  p = (27.850000x,16.250000y)..(27.350000x,16.750000y)..(26.850000x,16.250000y)..(27.350000x,15.750000y)..cycle;
  fill p withcolor (1.000000,1.000000,1.000000);
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (27.850000x,16.250000y)..(27.350000x,16.750000y)..(26.850000x,16.250000y)..(27.350000x,15.750000y)..cycle
    withpen pencircle scaled 0.1000x;
  path p;
  p = (35.245000x,21.200000y)..(34.745000x,21.700000y)..(34.245000x,21.200000y)..(34.745000x,20.700000y)..cycle;
  fill p withcolor (1.000000,1.000000,1.000000);
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (35.245000x,21.200000y)..(34.745000x,21.700000y)..(34.245000x,21.200000y)..(34.745000x,20.700000y)..cycle
    withpen pencircle scaled 0.1000x;
  path p;
  p = (39.300000x,16.050000y)..(38.800000x,16.550000y)..(38.300000x,16.050000y)..(38.800000x,15.550000y)..cycle;
  fill p withcolor (1.000000,1.000000,1.000000);
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (39.300000x,16.050000y)..(38.800000x,16.550000y)..(38.300000x,16.050000y)..(38.800000x,15.550000y)..cycle
    withpen pencircle scaled 0.1000x;
  path p;
  p = (44.550000x,16.500000y)..(44.050000x,17.000000y)..(43.550000x,16.500000y)..(44.050000x,16.000000y)..cycle;
  fill p withcolor (1.000000,1.000000,1.000000);
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (44.550000x,16.500000y)..(44.050000x,17.000000y)..(43.550000x,16.500000y)..(44.050000x,16.000000y)..cycle
    withpen pencircle scaled 0.1000x;
  path p;
  p = (35.250100x,9.625000y)..(34.750100x,10.125000y)..(34.250100x,9.625000y)..(34.750100x,9.125000y)..cycle;
  fill p withcolor (1.000000,1.000000,1.000000);
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (35.250100x,9.625000y)..(34.750100x,10.125000y)..(34.250100x,9.625000y)..(34.750100x,9.125000y)..cycle
    withpen pencircle scaled 0.1000x;
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (33.600100x,22.850000y)--(21.805237x,-2.533529y)
    withpen pencircle scaled 0.1000x;
% set_line_color 0.000000, 0.000000, 0.000000
% fill_polygon
  path p;
  p = (21.647213x,-2.873608y)--(22.084630x,-2.525518y)--(21.805237x,-2.533529y)--(21.631192x,-2.314821y)--cycle;
  fill p 
    withpen pencircle scaled 0.1000x;
% set_line_color 0.000000, 0.000000, 0.000000
  draw (21.647213x,-2.873608y)--(22.084630x,-2.525518y)--(21.805237x,-2.533529y)--(21.631192x,-2.314821y)--cycle
    withpen pencircle scaled 0.1000x;
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (45.900100x,25.500000y)--(15.936903x,25.450799y)
    withpen pencircle scaled 0.1000x;
% set_line_color 0.000000, 0.000000, 0.000000
% fill_polygon
  path p;
  p = (15.561903x,25.450184y)--(16.062313x,25.201005y)--(15.936903x,25.450799y)--(16.061492x,25.701004y)--cycle;
  fill p 
    withpen pencircle scaled 0.1000x;
% set_line_color 0.000000, 0.000000, 0.000000
  draw (15.561903x,25.450184y)--(16.062313x,25.201005y)--(15.936903x,25.450799y)--(16.061492x,25.701004y)--cycle
    withpen pencircle scaled 0.1000x;
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (15.350100x,23.300000y)--(15.350100x,25.550000y)
    withpen pencircle scaled 0.1000x;
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (46.035100x,23.150000y)--(46.035100x,25.400000y)
    withpen pencircle scaled 0.1000x;
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (12.700100x,12.175000y)--(5.036903x,12.175000y)
    withpen pencircle scaled 0.1000x;
% set_line_color 0.000000, 0.000000, 0.000000
% fill_polygon
  path p;
  p = (4.661903x,12.175000y)--(5.161903x,11.925000y)--(5.036903x,12.175000y)--(5.161903x,12.425000y)--cycle;
  fill p 
    withpen pencircle scaled 0.1000x;
% set_line_color 0.000000, 0.000000, 0.000000
  draw (4.661903x,12.175000y)--(5.161903x,11.925000y)--(5.036903x,12.175000y)--(5.161903x,12.425000y)--cycle
    withpen pencircle scaled 0.1000x;
% set_linewidth 0.050000
%metapost_arc
% center->x = 16.044451% center->y = 29.643274% width = 29.161250% height = 29.161250% angle1 = 104.068771% angle2 = 146.755563% set_line_color 0.000000, 0.000000, 0.000000
  draw (12.500100x,15.500000y)..(7.595646x,17.759995y)..(3.850100x,21.650000y)
    withpen pencircle scaled 0.0500x;
% set_linewidth 0.050000
%metapost_arc
% center->x = 46.858720% center->y = 3.886073% width = 25.384589% height = 25.384589% angle1 = 121.377854% angle2 = 178.640130% set_line_color 0.000000, 0.000000, 0.000000
  draw (40.250100x,-6.950000y)..(35.865875x,-2.458349y)..(34.170000x,3.584860y)
    withpen pencircle scaled 0.0500x;
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (14.350100x,24.250000y)--(7.786891x,24.203452y)
    withpen pencircle scaled 0.1000x;
% set_line_color 0.000000, 0.000000, 0.000000
% fill_polygon
  path p;
  p = (7.411901x,24.200793y)--(7.913661x,23.954345y)--(7.786891x,24.203452y)--(7.910115x,24.454333y)--cycle;
  fill p 
    withpen pencircle scaled 0.1000x;
% set_line_color 0.000000, 0.000000, 0.000000
  draw (7.411901x,24.200793y)--(7.913661x,23.954345y)--(7.786891x,24.203452y)--(7.910115x,24.454333y)--cycle
    withpen pencircle scaled 0.1000x;
\stopuseMPgraphic
\starttext

\scale[width=\textwidth]{\useMPgraphic{mag2}}
\scale[width=\textwidth]{\useMPgraphic{mag2}}

\stoptext


[-- Attachment #3: Type: text/plain, Size: 487 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: exported figures from DIA to Metapost including in document
  2008-11-24 15:20   ` Jan-Erik Hägglöf
@ 2008-11-24 15:40     ` Aditya Mahajan
  2008-11-24 19:22       ` Jan-Erik Hägglöf
  0 siblings, 1 reply; 10+ messages in thread
From: Aditya Mahajan @ 2008-11-24 15:40 UTC (permalink / raw)
  To: janerik.hagglof, mailing list for ConTeXt users

[-- Attachment #1: Type: TEXT/PLAIN, Size: 709 bytes --]

On Mon, 24 Nov 2008, Jan-Erik Hägglöf wrote:

>>
> Thanks to all answers. I got it work, though a minor problem left, it
> seems that "calligraphy" is not working.
>
> line 108 draw btex { $ \vec{\cal B }$} etex.....
>
> see the new attached file.

If you are using MKII (running context using texexec filename), then do 
not use btex ... etex.[1] Use \sometxt{...} instead.

I just used the following regex on your file
%s/btex\s*\(.\)\s*etex/\\sometxt\1/g
and then everything works fine.


[1] It is possible to get correct fonts using btex ... etex also. You need 
to set up fonts in \startMPenvironment ... \stopMPenvironment. For most 
cases \sometxt is more convinient.

Aditya

[-- Attachment #2: Type: text/plain, Size: 487 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: exported figures from DIA to Metapost including in document
  2008-11-24 15:40     ` Aditya Mahajan
@ 2008-11-24 19:22       ` Jan-Erik Hägglöf
  2008-11-24 21:23         ` Aditya Mahajan
  0 siblings, 1 reply; 10+ messages in thread
From: Jan-Erik Hägglöf @ 2008-11-24 19:22 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 1146 bytes --]

mån 2008-11-24 klockan 10:40 -0500 skrev Aditya Mahajan:
> On Mon, 24 Nov 2008, Jan-Erik Hägglöf wrote:
> 
> >>
> > Thanks to all answers. I got it work, though a minor problem left, it
> > seems that "calligraphy" is not working.
> >
> > line 108 draw btex { $ \vec{\cal B }$} etex.....
> >
> > see the new attached file.
> 
> If you are using MKII (running context using texexec filename), then do 
> not use btex ... etex.[1] Use \sometxt{...} instead.
I am using MKIV
> I just used the following regex on your file
> %s/btex\s*\(.\)\s*etex/\\sometxt\1/g
> and then everything works fine.
This above I didn't understood. I did though replace with
\sometxt{\vec{\cal B}} but no effect.
> 
> [1] It is possible to get correct fonts using btex ... etex also. You need 
> to set up fonts in \startMPenvironment ... \stopMPenvironment. For most 
> cases \sometxt is more convinient.
> 
> Aditya
I tried to do some fontsettings, maybe it was the wrong way setting up
things. You can see in the updated file.

Janneman

-- 
TeX Engine : LuaTeX

current version: 2008.10.23 17:32

OS : Ubuntu 8.10 Intrepid Ibex

[-- Attachment #2: dia-2.tex --]
[-- Type: text/x-tex, Size: 14397 bytes --]

%s/btex\s*\(.\)\s*etex/\\sometxt\1/g
\usetypescriptfile[type-gyr]
\usetypescript[Adventor] % leave out 'ec' when using XeTeX/luaTeX
\setupbodyfont[Adventor,14.4pt,ss]
\startMPenvironment
\usetypescript[Adventor] % leave out 'ec' when using XeTeX/luaTeX
\setupbodyfont[Adventor,14.4pt,ss]
\stopMPenvironment



\startuseMPgraphic{mag2}
% Define macro for horizontal centering.
vardef hcentered primary P =
  P shifted -(xpart center P, 0)
enddef;
% Define macro for right justification.
vardef rjust primary P =
  P shifted -(xpart (lrcorner P - llcorner P), 0)
enddef;
save x, y, t, p ;
  % picture(3.436250,-29.212500)(46.421315,9.246250)
  x = 1.000000cm; y = -1.000000cm;

  t = 1.000000;

% set_line_color 0.000000, 0.000000, 0.000000
% set_line_color 1.000000, 1.000000, 1.000000
% set_linewidth 0.100000
  path p;
  p = (15.400000x,5.150000y)--(15.400000x,22.900000y)--(46.100000x,22.900000y)--(46.100000x,5.150000y)--cycle;
  fill p withcolor (1.000000,1.000000,1.000000);
%metapost_arc
% center->x = 15.400000% center->y = 5.150000% width = 0.000000% height = 0.000000% angle1 = 90.000000% angle2 = 180.000000% set_line_color 1.000000, 1.000000, 1.000000
  draw (15.400000x,5.150000y)..(15.400000x,5.150000y)..(15.400000x,5.150000y)
    withpen pencircle scaled 0.1000x
    withcolor (1.0000, 1.0000, 1.0000);
%metapost_arc
% center->x = 46.100000% center->y = 5.150000% width = 0.000000% height = 0.000000% angle1 = 0.000000% angle2 = 90.000000% set_line_color 1.000000, 1.000000, 1.000000
  draw (46.100000x,5.150000y)..(46.100000x,5.150000y)..(46.100000x,5.150000y)
    withpen pencircle scaled 0.1000x
    withcolor (1.0000, 1.0000, 1.0000);
  path p;
  p = (15.400000x,5.150000y)--(15.400000x,22.900000y)--(46.100000x,22.900000y)--(46.100000x,5.150000y)--cycle;
  fill p withcolor (1.000000,1.000000,1.000000);
%metapost_arc
% center->x = 15.400000% center->y = 22.900000% width = 0.000000% height = 0.000000% angle1 = 180.000000% angle2 = 270.000000% set_line_color 1.000000, 1.000000, 1.000000
  draw (15.400000x,22.900000y)..(15.400000x,22.900000y)..(15.400000x,22.900000y)
    withpen pencircle scaled 0.1000x
    withcolor (1.0000, 1.0000, 1.0000);
%metapost_arc
% center->x = 46.100000% center->y = 22.900000% width = 0.000000% height = 0.000000% angle1 = 270.000000% angle2 = 360.000000% set_line_color 1.000000, 1.000000, 1.000000
  draw (46.100000x,22.900000y)..(46.100000x,22.900000y)..(46.100000x,22.900000y)
    withpen pencircle scaled 0.1000x
    withcolor (1.0000, 1.0000, 1.0000);
% set_line_color 0.000000, 0.000000, 0.000000
  draw (15.400000x,5.150000y)--(46.100000x,5.150000y)
    withpen pencircle scaled 0.1000x;
% set_line_color 0.000000, 0.000000, 0.000000
  draw (15.400000x,22.900000y)--(46.100000x,22.900000y)
    withpen pencircle scaled 0.1000x;
%metapost_arc
% center->x = 15.400000% center->y = 5.150000% width = 0.000000% height = 0.000000% angle1 = 90.000000% angle2 = 180.000000% set_line_color 0.000000, 0.000000, 0.000000
  draw (15.400000x,5.150000y)..(15.400000x,5.150000y)..(15.400000x,5.150000y)
    withpen pencircle scaled 0.1000x;
%metapost_arc
% center->x = 46.100000% center->y = 5.150000% width = 0.000000% height = 0.000000% angle1 = 0.000000% angle2 = 90.000000% set_line_color 0.000000, 0.000000, 0.000000
  draw (46.100000x,5.150000y)..(46.100000x,5.150000y)..(46.100000x,5.150000y)
    withpen pencircle scaled 0.1000x;
% set_line_color 0.000000, 0.000000, 0.000000
  draw (15.400000x,5.150000y)--(15.400000x,22.900000y)
    withpen pencircle scaled 0.1000x;
% set_line_color 0.000000, 0.000000, 0.000000
  draw (46.100000x,5.150000y)--(46.100000x,22.900000y)
    withpen pencircle scaled 0.1000x;
%metapost_arc
% center->x = 15.400000% center->y = 22.900000% width = 0.000000% height = 0.000000% angle1 = 180.000000% angle2 = 270.000000% set_line_color 0.000000, 0.000000, 0.000000
  draw (15.400000x,22.900000y)..(15.400000x,22.900000y)..(15.400000x,22.900000y)
    withpen pencircle scaled 0.1000x;
%metapost_arc
% center->x = 46.100000% center->y = 22.900000% width = 0.000000% height = 0.000000% angle1 = 270.000000% angle2 = 360.000000% set_line_color 0.000000, 0.000000, 0.000000
  draw (46.100000x,22.900000y)..(46.100000x,22.900000y)..(46.100000x,22.900000y)
    withpen pencircle scaled 0.1000x;
% set_linewidth 0.100000
% set_line_color 1.000000, 1.000000, 1.000000
% fill_polygon
  path p;
  p = (9.950000x,1.150000y)--(40.000000x,1.050000y)--(46.250000x,5.050000y)--(15.450000x,5.000000y)--cycle;
  fill p 
    withpen pencircle scaled 0.1000x
    withcolor (1.0000, 1.0000, 1.0000);
% set_line_color 0.000000, 0.000000, 0.000000
  draw (9.950000x,1.150000y)--(40.000000x,1.050000y)--(46.250000x,5.050000y)--(15.450000x,5.000000y)--cycle
    withpen pencircle scaled 0.1000x;
% set_linewidth 0.100000
% set_line_color 0.749020, 0.749020, 0.749020
% fill_polygon
  path p;
  p = (10.000000x,1.100000y)--(15.350000x,4.950000y)--(15.450000x,22.850000y)--(10.050000x,18.800000y)--cycle;
  fill p 
    withpen pencircle scaled 0.1000x
    withcolor (0.7490, 0.7490, 0.7490);
% set_line_color 0.000000, 0.000000, 0.000000
  draw (10.000000x,1.100000y)--(15.350000x,4.950000y)--(15.450000x,22.850000y)--(10.050000x,18.800000y)--cycle
    withpen pencircle scaled 0.1000x;
% set_line_color 0.000000, 0.000000, 0.000000
  draw btex {$n$} etex scaled 6.15t shifted (40.550000x,-7.150000y);
% set_line_color 0.000000, 0.000000, 0.000000
  draw \sometxt{ $ \vec{\cal B }$} scaled 6.15t shifted (21.400000x,-3.375000y);
% set_line_color 0.000000, 0.000000, 0.000000
  draw btex {$ A $} etex scaled 6.15t shifted (3.500000x,21.825000y);
% set_line_color 0.000000, 0.000000, 0.000000
  draw btex {${\vec{u}}$} etex scaled 6.15t shifted (5.950000x,10.325000y);
% set_line_color 0.000000, 0.000000, 0.000000
  draw btex {$ \vec{l}$}  etex scaled 6.15t shifted (10.400000x,26.400000y);
% set_line_color 0.000000, 0.000000, 0.000000
  draw btex {$ dl $} etex scaled 6.15t shifted (30.000000x,27.600000y);
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (10.000000x,18.800000y)--(40.000000x,18.850000y)
    withpen pencircle scaled 0.1000x
    dashed dashpattern (on 0.050000x off 0.050000x);
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (40.000000x,1.200000y)--(39.950000x,18.700000y)
    withpen pencircle scaled 0.1000x
    dashed dashpattern (on 0.050000x off 0.050000x);
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (39.950000x,18.800000y)--(46.100000x,22.800000y)
    withpen pencircle scaled 0.1000x
    dashed dashpattern (on 0.050000x off 0.050000x);
  path p;
  p = (19.100000x,20.000000y)..(18.600000x,20.500000y)..(18.100000x,20.000000y)..(18.600000x,19.500000y)..cycle;
  fill p withcolor (1.000000,1.000000,1.000000);
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (19.100000x,20.000000y)..(18.600000x,20.500000y)..(18.100000x,20.000000y)..(18.600000x,19.500000y)..cycle
    withpen pencircle scaled 0.1000x;
  path p;
  p = (17.000000x,3.150000y)..(16.500000x,3.650000y)..(16.000000x,3.150000y)..(16.500000x,2.650000y)..cycle;
  fill p withcolor (1.000000,1.000000,1.000000);
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (17.000000x,3.150000y)..(16.500000x,3.650000y)..(16.000000x,3.150000y)..(16.500000x,2.650000y)..cycle
    withpen pencircle scaled 0.1000x;
  path p;
  p = (34.500000x,4.100000y)..(34.000000x,4.600000y)..(33.500000x,4.100000y)..(34.000000x,3.600000y)..cycle;
  fill p withcolor (1.000000,1.000000,1.000000);
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (34.500000x,4.100000y)..(34.000000x,4.600000y)..(33.500000x,4.100000y)..(34.000000x,3.600000y)..cycle
    withpen pencircle scaled 0.1000x;
  path p;
  p = (23.600100x,6.975000y)..(23.100100x,7.475000y)..(22.600100x,6.975000y)..(23.100100x,6.475000y)..cycle;
  fill p withcolor (1.000000,1.000000,1.000000);
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (23.600100x,6.975000y)..(23.100100x,7.475000y)..(22.600100x,6.975000y)..(23.100100x,6.475000y)..cycle
    withpen pencircle scaled 0.1000x;
  path p;
  p = (20.590000x,12.350000y)..(20.090000x,12.850000y)..(19.590000x,12.350000y)..(20.090000x,11.850000y)..cycle;
  fill p withcolor (1.000000,1.000000,1.000000);
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (20.590000x,12.350000y)..(20.090000x,12.850000y)..(19.590000x,12.350000y)..(20.090000x,11.850000y)..cycle
    withpen pencircle scaled 0.1000x;
  path p;
  p = (28.225000x,12.000000y)..(27.725000x,12.500000y)..(27.225000x,12.000000y)..(27.725000x,11.500000y)..cycle;
  fill p withcolor (1.000000,1.000000,1.000000);
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (28.225000x,12.000000y)..(27.725000x,12.500000y)..(27.225000x,12.000000y)..(27.725000x,11.500000y)..cycle
    withpen pencircle scaled 0.1000x;
  path p;
  p = (27.850000x,16.250000y)..(27.350000x,16.750000y)..(26.850000x,16.250000y)..(27.350000x,15.750000y)..cycle;
  fill p withcolor (1.000000,1.000000,1.000000);
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (27.850000x,16.250000y)..(27.350000x,16.750000y)..(26.850000x,16.250000y)..(27.350000x,15.750000y)..cycle
    withpen pencircle scaled 0.1000x;
  path p;
  p = (35.245000x,21.200000y)..(34.745000x,21.700000y)..(34.245000x,21.200000y)..(34.745000x,20.700000y)..cycle;
  fill p withcolor (1.000000,1.000000,1.000000);
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (35.245000x,21.200000y)..(34.745000x,21.700000y)..(34.245000x,21.200000y)..(34.745000x,20.700000y)..cycle
    withpen pencircle scaled 0.1000x;
  path p;
  p = (39.300000x,16.050000y)..(38.800000x,16.550000y)..(38.300000x,16.050000y)..(38.800000x,15.550000y)..cycle;
  fill p withcolor (1.000000,1.000000,1.000000);
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (39.300000x,16.050000y)..(38.800000x,16.550000y)..(38.300000x,16.050000y)..(38.800000x,15.550000y)..cycle
    withpen pencircle scaled 0.1000x;
  path p;
  p = (44.550000x,16.500000y)..(44.050000x,17.000000y)..(43.550000x,16.500000y)..(44.050000x,16.000000y)..cycle;
  fill p withcolor (1.000000,1.000000,1.000000);
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (44.550000x,16.500000y)..(44.050000x,17.000000y)..(43.550000x,16.500000y)..(44.050000x,16.000000y)..cycle
    withpen pencircle scaled 0.1000x;
  path p;
  p = (35.250100x,9.625000y)..(34.750100x,10.125000y)..(34.250100x,9.625000y)..(34.750100x,9.125000y)..cycle;
  fill p withcolor (1.000000,1.000000,1.000000);
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (35.250100x,9.625000y)..(34.750100x,10.125000y)..(34.250100x,9.625000y)..(34.750100x,9.125000y)..cycle
    withpen pencircle scaled 0.1000x;
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (33.600100x,22.850000y)--(21.805237x,-2.533529y)
    withpen pencircle scaled 0.1000x;
% set_line_color 0.000000, 0.000000, 0.000000
% fill_polygon
  path p;
  p = (21.647213x,-2.873608y)--(22.084630x,-2.525518y)--(21.805237x,-2.533529y)--(21.631192x,-2.314821y)--cycle;
  fill p 
    withpen pencircle scaled 0.1000x;
% set_line_color 0.000000, 0.000000, 0.000000
  draw (21.647213x,-2.873608y)--(22.084630x,-2.525518y)--(21.805237x,-2.533529y)--(21.631192x,-2.314821y)--cycle
    withpen pencircle scaled 0.1000x;
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (45.900100x,25.500000y)--(15.936903x,25.450799y)
    withpen pencircle scaled 0.1000x;
% set_line_color 0.000000, 0.000000, 0.000000
% fill_polygon
  path p;
  p = (15.561903x,25.450184y)--(16.062313x,25.201005y)--(15.936903x,25.450799y)--(16.061492x,25.701004y)--cycle;
  fill p 
    withpen pencircle scaled 0.1000x;
% set_line_color 0.000000, 0.000000, 0.000000
  draw (15.561903x,25.450184y)--(16.062313x,25.201005y)--(15.936903x,25.450799y)--(16.061492x,25.701004y)--cycle
    withpen pencircle scaled 0.1000x;
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (15.350100x,23.300000y)--(15.350100x,25.550000y)
    withpen pencircle scaled 0.1000x;
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (46.035100x,23.150000y)--(46.035100x,25.400000y)
    withpen pencircle scaled 0.1000x;
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (12.700100x,12.175000y)--(5.036903x,12.175000y)
    withpen pencircle scaled 0.1000x;
% set_line_color 0.000000, 0.000000, 0.000000
% fill_polygon
  path p;
  p = (4.661903x,12.175000y)--(5.161903x,11.925000y)--(5.036903x,12.175000y)--(5.161903x,12.425000y)--cycle;
  fill p 
    withpen pencircle scaled 0.1000x;
% set_line_color 0.000000, 0.000000, 0.000000
  draw (4.661903x,12.175000y)--(5.161903x,11.925000y)--(5.036903x,12.175000y)--(5.161903x,12.425000y)--cycle
    withpen pencircle scaled 0.1000x;
% set_linewidth 0.050000
%metapost_arc
% center->x = 16.044451% center->y = 29.643274% width = 29.161250% height = 29.161250% angle1 = 104.068771% angle2 = 146.755563% set_line_color 0.000000, 0.000000, 0.000000
  draw (12.500100x,15.500000y)..(7.595646x,17.759995y)..(3.850100x,21.650000y)
    withpen pencircle scaled 0.0500x;
% set_linewidth 0.050000
%metapost_arc
% center->x = 46.858720% center->y = 3.886073% width = 25.384589% height = 25.384589% angle1 = 121.377854% angle2 = 178.640130% set_line_color 0.000000, 0.000000, 0.000000
  draw (40.250100x,-6.950000y)..(35.865875x,-2.458349y)..(34.170000x,3.584860y)
    withpen pencircle scaled 0.0500x;
% set_linewidth 0.100000
% set_line_color 0.000000, 0.000000, 0.000000
  draw (14.350100x,24.250000y)--(7.786891x,24.203452y)
    withpen pencircle scaled 0.1000x;
% set_line_color 0.000000, 0.000000, 0.000000
% fill_polygon
  path p;
  p = (7.411901x,24.200793y)--(7.913661x,23.954345y)--(7.786891x,24.203452y)--(7.910115x,24.454333y)--cycle;
  fill p 
    withpen pencircle scaled 0.1000x;
% set_line_color 0.000000, 0.000000, 0.000000
  draw (7.411901x,24.200793y)--(7.913661x,23.954345y)--(7.786891x,24.203452y)--(7.910115x,24.454333y)--cycle
    withpen pencircle scaled 0.1000x;
\stopuseMPgraphic
\starttext

\scale[width=\textwidth]{\useMPgraphic{mag2}}
\scale[width=\textwidth]{\useMPgraphic{mag2}}

\stoptext


[-- Attachment #3: Type: text/plain, Size: 487 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: exported figures from DIA to Metapost including in document
  2008-11-24 19:22       ` Jan-Erik Hägglöf
@ 2008-11-24 21:23         ` Aditya Mahajan
  2008-11-24 22:25           ` Jan-Erik Hägglöf
  2008-11-25  7:15           ` Taco Hoekwater
  0 siblings, 2 replies; 10+ messages in thread
From: Aditya Mahajan @ 2008-11-24 21:23 UTC (permalink / raw)
  To: janerik.hagglof, mailing list for ConTeXt users

[-- Attachment #1: Type: TEXT/PLAIN, Size: 712 bytes --]

On Mon, 24 Nov 2008, Jan-Erik Hägglöf wrote:

> I tried to do some fontsettings, maybe it was the wrong way setting up
> things. You can see in the updated file.

This is not your fault. There is a bug in MKIV definition of \cal. Test 
example:

\starttext
\startMPcode
   draw \sometxt{$\cal B$} ;
\stopMPcode
\stoptext

does not give caligraphic B. For the time being, you can use a 
work-around of adding \noexpand before \cal.

\starttext
\startMPcode
   draw \sometxt{$\noexpand\cal B$} ;
\stopMPcode
\stoptext

Hans, Taco: Is it OK to add \unexpanded in the definition of cal

\unexpanded\def\cal{\mathortext{\fam\purefamily{calligraphic}}{\symbolicfont{Calligraphic}}}

Aditya

[-- Attachment #2: Type: text/plain, Size: 487 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: exported figures from DIA to Metapost including in document
  2008-11-24 21:23         ` Aditya Mahajan
@ 2008-11-24 22:25           ` Jan-Erik Hägglöf
  2008-11-25 15:41             ` Aditya Mahajan
  2008-11-25  7:15           ` Taco Hoekwater
  1 sibling, 1 reply; 10+ messages in thread
From: Jan-Erik Hägglöf @ 2008-11-24 22:25 UTC (permalink / raw)
  To: Aditya Mahajan; +Cc: mailing list for ConTeXt users

It worked! Thanks a lot!

mån 2008-11-24 klockan 16:23 -0500 skrev Aditya Mahajan:
> On Mon, 24 Nov 2008, Jan-Erik Hägglöf wrote:
> 
> > I tried to do some fontsettings, maybe it was the wrong way setting up
> > things. You can see in the updated file.
> 
> This is not your fault. There is a bug in MKIV definition of \cal. Test 
> example:
> 
> \starttext
> \startMPcode
>    draw \sometxt{$\cal B$} ;
> \stopMPcode
> \stoptext
> 
> does not give caligraphic B. For the time being, you can use a 
> work-around of adding \noexpand before \cal.
> 
> \starttext
> \startMPcode
>    draw \sometxt{$\noexpand\cal B$} ;
> \stopMPcode
> \stoptext
> 
> Hans, Taco: Is it OK to add \unexpanded in the definition of cal
> 
> \unexpanded\def\cal{\mathortext{\fam\purefamily{calligraphic}}{\symbolicfont{Calligraphic}}}
Can this line above be copied and pasted in to my personal "module"
file?
> 

> Aditya

Cheers 
Janneman
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: exported figures from DIA to Metapost including in document
  2008-11-24 21:23         ` Aditya Mahajan
  2008-11-24 22:25           ` Jan-Erik Hägglöf
@ 2008-11-25  7:15           ` Taco Hoekwater
  1 sibling, 0 replies; 10+ messages in thread
From: Taco Hoekwater @ 2008-11-25  7:15 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Aditya Mahajan wrote:
> Hans, Taco: Is it OK to add \unexpanded in the definition of cal
> 
> \unexpanded\def\cal{\mathortext{\fam\purefamily{calligraphic}}{\symbolicfont{Calligraphic}}} 

I think so. It makes sense to have \unexpanded before every macro that
executes an unexpandable primitive command, as these will never be
expanded correctly anyway.

Best wishes,
Taco
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: exported figures from DIA to Metapost including in document
  2008-11-24 22:25           ` Jan-Erik Hägglöf
@ 2008-11-25 15:41             ` Aditya Mahajan
  0 siblings, 0 replies; 10+ messages in thread
From: Aditya Mahajan @ 2008-11-25 15:41 UTC (permalink / raw)
  To: Jan-Erik Hägglöf; +Cc: mailing list for ConTeXt users

[-- Attachment #1: Type: TEXT/PLAIN, Size: 310 bytes --]

On Mon, 24 Nov 2008, Jan-Erik Hägglöf wrote:

>> \unexpanded\def\cal{\mathortext{\fam\purefamily{calligraphic}}{\symbolicfont{Calligraphic}}}
> Can this line above be copied and pasted in to my personal "module"
> file?

For the time being, you should add this to your personal configuration.

Aditya

[-- Attachment #2: Type: text/plain, Size: 487 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2008-11-25 15:41 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-24 12:28 exported figures from DIA to Metapost including in document Jan-Erik Hägglöf
2008-11-24 14:08 ` Aditya Mahajan
2008-11-24 15:20   ` Jan-Erik Hägglöf
2008-11-24 15:40     ` Aditya Mahajan
2008-11-24 19:22       ` Jan-Erik Hägglöf
2008-11-24 21:23         ` Aditya Mahajan
2008-11-24 22:25           ` Jan-Erik Hägglöf
2008-11-25 15:41             ` Aditya Mahajan
2008-11-25  7:15           ` Taco Hoekwater
2008-11-24 14:09 ` Peter Rolf

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