May a person learn torah near a dead body? Does it matter if the corpse is Jewish or not? Please cite sources.
Gesher Hachayim, chapter 5, section 2, paragraphs 1–4, writes (in my own loose translation):
And one is not allowed to speak words of Torah within four cubits of a corpse, or even read Sh'ma or pray or say a b'racha, for he'd be "teasing the pauper", doing a mitzva that the dead person cannot. Likewise, he can't be in the vicinity of the corpse wearing t'filin or tzitzis visible out.
Outside of the corpse's four cubits it's permitted. The Shach wrote that words of Torah are prohibited even outside of four cubits, but the later rabbis have taken the position that even words of Torah are permitted outside four cubits.
But in the house the corpse is in, we're stringent even outside of his four cubits, as we treat the whole house as four cubits.
Even before a woman's or minor's corpse, who were exempt from Torah study, tzitzis, and t'filin even when alive, we nonetheless are forbidden to study or be adorned by t'filin or tzitzis.
But we can say, before a corpse, psalms or other things and verses that portend raising the level of his soul... and such verses as are customary to say when washing or dressing him [in preparation for burial]. For by such... "teasing the pauper" is irrelevant....
Also to expound before the corpse things in his honor (even as the S'faradim do) is permitted, as anything for his honor is permitted.
As always, for practical halacha, consult your rabbi rather than relying on what you read on this site. Note that the Gesher Hachayim does not specifically (as far as I see) mention non-Jews' corpses, one way or the other.