Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2013
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Latex 1.05 KB | None | 0 0
  1. \documentclass{sig-alternate}
  2.  
  3. %\usepackage{caption}
  4. \usepackage{listings}
  5.  
  6. \begin{document}
  7.  
  8. \title{The Title}
  9.  
  10. \numberofauthors{1}
  11. \author{
  12. \alignauthor
  13.       John Doe\\
  14.       \affaddr{Lorem ispum}\\
  15.       \affaddr{Lorem ispum}\\
  16.       \affaddr{Lorem ipsum}\\
  17.       \email{john.doe@example.com}
  18. }
  19. \date{30 July 1999}
  20. \maketitle
  21.  
  22.    
  23.  
  24. \lstnewenvironment{mycode}[1][]
  25. {
  26.  \minipage[b]{0.3\textwidth}
  27.  \lstset{
  28.    captionpos=b,
  29.    language=C,
  30.    numbers=left,
  31.    basicstyle=\tiny\ttfamily,
  32.    columns=fullflexible,
  33.    showstringspaces=false,
  34.    numbersep=3pt,
  35.    #1
  36.  }
  37. }
  38. {
  39.  \endminipage
  40. }
  41. \captionsetup[lstlisting]{font={small,tt}}
  42.  
  43. \begin{mycode}[title=Awesome C program,label=code:AwesomeC]
  44.  int main(int argc, char* argv[]) {
  45.    return 0;
  46.  }
  47. \end{mycode}
  48.  
  49. If I use "caption" package, caption of the figure changes style (it is no longer bold). Otherwise I cannot change caption of the code...
  50.  
  51. \begin{figure}
  52.  \centering
  53.  This is a figure
  54.  \caption{Caption of the figure}  
  55. \end{figure}
  56.  
  57. \end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement