לֹעֵ֣ג לָ֭רָשׁ חֵרֵ֣ף עֹשֵׂ֑הוּ שָׂמֵ֥חַ לְ֝אֵ֗יד לֹ֣א יִנָּקֶֽה׃
דער װאָס שפּאָט פֿון אַן אָרימאַן, לעסטערט זײַן באַשעפֿער;דעם װאָס פֿרײט זיך אױף אַ בראָך, װעט ניט געשאָנקען װערן.
Mishneh Torah, Reading the Shema
The Shema is not to be read in a bath house nor in a latrine, even if there is no ordure in it, nor in a graveyard, nor in proximity to a corpse. One is permitted to read it after moving away from the grave of a corpse to a distance of at least four cubits. If the Shema was read in a place where it was improper to do so, it must be read a second time.
Mishneh Torah, Tefillin, Mezuzah and the Torah Scroll
A person should not walk in a cemetery with phylacteries on his head. When he is within a distance of four cubits from a corpse or a grave, the phylacteries are to be removed till he has passed on to a distance outside four cubits. Phylacteries must not be put on before one is decently covered and has put on his garments. If a person is carrying a burden on his head, he must remove the phylactery from his head, and may not put it on till he has removed the burden. Even a kerchief [alone] may not be put upon the head when one is wearing phylacteries. But he puts his cap over the phylactery.
Shulchan Arukh, Yoreh De'ah
One who sees a corpse and does not escort him transgresses thereby, 'Whoso mocketh the poor12e., the dead. [blasphemeth his Maker],13Prov. XVII, 5. This ruling is found in Ber. 18a. Cf. Derek Ereẓ Zuta § and should be placed under a ban;14M.K. ibid. supra § 343 and notes. and one should escort him at least four cubits.15R. Jonah and Asheri to Ber. ibid. This applies only if there are sufficient people present at the funeral escort. Otherwise, one must escort the corpse to the grave.