From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/70888 Path: news.gmane.org!not-for-mail From: Alasdair McAndrew Newsgroups: gmane.comp.tex.context Subject: Re: Matlab formatting? Date: Fri, 26 Aug 2011 16:36:55 +1000 Message-ID: References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0741686721==" X-Trace: dough.gmane.org 1314340630 27604 80.91.229.12 (26 Aug 2011 06:37:10 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 26 Aug 2011 06:37:10 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Fri Aug 26 08:37:05 2011 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Qwq2K-0004Dk-5O for gctc-ntg-context-518@m.gmane.org; Fri, 26 Aug 2011 08:37:04 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 6BD63CAF14; Fri, 26 Aug 2011 08:37:03 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id qhjaKTfoVknl; Fri, 26 Aug 2011 08:37:00 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id B910CCAF10; Fri, 26 Aug 2011 08:37:00 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 42F17CAF10 for ; Fri, 26 Aug 2011 08:36:59 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id YSiRNkEhv8o9 for ; Fri, 26 Aug 2011 08:36:56 +0200 (CEST) Original-Received: from filter4-nij.mf.surf.net (filter4-nij.mf.surf.net [195.169.124.155]) by balder.ntg.nl (Postfix) with ESMTP id B0608CAF0E for ; Fri, 26 Aug 2011 08:36:56 +0200 (CEST) Original-Received: from mail-bw0-f41.google.com (mail-bw0-f41.google.com [209.85.214.41]) by filter4-nij.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p7Q6atCn005746 for ; Fri, 26 Aug 2011 08:36:55 +0200 Original-Received: by bkbzt4 with SMTP id zt4so3127516bkb.14 for ; Thu, 25 Aug 2011 23:36:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=qNKr21fJpRVLdiPBwMyL5MspkA508UZveAXuAF29IP8=; b=GLxiqnGw6LiKopbpy2eU9ZibMusLD2pbThz0E0Oz2YEnOyjH41ndtOZ5+/cv+p57M8 o9ZCnswiXRx04YAfUn8gyVE6XdR5jXvusJIy+27nAlj+Q/IMtRKcsMoWuXHCl0hcoHor BOURJ5WgDFHQ+E/EwUVAbl3RbJUW9U2d0Db0A= Original-Received: by 10.204.140.13 with SMTP id g13mr377537bku.65.1314340615107; Thu, 25 Aug 2011 23:36:55 -0700 (PDT) Original-Received: by 10.205.83.5 with HTTP; Thu, 25 Aug 2011 23:36:55 -0700 (PDT) In-Reply-To: X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.214.41; country=US; region=CA; city=Mountain View; postalcode=94043; latitude=37.4192; longitude=-122.0574; metrocode=807; areacode=650; http://maps.google.com/maps?q=37.4192,-122.0574&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 04FoSAT70 - b3a2b1f17d6a - 20110826 X-Scanned-By: CanIt (www . roaringpenguin . com) on 195.169.124.155 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:70888 Archived-At: --===============0741686721== Content-Type: multipart/alternative; boundary=0015174c3b867a33b704ab62c56b --0015174c3b867a33b704ab62c56b Content-Type: text/plain; charset=ISO-8859-1 Thank you so much! The vim module with Matlab formatting is just what I wanted. -Alasdair On Fri, Aug 26, 2011 at 4:02 PM, Mojca Miklavec < mojca.miklavec.lists@gmail.com> wrote: > On Fri, Aug 26, 2011 at 07:42, Alasdair McAndrew wrote: > > Hello, > > > > I'm writing up some student notes about Matlab, and I'm including > examples > > of Matlab functions. I'd like all the functions to be typeset in > typewriter > > font (which means using a "typing" environment), but I'd also like some > > colorization. For example, I want to display a function such as > > > > function out = add(a,b) > > % > > % ADD(A,B) returns the sum of A and B > > % > > out = a+b; > > > > in a frame, and with the three lines beginning with % all colored green. > > (If I can color reserved words like "function" that's even better.) > What's > > the easiest way to achieve this? > > You have three options: > - use t-vim module (http://modules.contextgarden.net/vim) > - manually apply commands for formatting > - write a parser in lpeg (and plug it into existing highlighting > functionality) > > Probably the easiest way is to use the vim module. (Vim does the > syntax highlighting and TeX typesets the result. The layout is > configurable.) > > Mojca > > ___________________________________________________________________________________ > 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 : http://foundry.supelec.fr/projects/contextrev/ > wiki : http://contextgarden.net > > ___________________________________________________________________________________ -- Blog: http://amca01.wordpress.com Web: http://bit.ly/Alasdair Facebook: http://www.facebook.com/alasdair.mcandrew --0015174c3b867a33b704ab62c56b Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Thank you so much!=A0 The vim module with Matlab formatting is just what I = wanted.

-Alasdair

On Fri, Aug 26, = 2011 at 4:02 PM, Mojca Miklavec <mojca.miklavec.lists@gmail.com> = wrote:
On Fri, Aug 26, 2011 at 07:42, Alasdair McAndrew wrote:
> Hello,
>
> I'm writing up some student notes about Matlab, and I'm includ= ing examples
> of Matlab functions.=A0 I'd like all the functions to be typeset i= n typewriter
> font (which means using a "typing" environment), but I'd= also like some
> colorization.=A0 For example, I want to display a function such as
>
> function out =3D add(a,b)
> %
> % ADD(A,B) returns the sum of A and B
> %
> out =3D a+b;
>
> in a frame, and with the three lines beginning with % all colored gree= n.
> (If I can color reserved words like "function" that's ev= en better.)=A0 What's
> the easiest way to achieve this?

You have three options:
- use t-vim module (http://modules.contextgarden.net/vim)
- manually apply commands for formatting
- write a parser in lpeg (and plug it into existing highlighting functional= ity)

Probably the easiest way is to use the vim module. (Vim does the
syntax highlighting and TeX typesets the result. The layout is
configurable.)

Mojca
___________________________________________________________________________= ________
If your question is of interest to others as well, please add an entry to t= he Wiki!

maillist : ntg-context@ntg.nl / <= a href=3D"http://www.ntg.nl/mailman/listinfo/ntg-context" target=3D"_blank"= >http://www.ntg.nl/mailman/listinfo/ntg-context
webpage =A0: http://= www.pragma-ade.nl / http://tex.aanhet.net
archive =A0: http://foundry.supelec.fr/projects/contextrev/
wiki =A0 =A0 : http:= //contextgarden.net
___________________________________________________________________________= ________



--
Blog: http://amca01.wordpress.com
Web:=A0= http://bit.ly/Alasdair
Facebook: http://www.= facebook.com/alasdair.mcandrew
--0015174c3b867a33b704ab62c56b-- --===============0741686721== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ --===============0741686721==--