Just to follow my previous comment- there's a danger that your question might get closed if it is not posed clearly; your question is very reasonable, but would benefit greatly from being turned into a Minimal Working Example
–
cmhughesOct 31 '12 at 16:49

\D might depend on a certain package, the \mathbb{R} without $ surrounded should not produce the mentioned error, but an missing $. Hence \D should be the cause for the error (though depending on the OPs packages in use).
–
RonnyOct 31 '12 at 16:24

well i was right stating, that the OPs error does not come from the math mode missing around \mathbb R, though the real error message then is of course Error: \mathbb allowed only in math mode. :)
–
RonnyOct 31 '12 at 16:45