Skip to Content.
Sympa Menu

texmacs-users - [TeXmacs] Re: literate programming, again. Question about syntax highlighting.

Subject: mailing-list for TeXmacs Users

List archive

[TeXmacs] Re: literate programming, again. Question about syntax highlighting.


Chronological Thread 
  • From: Michael Lachmann <address@hidden>
  • To: address@hidden
  • Subject: [TeXmacs] Re: literate programming, again. Question about syntax highlighting.
  • Date: Sat, 12 Sep 2009 13:04:35 +0200
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=A4PPbh+gdqO+Vq74MSN6kSiaMXDq3IcFuAltRUqyrNa3X7ZPDdiFv2fN/E64tE2aat leu3weBIYmKvK/B/CcXFCQWHr7wXo6oO1qxIm0OuD1et0o2VH5QSQ/mZAnmeLo69wCeq b/VWmH7llQJpCwKjpAC1HwofI1QBYir6gclLI=

Some more about syntax highlighting.

In the document style tmdoc there are formating styles for different
programming languages, like scheme, shell, and c++. These show up as
nice light-blue boxes, and have syntax highlighting.


By copying and pasting from the documentation and using the tmdoc
style, I managed to create the attached literate programing example.
This is much nicer than what I had before! (Notice that in the
previous example I manually formated strings to have certain colors,
whereas here it is all done by teXmacs....)
It is actually all I need, maybe apart from:
- automatic indentation (it also exists in TeXmacs, when editing scm
files... how do I harness the power?)
- adding the "@" at the end of a code section automatically,
- formating the "<<section>>" in a special style, and adding
links/labels to them automatically.

But even like this, it is much more than I had hoped!

I have the following questions, though:

1. How do I insert these styles without copy/pasting them from the
documentation?
2. Where are the programming languages defined? I searched all through
the source code, but couldn't find where it is defined that "cout" and
"cin" are keywords of c++.

On an unrelated subject, it would be really nice if TeXmacs could
format R code in the same way it formats C++ or shell code here. What
should I do to add this to the R plugin?

thanks,
Michael

Attachment: test.tm
Description: Binary data




Archive powered by MHonArc 2.6.19.

Top of Page