ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Taco Hoekwater <taco@elvenkind.com>
Subject: Re: Making a verbatim file for another language
Date: Mon, 25 Dec 2006 11:38:44 +0100	[thread overview]
Message-ID: <458FAA34.7030507@elvenkind.com> (raw)
In-Reply-To: <58E326FC-9E9E-487E-A9D4-2CCA840F0E4D@mac.com>

cormullion@mac.com wrote:
> I'm going to try to make a 'verbatim- module' (don't know what the  
> right word is) for another language. I've found:
> 
> /usr/local/teTeX/share/texmf.tetex/tex/context/base/verb-pl.tex

The syntax of your intended language is indeed similar to perl?

There a few definition files already there, and you should start
from the one that is closest to the language you want to define
(especially wrt comment and string syntax).

   verb-c    C
   verb-eif  Eiffel
   verb-js   JavaScript
   verb-jv   Java
   verb-mp   MetaPost & MetaFont
   verb-pas  Pascal & Modula
   verb-pl   Perl 5
   verb-sql  SQL
   verb-tex  TeX
   verb-xml  XML

> and can probably have a go at making a version of this. Some  
> questions occur:
> 
> 1: where should i put my file?

Possibly the
best place is:     in the context distribution, but that depends a bit
                    on what language it is, precisely (you can email me
                    the completed file, in that case).

Second best place: http://modules.contextgarden.net, so it can be
                    included in cont-ext.zip (third-party addons that
                    are distributed by Pragma-Ade alongside the normal
                    distribution).

Third best:        The directory <$HOME/texmf/tex/context/base> (the
                    place where your TeX installation finds local files,
                    I do not immediately recall the name gwTeX uses).

Final option:      Same directory as the file to be processed

> 2: do I have to do anything else to get Context to recognise and use it?

Your file has to have a name like verb-xxxx.tex, with xxxx a lowercase
short identifier (example: verb-php.tex), and then you have to use one
or two commands to make ConTeXt use the file.

First:

    \installprettytype [PHP]        [PHP]

This maps the command \starttyping[option=PHP] to verb-php.tex.
The first argument is the option as passed to \starttyping,
the second argument is an uppercase version of xxxx (thus
allowing context to find the file),

And you probably also want:

    \definetyping[PHP]   [option=PHP]

Because that allows  \startPHP ... \stopPHP as a shortcut to
\setuptyping[option=PHP]


Good luck, Taco

  reply	other threads:[~2006-12-25 10:38 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-25  9:24 cormullion
2006-12-25 10:38 ` Taco Hoekwater [this message]
2006-12-25 15:22   ` cormullion
2006-12-26 16:59   ` Henning Hraban Ramm
2006-12-26 18:47     ` Mojca Miklavec
2006-12-26 21:25       ` cormullion
2006-12-27 21:41         ` Aditya Mahajan
2006-12-28  8:15           ` cormullion
2006-12-28 17:09             ` Aditya Mahajan
2006-12-28 18:05               ` cormullion
2006-12-28 23:47                 ` Mojca Miklavec
2006-12-29  8:46                   ` cormullion
2006-12-29 13:09                     ` Mojca Miklavec
2006-12-29 15:37                       ` Aditya Mahajan
2006-12-29 15:42                       ` cormullion
2006-12-29 15:59                         ` Aditya Mahajan
2006-12-29 16:36                           ` cormullion
2006-12-29 18:39                         ` Mojca Miklavec
2006-12-30  9:22               ` Jarimatti Valkonen
2006-12-30 14:18                 ` cormullion
2006-12-30 21:24                   ` Jarimatti Valkonen
2006-12-31 11:51                     ` cormullion
2006-12-31 13:40                       ` Mojca Miklavec
2006-12-31 16:57                         ` cormullion
2006-12-25 18:12 ` Mojca Miklavec
2006-12-25 19:37   ` Aditya Mahajan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=458FAA34.7030507@elvenkind.com \
    --to=taco@elvenkind.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).