Let $R$ be a $\mathbb{Z}^n$-graded ring with unique maximal ideal $R_{+}$ generated by all elements positive degree in $(\mathbb{N}_{>0})^n$ and we consider a bounded complex of $\mathbb{Z}^n$-graded $R$-modules $M_i$ having only in degrees $0,.., n$ non zero entries:
$$ 0 \xrightarrow{\partial_{0}} M_0 \xrightarrow{\partial_1} M_1 \xrightarrow{\partial_2} M_2 ... \xrightarrow{\partial_n} M_n \xrightarrow{} 0 $$
where we assume that the coboundary maps $\partial_i$ respect the grading: $\partial_i(M_{i-1, \alpha}) \subset M_{i, \alpha}$ for every grade $\alpha \in \mathbb{Z}^n$.
Next we do the most usual thing at this stage by taking cohomology $H^i(M):= \text{ker }\partial_{i+1}/ \text{im }\partial_{i}$ with respect this complex and I'm posting the question why the cohomology groups $H^i(M)$ should inherit also a $\mathbb{Z}^n$-grading?
It is known that if $N \subset M$ is a $R$-submodule of a graded module $M$, which is generated by homogeneous elements of $M$, then $N$ inherits grading from $M$ via $N_{\alpha}:= N \cap M_{\alpha}$. Then the quotient $M/N$ inherits also a grading via $(M/N)_{\alpha} := M_{\alpha}/N_{\alpha} $. The problem here is that I not see any plausible reason why $\text{ker }\partial_{i} $ and $\text{im }\partial_{j} $ should inherit $\mathbb{Z}^n$-gradings from $M_i$, since there is no reason why these $R$-submodules are generated by homogeneous elements of the $M_i$.
But nevertheless in R. Stanley's Combinatorics and Commutative Algebrain the section treating local cohomology on page 37 it is stated that the cohomology groups $H^i(M)$ should still inherit the $\mathbb{Z}^n$-grading from the objects of the complex. Why is this true?