def configure_typogrify(pelicanobj, mathjax_settings):
 if (not pelicanobj.settings.get('TYPOGRIFY', False)):
  return
 try:
  import typogrify
  from distutils.version import LooseVersion
  if (LooseVersion(typogrify.__version__) < LooseVersion('2.0.7')):
   raise TypeError('Incorrect version of Typogrify')
  from typogrify.filters import typogrify
  pelicanobj.settings['TYPOGRIFY_IGNORE_TAGS'].extend(['.math', 'script'])
 except (ImportError, TypeError) as e:
  pelicanobj.settings['TYPOGRIFY'] = False
  if isinstance(e, ImportError):
   print '\nTypogrify is not installed, so it is being ignored.\nIf you want to use it, please install via: pip install typogrify\n'
  if isinstance(e, TypeError):
   print '\nA more recent version of Typogrify is needed for the render_math module.\nPlease upgrade Typogrify to the latest version (anything equal or above version 2.0.7 is okay).\nTypogrify will be turned off due to this reason.\n'

def configure_typogrify ( pelicanobj , mathjax_settings ) : if ( not pelicanobj . settings . get ( 'TYPOGRIFY' , False ) ) : return try : import typogrify from distutils . version import LooseVersion if ( LooseVersion ( typogrify . __version__ ) < LooseVersion ( '2.0.7' ) ) : raise TypeError ( 'Incorrect version of Typogrify' ) from typogrify . filters import typogrify pelicanobj . settings [ 'TYPOGRIFY_IGNORE_TAGS' ] . extend ( [ '.math' , 'script' ] ) except ( ImportError , TypeError ) as e : pelicanobj . settings [ 'TYPOGRIFY' ] = False if isinstance ( e , ImportError ) : print '\nTypogrify is not installed, so it is being ignored.\nIf you want to use it, please install via: pip install typogrify\n' if isinstance ( e , TypeError ) : print '\nA more recent version of Typogrify is needed for the render_math module.\nPlease upgrade Typogrify to the latest version (anything equal or above version 2.0.7 is okay).\nTypogrify will be turned off due to this reason.\n'
instructs typogrify to ignore math tags - which allows typogrify to play nicely with math related content .