Because metadata-edit is common template and is used not only in html and problem types. UNDEFINED is special Mako templates singleton object that can be used to check if variable is not passed to template. So  ```enable_latex_compiler is not UNDEFINED``` is check for cases when metadata-edit is used outside of HTML or Problem templates, and enable_latex_compiler is not passed to template. Or I didn't get your point?