I'm getting odd spacing/indentation behavior when the \textcolor command is combined with the \[ ... \] environment. I did find a fix by putting % in a couple places, as outlined below, but I'd like to know if anyone has a better solution. The picture below, followed by a MWE, explains the problem in more detail.
Output:

Code:
\documentclass[a4 paper,11pt]{article} \usepackage{amsmath, amsfonts, amssymb, parskip, dsfont, amsthm, wasysym, mathrsfs} \usepackage[pdftex]{graphicx} \usepackage[usenames, dvipsnames]{xcolor} \usepackage[top=1in, bottom=1in, left=1in, right=1in]{geometry} \usepackage{mathrsfs} \usepackage[normalem]{ulem} \usepackage[breaklinks=true]{hyperref} \usepackage{soul, color} % for highlighting \usepackage{pifont} % for cool symbols in text mode \begin{document} \textbf{No problems with spacing or indents when I don't use the \textbackslash[ ... \textbackslash] environment.} \textcolor{NavyBlue}{Insert problem description here.} Insert problem solution here. %%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%% \textbf{When I use the \textbackslash[ ... \textbackslash] environment, it puts a large space after the \textbackslash textcolor section.} Insert problem solution here. %% this line should have been removed \textcolor{NavyBlue}{Insert problem description here. Along with some math: \[ 1 \neq 0 \]} Insert problem solution here. %%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%% \textbf{I can sort of fix the problem by eliminating the space between the problem statement and the solution statement, but then there is an ugly little indent.} \textcolor{NavyBlue}{Insert problem description here. Along with some math: \[ 1 \neq 0 \]} Insert problem solution here. %%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%% \textbf{Finally, I realized that I could ``fix'' the problem by putting a comment character at the end of the line and between the lines.} \textcolor{NavyBlue}{Insert problem description here. Along with some math: \[ 1 \neq 0 \]}% % Insert problem solution here. %%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%% \textbf{But this seems incredibly hacky, and I'm hoping someone can point me to a more elegant fix.} \end{document}