0

This is probably a trivial question, but I can't find an answer: In some circumstances (large verbatim environments between paragraphs, many empty sections), LaTeX squeezes the line distance within paragraphs. How can I avoid this? It there a length with plus or minus tolerances I could redefine? I tried defining \baselineskip as suggested by https://tex.stackexchange.com/a/51447/239563, but using minus 0pt, but it didn't help.

Thanks a lot for your help!


Edit after the issue was resolved: Since it turned out to be a completely different effect (thanks a lot to David Carlisle who spotted this), here (belatedly) comes the example (may be helpful if someone has a similar problem):

This is a paragraph
with text.
%
\begin{footnotesize}
\begin{verbatim}
Here comes some code.
\end{verbatim}
\end{footnotesize}

Apperently, the problems are caused by the footnotesize environment, if there is no blank line beforehand.

Ralf
  • 185
  • 2
    please always show a small but complete example. By default latex never adds stretchy glue as \baselineskip so what you describe does not happen. If you show an example we can debug where the bad setting has been made. My guess is that you are not seeing stretch glue but rather large text on a small baseline due to incorrectly ending the size change without ending the paragraph. – David Carlisle Jun 01 '22 at 09:57
  • @DavidCarlisle: Thanks for your comments. I didn't manage to reproduce the effect in a small example, but when I tried to find one, I noticed a possible cause for the problem. I had normal text paragraphs, then a line with only %, followed by a \begin{verbatim}...\end{verbatim} environment over multiple lines. If I replace the % by an empty line, the squeezed paragraphs disappear. – Ralf Jun 01 '22 at 10:41
  • 1
    so that will be the same issue as the linked answer. You are not seeing stretch you are just setting large text on a baseline set for a small size. (You must have a non standard verbatim environment font setup) – David Carlisle Jun 01 '22 at 10:42
  • @DavidCarlisle: The verbatim environment is embraced in \begin{footnotesize} and \end{footnotesize}, may that be the problem? Why would the font size leak through to the paragraph? – Ralf Jun 01 '22 at 13:12
  • @DavidCarlisle: Ok, I see: the question has in fact been answered before, I just didn't see the correspondence to my question when reading it for the first time (since in my case line-spacing wasn't uneven, but just smaller). Thanks a lot! – Ralf Jun 01 '22 at 13:17
  • 1
    You really should have provided an example in the question rather than rely on someone spotting the issue is unrelated to the glue settings you described...., but that is a faq, \foonotesize isn't designed as an environment but if you do use it in that form you must leave a blank line before \begin and before \end otherwise the paragraph before the environment will be set with too small line spacing and the last paragraph of the environment will be set with too large line space. – David Carlisle Jun 01 '22 at 18:20
  • @DavidCarlisle: I agree that an example would have been useful, but I had a completely different idea of what was happening; I thought that the line-spacing is squeezed since LaTeX tries to put too many things on the same page for some reason. Thanks again for spotting the relation. Can I ask you a related question: when using equations like align environments, I also have % comment lines between paragraphs and equations instead of blank lines. Could that have some undesired consequences as well? Not footnotesize is used in this case. – Ralf Jun 02 '22 at 19:51
  • @DavidCarlisle: Sorry, maybe even worse: I have the footnotesize/verbatim environments sometimes followed by a % comment line (no blank line) and then an align environment - could that cause trouble? – Ralf Jun 02 '22 at 20:10
  • 2
    align is the opposite you should never have a blank line before a display math environment. – David Carlisle Jun 02 '22 at 22:15

0 Answers0