ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Making a verbatim file for another language
@ 2006-12-25  9:24 cormullion
  2006-12-25 10:38 ` Taco Hoekwater
  2006-12-25 18:12 ` Mojca Miklavec
  0 siblings, 2 replies; 26+ messages in thread
From: cormullion @ 2006-12-25  9:24 UTC (permalink / raw)


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

and can probably have a go at making a version of this. Some  
questions occur:

1: where should i put my file?
2: do I have to do anything else to get Context to recognise and use it?

cheers

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

* Re: Making a verbatim file for another language
  2006-12-25  9:24 Making a verbatim file for another language cormullion
@ 2006-12-25 10:38 ` Taco Hoekwater
  2006-12-25 15:22   ` cormullion
  2006-12-26 16:59   ` Henning Hraban Ramm
  2006-12-25 18:12 ` Mojca Miklavec
  1 sibling, 2 replies; 26+ messages in thread
From: Taco Hoekwater @ 2006-12-25 10:38 UTC (permalink / raw)


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

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

* Re: Making a verbatim file for another language
  2006-12-25 10:38 ` Taco Hoekwater
@ 2006-12-25 15:22   ` cormullion
  2006-12-26 16:59   ` Henning Hraban Ramm
  1 sibling, 0 replies; 26+ messages in thread
From: cormullion @ 2006-12-25 15:22 UTC (permalink / raw)


On 2006-12-25, at 10:38.0, Taco Hoekwater wrote:

> 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:
>
> Good luck, Taco

Thanks - I'll need it, I think. ;-) Your very helpful reply is most  
appreciated.

cheers

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

* Re: Making a verbatim file for another language
  2006-12-25  9:24 Making a verbatim file for another language cormullion
  2006-12-25 10:38 ` Taco Hoekwater
@ 2006-12-25 18:12 ` Mojca Miklavec
  2006-12-25 19:37   ` Aditya Mahajan
  1 sibling, 1 reply; 26+ messages in thread
From: Mojca Miklavec @ 2006-12-25 18:12 UTC (permalink / raw)


On 12/25/06, 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
>
> and can probably have a go at making a version of this. Some
> questions occur:
>
> 1: where should i put my file?
> 2: do I have to do anything else to get Context to recognise and use it?
>
> cheers

Unless you need that highlighting urgently, I would wait for luatex in
your case and write it in lua then (which is certainly less painful
than writing it in plain TeX). But it's up to you. I found those TeX
definitions too complicated to even try to understand, I would never
dare to try writing one by myself.

Mojca

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

* Re: Making a verbatim file for another language
  2006-12-25 18:12 ` Mojca Miklavec
@ 2006-12-25 19:37   ` Aditya Mahajan
  0 siblings, 0 replies; 26+ messages in thread
From: Aditya Mahajan @ 2006-12-25 19:37 UTC (permalink / raw)


On Mon, 25 Dec 2006, Mojca Miklavec wrote:

> On 12/25/06, 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
> >
> > and can probably have a go at making a version of this. Some
> > questions occur:
> >
> > 1: where should i put my file?
> > 2: do I have to do anything else to get Context to recognise and use it?
> >
> > cheers
> 
> Unless you need that highlighting urgently, I would wait for luatex in
> your case and write it in lua then (which is certainly less painful
> than writing it in plain TeX). But it's up to you. I found those TeX
> definitions too complicated to even try to understand, I would never
> dare to try writing one by myself.

Any update on 2context.vim? Then things could be as simple as

\startVIMtyping[ft=mylang,colorscheme=fancy]
Your code
\stopVIMtyping

with a external call to vim -u NONE buffer.tmp
with an appropriate autocommand to set filetype, colorscheme and 
source 2context.

Aditya

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

* Re: Making a verbatim file for another language
  2006-12-25 10:38 ` Taco Hoekwater
  2006-12-25 15:22   ` cormullion
@ 2006-12-26 16:59   ` Henning Hraban Ramm
  2006-12-26 18:47     ` Mojca Miklavec
  1 sibling, 1 reply; 26+ messages in thread
From: Henning Hraban Ramm @ 2006-12-26 16:59 UTC (permalink / raw)


Am 2006-12-25 um 11:38 schrieb Taco Hoekwater:

> 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).
> ...
> Good luck, Taco

I found that interesting and wikified it at http:// 
wiki.contextgarden.net/Verbatim_text (plus Mojca's comment to wait  
for LuaTeX) ;-)


Greetlings from Lake Constance!
Hraban
---
http://www.fiee.net/texnique/
http://contextgarden.net
http://www.cacert.org (I'm an assurer)

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

* Re: Making a verbatim file for another language
  2006-12-26 16:59   ` Henning Hraban Ramm
@ 2006-12-26 18:47     ` Mojca Miklavec
  2006-12-26 21:25       ` cormullion
  0 siblings, 1 reply; 26+ messages in thread
From: Mojca Miklavec @ 2006-12-26 18:47 UTC (permalink / raw)


On 12/26/06, Henning Hraban Ramm wrote:
> Am 2006-12-25 um 11:38 schrieb Taco Hoekwater:
>
> > 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).
> > ...
> > Good luck, Taco
>
> I found that interesting and wikified it at http://
> wiki.contextgarden.net/Verbatim_text (plus Mojca's comment to wait
> for LuaTeX) ;-)

Thanks for the remark. It seems that I'm not checking the wiki pages
reguraly enough to remove spam before others notice it ;)

Well ... I would now rather corerct my own remark into " ... or wait a
few days for Aditya's mail" ;)

Mojca

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

* Re: Making a verbatim file for another language
  2006-12-26 18:47     ` Mojca Miklavec
@ 2006-12-26 21:25       ` cormullion
  2006-12-27 21:41         ` Aditya Mahajan
  0 siblings, 1 reply; 26+ messages in thread
From: cormullion @ 2006-12-26 21:25 UTC (permalink / raw)


After looking at these files a bit more closely, I decided I didn't  
have a week to spare. Too much to learn and too few instructions. For  
now I'm sticking with plain old black verbatim code listings.  
Sometimes one has to set one's sights a little lower...! :-)

