I'm using lstlistings. I've changed lstlistingname using \renewcommand{\lstlistingname}{Kod \'zr\'od\l{}owy} command. But there something wrong, please see the picture.
Does anyone know how can I fix it?
Document Classes ⇒ Problem with lstlistings (caption is overlaping other)
Problem with lstlistings (caption is overlaping other)
- Attachments
-
- Latex_bug.png (5.65 KiB) Viewed 8512 times
- localghost
- Site Moderator
- Posts: 9201
- Joined: Fri Feb 02, 2007 12:06 pm
Problem with lstlistings (caption is overlaping other)
Providing a minimal working example (MWE) lets us play around with some code and would help us to see where there is something to correct.
Best regards and welcome to the board
Thorsten¹
Best regards and welcome to the board
Thorsten¹
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]
¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
Board Rules
Avoidable Mistakes[/size]
¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
Problem with lstlistings (caption is overlaping other)
I found the problem, its because I changed caption width. I don't know if this is a bug or just my lack of knowledge but I know it isn't what I need 
Here's the MWE:

Here's the MWE:
Code: Select all
\documentclass[a4paper]{memoir}
\usepackage{listings}
\lstset{frame=tb}
\changecaptionwidth
\captionwidth{.6\linewidth}
\captiontitlefont{\footnotesize}
\begin{document}
\begin{lstlisting}[language=bash,caption=Text text text text text text text text text text text text text text text text text]
@echo off
echo Source '%1'
echo Destination '%2'
...
\end{lstlisting}
\end{document}
Problem with lstlistings (caption is overlaping other)
Hi one_eddie,
you already solved your problem, but you can keep the changes to the caption width and modify the separation between the caption and the code to avoid the overlapping, using belowcaptionskip. Take a look at the following example:
you already solved your problem, but you can keep the changes to the caption width and modify the separation between the caption and the code to avoid the overlapping, using belowcaptionskip. Take a look at the following example:
Code: Select all
\documentclass[a4paper]{memoir}
\usepackage{listings}
\lstset{frame=tb}
\changecaptionwidth
\captionwidth{.6\linewidth}
\captiontitlefont{\footnotesize}
\begin{document}
\begin{lstlisting}[language=bash,caption=Text text text text text text text text text text text text text text text text text,belowcaptionskip=0.4cm]
@echo off
echo Source '%1'
echo Destination '%2'
...
\end{lstlisting}
\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Re: Problem with lstlistings (caption is overlaping other)
So simple and its in the documentation. I probably missed it while reading docs 
Thanks

Thanks