change handling of global variables in LaTeX field module, fix #321