Graphics, Figures & Tables ⇒ putting code in a box with figure caption
putting code in a box with figure caption
Note that I use kile.
Cheers,
Carol
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
putting code in a box with figure caption
Re: putting code in a box with figure caption
Moreover, the captions of the listing are independent of floats. I want the opposite that the captions of these pieces would follow floats' caption.
Also, note that there are some lines that exceed the width of the page so they should be adjusted
Any suggestions?
putting code in a box with figure caption
No problem for the listing packagecarol wrote:How about if it is not a code but the output of a program or just a text file?
I don't really understand what you mean. If you're saying that the listing package uses his own counter and name for the captions, you can easily adjust it (its explained in the documentation of the listing package)carol wrote:Moreover, the captions of the listing are independent of floats. I want the opposite that the captions of these pieces would follow floats' caption.
Automatic line breaking is an option of the listing package, as explained in the documentation of the packagecarol wrote:Also, note that there are some lines that exceed the width of the page so they should be adjusted
Re: putting code in a box with figure caption
Thanks for your reply. Actually, I found no information how it is possible to have the same counter for listings captions and floating caption. I have defined a command for floating captions \newcommand*\mycaption[2]{\caption[#1]{#1 #2}}, how could I use it as key value for \lstinputlisting[]?
Look forward to your reply,
carol