 				results['mathInline'] = parseInt(info, 10)
 			if data.indexOf("Number of math displayed") > -1
 				results['mathDisplay'] = parseInt(info, 10)
+			if data is "(errors"  # errors reported as (errors:123)
+				results['errors'] = parseInt(info, 10)
+			if line.indexOf("!!! ") > -1  # errors logged as !!! message !!!
+				results['messages'] += line + "\n"
 		return results

	wordcount: (project_id, user_id, file_name, image, callback = (error, pdfPositions) ->) ->
		logger.log project_id:project_id, user_id:user_id, file_name:file_name, image:image, "running wordcount"
		file_path = "$COMPILE_DIR/" + file_name
		command = [ "texcount", '-inc', file_path, "-out=" + file_path + ".wc"]
		directory = getCompileDir(project_id, user_id)
		timeout = 10 * 1000
		compileName = getCompileName(project_id, user_id)

			elements: 0
			mathInline: 0
			mathDisplay: 0
			errors: 0
			messages: ""
		}
		for line in output.split("\n")
			[data, info] = line.split(":")
