Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Possible Duplicate:
Setting a single equation in a paragraph in a smaller font

I want to shrink the size of some typeset material inserted in the middle of a paragraph. The following tex file produces the font sizes that I want, but the line spacing in the paragraph prior to \begin{footnotesize} is improperly altered. Why is this happening? How can I change the font size without changing the spacing of the surrounding text?

\documentclass{article}

% Commands to typeset code in a certain style
% Not relevant to the problem
\newcommand{\letE}{\mathbf{let}\;}
\newcommand{\inE}{\mathbf{in}\;}
\newcommand{\qlambda}[1]{\lambda#1\to}
\newcommand{\app}[1]{#1\;}
\newcommand{\putspace}{\mathord{}}
\newcommand{\name}[1]{\mathit{#1}}
\begin{document}

This is an example of a document where paragraph spacing is altered
because the size of some text in the paragraph is changed.

The following expression in the polymorphic lambda calculus is
rendered in a small font so that it can be displayed with fewer line breaks.
\begin{footnotesize}
\begin{tabbing}
$\letE \name{double} = \qlambda{f} \qlambda{x} \app f (\app fx)$ \\
$\inE\putspace$\=
  $\letE \name{twohundredfiftysix} = \putspace$\=%
    $\letE \name{four} = \app{\name{double}}\name{double}\;%
      \inE \app{\name{four}}\name{four}$ \\
\>$\inE \app{\name{twohundredfiftysix}}\name{twohundredfiftysix}$
\end{tabbing}
\end{footnotesize}
Vexingly, the use of \verb+footnotesize+ has altered the
spacing of the preceding lines in the same paragraph.

\end{document}

Edit: Changed to a non-math example.

share|improve this question

marked as duplicate by Mico, Andrey Vihrov, percusse, egreg, lockstep Feb 22 '12 at 23:11

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
agree with @DavidCarlisle's duplicate pointer, but the title text for this question is a bit clearer. recommend combining. –  barbara beeton Feb 22 '12 at 19:21
    
@DavidCarlisle Thanks for finding that. The answer here works better for my purposes though. The answers on 45354 are more specific to math typesetting. –  Heatsink Feb 22 '12 at 19:28
1  
rather than voting to close, i recommend that the text of this question be modified so that the dependence is on something other than text. a possible (and genuine) example is the need to set a block of verbatim code at a smaller size than the main text while remaining "within" a paragraph. –  barbara beeton Feb 22 '12 at 19:44
    
@barbarabeeton I put in a formatted code example to represent what I'm actually using it for. –  Heatsink Feb 22 '12 at 21:20
add comment

1 Answer

up vote 1 down vote accepted

The problem here is that the footnotesize environment still forms part of the previous paragraph. TeX actually assembles an entire paragraph before deciding on an optimized line breaking, leading to the footnotesize environment influence. Issue a formal \par and remove the spurious space before the next paragraph using % (if you want the paragraph components to be "joined"):

enter image description here

\documentclass{article}
\begin{document}

This is an example of a document where paragraph spacing is altered
because the size of some text in the paragraph is changed.

The following long and complicated formula is rendered in a small font
so that it can be displayed with fewer line breaks.\par
\begin{footnotesize}
\[ x = 1 \]
\end{footnotesize}%
Vexingly, the use of \verb+footnotesize+ has altered the
spacing of the preceding lines in the same paragraph.

\end{document}​
share|improve this answer
    
\footnotesize is not an environment, but a command. –  Andrey Vihrov Feb 22 '12 at 19:20
    
the problem with this solution is that the values for the skip above the display aren't applied the same when a paragraph break intervenes; also, a paragraph break permits a page break which isn't good practice. packing the "smallified" material in a box and displaying the box avoids those problems. but this is still essentially a duplicate of the question noted above, hence this comment instead of an answer. –  barbara beeton Feb 22 '12 at 19:24
    
@barbarabeeton: I agree that the request is out of the norm. My answer attempted to address the question "Why is it happening" and not how to generate something similar in a better way. –  Werner Feb 22 '12 at 19:29
    
@Werner -- i applaud the "why is it happening?" approach. unfortunately, it still looks to me like the same question. i'll make a suggestion to modify the text of this question to either remove the implied dependence on math, or explain that something other than math is responsible for the situation. –  barbara beeton Feb 22 '12 at 19:42
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.