[OS X TeX] metapost question
Maarten Sneep
maarten.sneep at xs4all.nl
Sat Dec 15 09:13:51 CET 2007
On 15 dec 2007, at 02:45, Bruce Kellogg wrote:
> Unfortunately, I was not precise in my original question. I include
> some text in the metapost file, such as labeling of axes, etc.
> This text is included with commands such as
>
> \tlabel{(1.75,-.8)}{\small$x$}
>
> This text is not to be found in the file KK3.1, so when I use
> \includegraphics{KK3.1}
> to put the picture into my big latex file, the picture is not
> complete as
> there are no axis labels, etc. In the third attempt that I describe,
> I get the picture + labels,
> but they are pushed below some empty space. Maybe I should just try
> fiddling with
> the numbers in the command
>
> \begin{mfpic}[40]{-2}{2}{-20}{-16}
>
> and maybe this will push the picture into a correct location. I have
> not tried this yet,
> and indeed it seems to be an unnatural solution to my problem if it
> works.
I don't use the mfpic latex package, but I'll show you a sample from
my setup because it might be helpful.
% include some metapost macro pacages to produce graphs and my custom
graph sizing.
input graph;
input support/figsize.mp
% put your latex preamble here. Include things like fonts and font
sizing.
% They need to work with LaTeX in dvi production mode.
verbatimtex
%&latex
\documentclass[10pt]{article}
\usepackage{mathptmx}
\begin{document}
etex
prologues := 2 ;
%% Description: the coordinate system
beginfig(0) ;
numeric scalefactor; scalefactor := 1.2cm;
numeric theangle; theangle := -32;
pair pntone, pnttwo ;
pntone := (0,scalefactor);
pnttwo := pntone rotated theangle;
draw (-1.1*scalefactor,0) -- (1.1*scalefactor,0) withpen pencircle
scaled 0.5pt withcolor black;
draw (0,-1.1*scalefactor) -- (0,1.1*scalefactor) withpen pencircle
scaled 0.5pt withcolor black;
drawarrow (0, -0.5*scalefactor) -- (0,0.5*scalefactor) withpen
pencircle scaled 1.5pt withcolor black;
draw origin -- (0,1.1*scalefactor) rotated theangle withpen pencircle
scaled 0.5pt withcolor black;
drawarrow for i=0 step -4 until theangle+4: (pntone rotated i) ..
endfor pnttwo withpen pencircle scaled 0.5pt withcolor black;
% here some text is included
draw btex $z$ etex shifted (-2.5mm, 11mm) ;
draw btex $\Vector{p}$ etex shifted (1mm, -3mm);
draw btex $\vartheta'$ etex rotated 10 shifted (0,8mm) rotated -10;
endfig ;
verbatimtex
\end{document}
etex
end
%% end of metapost document. Save as 'angles.mp' and run the following
commands from the command-line (there may be an easier way with
TeXShop, I don't know, others will comment).
mpost -tex=latex angles.mp
mptopdf angles.0
mv angles.0 angles.mps
mv angles-0.pdf angles.pdf
and then use angles.pdf with pdflatex as you would do normally.
pdflatex can also use angles.mps and convert on the fly. This may
actually be preferred because it prevents multiple inclusion of your
fonts (not sure about that).
Hope this may help.
Maarten
More information about the macostex-archives
mailing list