saving charts as PGN format, and creating tex template with values from mongodb