סימן קכח סעיף ד
מִשַׁבָּת שֶׁלְּאַחַר תִּשְׁעָה בְּאָב וּלְהַלָּן, מַפְטִירִין בְּשֶׁבַע שַׁבָּתוֹת, שִׁבְעָה דְּנֶחָמָתָא. וְאִם חָל א' דְּרֹאשׁ חֹדֶשׁ אֱלוּל בַּשַׁבָּת, דּוֹחִין עֲנִיָּה סוֹעֲרָה וּמַפְטִירִין הַשָּׁמַיִם כִּסְאִי, מִפְּנֵי שֶׁיֵּשׁ בָּהּ גַּם כֵּן מִנֶּחָמוֹת יְרוּשָׁלָיִם. וּבְשַׁבָּת פָּרָשַׁת כִּי תֵצֵא, שֶׁאָז מַפְטִירִין רָנִי עֲקָרָה, מַשְׁלִימִין עָלֶיהָ גַּם עֲנִיָּה סוֹעֲרָה, שֶׁהִיא סְמוּכָה לָהּ. אִם טָעָה בְּשַׁבָּת רֹאשׁ חֹדֶשׁ אֱלוּל וְאָמַר עֲנִיָּה סוֹעֲרָה, אִם נִזְכַּר קֹדֶם שֶׁבֵּרַךְ לְאַחֲרֶיהָ, יֹאמַר גַּם הַשָּׁמַיִם כִּסְאִי, וִיבָרֵךְ לְאַחֲרֶיהָ. וְאִם לֹא נִזְכַּר עַד לְאַחַר הַבְּרָכוֹת, יֹאמַר הַשָּׁמַיִם כִּסְאִי בְּלֹא בְּרָכוֹת. וְאִם חָל רֹאשׁ חֹדֶשׁ אֱלוּל בְּאֶחָד בַּשַׁבָּת, דּוֹחִין הַפְטָרַת מָחָר חֹדֶשׁ, שֶׁאֵין בָּהּ מִנֶּחָמוֹת יְרוּשָׁלַיִם, וּמַפְטִירִין עֲנִיָּה סוֹעֲרָה.
Beginning with the Shabbos following Tishah beAv and after that, for the next seven Shabbosos we read the haftoras "sheva denechamasa" [seven haftoras of consolation]. If the first day of Rosh Chodesh Elul occurs on Shabbos, the haftorah, Aniyah so'arah, is set aside ["O you afflicted, floundering in the storm,"] (Isaiah 54:11) and we read instead, "Hashamayim kis'i," [The heaven is My throne] (Isaiah 66:1), because this haftorah also contains consolation for Jerusalem. On the Shabbos of Parshas Ki Seitzei, when the haftorah Roni akarah [Sing, O barren woman] (Isaiah 54:1) is read, we conclude the haftorah with Aniyah so'arah, which is next to it. If, by mistake, on Shabbos Rosh Chodesh Elul, you said Aniyah so'arah, and you became aware of it before saying the concluding berachos, you should also say Hashamayim kis'i, and then say the concluding berachah. If you only became aware [of your error] after saying the concluding berachos, then you should recite, Hashamayim kis'i without the berachos. If Rosh Chodesh Elul occurs on Sunday, the haftorah, Machar Chodesh is set aside, [Tomorrow is Rosh Chodesh] (I Samuel 20:18), because it contains no consolation for Jerusalem, and the haftorah Aniyah so'arah is read.
תנא דבי אליהו כל השונה הלכות בכל יום מובטח לו שהוא בן העולם הבא שנאמר הליכות עולם לו אל תקרי הליכות אלא הלכות (נדה ע"ג.)