On Sat, 5 Jul 2008, abbg770@city.ac.uk wrote:
Ok now that's out of the way i've got a few questions regarding ConTeXt itself.
These got ignored in the heap on installation hints.
1. Is there an equivalent of the listing package?
No, but read on ...
Take a look at listing-sample.pdf. It's also highly customizable, allowing me to change the colour etc. For instance here is my setup.
\lstset{breaklines=true, showlines=true, % showing line numbers numbers=left, % where to show line numbers numberstyle=\scriptsize\sffamily\color{gray}, % numbersep=10pt, % stepnumber=1, % how often to show the line number on the left language=Java, % specifiy the language basicstyle=\scriptsize\ttfamily, % print whole listing small keywordstyle=\bfseries\color{eclipsekeyword}, % underlined bold black keywords identifierstyle=, % nothing happens commentstyle=\color{eclipsecomment}, % white comments, if you use commentstyle=\color{white}, it doesn't display the PRODID for the VCALENDAR stringstyle=\ttfamily, % typewriter type for strings showstringspaces=false, % no special string spaces frame=single, % bottom of listing gets a rule, use frame=single if you want awhole frame around it backgroundcolor=\color{white}, use frame=b for line a the bottom only backgroundcolor=\color{white}, tabsize=4, showspaces=false, showstringspaces=false}
\lstset{morecomment=[s][\color{eclipsejavadoc}]{/**}{*/}}%, % morecomment=[s][\color{red}]{/*-}{*/}}
And including the source code.
\lstinputlisting[
caption={CalendarExtractor.java},
label=lst:CalendarExtractor.java]
{source/CalendarExtractor.java}
Context does have a pretty printer, which comes for support for C, Java, Javascript, pascal, eiffel, metapost and tex. It is not as configurable as listings, but has most of the features. In MKII, writing a module for pretty printing files was a pain. Now, with luatex, things are much easier. The new tex and mp pretty printers are written in lua, and are much easier to read (and write). Part of the interface is documented here: http://wiki.contextgarden.net/Verbatim_text
2. Can someone please tell me if a book is being planned, I'd hate to print out the documentation and then come to realize that, say, two months down the line a book is available.
Don't worry. Print out the doucumentation and get it bound so that it lasts :) A book is planned, but the effort is still in the planning stage. Aditya