\documentclass{article}
\everymath{\displaystyle}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[estonian]{babel}
\usepackage[a4paper]{geometry}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage[shellescape]{gmp}
\DeclareMathOperator{\ch}{ch}
\DeclareMathOperator{\sh}{sh}
\renewcommand\leq\leqslant
\renewcommand\geq\geqslant
\DeclareGraphicsRule{.1}{mps}{*}{}
\begin{document}
\begin{mpost*}
outputtemplate := "%j-%c.mps";
beginfig(1);
$ := 1;
for i = -.3cm step .6cm until 3.6cm:
% draw a line
draw (1cm,2cm) -- (3cm,5cm);
endfor;
endfig;
\end{mpost*}
\end{document}
答案1
删除以下行
outputtemplate := "%j-%c.mps";
并编译
pdflatex --shell-escape your_file_name.tex