I am using Metapost software 18.0.1. I have created some plots. How should I export them that I can easily import all plots in Latex?
This is a difficult question to answer correctly, because there are several equally good ways to use MetaPost output with TeX. This means my answer is largely my own opinion, which might fall outside the normal guidelines for this site. You might want to read this guidance: https://tex.stackexchange.com/help/dont-ask
Nevertheless, just in case it is helpful to you and other new users of MetaPost, here is a description of my work flow for plain MetaPost. I work on a mac os system, and I use MacVim to edit MP source, and Skim.app to view the output files (.EPS and/or .PDF). I have the whole of MacTex installed locally.
I use this template file:
prologues := 3; outputtemplate := "%j%c.eps"; beginfig(1); endfig; end.
The first two lines are important:
prologues := 3; makes MP put the full font
details in the output so that the files are self-contained; the
line means that the output will be written to files with an extension of
(suggesting that they are Encapsulated PostScript).
I then add drawing and label commands, etc, and I compile the source
mpost. Usually I need several attempts to get a diagram right, so I open Skim to preview the output with
open -a Skim xxxxx.eps. I have Skim set up so that when I recompile the source, it automatically updates the view of the PostScript output.
If I want to use the diagram in a LaTeX document I can include the EPS file directly with
but usually I prefer to convert the EPS to PDF using
epstopdf rather than rely on
the automatic conversion. This is mainly because the PDFs are generally more useful
files to have about (I can include them in presentations etc).
Your mileage may vary.