My document starts with:

\lstset{ %

However all listings appear exactly just where they have been defined, e.g. this one:

                   caption={Example of a JAX-RS annotated Resource class (by Marek Potociar)}]
public class AtmResource {  
  public String balance(@PathParam("cardId") String card,   
                        @QueryParam("pin") String pin) {    
    return Double.toString(getBalance(card, pin));  

Do you already see sth. wrong or do I need to find a minimal document with this issue? My full document is here: https://github.com/thkoch2001/bachelor-thesis/blob/master/latex/restful_groupware.tex

1 Answer 1


Although this seems clearly to be a bug, a work-around is the define a new listing environment:

  {\lstset{language=Java,float=tb,#1}}% \begin{javalisting}[...]
  {} % \end{javalisting}
  • Danke! Der Workaround funktioniert. Ich hatte nur Probleme, weil ich das \lstnewenvironment ohne die "Kommentare"(?) nach den % Zeichen kopiert habe. Oh latex... Commented Feb 6, 2012 at 14:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .