סימן צה סעיף יב
אִם יֵשׁ בְּתוֹךְ הַתְּחוּם אֵיזֶה עִיר שֶׁהִיא מֻקֶּפֶת חוֹמָה אוֹ שֶׁהִיא מְתֻקֶּנֶת בְּעֵרוּבִין, אֵינָהּ נִמְדֶּדֶת וְאֵינָהּ עוֹלָה לְחֶשְׁבּוֹן אֶלָּא לְאַרְבַּע אַמּוֹת. וְדַוְקָא כְּשֶׁהַתְּחוּם שַׁבָּת מַגִּיעַ עַד חוּץ לָעִיר, כְּגוֹן שֶׁמִּן הָעֵרוּב עַד הָעִיר יֵשׁ חֲמֵשׁ מֵאוֹת אַמָּה, וְאֹרֶךְ הָעִיר הוּא אֶלֶף אַמָּה, אָז הָעִיר אֵינָהּ נֶחְשֶׁבֶת אֶלָּא לְאַרְבַּע אַמּוֹת, וְיֵשׁ לוֹ מִחוּץ לָעִיר עוֹד אֶלֶף וְאַרְבַּע מֵאוֹת וְתִשְׁעִים וְשֵׁשׁ אַמּוֹת. וְאֵין חִלּוּק בֵּין צַד זֶה שֶׁלִּפְנֵי הָעֵרוּב בֵּין הַצַּד שֶׁלְּאַחַר הָעֵרוּב. אֲבָל אִם תְּחוּם הַשַׁבָּת כָּלֶה בְּאֶמְצַע הָעִיר, אָסוּר לוֹ לָלֶכֶת יוֹתֵר, כֵּיוָן שֶׁהוּא חוּץ לַתְּחוּם, כִּי בְּעִנְיָן זֶה לֹא נֶחְשֶׁבֶת לוֹ כָּל הָעִיר לְאַרְבַּע אַמּוֹת.
If there is a town within the techum that is either surrounded by walls or equipped with an eiruv, that town is not measured [in the 2, 000 amos], and is counted only as four amos. This is true only when the techum Shabbos reaches the town limits. For example, if [the distance] from the eiruv to the town is 500 amos and the length of the town is 1,000 amos, then the town is figured at only four amos; and you [may walk] an additional 1,496 amos from the town limits. [In this regard] we make no distinction between the side [of the town] nearer the eiruv and the side that is farther from the eiruv.31There is a difference of four amos. But if the techum Shabbos ends in the middle of the town, you are forbidden to walk farther than that, since you [would be walking] outside the techum, for in this case, the entire town is not considered as four amos.32See Shulchan Aruch 408: 1.
תנא דבי אליהו כל השונה הלכות בכל יום מובטח לו שהוא בן העולם הבא שנאמר הליכות עולם לו אל תקרי הליכות אלא הלכות (נדה ע"ג.)