Let $g\geq 2$ be an integer. (It will be the genus of some curve.)
Are there positive integers $d$ and $e$ such that the equality
$$ (e-2)(e-1) = 2d(g-1)+2$$ holds?
Yes, there does exist $d$ and $e$.
We have $e^2 - 3e = 2d(g-1)$ i.e. $e(e-3) = 2d(g-1)$.
Now given $g$, choose $e = 2k(g-1)$. Then $d = k(e-3)$.
$Let,$ $g = k+1$ where, k is a positive integer and $k \neq 0$
for k = 1, g = 2
we now have, $e(e-3)=2dk$
now we must consider some of the following scenarios,
e = 1, (e-3)=2dk, which is not possible as (e - 3) will be negative for e = 1
e = 2, (e -3) =dk, which is not possible as (e -3) will be negative for e = 2
e = d, (e-3)=2k, i.e. e = d = 3+2k, which has infinite solutions
e = k, (e-3)=2d, i.e. e = 2d+3 =k, which has infinite solutions for k=5,7,9,...,(2n+3)
e = 2k, (e -3) = d, i.e. e=2k and d= (e-3), which has infinite solutions for $k \geq 2$
$e = dk, (e -3) = 2,$ $i.e.$ $e=5$ $and$ $d= 5$ $for$ $k=1$
e = 2d, (e -3) = k, i.e. e=k+3 and d= e/2 which has infinite solutions for k=1,3,5,...,(2n-1)
lastly, e = 2dk, (e-3)=1, gives e=4 and d=2 for k=1