Getting the front sign of an expression. Positive or negative for formatting only
Maybe this is too simple to handle all the real cases, but it seems to work on your test cases.
exprWithSign[expr_] :=
StringReplace[" + " <> ToString[InputForm[expr]], "+ -" -> "- "]
Clear[x, y]
testCases =
{-1/2, 1/2, 1, -1, x, x - y, -x - y, 2/3 - x, -2 x + 1, Sin[x], -Sin[y] + Sin[x]};
Print["z " <> exprWithSign[#]] & /@ testCases;
Why do you need to use both TeXForm and InputForm? If you're interested in ending up with a latex string, perhaps you could use something like:
Replace[
testCases,
Verbatim[Plus][a__] | a__ :> ToString[HoldForm[Plus[z,a]], TeXForm],
{1}
]
${z-\frac{1}{2},z+\frac{1}{2},z+1,z-1,z+x,z+x-y,z-x-y,z+\frac{2}{3}-x,z+1-2 x,z+\sin (x),z+\sin (x)-\sin (y),z-\frac{4 \sin (x)}{3}}$