elucubrating

verb
  1. to write or compose with great care and effort, especially late into the night; to produce through laborious study or writing
  2. Usage: formal; literary; archaic

Examples