I am trying to center a listing horizontally within a page.
So far I have tried defining the following macro:
\lstnewenvironment{snippet}[1][]
{\centering \lstset{float=htpb,#1}}
{}
But it did not work.
I have read this question and answer, but I would prefer a solution that does not rely in figures or tables.
! Emergency stop.error and the resulting file does not contain the listing. – Tiago Veloso Feb 05 '11 at 15:39