Drawing with MetaPost for Tex (with WinEdit7.0 as editor)

Source: Internet
Author: User

MetaPostIt's a descriptive language., use it to make very nice graphics. ideal for precise graphics. MetaPostcan generate the highest qualityEPSfiles that can be conveniently inserted into theTeXin the file. Generated byDVIfile can be without any problems of beingdvipsconverted intoPS,or beDVIPDFMconverted intoPDF.

in July, he was fortunate enough to write a paper for an American professor, one of his American students helped writeTexThe file shook me deeply, all the charts were usedtikzpictureThe package was written, and at first it looked wholeTexhalf of the file is the code of the drawing, which I am very surprised, on the one hand, with the students aroundVisioThe drawing form looks sharp contrast, on the other hand is also deeplyMatof theTexThe skill was impressed, I came back to check, foundTexused in theEPSpictures can be done in addition totikzpictureThere are a lot of people out there that can do things like macro packages.MetaPostThis tool drawing, so I began my long process, see here Everyone also understand, today I will be how to useMetaPostto us.Texfile to add a variety of beautiful pictures.

Open Winedit (I used to be 7.0 version), I went through two times to find a big M tool, stuck through the mouse, confirms my conjecture, that's what we need. ---metapost , see (The Red Oval circle comes out, put in why is gray, see below).

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/4B/B9/wKiom1QxHaez3xOOAAFd7PVoFjM394.jpg "title=" 1.png " alt= "Wkiom1qxhaez3xooaafd7pvofjm394.jpg"/>

in order to get started as soon as possible, I also found a lot of information, here I choose to help me the biggest blog as a representative, we can also refer to the following http://blog.sina.com.cn/s/blog_4945c47301000a70.html , and I found it on the homepage of Wang Yin, Tsinghua University. MetaPost related Routines http://www.ctex.org/documents/shredder/metapost.html , please believe me, these two information is definitely worth your visit to learn the good information.

It seems that the topic is far away, back to the point, after the tool bar found the tool, I created a new file, simple Copy a section of the drawing code, as follows:

Verbatimtex

%&latex

\documentclass{article}

\begin{document}

Etex

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Beginfig (1)

Pair A, b,c;

A:= (0,0); B:= (25px,0); C:= (0,25px);

Drawa--b--c;

Endfig;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Verbatimtex

\end{document}

Etex End

put it in and save it, and save it directly as MP format of the file, I gave a name called 1.mp , then, the drawing code is finished, after the completion of the save, you will find that this time M becomes available,

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/4B/BB/wKioL1QxHfrD6erjAAHXw305SPA475.jpg "title=" 2.png " alt= "Wkiol1qxhfrd6erjaahxw305spa475.jpg"/>

this time click m , the console will have a bunch of output, as long as the error is not the case, after the compilation, you will find in the folder more than one Span style= "background: #FFFFFF;" >1.1 file, so a monster that looks even like a suffix is actually generated eps image files, if you don't believe, you can just change the suffix to open it (plus .eps suffix then open to view), is it a bit too simple?

speaking of which I have a little hint, online a lot of information is recommended to use the command line to carry out, I tested a bit actually can be, but here I feel a bit M more convenient, for some of the more accustomed to command-line operations of the small partners, may use the Command Guild more accustomed.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/4B/B9/wKiom1QxHeSyi72LAAFWv7GFL4g257.jpg "title=" 3.png " alt= "Wkiom1qxhesyi72laafwv7gfl4g257.jpg"/>

Below we just need to make the generated 1.1 file referenced in the Tex file, the code is as follows

\documentclass[a4paper]{article}

\USEPACKAGE{CJK}

\USEPACKAGE{GRAPHICX}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}

\begin{cjk*}{gbk}{song}

\renewcommand\figurename{ diagram }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

The following are the Fig examples of references

\BEGIN{FIGURE}[HTBP]

\begin{center}

\includegraphics{1.1}

\end{center}

\caption{ A reference to fig }

\end{figure}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\end{cjk*}

\end{document}

Okay, compile, view, PDF file can be displayed, it is so simple, first of all, I'm rushing to prepare a weekly newspaper, Bye


To supplement the information just found, see, Source: Reitach Typesetting System Introduction second Edition

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/4B/BC/wKioL1QxMt2zq5nFAANSPFcFxhg116.jpg "title=" QQ picture 20141005195805.jpg "alt=" Wkiol1qxmt2zq5nfaanspfcfxhg116.jpg "/>


Finally add a sentence, just found an online metapost edit website, recommend to everyone http://www.tlhiv.org/mppreview/, specifically how to use believe not I say more


Drawing with MetaPost for Tex (with WinEdit7.0 as editor)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.