A chat export is a transcript. A book is a manuscript.
When your book lives in a conversation, the only thing you can export is the conversation. That transcript is a faithful record of how the book got made — every prompt, every reply, every abandoned direction, every “actually, change that” — in the exact order you typed it. It is genuinely useful for remembering your process. It is useless as a book, because a reader does not want your process. They want the finished text, in order, with nothing else in it.
A manuscript is the opposite of a transcript. It contains only the accepted content — the chapters you decided to keep — arranged in the sequence a reader moves through them. Turning a transcript into a manuscript is not a formatting step you can automate at the end; it is a decision about which words are in the book, and that decision has to be made somewhere before any export can be clean.
The question is never really “how do I export from ChatGPT.” It is “where do my accepted chapters live?” Answer that and the export is trivial.