If opposite a portion of the city's width in any direction there is a city where the two thousand cubits end at the edge of the city, it becomes entirely like four cubits and the remainder is completed outside the city; and opposite the second portion of the width in this direction there is no city, or there is a city where its measurement ended in the middle of the city—we do not equalize the sides, but rather we follow here according to its measurement and there according to its measurement, and it is simple. (And so wrote the Sha'arei Teshuva in the name of the Noda BiYehuda).
And one who places his eruv in a city, even a large one (like Nineveh), and even a ruined city or a cave fit for dwelling—he may walk through all of it and two thousand cubits outside of it in every direction. And one who places his eruv inside the city in which he spent the Shabbat—we do not measure from the place of his eruv, but rather he is like all the residents of the city, who have two thousand cubits in every direction outside the city. And so too if he placed his eruv in places that join to the city, such as houses standing within seventy cubits, or according to the opinion of the Tur within seventy cubits of the city—he has done nothing and he is like the residents of the city, for this is exactly like placing it in the city. And if he placed his eruv outside the techum—it is not an eruv, and he has the techum of his house. And we do not say that he uprooted his intention from his house, because such is his intention, that if the eruv is not effective—he should not lose the techum of his house, and it will be explained in siman 141. (See Magen Avraham subsection 4)
אם נגד מקצת רוחב העיר באיזה רוח יש עיר שכלים האלפים בסוף העיר, דנעשית כולה כד' אמות ומשלימין השאר מחוץ לעיר, ונגד מקצתו השני לרוחב רוח זה אין עיר, או יש עיר שכלתה מדתה באמצע העיר - אין משוין הצדדים, אלא הולכין בכאן כפי המדה שלה, ובכאן כפי המדה שלה, ופשוט הוא. (וכן כתב בש"ת בשם הנודע ביהודה)והמניח עירובו בעיר, אפילו גדולה (כנינוה), [כננוה] ואפילו עיר חריבה או מערה הראויה לדיורין - מהלך את כולה וחוצה לה אלפים אמה לכל רוח. והמניח עירובו בתוך העיר ששבת בה - אין מודדין ממקום עירובו אלא הרי הוא כבני העיר כולם, שיש להם אלפים אמה לכל רוח חוץ לעיר. וכן אם נתן עירובו במקומות המצטרפין לעיר, כמו בתים העומדים בתוך ע' אמה, או לדעת הטור בתוך ע' אמה מהעיר - לא עשה כלום והרי הוא כבני העיר, דזהו ממש כנתנו בעיר. ואם נתן עירובו חוץ לתחום - אינו עירוב, ויש לו תחום ביתו. ולא אמרינן דעקר דעתו מביתו, משום דכן הוא דעתו, שאם העירוב לא יועיל - לא יפסיד תחום ביתו, ויתבאר בסימן קמ"א. (עיין מג"א סק"ד)