Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- \documentclass{report}
- \usepackage{color}
- \usepackage{xcolor}
- \usepackage{listings}
- \usepackage{caption}
- \DeclareCaptionFont{white}{\color{white}}
- \DeclareCaptionFormat{listing}{\colorbox{gray}{\parbox{\textwidth}{#1#2#3}}}
- \captionsetup[lstlisting]{format=listing,labelfont=white,textfont=white}
- % This concludes the preamble
- \begin{document}
- \begin{lstlisting}[label=some-code,caption=Some Code]
- public void here() {
- goes().the().code()
- }
- \end{lstlisting}
- \end{document}
Add Comment
Please, Sign In to add comment