GeneralListing env. skip line numbers

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
cb2001
Posts: 6
Joined: Mon Sep 15, 2008 10:42 pm

Listing env. skip line numbers

Post by cb2001 »

Hi,

I've question about the listing environment. I use it to add c source code to a technical paper. I've read that it is possible to show line numbering on left or right, which works pretty well. But because because the listing contains code fragments rather than the whole program I would like to support this fact by increasing the counter within the listing.

Like:

Code: Select all

1 do {
// comment
3 a = b;
...
20 } while(true);
// more comments
...
43 return a;
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Is there a command or trick to achieve that?

Thanks!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
brlnd
Posts: 15
Joined: Wed Sep 17, 2008 6:50 pm

Re: Listing env. skip line numbers

Post by brlnd »

Yes, the listings package can do that using the 'firstnumber' option, documented on page of the documentation. I issued 'texdoc listings' on my computer and the documentation popped up.
Post Reply