From: "Jan-Erik Hägglöf" <janerik.hagglof@bredband.net>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: exported figures from DIA to Metapost including in document
Date: Mon, 24 Nov 2008 20:22:51 +0100 [thread overview]
Message-ID: <1227554571.5749.6.camel@lundby> (raw)
In-Reply-To: <alpine.LNX.2.00.0811241036490.7783@nqv-yncgbc>
[-- 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
___________________________________________________________________________________
next prev parent reply other threads:[~2008-11-24 19:22 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-24 12:28 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 [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1227554571.5749.6.camel@lundby \
--to=janerik.hagglof@bredband.net \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).