modify PGF write to avoid extra spaces