Wednesday, July 13, 2016

Re: metapost indentation problem

在 2007年8月1日星期三 UTC+8下午2:16:19,Zhaojun WU写道:
> Hi, Peng Yu,
>
> On 7/31/07, Peng Yu <PengYu.UT@gmail.com> wrote:
> >
> > Hi,
> >
> > There are some metapost indentation problems like the following (.mp
> > file). Can somebody let me fix them?
> >
> > Thanks,
> > Peng
> >
> > for i = 0 upto 3:
> > for j = 0 upto 3:
> > dotlabel ("", (i+.5,j+.5)*8*u);
> > endfor
> > endfor
> >
> > def square(expr x, y, s) =
> > unitsquare scaled s shifted (x,y)
> > enddef;
> >
> > def circle(expr x, y, r) =
> > fullcircle scaled (2*r) shifted (x,y)
> > enddef;
> >
> I changed a bit of the codes in $VIMRUNTIME/indent/mp.vim to resolve
> the indentation problem for nested "FOR". It seems to me that this
> modification is working well for your problem. (you can download the
> attached mp.vim to replace the original one after you make a backup of
> it)
>
> But, as a reminder, the original author mentioned that "First of all,
> MetaPost language don't expect any identation rules." So that if you
> want other indentation format, you'd better to DIY the mp.vim.
>
> HTH,
> --
> Best,
> Zhaojun (Joseph)

I use mpgraphics.sty to include mp code into tex source. And I need to indent the following code correctly:
\begin{mpdisplay}
for i=1 upto 2:
show i;
endfor;
\end{mpdisplay}

Can you help me?

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: