TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have written following command:

\color{red} #1\nopagebreak\\\raisebox{-0.2mm}{\includegraphics{pol.pdf}}  
\color{blue} \emph{#2}}\vspace{5pt}}

This is going to be used as follows:

\ger{First sentence}{Second sentence}

Question is, how to assert that these two sentences will be always on the same page with full content (there won't be any page breaks)? I tried to use \nopagebreak, but it still breaks sometimes part of the second sentence.

share|improve this question
up vote 6 down vote accepted

Instead of \\ you can use \par\nobreak to prevent page breaks:

\color{red} #1\par\nobreak\noindent\raisebox{-0.2mm}{\includegraphics{pol.pdf}}  
share|improve this answer

One solution is to put the whole thing in a \minipage, and make that mini page a float.


Per request, an example:


You may want to add a \caption and a \label as well.

share|improve this answer
I think this is the simpler, cleaner solution as a concept, but I'm not going to vote it up, unless you'd like to provide sufficiently simple example code... – Brent.Longborough Jun 17 '11 at 10:24
@Brent: Example code added. – David Hammen Jun 19 '11 at 11:02
why a float? – egreg Jun 19 '11 at 11:09
@egreg: A float isn't essential here. However, my experience is that tall boxes/minipages often create overfull/underfull vbox problems. At least in my usage, those tall boxes/minipages almost always result from describing something graphically or tabularly: A figure or a table. – David Hammen Jun 19 '11 at 11:21
+1 as promised... – Brent.Longborough Jun 19 '11 at 17:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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