problem about code-Collection of common programming errors


  • Frank
    floats code
    My document starts with\documentclass{sig-alternate} \usepackage{listings}and it includes listings like this:\begin{lstlisting}[label=samplecode,float=tb,caption=My super code] // code \end{lstlisting}I also tried frame=tb. However, the listing is placed as flow-text right in the surrounding text. It’s not floating. I also tried including the float package, didn’t help either.PS There are figures and tables in the document that are placed as floats.EDIT (.log):This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian) (format=pdflatex 2012.12.23) 22 APR 2013 16:41 entering extended mode%&-line parsing enabled. **paper.tex (./paper.tex LaTeX2e Babel and hyphenation patterns for english, usenglishmax, dumylang, noh yphenation, farsi, arabic, croatian, bulgarian, ukrainian, russian, czech, slov ak, danish, dutch, finnish, french, basque, ngerman, german, german-x-2009-06-1 9, ngerman-x-2009-06-19, ibycus, monogreek, greek, ancientgreek, hungarian, san skrit, italian, latin, latvian, lithuanian, mongolian2a, mongolian, bokmal, nyn orsk, romanian, irish, coptic, serbian, turkish, welsh, esperanto, uppersorbian , estonian, indonesian, interlingua, icelandic, kurmanji, slovenian, polish, po rtuguese, spanish, galician, catalan, swedish, ukenglish, pinyin, loaded. (./sig-alternate.cls (/usr/share/texmf-texlive/tex/latex/graphics/epsfig.sty Package: epsfig 1999/02/16 v1.7a (e)psfig emulation (SPQR)(/usr/share/texmf-texlive/tex/latex/graphics/graphicx.sty Package: graphicx 1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)(/usr/share/texmf-texlive/tex/latex/graphics/keyval.sty Package: keyval 1999/03/16 v1.13 key=value parser (DPC) \KV@toks@=\toks14 ) (/usr/share/texmf-texlive/tex/latex/graphics/graphics.sty Package: graphics 2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)(/usr/share/texmf-texlive/tex/latex/graphics/trig.sty Package: trig 1999/03/16 v1.09 sin cos tan (DPC) ) (/etc/texmf/tex/latex/config/graphics.cfg File: graphics.cfg 2009/08/28 v1.8 graphics configuration of TeX Live ) Package graphics Info: Driver file: pdftex.def on input line 91.(/usr/share/texmf-texlive/tex/latex/pdftex-def/pdftex.def File: pdftex.def 2010/03/12 v0.04p Graphics/color for pdfTeX \Gread@gobject=\count79 )) \Gin@req@height=\dimen102 \Gin@req@width=\dimen103 ) \epsfxsize=\dimen104 \epsfysize=\dimen105 ) (/usr/share/texmf-texlive/tex/latex/amsfonts/amssymb.sty Package: amssymb 2009/06/22 v3.00(/usr/share/texmf-texlive/tex/latex/amsfonts/amsfonts.sty Package: amsfonts 2009/06/22 v3.00 Basic AMSFonts support \@emptytoks=\toks15 \symAMSa=\mathgroup4 \symAMSb=\mathgroup5 LaTeX Font Info: Overwriting math alphabet `\mathfrak’ in version `bold’ (Font) U/euf/m/n –> U/euf/b/n on input line 96. )) (/usr/share/texmf-texlive/tex/latex/amsmath/amsmath.sty Package: amsmath 2000/07/18 v2.13 AMS math features \@mathmargin=\skip41For additional information on amsmath, use the `?’ option. (/usr/share/texmf-texlive/tex/latex/amsmath/amstext.sty Package: amstext 2000/06/29 v2.01(/usr/share/texmf-texlive/tex/latex/amsmath/amsgen.sty File: amsgen.sty 1999/11/30 v2.0 \@emptytoks=\toks16 \ex@=\dimen106 )) (/usr/share/texmf-texlive/tex/latex/amsmath/amsbsy.sty Package: amsbsy 1999/11/29 v1.2d \pmbraise@=\dimen107 ) (/usr/share/texmf-texlive/tex/latex/amsmath/amsopn.sty Package: amsopn 1999/12/14 v2.01 operator names ) \inf@bad=\count80 LaTeX Info: Redefining \frac on input line 211. \uproot@=\count81 \leftroot@=\count82 LaTeX Info: Redefining \overline on input line 307. \classnum@=\count83 \DOTSCASE@=\count84 LaTeX Info: Redefining \ldots on input line 379. LaTeX Info: Redefining \dots on input line 382. LaTeX Info: Redefining \cdots on input line 467. \Mathstrutbox@=\box26 \strutbox@=\box27 \big@size=\dimen108 LaTeX Font Info: Redeclaring font encoding OML on input line 567. LaTeX Font Info: Redeclaring font encoding OMS on input line 568. \macc@depth=\count85 \c@MaxMatrixCols=\count86 \dotsspace@=\muskip10 \c@parentequation=\count87 \dspbrk@lvl=\count88 \tag@help=\toks17 \row@=\count89 \column@=\count90 \maxfields@=\count91 \andhelp@=\toks18 \eqnshift@=\dimen109 \alignsep@=\dimen110 \tagshift@=\dimen111 \tagwidth@=\dimen112 \totwidth@=\dimen113 \lineht@=\dimen114 \@envbody=\toks19 \multlinegap=\skip42 \multlinetaggap=\skip43 \mathdisplay@stack=\toks20 LaTeX Info: Redefining \[ on input line 2666. LaTeX Info: Redefining \] on input line 2667. ) Document Class ‘sig-alternate’

Originally posted 2013-11-09 22:49:09.