# [texhax] Two questions about mpgraphics

aiwanjun aiwanjun at swu.edu.cn
Tue Jul 12 06:27:49 CEST 2011

  I found the package mpgraphics on Ctan, and It do make me fell more convenient to draw graphics by MetaPost. Here I owe you a lot of thanks.
But still, there are two questions I want to solve.
First, I found that the figure that produced by mpdisplay is not labeled;
and Second, I want to use my TeX code file name instead the main file name_ fignum; This is quite helpful since I want to write all the Tex Code of figures in a main file(imagin in a paper there are more than ten graphics), and through which I called the file of figure code, which named by the chapter: such as fig1-2.tex or if there are two figures in the figure 2 of  chapter 1, I'd like to name it fig1-2_1.tex and fig1-2_2.tex respectively.
The following is a example of main file and figure file:
--------------------------------------
This is the main file
--------------------------------------
\documentclass{article}
\usepackage[compilation=on]{mpgraphics}
%\NoProcess[1-38]
\configure[mpggraphic][linewidth=1pt]
\begin{document}
\begin{mpdefs}
u:=10pt;
\input metaobj.mp
\end{mpdefs}
\input{source/fig1-1}
\input{source/fig1-2}
\input{source/fig2-1}
\input{source/fig2-2}
\end{document}
-------------------------------------
This is the figure code for fig1-1; which
as the \input say, is located in ./source/
folder
--------------------------------------
%fig1-1_1
\begin{mpdisplay}
draw fullcircle scaled 10u;
\end{mpdisplay}
%fig1-1_2
\begin{mpdisplay}
draw fullcircle scaled 50pt withcolor red;
\end{mpdisplay}
---------------------------------------
similarly for other figure codes;
I want to compile the main.tex and get fig1-1_1.eps (or pdf if in pdftex mode) and fig1-1_2.eps and so on;
Moreover (I think it should not hard), the fig1-1_1.eps is labeled as "fig1-1_1.eps" and so on; That is every figure is labeled after its name; That will help me to find which figure it is in a long list of figure.
Did I make myself clear? If not please Email me.

2011-07-12

aiwanjun
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/texhax/attachments/20110712/428f3573/attachment.html>