Shulchan Arukh, Orach Chayim Siman 408
Can copy this into an AI, or connect the whole library to your assistant. For deeper learning, you can directly use the original seforim, sites, and apps.
(מותר לערב עירובי תחומין ולקנות שביתה סוף התחום ולכן) מי שיצא מהעיר בע"ש והניח מזון ב' סעודו' רחוק מהעיר בתוך התחו' וקבע שביתתו שם אע"פ שחזר לעיר ולן בביתו נחשב אותו כאלו שבת במקו' שהניח בו הב' סעודות וזהו הנקרא עירובי תחומין ויש לו להלך ממקום עירובו למחר אלפי' אמה לכל רוח לפיכך כשהוא מהלך ממקום עירובו למחר אלפי' אמה כנגד העיר אינו מהלך בעיר אלא עד סוף מדתו ואם היתה העיר מובלע' בתוך מדתו תחשב העיר כולה כד"א וישלים מדתו חוצה לה כיצד הרי שהניח את עירובו ברחוק אלף אמה מביתו שבעיר לרוח מזרח נמצא מהלך למחר ממקום עירובו אלפי' אמה למזרח ומהלך ממקום עירובו אלפים אמה למערב אלף שמן העירוב עד ביתו ואלף אמה מביתו בתוך העיר ואינו מהלך בעיר אלא עד סוף האלף ואם היה מביתו עד סוף העיר פחות מאלף אפילו אמה אחת שנמצאת מדתו כלתה חוץ לעיר תחשב המדינה כולה כד"א ויהלך חוצה לה תתקצ"ו אמה תשלום האלפי' לפיכך אם הניח עירובו ברחוק אלפי' אמה מביתו שבעיר הפסיד את כל העיר ונמצא מהלך מביתו עד עירובו אלפי' אמה ואינו מהלך מביתו בעיר לרוח מערב אפי' אמה אחת: הגה ויש אומרים דאפילו כלתה מדתו באמצע העיר מהלך בכל העיר כולה אבל לא חוצה לה ויש להקל (טור והגהות מיימוני פכ"ז מה"ש בשם סמ"ק ורש"י) ואם כלתה מדתו בסוף העיר ואע"ג דעדיין עיבור לפני העיר כל העיר כארבע אמות דלא אמרינן עיבור של העיר כעיר להחמיר (המגיד פכ"ז מה' שבת) כל מקום שהניח עירוב תחומין ויש לו אלפים לכל רוח אסור לו לילך לצפון ולדרום רק נגד רוחב המקום שקנה בו שביתה ואם אינו רק ארבע אמות כגון שאין העירוב ברשות היחיד אסור לו לילך לכל רוח אלפים רק ברוחב ארבע אמותיו עם זויותיהן כדלעיל סי' שצ"ח סעיף ב' ומכל מקום אם כלתה המדה סוף העיר וכולה כארבע אמותיו מותר לילך כל רחבה ויש לו אלפים חוץ לעיר לצפון ולדרום אע"פ שאין לו רחב כל כך נגד המקום שקנה בו עירוב (הר"ר יונתן):
Laws of placing an eruv and acquiring Shabbat rest. Contains 4 sections (It is permitted to make an eruv of boundaries and acquire Shabbat rest at the end of the boundary, and therefore:) One who left the city on Shabbat eve and placed two meals' worth of food at a distance from the city within the boundary and established his Shabbat rest there — even if he returned to the city and slept in his house — he is considered as if he spent Shabbat at the place where he placed the two meals. This is called an eruv of boundaries. He may walk from the place of his eruv the next day two thousand cubits in each direction. Therefore when he walks from his eruv two thousand cubits in the direction of the city, he may only walk within the city until the end of his measure. If the city is contained within his measure, the entire city counts as four cubits and he completes his measure beyond it. How so? If he placed his eruv one thousand cubits east of his house in the city, he may walk two thousand cubits east from his eruv, and two thousand cubits west from his eruv — one thousand from the eruv to his house and one thousand cubits from his house within the city — and he may only walk within the city until the end of that thousand. If from his house to the end of the city is less than a thousand — even by one cubit — so that his measure ends beyond the city, the entire city counts as four cubits and he may walk 996 cubits beyond it to complete the two thousand. Therefore if he placed his eruv two thousand cubits from his house in the city, he has lost the entire city and may walk from his house to the eruv two thousand cubits, but may not walk even one cubit from his house into the city in the western direction. Rema: Some say that even if his measure ends in the middle of the city he may walk through the entire city but not beyond it, and one may be lenient. And if his measure ends at the edge of the city, even though there is still an extension beyond the city, the entire city counts as four cubits — we do not say the city's extension counts as the city to be stringent. Wherever one places an eruv of boundaries and has two thousand cubits in each direction, he is only permitted to walk north and south within the width of the place where he acquired Shabbat rest. If it is only four cubits — such as when the eruv is not in a private domain — he may only walk in each direction two thousand cubits within the width of his four cubits and their corners, as explained above in Siman 398, section 2. Nevertheless, if his measure ends at the edge of the city and the entire city counts as his four cubits, he may walk its entire width and has two thousand cubits beyond the city to the north and south, even if he does not have that width opposite the place where he acquired the eruv.
המניח עירובו ברה"י אפי' היתה מדינה גדולה כנינוה ואפי' עיר חריבה או מערה הראוי' לדיורין מהלך את כולה וחוצה לה אלפים אמה לכל רוח:
One who places his eruv in a private domain — even if it were a large city like Nineveh, or even a ruined city or a cave fit for dwelling — may walk through all of it and two thousand cubits beyond it in each direction.
המניח עירובו בתוך העיר ששבת בה לא עשה כלום ואין מודדין ממקום עירובו אלא הרי הוא כבני העיר כולם שיש להם אלפים אמה לכל רוח חוץ לעיר וכן אם נתן עירובו במקומות המצטרפים לעיר שמודדים התחום חוץ מהם הרי זה כנותנו בתוך העיר:
One who places his eruv within the city where he spent Shabbat has accomplished nothing, and we do not measure from the place of his eruv — rather he is like all the city's residents who have two thousand cubits in each direction beyond the city. Similarly, if he placed his eruv in places that combine with the city from whose edge the boundary is measured, it is as if he placed it within the city.
נתן עירובו חוץ לתחום אינו כלום (ויש לו תחום מביתו) (מיימוני והמגיד פ"ו מה' עירובין):
If he placed his eruv beyond the boundary it is ineffective. (And he has his boundary measured from his house.)