Saturday, 25 May 2013

Source code description in latex

Source code description in latex

I have a problem concerning the creation of the name below a "Source code" (Listing) in LATEX. When i have a figure i use :
       \begin{figure}[t]
       \centering
       \includegraphics{Figures/drawing.pdf}
       \caption{Spoken Dialogue System}

       \label{fig:SLDS2}
       \end{figure}
I see "Figure 4.5. : Spoken Dialog System" on the screen. However when i could not figure out how to print "Listing.4.5 Java Code" below this framed code on the screen. What should i add to this code? The source code is as shown in the following:
     \begin{framed}
     \begin{lstlisting}[frame=single, backgroundcolor=\color{light-gray}, basicstyle=\footnotesize\ttfamily, language=Java, numbers=left, numberstyle=\tiny            
     \color{black}]

          [HERE IS THE JAVA CODE]

  \end{lstlisting}

  \end{framed}
Thanks a lot in advance!!!

No comments:

Post a Comment