ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Beautiful source code
@ 2007-06-04 18:16 David Arnold
  2007-06-04 19:39 ` Hans Hagen
  0 siblings, 1 reply; 3+ messages in thread
From: David Arnold @ 2007-06-04 18:16 UTC (permalink / raw)
  To: Context Mailing List List; +Cc: Hans Hagen

Hans,

I'm revisiting the metafun manual and I am marveling at the format of  
the source code. For example:

\starttabulate[|lT|l|]
\HL
\NC \METAPOST\ code     \NC mathematical equivalent \NC \NR
\HL
\NC (x,y) shifted (a,b) \NC $(x+a,y+b)$     \NC \NR
\NC (x,y) scaled  s     \NC $(sx,sy)$       \NC \NR
\NC (x,y) xscaled s     \NC $(sx,y)$        \NC \NR
\NC (x,y) yscaled s     \NC $(x,sy)$        \NC \NR
\NC (x,y) zscaled (u,v) \NC $(xu-yv,xv+yu)$ \NC \NR
\NC (x,y) slanted s     \NC $(x+sy,y)$      \NC \NR
\NC (x,y) rotated r     \NC $(x\cos(r)-y\sin(r),x\sin(r)+y\cos(r))$  
\NC \NR
\HL
\stoptabulate

Pasting into my email program does not do this code snippet justice,  
as in the Metafun source, all of the \NC's are aligned vertically, as  
are the \NR's. How do you do this? Does your editor align these for  
you, or do you painstakenly align them manually with the spacebar?


___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Beautiful source code
  2007-06-04 18:16 Beautiful source code David Arnold
@ 2007-06-04 19:39 ` Hans Hagen
  2007-06-07 12:45   ` Karsten Heymann
  0 siblings, 1 reply; 3+ messages in thread
From: Hans Hagen @ 2007-06-04 19:39 UTC (permalink / raw)
  To: mailing list for ConTeXt users

David Arnold wrote:
> Hans,
>
> I'm revisiting the metafun manual and I am marveling at the format of  
> the source code. For example:
>
> \starttabulate[|lT|l|]
> \HL
> \NC \METAPOST\ code     \NC mathematical equivalent \NC \NR
> \HL
> \NC (x,y) shifted (a,b) \NC $(x+a,y+b)$     \NC \NR
> \NC (x,y) scaled  s     \NC $(sx,sy)$       \NC \NR
> \NC (x,y) xscaled s     \NC $(sx,y)$        \NC \NR
> \NC (x,y) yscaled s     \NC $(x,sy)$        \NC \NR
> \NC (x,y) zscaled (u,v) \NC $(xu-yv,xv+yu)$ \NC \NR
> \NC (x,y) slanted s     \NC $(x+sy,y)$      \NC \NR
> \NC (x,y) rotated r     \NC $(x\cos(r)-y\sin(r),x\sin(r)+y\cos(r))$  
> \NC \NR
> \HL
> \stoptabulate
>
> Pasting into my email program does not do this code snippet justice,  
> as in the Metafun source, all of the \NC's are aligned vertically, as  
> are the \NR's. How do you do this? Does your editor align these for  
> you, or do you painstakenly align them manually with the spacebar?
>   
just manually ; the cleaner the ascii text, the less chance of errors (typos or coding); company policy/habit; it hardly takes more time;  

Hans  


-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Beautiful source code
  2007-06-04 19:39 ` Hans Hagen
@ 2007-06-07 12:45   ` Karsten Heymann
  0 siblings, 0 replies; 3+ messages in thread
From: Karsten Heymann @ 2007-06-07 12:45 UTC (permalink / raw)
  To: mailing list for ConTeXt users

2007/6/4, Hans Hagen <pragma@wxs.nl>:
> David Arnold wrote:
[...]
> > Pasting into my email program does not do this code snippet justice,
> > as in the Metafun source, all of the \NC's are aligned vertically, as
> > are the \NR's. How do you do this? Does your editor align these for
> > you, or do you painstakenly align them manually with the spacebar?
>
> just manually ; the cleaner the ascii text, the less chance of errors (typos or coding); company policy/habit; it hardly takes more time;

A side note: When using LaTeX, emacs+auctex can do that with the
"align-current" function. It would in fact be very nice if auctex's
context mode was equally powerful.

Yours
Karsten
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-06-07 12:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-04 18:16 Beautiful source code David Arnold
2007-06-04 19:39 ` Hans Hagen
2007-06-07 12:45   ` Karsten Heymann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).