1

This question already has an answer here:

\def\Grammercaption{\textbf{Grammer}}
\def\grammer{\bgroup\ignorespaces\Grammercaption\fontsize{10}{13pt}\selectfont}
\def\grammer{\egroup}

I want all lines of text within this environment stick together. So that no page break is issued here.

marked as duplicate by lockstep, Mensch, clemens, Martin Schröder, Werner Feb 15 '13 at 18:47

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.

  • 3
    You might be after something like \newenvironment{grammer}{\noindent\minipage{\linewidth}\Grammercaption\fontsize{10}{13pt}\selectfont}{\endminipage} that you can then use as \begin{grammer}...\end{grammer}. – Werner Dec 6 '12 at 6:43
  • 2
    I also recommend using the minipage environment. You may have to tweak the \parindent setting inside the minipage environment because minipage sets it to opt. – user10274 Dec 6 '12 at 6:50