Many mathematicians wrote their autobiographies, see the answers to
http://mathoverflow.net/questions/102597/history-question-autobiography-of-mathematicians/102676#102676
Quite a few also have engaged in writing literary fiction.
For example, Sofya Kovalevskaya (apart from memories about her childhood) wrote a novel: Nihilist Girl, translated by Natasha Kolchevska with Mary Zirin ; introduction by Natasha Kolchevska. Modern Language Association of America (2001) ISBN 0-87352-790-9.
Kovalevskaya also collaborated with Anne Charlotte Leffler on a play (according to the Wikipedia page of Leffler, the title is The struggle for happiness).
In our times, Michèle Audin, known for her achievements in symplectic geometry, is a member of Oulipo.
She recently published a novel: La formule de Stokes, roman, Cassini, 2016, 297 p. (ISBN 9782842252069) However, in view of the preferred mode of creation by Oulipo, this work may be not entirely unrelated to mathematics. It is a novel, though, not a scholarly or popularizing work.
Some other examples can be found among answers to this question:http://mathoverflow.net/questions/45185/pseudonyms-of-famous-mathematicians/62966#62966