Ejemplo n.º 1
0
	def get_javascript(self, webenv=False):
		if '<script type="math/' in self.body:
			javascript = (MATHJAX_CONFIG + '<script type="text/javascript" src="'
		                                     + common.get_mathjax_url(webenv) + '"></script>')
		else:
			javascript = ''

		return javascript
Ejemplo n.º 2
0
	def get_javascript(self, webenv=False):
		if '<script type="math/tex' in self.body:
			javascript = (MATHJAX_CONFIG + '<script type="text/javascript" src="'
		                                     + common.get_mathjax_url(webenv) + '"></script>')
		else:
			javascript = ''

		return javascript
Ejemplo n.º 3
0
	def get_javascript(self, text='', webenv=False):
		if 'body' in self._cache:
			body = self._cache['body']
		else:
			body = self.get_document_body(text)
		if not '<script type="math/tex' in body:
			return ''
		return (MATHJAX_CONFIG + '<script type="text/javascript" src="'
		+ common.get_mathjax_url(webenv) + '"></script>')
Ejemplo n.º 4
0
	def get_javascript(self, text='', webenv=False):
		head = self.publish_parts(text)['head']
		start_position = head.find('<script ')
		end_position = head.rfind('</script>')
		if start_position >= 0 and end_position >= 0:
			mjurl = head[start_position:end_position+9]+'\n'
			return mjurl.replace(common.MATHJAX_WEB_URL,
				common.get_mathjax_url(webenv))
		return ''
Ejemplo n.º 5
0
    def get_javascript(self, webenv=False):
        start_position = self.head.find("<script ")
        end_position = self.head.rfind("</script>")
        if start_position >= 0 and end_position >= 0:
            mjurl = self.head[start_position : end_position + 9] + "\n"
            javascript = mjurl.replace(common.MATHJAX_WEB_URL, common.get_mathjax_url(webenv))
        else:
            javascript = ""

        return javascript
Ejemplo n.º 6
0
 def get_javascript(self, webenv=False):
     if 'MathJax.js?config=TeX-AMS_CHTML' not in self.head:
         return ''
     return (
         '<script type="text/javascript" src="%s?config=TeX-AMS_CHTML"></script>\n'
         % common.get_mathjax_url(webenv))