已知 $\sin x+\cos x=\frac{\sqrt{3}-1}{2}, x \in(0, \pi)$, 则 $\tan x=(\quad)$
$\sin x+\cos x=\frac{\sqrt{3}-1}{2}$, 且 $x \in(0, \pi), \therefore 1+2 \sin x \cos x=1-\frac{\sqrt{3}}{2}, \therefore 2 \sin x \cos x=-\frac{\sqrt{3}}{2}<0, \therefore x$为钝角, $\therefore \sin x-\cos x=\sqrt{(\sin x-\cos x)^{2}}=\frac{1+\sqrt{3}}{2}, \therefore \sin x=\frac{\sqrt{3}}{2}, \cos x=-\frac{1}{2}, \tan x=\frac{\sin x}{\cos x}=-\sqrt{3}$故选 D.