Dark theme messing with formulas text color, white on white when print/export

I had the same issues on libre office writer 25.8.1 windows, the posted solution still resulted in white on white for me, however I did manage to fix it by doing Tools>Options>LibreOffice Writer>Print, and setting “Print text in black” to true.