But thanks again.

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

* Re: Making a verbatim file for another language
  2006-12-26 21:25       ` cormullion
@ 2006-12-27 21:41         ` Aditya Mahajan
  2006-12-28  8:15           ` cormullion
  0 siblings, 1 reply; 26+ messages in thread
From: Aditya Mahajan @ 2006-12-27 21:41 UTC (permalink / raw)


On Tue, 26 Dec 2006, cormullion@mac.com wrote:

> After looking at these files a bit more closely, I decided I didn't 
> have a week to spare. Too much to learn and too few instructions. For 
> now I'm sticking with plain old black verbatim code listings. 
> Sometimes one has to set one's sights a little lower...! :-)

Is there vim syntax file for your language? Mojca and I are working on 
a module which uses VIM syntax highlighting to pretty print verbatim 
files. It is almost release quality right now. The following features 
are working.

You can define

\defineVIMtyping [MATLAB]  [syntax=matlab]

and then use

\startMATLAB
....
\stopMATLAB

where the result is pretty printed.

A whole file can be printed using

\definetypeVIMfile [typeMATLAB] [syntax=matlab]

\typeMATLAB[file.m]

You can select the lines of the file to print, though there is no 
support for showing linenumbers yet.

The script is slooow, and the delay is noticable for anything close to 
1000 lines. But a few 100 lines should work just fine.

If you have vim and are interested in testing, you can be the first 
tester of the module :)

Aditya

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

* Re: Making a verbatim file for another language
  2006-12-27 21:41         ` Aditya Mahajan
@ 2006-12-28  8:15           ` cormullion
  2006-12-28 17:09             ` Aditya Mahajan
  0 siblings, 1 reply; 26+ messages in thread
From: cormullion @ 2006-12-28  8:15 UTC (permalink / raw)


On 2006-12-27, at 21:41.0, Aditya Mahajan wrote:

> If you have vim and are interested in testing, you can be the first
> tester of the module :)

Hi! Yes I can find a vim module, so if you can tell me which files to  
put where, I'll give it a try!

thanks

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

* Re: Making a verbatim file for another language
  2006-12-28  8:15           ` cormullion
@ 2006-12-28 17:09             ` Aditya Mahajan
  2006-12-28 18:05               ` cormullion
  2006-12-30  9:22               ` Jarimatti Valkonen
  0 siblings, 2 replies; 26+ messages in thread
From: Aditya Mahajan @ 2006-12-28 17:09 UTC (permalink / raw)


[-- Attachment #1: Type: TEXT/PLAIN, Size: 2149 bytes --]

On Thu, 28 Dec 2006, cormullion@mac.com wrote:

> On 2006-12-27, at 21:41.0, Aditya Mahajan wrote:
> 
> > If you have vim and are interested in testing, you can be the first
> > tester of the module :)
> 
> Hi! Yes I can find a vim module, so if you can tell me which files to 
> put where, I'll give it a try!

I have attached the files. Please note that we are still playing 
around with the module, so certain features will change.

Right now, place t-vimsyntax.tex and 2context.vim files in the working 
directory. You need to have write18 enabled.

Add \usemodule[vimsyntax] on the top of your file. (And ofcourse,
\setupcolors[state=start])

