In recent days, the boss to go abroad, a lot of things anxious to finish, so busy, did not sleep a good sleep, anyway, a sentence: enough to hurt the egg! A little bit of time, talk about the recent use of metapost painting flowchart of a little feeling it.
First of all, many people do not recommend the use of MetaPost to draw a flowchart, of course, it is certainly reasonable, such as the context is widely recommended, or other specifically used to draw a flowchart of the tool, and even asked Latex to provide a picture flowchart of the macro package why also use other tools to draw a flowchart, Here I insist to use metapost reason is very simple, because I recently learning this east, with it to draw out of the diagram feel very beautiful, so I am sure to draw a flowchart certainly is no problem, as for you to use other tools, I also very much agree, anyway to achieve the effect on the line.
First of all, to introduce the Metaflow, from the name can also be seen, this is a painting flowchart of the special package, is written by Kevin Hamlen A toolkit, the specific introduction can see his home page, the address is here: http://www.utdallas.edu/~ hamlen/projects.html, I tried to use this tool to draw the flowchart I need, but encountered some small problems (this later), first say how to use it, first of all, of course, download the need for METAFLOW.MP and Mftext.tex, these two files is the labor of Kevin Hamlen, download the matter directly into your MP file under the same folder is OK, such as I do:
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/4D/DC/wKioL1RbL8zDq_MEAAFDMnaWyds943.jpg "title=" Qq20141106162011.jpg "alt=" Wkiol1rbl8zdq_meaafdmnawyds943.jpg "/>
One of the chart.mp is my own painting Flowchart MP files, of course, can also see the generated EPs and PDF files, this is something, it is important to paste the code up
Input Metaflow
Prologues: = 2;
Filenametemplate "%j-%c.eps";
Verbatimtex
\documentclass[10pt]{article}
\renewcommand\familydefault{\sfdefault}
\input Mftext
\begin{document}
Etex
Beginfig (1)
z1c = (0,0);
Draw Rect1 (Btex he etex);
Putitem2 20right of 1;
Draw Oval2 (btex result etex);
Drawarrow connector (1,2,right,right);
Putitems (2,3) like ();
%z3s = (55,30);
Draw Diamond3 (Btex evaluation Etex);
Drawarrow connector (2,3,right,right);
Drawarrow Connector1 (3,1,down,up);
Z4um = point 1.5 of CP1;
Drawopen Rect4 (Btex revise Etex);
Putitems (3,5) like ();
Drawopen Rect5 (btex successful Etex);
Drawarrow connector (3,5,right,right);
Endfig;
Verbatimtex
\end{document}
Etex
End
Note that the red two lines, which is a reference to Metaflow, I understand is equivalent to the METAFLOW.MP and Mftext.tex code to replace the two lines directly, of course, this understanding may not be entirely right, but at least that is the meaning.
The following is the focus, pay attention to see z1c = (0,0); In fact, this is just the point of defining a central point at (0,0), but each character is meaningful: Z means the point is defined, 1 is the identification of the point, C is defined as its central point, although at first glance it seems to be absolutely streamlined and convenient, but for beginners it is simply egg pain, The first time I look at the code completely do not understand ah, although the gradual contact with more can understand the specific meaning of each character, but still for this extremely concise year practice expressed hate unacceptable, so if you do not often use this tool to draw, you still do not use Metaflow, Because you can't use it for a short time, it's really handy for people who are used to it, but it's hard for beginners to remember the meaning of so many characters.
Here is the problem I encountered when I used, is that the text in the process is always out of bounds, such as the following diagram:
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/4D/DE/wKiom1RbMlLA5GbDAACjTP-uGuo440.jpg "title=" Qq20141106162011.jpg "alt=" Wkiom1rbmlla5gbdaacjtp-uguo440.jpg "/>
Obviously, evaluste the last two characters are beyond the boundary, very ugly ah, of course, here is the most questionable is that I have not really learned to use this stuff, so the code has a problem does not have to set the corresponding, if the big God know so correct, please leave a message to tell me, or I can solve the problem later, will also be supplemented accordingly.
Metaflow said here, the following is another thing, from MetaPost's original author John_hobby (I think so, because in his written a User's Manual for metapost I actually found a detailed introduction to box, So guess box should be he wrote, in fact, box design is not used to draw flowchart, but it is very easy to use to draw flowchart, nonsense not to say, directly download boxes.mp and RBOXES.MP, here http://ctan.mackichan.com/ obsolete/systems/msdos/metapost/mpinputs/, after downloading the processing method and Metaflow similar, directly put in the same folder, directly on the code:
\input rboxes
Beginfig (501);
Pair Disx,disy;
Disx:= (11,0);
Disy:= (0,17);
RBOXIT.A (Btex $L $ hears beep at $t _{beep,l}$ Etex);
A.N = (0,0);
Drawboxed (a);
RBOXIT.B (Btex \begin{tabular}{c} $L $ promoted to leader \\by $A $, with $t _{beep,l}$ \\corresponding to $t _{beep,a}$ \end{ Tabular} Etex);
B.NW = A.NE+DISX;
Drawboxed (b);
BOXIT.C (Btex \begin{tabular}{c} $X _l = (x_a \cap n_l) \cup \{a\}$ \\$\lambda_l = n_l-x_l$ \end{tabular} etex);
C.W=B.E+DISX;
Drawboxed (c);
Drawarrow B.E--C.W;
...............
code too long, it is not all posted out, note that there is only one \input Rboxes without Actually, the reason is simple, I wrote \input boxes , result compilation error, then I looked at rboxes.mp Document, the result is the first sentence is
Well, it's time to say the problem, the problem is not able to use box to draw diamonds, although seen a variety of changes, but did not change the diamond (that is, the decision in the flowchart), do not know which God can provide a solution, finally I chose to draw a closed path to draw a diamond, But obviously not the best result, at least for the internal text processing and scaling size is not as smart as box, you know, box will not appear in the metaflow that the text out of the question. After studying for the afternoon, I decided to write a diamond.mp, like box, to encapsulate one myself, but I haven't finished writing it yet.
Here, by the way, a lot of people don't know how to wrap the text in box, here's a solution for someone else, which is to build a table inside box, such as the following:
RBOXIT.N (Btex \begin{tabular}{c} (3b) Promote $P $ \\to leader with \ \ $[t_{beep,l}, x_l]$ \end{tabular} etex);
Finally paste a bar, this is my paper used a flowchart, we look at the effect
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/4D/DE/wKiom1RbNwyynfQgAAO9Cs57cQo511.jpg "title=" Qq20141106162011.jpg "alt=" Wkiom1rbnwyynfqgaao9cs57cqo511.jpg "/>
I feel more good-looking, how we feel, welcome suggestions.
OK, it's time to eat again, walk up ~ ~ ~
This article is from the "Book Mountain Road" blog, please be sure to keep this source http://stevekeepgoing.blog.51cto.com/7993033/1573774
MetaPost drawing flowchart of several options metaflow or box?