If $F$ is any totally real field of degree $r$ over $\mathbb Q$ and if
$\tau=(\tau_1,\dotsc,\tau_r)\in \mathbb H^r$, by definition it is usual to
define $\operatorname{Tr}(u\tau)=u^{(1)}\tau_1+\cdots u^{(r)}\tau_r$, where
the $u^{(i)}$ denote the $r$ embeddings of $F$ into $\mathbb R$.
However, the Fourier expansion at infinity of a holomorphic Hilbert modular form is of the form
$$f(\tau)=a(0)+\sum_{0<<u\in{\frak d}^{-1}}a(u)e^{2\pi i\operatorname{Tr}(u\tau)}$$
where the sum is over totally positive elements of the codifferent.

In the special case when the codifferent is a principal ideal generated by
some element $\delta\in O_F$, as in the case of quadratic fields, one can
write $u=v/\delta$ and now sum on $v\in O_F$ instead. In that case
$\operatorname{Tr}(u\tau)=\operatorname{Tr}(v\tau/\delta)$. But it is a bad
idea to define the trace specifically for the case of quadratic fields
(where $\delta=\sqrt{D}$) as the reference that you mention seems to do,
since it does not seem to be generalizable to arbitrary totally real fields.