ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Problem with codelistings and linenumbers
@ 2012-09-07 16:32 Markus Hubig
  0 siblings, 0 replies; only message in thread
From: Markus Hubig @ 2012-09-07 16:32 UTC (permalink / raw)
  To: ConTeXt ML

Hi @all,

I'm trying to put some codelistings into my ConTeXt file, but I don't get
line numbers. Im using a resend version of ConTeXt:

| ConTeXt  ver: 2012.09.06 23:03 MKIV  fmt: 2012.9.7  int: english/english

Here is the setup for my code environment:

| \definefloat [listing] [listings]
| \setupfloat  [listing] [topframe=on, bottomframe=on]
| \setupheadtext [listings=Quellcodelistings]
|
| \defineblank  [aroundcode] [medium]
| \definetyping [code]
| \setuptyping  [code]
|   [option=color, bodyfont=8.0pt, margin=yes,
|      before={\blank[aroundcode]\startlinenumbering},
|      after={\blank[aroundcode]\stoplinenumbering}]

And here is an example, how I use it. I place it into a floating environment
so I can have a nice Listion of my code sippets with \completelistoflistings.

| \placelisting [here] [lst:bb]
| {Beispiel eines bitbake Rezeptes (zlib_1.2.7.bb)}
| {\startcode
| SUMMARY = "Zlib Compression Library"
| DESCRIPTION = "Zlib is a general-purpose, patent-free, lossless data \
| compression library which is used by many different programs."
| HOMEPAGE = "http://zlib.net/"
| SECTION = "libs"
|
| LICENSE = "Zlib"
| LIC_FILES_CHKSUM = "file://zlib.h;beginline=4;endline=23;md5=94d1b5a..."
|
| SRC_URI = "http://www.zlib.net/${BPN}-${PV}.tar.bz2 \
|            file://remove.ldconfig.call.patch \
|            "
| SRC_URI[md5sum]    = "2ab442d1691..."
| SRC_URI[sha256sum] = "49e2e9658df..."
|
| do_configure (){
|     ./configure --prefix=${prefix} --shared --libdir=${libdir}
| }
|
| do_compile (){
|     oe_runmake
| }
|
| do_install() {
|     oe_runmake DESTDIR = ${D} install
| }
| \stopcode}

You can have a look at the result here:
https://dl.dropbox.com/u/2721576/code.pdf

Besides the lack of the linenumbers you may notice the slightly bigger
space between the top line and the code and the bottom line and the code.

At the moment I'm adding the line numbers by hand ...

Cheers, Markus
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-09-07 16:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-07 16:32 Problem with codelistings and linenumbers Markus Hubig

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