1. If you want to typeset an existing file, and lets say the filetype 
(in vim's terms) is ruby. Then

\definetypeVIMfile [name of macro] %Usually typeRUBY, typeMATLAB, etc.
       [ % Optional arguments
        start=<linenumber>, %starting line number, defaults to 1
        stop=linenumber,    %stopping line number, defaults to 0,
                            %and 2context makes it end of file
        tab=<tabstop>,      %How many spaces should a tab mean,
                            %defaults to 8.
                            %Support for visible tab will be added.
        space=(yes|on|no)   %no ignores spaces, yes honors file spaces
                            %on makes spaces visible.
        vimcolorscheme=<colorscheme>, %Which vim colorscheme to use
                            %defaults to pscolor, which is the only
                            %scheme implemented so far.
       syntax=<syntax>,     %Which syntax highlighing to use in vim.
       ] % End of optional arguments

In the simplest case, you will have

\definetypeVIMfile [typeRUBY] [syntax=ruby] % tab and spaces to your preference

Then you can use

\typeRUBY [optional arguments, as above] {filename}
                                          %filename needs extension also

2. If you need to type code snippets

\defineVIMtyping  [RUBY]    [syntax=ruby] %Other options same as above

and then

\startRUBY
# This is a ruby program

puts "Hello World"
\stopRUBY


Let us know if you come across any problems.

Aditya

[-- Attachment #2: Type: APPLICATION/octet-stream, Size: 9418 bytes --]

%D \module
%D   [      file=t-vimsyntax
%D        version=2006.12.26,
%D          title=ViM to \CONTEXT,
%D       subtitle=Use ViM to generate code listing,
%D         author=Mojca Miklavec \& Aditya Mahajan,
%D          email=<mojca.miklavec.lists@gmail.com>
%D           date=\currentdate,
%D      copyright=Public Domain]

%D \CONTEXT\ has an excellent pretty printing capabilities for many languages.
%D The code is written in \TEX, and due to catcode jugglary verbatim
%D typesetting is perhaps the trickiest part of \TEX. This makes it difficult
%D for a \quotation{normal} user to define syntax highlighting rules for a new
%D language. This module, takes the onus of defining syntax highlighting rules
%D away from the user and uses ViM editor to generate the syntax highlighting.
%D There is a helper \filename{2context.vim} script to do the syntax parsing
%D in ViM. This is a stop|-|gap method, and hopefully with \LUATEX, things
%D will be much easier. 

\writestatus  {loading}   {Context Module for ViM Sytax Highlighting}

\startmodule[vimsyntax]

\unprotect

\definesystemvariable {vs}  % Vim Syntax

%D \macros{startvimcolorscheme}
%D To start a new vim colorscheme.

\def\startvimcolorscheme[#1]%
  {\pushmacro\vimcolorscheme
   \edef\vimcolorscheme{#1}}

\def\stopvimcolorscheme
  {\popmacro\vimcolorscheme}

%D \macros{definevimsyntax, definevimsyntaxsynonyms} 
%D These macros should always occur inside a \type{\startvimcolorschme}
%D \unknown \type{\stopvimcolorscheme} pair.  The \type{\definevimsyntax}
%D macro defines syntax highlighting rules for ViM's syntax highlighting
%D regions. It takes three arguments \type{style}, \type{color} and
%D \type{command}. The most common ViM syntax highlighting regions are defined
%D in the end of this file. The \type{\definevimsyntaxsynonyms} macro just
%D copies the settings from another syntax highlighting region.

\def\definevimsyntax
  {\dodoubleargumentwithset\dodefinevimsyntax}

\def\dodefinevimsyntax[#1]% [#2]
  {\getparameters[\??vs\vimcolorscheme#1]} %[#2]

\def\definevimsyntaxsynonyms
  {\dodoubleargumentwithset\dodefinevimsyntaxsynonyms}

\def\dodefinevimsyntaxsynonyms[#1][#2]%
  {\copyparameters[\??vs\vimcolorscheme#1][\??vs\vimcolorscheme#2]
                  [\c!style,\c!color,\c!command]}


%D \macro{vimsyntax}
%D This macro is inserted by \filename{2context.vim} script, and takes care of
%D properly highlighting different syntax regions.

\def\vimsyntax
  {\dosingleargument\dovimsyntax}

\def\dovimsyntax[#1]#2%
  {\dostartattributes{\??vs\vimcolorscheme Normal}\c!style\c!color\empty%
   \dostartattributes{\??vs\vimcolorscheme #1}\c!style\c!color\empty%
   \getvalue{\??vs#1\c!command}{#2}%
    \dostopattributes%
    \dostopattributes}

%D \macros{setupVIMtyping, typeVIMfile}
%D There are three settings for \type{\setupVIMtyping}: \type{syntax}, which
%D tells ViM which syntax rules to use; \type{tab}, which sets the
%D \type{tabstop} in ViM; and \type{space} which takes care of spaces.
%D
%D \type{\typeVIMfile} macro basically calls ViM with appropriate settings and
%D sources the \filename{2context.vim} script. The result is slow, because
%D parsing by ViM is slow. Do not use this method for anything larger than a
%D few hundred lines. For large files, one option is to pre||prase them, and
%D then typeset the result. We have not provided any interface for that, but
%D it is relatively easy to implement.

\def\setupVIMtyping
  {\dosingleargument\getparameters[\??vs]}

\def\typeVIMfile
  {\dosingleempty\dotypeVIMfile}

\def\notypeVIMfile[#1][#2]#3%
  {\dotypeVIMfile[#1,#2]{#3}}

\def\dotypeVIMfile[#1]#2%
  {\doiffileelse{#2}
   {\dodotypeVIMfile[#1]{#2}}
   {\reporttypingerror{#2}}}

\def\dodotypeVIMfile[#1]#2%
  {\bgroup
   \initializeVIMtyping{#1}
   \def\vimcolorscheme{\@@vscolorscheme}
   \runVIMsyntax{#2}
   \startlines \input #2-vimsyntax.tmp \stoplines
   \@@vsafter
   \egroup}

\def\initializeVIMtyping#1
  {\setupVIMtyping[#1]
   %Make sure that stop is not empty
   \doifempty{\@@vsstop}{\setvalue{\@@vsstop}{0}}
   \@@vsbefore
   \setuplines[space=\@@vsspace]}

\def\runVIMsyntax#1
   {\executesystemcommand
      {vim -u NONE  % No need to read unnessary configurations
           -e       % run in ex mode
%            -V10log  % For debugging only, will go away later.
           -c "set noswapfile"
           -c "set tabstop=\@@vstab"
           -c "set cp"
           -c "syntax on"
           -c "set syntax=\@@vssyntax"
           -c "let contextstartline=\@@vsstart"
           -c "let contextstopline=\@@vsstop"
           -c "source 2context.vim"
           -c "wqa" #1}}


%D \macro{definetypeVIMfile}
%D This macro allows you to define new file typing commands. For example
%D \starttyping
%D \definetypeVIMfile[typeRUBY] [syntax=ruby]
%D \stoptyping
%D after which one can use
%D \starttyping
%D \typeRUBY[option]{rubyfile}
%D \stoptyping

\def\definetypeVIMfile
  {\dodoubleargument\dodefinetypeVIMfile}

\def\dodefinetypeVIMfile[#1][#2]%
  {\unexpanded\setvalue{#1}{\dodoubleempty\notypeVIMfile[#2]}}

\def\defineVIMtyping
  {\dodoubleargument\dodefineVIMtyping}

\def\dodefineVIMtyping[#1][#2]%
  {\setevalue{\e!start#1}{\noexpand\dostartbuffer[vimsyntax][\e!start#1][\e!stop#1]}%
   \setvalue{\e!stop#1}{\dodotypeVIMfile[#2]{\TEXbufferfile{vimsyntax}}}}

%D Some defaults.

\setupVIMtyping
  [     syntax=context,
        \c!tab=8,
      \c!space=\v!yes,
      \c!start=1,
       \c!stop=0, %stop should be set to some value.
     \c!before=,
      \c!after=,
   colorscheme=pscolor,
  ]

%D Pre-defined Syntax : {{{ Based on \filename{ps_color.vim}
%D Perhaps this should be customizable

%D ViM uses hex mode for setting colors, I do not want to convert them to rgb
%D values.

\startvimcolorscheme[pscolor]

\setupcolor[hex]

\definecolor  [vimsyntax!Special]     [h=907000]
\definecolor  [vimsyntax!Comment]     [h=606000]
\definecolor  [vimsyntax!Number]      [h=907000]
\definecolor  [vimsyntax!Constant]    [h=007068]
\definecolor  [vimsyntax!PreProc]     [h=009030]
\definecolor  [vimsyntax!Statement]   [h=2060a8]
\definecolor  [vimsyntax!Type]        [h=0850a0]
\definecolor  [vimsyntax!Todo]        [h=e0e090]

\definecolor  [vimsyntax!Error]       [h=c03000]
\definecolor  [vimsyntax!Identifier]  [h=a030a0]
\definecolor  [vimsyntax!SpecialKey]  [h=1050a0]
\definecolor  [vimsyntax!Underline]   [h=6a5acd]


\definevimsyntax
  [Normal]
  [\c!style=\v!mono,\c!color=\maintextcolor]

\definevimsyntax 
  [Constant]
  [\c!style=\v!mono,\c!color=vimsyntax!Constant]

\definevimsyntaxsynonyms
  [Character,Boolean,Float]
  [Constant]

\definevimsyntax
  [Number]
  [\c!style=\v!mono,\c!color=vimsyntax!Number]

\definevimsyntax
  [Identifier]
  [\c!style=\v!mono,\c!color=vimsyntax!Identifier]

\definevimsyntaxsynonyms
  [Function]
  [Identifier]

\definevimsyntax 
  [Statement]
  [\c!style=\v!mono,\c!color=vimsyntax!Statement]

\definevimsyntaxsynonyms
  [Conditional,Repeat,Label,Operator,Keyword,Exception]
  [Statement]

\definevimsyntax 
  [PreProc]
  [\c!style=\v!mono,\c!color=vimsyntax!PreProc]

\definevimsyntaxsynonyms
  [Include,Define,Macro,PreCondit]
  [PreProc]

\definevimsyntax 
  [Type,StorageClass, Structure, Typedef]
  [\c!style=\v!mono, \c!color=vimsyntax!Type]

\definevimsyntax 
  [Special]
  [\c!style=\v!mono,\c!color=vimsyntax!Special]

\definevimsyntax 
  [SpecialKey]
  [\c!style=\v!mono,\c!color=vimsyntax!SpecialKey]

\definevimsyntax
  [Tag,Delimiter]
  [\c!style=\v!mono]

\definevimsyntax
  [Comment,SpecialComment]
  [\c!style=\v!mono,\c!color=vimsyntax!Comment]

\definevimsyntax
  [Debug]
  [\c!style=\v!mono]

\definevimsyntax
  [Underlined]
  [\c!style=\v!mono,\c!command=\underbar]

\definevimsyntax 
  [Ignore]
  [\c!style=\v!mono]

\definevimsyntax 
  [Error]
  [\c!style=\v!mono,\c!color=vimsyntax!Error]

\definevimsyntax 
  [Todo]
  [\c!style=\v!mono,\c!color=vimsyntax!Todo]

\stopvimcolorscheme
% }}}

\protect

\stopmodule

% TODO: Enable line numbering
% TODO: Get start=continue to work.

\doifnotmode{demo}{\endinput}

\setupcolors[state=start]

\setupbodyfont[10pt]

\defineVIMtyping  [MATLAB]  [syntax=matlab]

\starttext
\startMATLAB
function russell_demo()

% Do the example in ch 17 (p501) of Russell and Norvig
% (1,1) is top left corner.

r = 3; c = 4; p = 0.8; action_cost = -1/25;
obstacle = zeros(r,c); obstacle(2,2)=1;
terminal = zeros(r,c); terminal(1,4)=1; terminal(2,4)=1;
absorb = 1;
wrap_around = 0;
noop = 0;
T = mk_grid_world(r, c, p, obstacle, terminal, absorb, wrap_around, noop);
% Add rewards for terminal states
nstates = r*c + 1;
if noop
  nact = 5;
else
  nact = 4;
end
R = action_cost*ones(nstates, nact);
R(10,:) = 1;
R(11,:) = -1;
R(nstates,:) = 0;
discount_factor = 1;


V = value_iteration(T, R, discount_factor);
%reshape(V(1:end-1),[r c])
%    0.8116    0.8678    0.9178    1.0000
%    0.7616    0.7964    0.6603   -1.0000
%    0.7053    0.6553    0.6114    0.3878
% Same as the book p501

Q = Q_from_V(V, T, R, discount_factor);
[V, p] = max(Q, [], 2);


use_val_iter = 1;
% (I-gT) is singular since g=1 and there is an absorbing state (i.e., T(i,i)=1)
% Hence we cannot use value determination.
[p,V] = policy_iteration(T, R, discount_factor, use_val_iter);

%reshape(V(1:end-1),[r c])
%    0.8115    0.8678    0.9178    1.0000
%    0.7615    0.7964    0.6603   -1.0000
%    0.7048    0.6539    0.6085    0.3824
\stopMATLAB

\page

\typeVIMfile{\jobname.tex}

\stoptext


[-- Attachment #3: Type: APPLICATION/octet-stream, Size: 4717 bytes --]

"D \module
"D   [      file=2context.vim,
"D        version=2006.12.26,
"D          title=ViM to \CONTEXT,
"D       subtitle=Use ViM to generate code listing,
"D         author=Mojca Miklavec \& Aditya Mahajan,
"D          email=<mojca.miklavec.lists@gmail.com>
"D           date=\currentdate,
"D      copyright=Public Domain]

"D This file is based on \filename{2html.vim}. It uses ViM systax highlighting
"D to generate a \CONTEXT\ file which is parsed using \filename{t-vimsyntax}
"D module.

"D We use \filename{.tmp} extension so that the file is purged by
"D \filename{ctxtools}

if expand("%") == ""
  new vimsyntax.tmp
else
  new %-vimsyntax.tmp
endif

"D We are right now in the new buffer.

set modifiable
%d "This empties the buffer.

wincmd p

let s:expandedtab = ' '
while strlen(s:expandedtab) < &ts
  let s:expandedtab = s:expandedtab . ' '
endwhile

"D Loop over all lines in the original text.
"D Use contextstartline and contextstopline if they are set.

if exists("contextstartline")
  let s:lnum = contextstartline
  if !(s:lnum >= 1 && s:lnum <= line("$"))
    let s:lnum = 1
  endif
else
  let s:lnum = 1
endif

if exists("contextstopline")
  let s:end = contextstopline
  if !(s:end >= s:lnum && s:end <= line("$"))
    let s:end = line("$")
  endif
else
  let s:end = line("$")
endif

let s:buffer_lnum = 1

while s:lnum <= s:end
"D Get the current line
  let s:line = getline(s:lnum)
  let s:len  = strlen(s:line)
  let s:new  = ""

"D Loop over each character in the line
  let s:col = 1
  while s:col <= s:len
    let s:startcol = s:col " The start column for processing text
    let s:id       = synID (s:lnum, s:col, 1)
    let s:col      = s:col + 1
"D Speed loop (it's small - that's the trick)
"D Go along till we find a change in synID
    while s:col <= s:len && s:id == synID(s:lnum, s:col, 1) 
      let s:col = s:col + 1 
    endwhile

"D Output the text with the same synID, with class set to {s:id_name}
    let s:id      = synIDtrans (s:id)
    let s:id_name = synIDattr  (s:id, "name", "gui")
    let s:temp    = strpart(s:line, s:startcol - 1, s:col - s:startcol)
"D We need to get rid of the characters that can cause trouble in \CONTEXT.
"D The funny \type{||||||||||} and \type{$$$$$$$$$} characters should never
"D appear in {\em normal} \TEX\ file. As a side||effect, this script can not
"D pretty print itself.
    let s:temp = substitute( s:temp,  '\\', '||||||||||\\letterbackslash$$$$$$$$$$', 'g')
    let s:temp = substitute( s:temp,  '{',  '||||||||||\\letteropenbrace$$$$$$$$$$', 'g')
    let s:temp = substitute( s:temp,  '}',  '||||||||||\\letterclosebrace$$$$$$$$$$', 'g')
    let s:temp = substitute( s:temp,  '||||||||||' , '{' , 'g')
    let s:temp = substitute( s:temp,  '\$\$\$\$\$\$\$\$\$\$' , '}' , 'g')
    let s:temp = substitute( s:temp,  '&',  '{\\letterampersand}', 'g')
    let s:temp = substitute( s:temp,  '<',  '{\\letterless}', 'g')
    let s:temp = substitute( s:temp,  '>',  '{\\lettermore}', 'g')
    let s:temp = substitute( s:temp,  '#',  '{\\letterhash}', 'g')
    let s:temp = substitute( s:temp,  '"',  '{\\letterdoublequote}', 'g')
    let s:temp = substitute( s:temp,  "'",  '{\\lettersinglequote}', 'g')
    let s:temp = substitute( s:temp,  '\$', '{\\letterdollar}', 'g')
    let s:temp = substitute( s:temp,  '%',  '{\\letterpercent}', 'g')
    let s:temp = substitute( s:temp,  '\^', '{\\letterhat}', 'g')
    let s:temp = substitute( s:temp,  '_',  '{\\letterunderscore}', 'g')
    let s:temp = substitute( s:temp,  '|',  '{\\letterbar}', 'g')
    let s:temp = substitute( s:temp,  '\~', '{\\lettertilde}', 'g')
    let s:temp = substitute( s:temp,  '/',  '{\\letterslash}', 'g')
    let s:temp = substitute( s:temp,  '?',  '{\\letterquestionmark}', 'g')
    let s:temp = substitute( s:temp,  '!',  '{\\letterexclamationmark}', 'g')
    let s:temp = substitute( s:temp,  '@',  '{\\letterat}', 'g')
    let s:temp = substitute( s:temp,  ':',  '{\\lettercolon}', 'g')
    let s:new  = s:new . '\vimsyntax[' . s:id_name . ']{' . s:temp .  '}'

" Why will we ever enter this loop
"    if s:col > s:len
"      break
"    endif
  endwhile

"D Expand tabs 
  let s:pad   = 0
  let s:start = 0
  let s:idx = stridx(s:line, "\t")
  while s:idx >= 0
    let s:i     = &ts - ((s:start + s:pad + s:idx) % &ts)
    let s:new   = substitute(s:new, '\t', strpart(s:expandedtab, 0, s:i), '')
    let s:pad   = s:pad + s:i - 1
    let s:start = s:start + s:idx + 1
    let s:idx   = stridx(strpart(s:line, s:start), "\t")
  endwhile

"D Go back and paste the current line
  wincmd p
  call append (s:buffer_lnum-1, s:new)
  wincmd p

"D Increment line numbers
  let s:lnum = s:lnum + 1
  let s:buffer_lnum = s:buffer_lnum + 1
endwhile

wincmd p

[-- Attachment #4: Type: text/plain, Size: 139 bytes --]

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

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

* Re: Making a verbatim file for another language
  2006-12-28 17:09             ` Aditya Mahajan
@ 2006-12-28 18:05               ` cormullion
  2006-12-28 23:47                 ` Mojca Miklavec
  2006-12-30  9:22               ` Jarimatti Valkonen
  1 sibling, 1 reply; 26+ messages in thread
From: cormullion @ 2006-12-28 18:05 UTC (permalink / raw)


How does it find the .vim language syntax file for - say - Ruby?

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

* Re: Making a verbatim file for another language
  2006-12-28 18:05               ` cormullion
@ 2006-12-28 23:47                 ` Mojca Miklavec
  2006-12-29  8:46                   ` cormullion
  0 siblings, 1 reply; 26+ messages in thread
From: Mojca Miklavec @ 2006-12-28 23:47 UTC (permalink / raw)


On 12/28/06, cormullion@mac.com wrote:
> How does it find the .vim language syntax file for - say - Ruby?

When you start vim and say "set syntax=ruby", vim should find the
syntax file automatically. For example under:
    /usr/share/vim/vimXX/syntax/ruby.vim
    c:/programs/vim/vimXX/syntax/ruby.vim
depending on your vim runtime environment.

:help VIMRUNTIME

Mojca

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

* Re: Making a verbatim file for another language
  2006-12-28 23:47                 ` Mojca Miklavec
@ 2006-12-29  8:46                   ` cormullion
  2006-12-29 13:09                     ` Mojca Miklavec
  0 siblings, 1 reply; 26+ messages in thread
From: cormullion @ 2006-12-29  8:46 UTC (permalink / raw)


OK, I think vim works OK here, so this is what I tried:

...
\setupcolors[state=start]

\usemodule[vimsyntax]

\definetypeVIMfile [typeRUBY] [syntax=ruby]

\typeRUBY[typeRUBY]{fibo.rb}

\defineVIMtyping[RUBY][syntax=ruby]

\startRUBY
# This is a ruby program

puts "Hello World"
\stopRUBY
...

Error message was this:

system          : no macros found in module vimsyntax
! Undefined control sequence.
l.15 \definetypeVIMfile
                         [typeRUBY] [syntax=ruby]

So it looks like it didn't really get started... The files t- 
vimsyntax.text and 2context.vim are rattling loose in the directory...

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

* Re: Making a verbatim file for another language
  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
  0 siblings, 2 replies; 26+ messages in thread
From: Mojca Miklavec @ 2006-12-29 13:09 UTC (permalink / raw)


On 12/29/06, cormullion@mac.com wrote:
> OK, I think vim works OK here, so this is what I tried:
>
> ...
> \setupcolors[state=start]
>
> \usemodule[vimsyntax]
>
> \definetypeVIMfile [typeRUBY] [syntax=ruby]
>
> \typeRUBY[typeRUBY]{fibo.rb}
>
> \defineVIMtyping[RUBY][syntax=ruby]
>
> \startRUBY
> # This is a ruby program
>
> puts "Hello World"
> \stopRUBY
> ...
>
> Error message was this:
>
> system          : no macros found in module vimsyntax

Weird! Do you have a file t-vimsyntax.tex in the same folder as the
file where you're running the sample? An alternative is to place the
file under [texmf]/tex/context/third/t-vimsyntax.tex and then run
"[sudo] mktexlsr".

But in any case you need to have 2context.vim in the same folder
(there is no support for an arbitrary path of the script yet).

> ! Undefined control sequence.
> l.15 \definetypeVIMfile
>                          [typeRUBY] [syntax=ruby]
>
> So it looks like it didn't really get started... The files t-
> vimsyntax.text and 2context.vim are rattling loose in the directory...

It has to be *t-vimsyntax.tex*, not *.text*, if that's the case. But
if I try to rename the file, I get "module vimsyntax not found", while
you get "no macros found in module vimsyntax".

While googling through the archive I've found the following message:
http://archive.contextgarden.net/message/20050215.182506.0838140e.en.html

Citing:
> tracefiles showed that ConTeXt was expecting a file
> name with six or less characters after t-; my module was called
> t-utfgreek, so ConTeXt was looking for t-utfgre and couldn't find it

Which version of TeX/ConTeXt are you using? (Perhaps Hans has changed
something in the meantime, to make that work again.) Are you using
Gerben's i-Installer? In that case and if you have a chance, can you
please test the new TeXLive-based distribution?

(I didn't know that 8-char was still a limitation nowadays.)

Mojca

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

* Re: Making a verbatim file for another language
  2006-12-29 13:09                     ` Mojca Miklavec
@ 2006-12-29 15:37                       ` Aditya Mahajan
  2006-12-29 15:42                       ` cormullion
  1 sibling, 0 replies; 26+ messages in thread
From: Aditya Mahajan @ 2006-12-29 15:37 UTC (permalink / raw)


On Fri, 29 Dec 2006, Mojca Miklavec wrote:

> On 12/29/06, cormullion@mac.com wrote:
> > OK, I think vim works OK here, so this is what I tried:
> >
> > ...
> > \setupcolors[state=start]
> >
> > \usemodule[vimsyntax]
> >
> > \definetypeVIMfile [typeRUBY] [syntax=ruby]
> >
> > \typeRUBY[typeRUBY]{fibo.rb}
> >
> > \defineVIMtyping[RUBY][syntax=ruby]
> >
> > \startRUBY
> > # This is a ruby program
> >
> > puts "Hello World"
> > \stopRUBY
> > ...
> >
> > Error message was this:
> >
> > system          : no macros found in module vimsyntax
> 
> Weird! Do you have a file t-vimsyntax.tex in the same folder as the
> file where you're running the sample? An alternative is to place the
> file under [texmf]/tex/context/third/t-vimsyntax.tex and then run
> "[sudo] mktexlsr".
> 
> But in any case you need to have 2context.vim in the same folder
> (there is no support for an arbitrary path of the script yet).
> 
> > ! Undefined control sequence.
> > l.15 \definetypeVIMfile
> >                          [typeRUBY] [syntax=ruby]
> >
> > So it looks like it didn't really get started... The files t-
> > vimsyntax.text and 2context.vim are rattling loose in the directory...
> 
> It has to be *t-vimsyntax.tex*, not *.text*, if that's the case. But
> if I try to rename the file, I get "module vimsyntax not found", while
> you get "no macros found in module vimsyntax".
> 
> While googling through the archive I've found the following message:
> http://archive.contextgarden.net/message/20050215.182506.0838140e.en.html
> 
> Citing:
> > tracefiles showed that ConTeXt was expecting a file
> > name with six or less characters after t-; my module was called
> > t-utfgreek, so ConTeXt was looking for t-utfgre and couldn't find it

You can also try renaming t-vimsyntax.tex to t-vims.tex and then using 
\usemodule[vims]

But with an old ConTeXt, there can be other things that do not work. 
The best thing will be to update.


> Which version of TeX/ConTeXt are you using? (Perhaps Hans has changed
> something in the meantime, to make that work again.) Are you using
> Gerben's i-Installer? In that case and if you have a chance, can you
> please test the new TeXLive-based distribution?
> 
> (I didn't know that 8-char was still a limitation nowadays.)

AFAIK, it is not. The 8-char limitation was removed about two years 
ago.

Aditya

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

* Re: Making a verbatim file for another language
  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 18:39                         ` Mojca Miklavec
  1 sibling, 2 replies; 26+ messages in thread
From: cormullion @ 2006-12-29 15:42 UTC (permalink / raw)


On 2006-12-29, at 13:09.0, Mojca Miklavec wrote:
> Which version of TeX/ConTeXt are you using? (Perhaps Hans has changed
> something in the meantime, to make that work again.) Are you using
> Gerben's i-Installer? In that case and if you have a chance, can you
> please test the new TeXLive-based distribution?

----
  TeXExec 5.2.4 - ConTeXt / PRAGMA ADE 1997-2005

             executable : pdfetex
                 format : cont-en
              inputfile : test2
                 output : pdftex
              interface : en
           current mode : none
                TeX run : 1

This is pdfeTeX, Version 3.141592-1.30.4-2.2 (Web2C 7.5.5)
\write18 enabled.
(/usr/local/teTeX/share/texmf.tetex/web2c/natural.tcx)
----

yes - and it's a default Gerben i-Installation, installed 1 week ago.  
I wouldn't really know how to do any other kind... ;-)

I was hoping to use ConTeXt like I would use a luxury Mercedes car,  
to go places without having to open the engine door at all - but  
perhaps I will have to peer underneath the lid occasionally. :-)

But - if it looks like I have to spend much time in the garage  
underneath the car, perhaps I will try to work out how you are  
calling external programs during the compilation of the document... I  
didn't know you could do that, and it might be a great avenue for  
exploration (once I have my overalls on)...!

thanks!

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

* Re: Making a verbatim file for another language
  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
  1 sibling, 1 reply; 26+ messages in thread
From: Aditya Mahajan @ 2006-12-29 15:59 UTC (permalink / raw)


On Fri, 29 Dec 2006, cormullion@mac.com wrote:

> On 2006-12-29, at 13:09.0, Mojca Miklavec wrote:
> > Which version of TeX/ConTeXt are you using? (Perhaps Hans has changed
> > something in the meantime, to make that work again.) Are you using
> > Gerben's i-Installer? In that case and if you have a chance, can you
> > please test the new TeXLive-based distribution?
> 
> ----
>   TeXExec 5.2.4 - ConTeXt / PRAGMA ADE 1997-2005
>
>              executable : pdfetex
>                  format : cont-en
>               inputfile : test2
>                  output : pdftex
>               interface : en
>            current mode : none
>                 TeX run : 1
> 
> This is pdfeTeX, Version 3.141592-1.30.4-2.2 (Web2C 7.5.5)
> \write18 enabled.
> (/usr/local/teTeX/share/texmf.tetex/web2c/natural.tcx)
> ----
This is the perl version of texexec

> yes - and it's a default Gerben i-Installation, installed 1 week ago. 
> I wouldn't really know how to do any other kind... ;-)

try using

texmfstart texexec filename

which should call the ruby version of texexec. What is the output of

texmfstart texexec --check

It will take some time, and it will be a long output, just post the 
first 10-15 lines.

Aditya

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

* Re: Making a verbatim file for another language
  2006-12-29 15:59                         ` Aditya Mahajan
@ 2006-12-29 16:36                           ` cormullion
  0 siblings, 0 replies; 26+ messages in thread
From: cormullion @ 2006-12-29 16:36 UTC (permalink / raw)


On 2006-12-29, at 15:59.0, Aditya Mahajan wrote:

> This is the perl version of texexec

I do everything from TeXShop (<http://www.uoregon.edu/~koch/texshop>)  
and BBEdit so I have no idea where anything TeX-y is... I spent half  
an hour finding out how to 'enable write 18'... ;-)

Poking around inside this stuff is probably too much, too soon for  
me, since I'm a newcomer to the whole thing... In that sense I'm  
probably not the best tester for this stuff. :-)

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

* Re: Making a verbatim file for another language
  2006-12-29 15:42                       ` cormullion
  2006-12-29 15:59                         ` Aditya Mahajan
@ 2006-12-29 18:39                         ` Mojca Miklavec
  1 sibling, 0 replies; 26+ messages in thread
From: Mojca Miklavec @ 2006-12-29 18:39 UTC (permalink / raw)


On 12/29/06, cormullion@mac.com wrote:
> On 2006-12-29, at 13:09.0, Mojca Miklavec wrote:
> > Which version of TeX/ConTeXt are you using? (Perhaps Hans has changed
> > something in the meantime, to make that work again.) Are you using
> > Gerben's i-Installer? In that case and if you have a chance, can you
> > please test the new TeXLive-based distribution?
>
> ----
>   TeXExec 5.2.4 - ConTeXt / PRAGMA ADE 1997-2005
>
>              executable : pdfetex
>                  format : cont-en
>               inputfile : test2
>                  output : pdftex
>               interface : en
>            current mode : none
>                 TeX run : 1
>
> This is pdfeTeX, Version 3.141592-1.30.4-2.2 (Web2C 7.5.5)
> \write18 enabled.
> (/usr/local/teTeX/share/texmf.tetex/web2c/natural.tcx)
> ----
>
> yes - and it's a default Gerben i-Installation, installed 1 week ago.
> I wouldn't really know how to do any other kind... ;-)

Hmmm ... Gerben's i-Installer has switched from tetex to TeX Live
(very) recently (TeX Live hasn't even been released yet). I would
suggest you to try to install "TeX Live" if possible. If anything goes
wrong, he'll only answer mails until 1.1.2007. I have no idea whether
anyone from the ConTeXt community has tested that already. And I have
no idea what will happen with the installer in the future ...

(Just for an explanation: you can choose whether to install tetex or
TeX Live, you have to choose the new TeX Live. You probably have to
install from scratch.)

With TeX Live-based sources texmfstart should work by default, so it
will mean less problems in the future.

Mojca

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

* Re: Making a verbatim file for another language
  2006-12-28 17:09             ` Aditya Mahajan
  2006-12-28 18:05               ` cormullion
@ 2006-12-30  9:22               ` Jarimatti Valkonen
  2006-12-30 14:18                 ` cormullion
  1 sibling, 1 reply; 26+ messages in thread
From: Jarimatti Valkonen @ 2006-12-30  9:22 UTC (permalink / raw)


Aditya Mahajan kirjoitti 28.12.2006 kello 19.09:

[About ConTeXt and Vim module for syntax highlighting.]
> Let us know if you come across any problems.

Works fine here. System: Mac OS 10.4.8, using default Vim (6.2:  
yikes, thats old!).
ConTeXt  ver: 2006.08.08 21:51  fmt: 2006.11.1

-- 
Jarimatti Valkonen
javalkon@hytti.uku.fi

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

* Re: Making a verbatim file for another language
  2006-12-30  9:22               ` Jarimatti Valkonen
@ 2006-12-30 14:18                 ` cormullion
  2006-12-30 21:24                   ` Jarimatti Valkonen
  0 siblings, 1 reply; 26+ messages in thread
From: cormullion @ 2006-12-30 14:18 UTC (permalink / raw)



On 2006-12-30, at 09:22.0, Jarimatti Valkonen wrote:

> Aditya Mahajan kirjoitti 28.12.2006 kello 19.09:
>
> [About ConTeXt and Vim module for syntax highlighting.]
>> Let us know if you come across any problems.
>
> Works fine here. System: Mac OS 10.4.8, using default Vim (6.2:
> yikes, thats old!).
> ConTeXt  ver: 2006.08.08 21:51  fmt: 2006.11.1

Thanks Jarimatti for sharing that. It suggests that my week-old  
installation isn't the most up to date one:

> ConTeXt  ver: 2005.01.31  fmt: 2006.7.23  int: english  mes: english

I obviously chose a suboptimal option when I started i-Installer.  
(Not difficult, really - it felt like a first attempt to hot-wire a  
Boing 747... :-)

I'm reluctant to re-install the whole thing, when ConTeXt is  
currently working so well. Perhaps next week.

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

* Re: Making a verbatim file for another language
  2006-12-30 14:18                 ` cormullion
@ 2006-12-30 21:24                   ` Jarimatti Valkonen
  2006-12-31 11:51                     ` cormullion
  0 siblings, 1 reply; 26+ messages in thread
From: Jarimatti Valkonen @ 2006-12-30 21:24 UTC (permalink / raw)


cormullion@mac.com kirjoitti 30.12.2006 kello 16.18:

>
> On 2006-12-30, at 09:22.0, Jarimatti Valkonen wrote:
>
>> Works fine here. System: Mac OS 10.4.8, using default Vim (6.2:
>> yikes, thats old!).
>> ConTeXt  ver: 2006.08.08 21:51  fmt: 2006.11.1
>
> Thanks Jarimatti for sharing that. It suggests that my week-old
> installation isn't the most up to date one:
>
>> ConTeXt  ver: 2005.01.31  fmt: 2006.7.23  int: english  mes: english
>
> I obviously chose a suboptimal option when I started i-Installer.
> (Not difficult, really - it felt like a first attempt to hot-wire a
> Boing 747... :-)

That is odd, as I haven't updated my ConTeXt in a while. My ConTeXt  
updater i-Package (context-update.ii2) is dated 2006/10/06 meaning  
that it's almost three months old. And I'm still using the teTeX  
installation that is apparently no longer available (tex.ii2).

Anyway, I use ConTeXt from the shell (Terminal.app) and have defined  
the following aliases:
---
# ConTeXt stuff
alias texmfstart="ruby /usr/local/teTeX/share/texmf.local/scripts/ 
context/ruby/texmfstart.rb"
alias context="texmfstart texexec"
---
You could try those, just change the name and path to texmfstart.rb  
so that it matches your installation. After adding the aliases you  
can just issue command 'context myfile.tex' and the file gets processed.

-- 
Jarimatti Valkonen
javalkon@hytti.uku.fi

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

* Re: Making a verbatim file for another language
  2006-12-30 21:24                   ` Jarimatti Valkonen
@ 2006-12-31 11:51                     ` cormullion
  2006-12-31 13:40                       ` Mojca Miklavec
  0 siblings, 1 reply; 26+ messages in thread
From: cormullion @ 2006-12-31 11:51 UTC (permalink / raw)


On 2006-12-30, at 21:24.0, Jarimatti Valkonen wrote:

> /usr/local/teTeX/share/texmf.local/scripts/context/ruby/texmfstart.rb

Unfortunately, I don't have a scripts directory here... Obviously my  
system is not correctly installed.

What is the recommended way to install the latest Context version  
(MacOS X)?

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

* Re: Making a verbatim file for another language
  2006-12-31 11:51                     ` cormullion
@ 2006-12-31 13:40                       ` Mojca Miklavec
  2006-12-31 16:57                         ` cormullion
  0 siblings, 1 reply; 26+ messages in thread
From: Mojca Miklavec @ 2006-12-31 13:40 UTC (permalink / raw)


On 12/31/06, cormullion@mac.com wrote:
> What is the recommended way to install the latest Context version
> (MacOS X)?

You have to install at least the following two packages:
- gwTeX based on TeX Live (texlive.ii2)
- gwTeX Support: ConTeXt updater (context-update.ii2)

Perhaps uninstall both ConTeXt and "DEPRECATED" gwTeX based on teTeX
and TeX Live first (tex.ii2) before installing texlive.ii2 and install
context-update at the end again.

You also have to configure auto-updating, but I'm not sure how to do
that properly.

Mojca

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

* Re: Making a verbatim file for another language
  2006-12-31 13:40                       ` Mojca Miklavec
@ 2006-12-31 16:57                         ` cormullion
  0 siblings, 0 replies; 26+ messages in thread
From: cormullion @ 2006-12-31 16:57 UTC (permalink / raw)


On 2006-12-31, at 13:40.0, Mojca Miklavec wrote:

> On 12/31/06, cormullion@mac.com wrote:
>> What is the recommended way to install the latest Context version
>> (MacOS X)?
>
> You have to install at least the following two packages:
> - gwTeX based on TeX Live (texlive.ii2)
> - gwTeX Support: ConTeXt updater (context-update.ii2)

Good news - I deleted everything from my system and re-installed from  
scratch. Now everything works better - and I've even got the  
vimsyntax coloring up my Lisp code! Cool. Thanks very much for your  
help...

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

end of thread, other threads:[~2006-12-31 16:57 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-12-25  9:24 Making a verbatim file for another language cormullion
2006-12-25 10:38 ` Taco Hoekwater
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

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).