writing detected citations in a file