Orach Chaim Simman 580 Seif 1 the SA writes
אֵלּוּ הַיָּמִים שֶׁאֵרְעוּ בָּהֶם צָרוֹת לַאֲבוֹתֵינוּ וְרָאוּי לְהִתְעַנּוֹת בָּהֶם; וְאַף עַל פִּי שֶׁמִּקְּצָתָם בְּרֹאשׁ חֹדֶשׁ, יֵשׁ מִי שֶׁאוֹמֵר שֶׁיִּתְעַנּוּ בּוֹׁ.
On the following days which involved suffering to our ancestors, it is fitting to fast. Even if it occurs on Rosh Chodesh, there is an opinion to fast.
The Rema adds:
וְטוֹב שֶׁלֹּא לְהַשְׁלִים בְּרֹאשׁ חֹדֶשׁ.
It is good [however] to not complete the fast when it is on Rosh Chodesh.
The Mishnah Berurah Seif Kattan 3 explains the Rema's statement:
(ג) וטוב שלא להשלים בר"ח - משום דכתיב בספר תניא דאין להתענות בר"ח:
Because it's written in the Sefer Tanya not to fast on Rosh Chodesh.
Maybe I'm reading too much into this statement, but at face value it's surprising. The Rema was in the 16th century, and the Tanya was written in the late 18th century.
I'm wondering if the MB really is referring to the Tanya by the Alter Rebbe, or a different book known as "Sefer Tanya" (Tanya Rabbasi seems like a good candidate...is it known as "Sefer Tanya"?). If he's referring to a different book, what is the exact source? If he's referring to the Tanya by the Alter Rebbe, how can it be the source for the Rema? Is it quoting an earlier source which is the source for both of them?