04. Spending Shabbat In or Outside a City

For someone who is spending Shabbat in a city or town, whether its residents are Jewish or non-Jewish, the whole area that is built up contiguously is considered one place, and the 2,000 amot of the teĥum are measured from its perimeter. Even if there is space between the homes, as long as they are surrounded by a fence or an eruv, the entire enclosed area is considered one place, and the 2,000 amot are measured from its perimeter (as will be explained in section 8).

All this pertains to one who spends Shabbat in the city or within its squared-off area. However, one who spends Shabbat in a field near the city is limited to 2,000 amot in each direction, and if his 2,000 amot terminate inside a city, his teĥum ends right there, in the middle of the city. We do not consider the whole city his four amot.[5]

[5]. If a town is so small that the entire area is within his 2,000 amot, then the area of the town is skipped (the whole city is considered four amot), and his 2,000 amot continue from the far edge of the town (SA 408:1). Here is an example: