I've checked this answer. While it works in Mathematica, the $\LaTeX$ output is weird.
X[x_, y_, z_] := Piecewise[{{3/(4*Pi), Sqrt[x^2 + y^2 + z^2] <= 1}}, 0]
Row[{HoldForm[X[x, y, z]], X[x, y, z]}, "\[LongEqual]"] // TraditionalForm // TeXForm
The $\LaTeX$ output is:
X(x,y,z)=
\begin{array}{cc}
\{ &
\begin{array}{cc}
\frac{3}{4 \pi } & \sqrt{x^2+y^2+z^2}\leq 1 \\
0 & \text{True} \\
\end{array}
\\
\end{array}
which renders as:
How could I get something like:
?