0

I was under the assumption that wrapping a section of text within curly brackets effectively creates an implicit environment where I can temporarily change some settings, for instance the font size:

Some text in normal size
{
    \footnotesize
    Some text in footnote size
}
back to normal size

This does works but I have now run into cases where using {} has side effects on spacings. For instance when I have multiple paragraphs the last paragraph is spaced further vertically than the other paragraphs. Is this expected? What's the best way to temporarily change settings without any other side effects?

7
  • 2
    I'm not understanding what you mean by "spaced further vertically". Would you be able to provide a MWE that shows what you're talking about?
    – Teepeemm
    Jan 23, 2020 at 14:44
  • 1
    The text you present here is one single paragraph and the line spacing is determined at the end of the paragraph thus the line spacing specified by \footnotesize is never used. As already mentioned please explain in more detail what exactly your goal is here.
    – daleif
    Jan 23, 2020 at 14:46
  • 2
    You have to add a \par before the closing brace.
    – AboAmmar
    Jan 23, 2020 at 15:03
  • \par did the trick!
    – Seyouki
    Jan 23, 2020 at 15:06
  • 1
    Technically, braces form a group. One can also use \bgroup ... \egroup or \begingroup ... \endgroup. Note that ending a line with a brace adds a space, so use {% and }%. Jan 23, 2020 at 15:31

1 Answer 1

3

The line spacing in a paragraph is set by the value of \baselineskip at the end of the paragraph so you should always make sure the end of the paragraph is in the scope of a size change. However empty brace groups (or environments) will affect the space in lots of ways, you need to be aware of and avoid adding white space, typically by adding % at ends of lines.

Consider a version of your example, but without the size change, spacing is already affected:

enter image description here

\documentclass{article}

\begin{document}

aaa bbb

aaa
{
}
bbb

\end{document}

The {} markup has forced three word spaces rather than one between aaa and bbb.

The markup should be

aaa
{%
}%
bbb
2
  • Get out from my property!
    – egreg
    Jan 23, 2020 at 16:37
  • @egreg squatters rights Jan 23, 2020 at 22:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .