本文整理汇总了Python中sphinx.ext.mathbase.mathbase_setup函数的典型用法代码示例。如果您正苦于以下问题:Python mathbase_setup函数的具体用法?Python mathbase_setup怎么用?Python mathbase_setup使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了mathbase_setup函数的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: init_math
def init_math(app):
"""
This is a dummy math extension.
It's a hack, but if you want math in a PDF via pdfbuilder, and don't want to
enable pngmath or jsmath, then enable this one.
:copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from sphinx.errors import SphinxError
try:
# Sphinx 0.6.4 and later
from sphinx.ext.mathbase import setup_math as mathbase_setup
except ImportError:
try:
# Sphinx 0.6.3
from sphinx.ext.mathbase import setup as mathbase_setup
except ImportError:
_, e, _ = sys.exc_info()
log.error('Error importing sphinx math extension: %s', e)
class MathExtError(SphinxError):
category = 'Math extension error'
def html_visit_math(self, node):
self.body.append(node['latex'])
raise nodes.SkipNode
def html_visit_displaymath(self, node):
self.body.append(node['latex'])
raise nodes.SkipNode
mathbase_setup(app, (html_visit_math, None), (html_visit_displaymath, None))
开发者ID:EronHennessey,项目名称:rst2pdf,代码行数:35,代码来源:pdfbuilder.py
示例2: setup
def setup(app):
mathbase_setup(app, (html_visit_math, None), (html_visit_displaymath, None))
app.add_config_value('pngmath_dvipng', 'dvipng', False)
app.add_config_value('pngmath_latex', 'latex', False)
app.add_config_value('pngmath_use_preview', False, False)
app.add_config_value('pngmath_dvipng_args', [], False)
app.add_config_value('pngmath_latex_preamble', '', False)
app.connect('build-finished', cleanup_tempdir)
开发者ID:BackupGGCode,项目名称:sphinx,代码行数:8,代码来源:pngmath.py
示例3: setup
def setup(app):
mathbase_setup(app, (html_visit_math, None), (html_visit_displaymath, None))
app.add_config_value('mathjax_path',
'http://cdn.mathjax.org/mathjax/latest/MathJax.js?'
'config=TeX-AMS-MML_HTMLorMML', False)
app.add_config_value('mathjax_inline', [r'\(', r'\)'], 'html')
app.add_config_value('mathjax_display', [r'\[', r'\]'], 'html')
app.connect('builder-inited', builder_inited)
开发者ID:101man,项目名称:sympy,代码行数:8,代码来源:mathjax.py
示例4: setup
def setup(app):
try:
mathbase_setup(app, (html_visit_math, None), (html_visit_displaymath, None))
except ExtensionError:
raise ExtensionError('sphinx.ext.jsmath: other math package is already loaded')
app.add_config_value('jsmath_path', '', False)
app.connect('builder-inited', builder_inited)
return {'version': sphinx.__display_version__, 'parallel_read_safe': True}
开发者ID:spolanski,项目名称:WirnikApp,代码行数:9,代码来源:jsmath.py
示例5: setup
def setup(app):
mathbase_setup(app, (html_visit_math, None), (html_visit_displaymath, None))
# more information for mathjax secure url is here:
# http://docs.mathjax.org/en/latest/start.html#secure-access-to-the-cdn
app.add_config_value('mathjax_path',
'https://cdn.mathjax.org/mathjax/latest/MathJax.js?'
'config=TeX-AMS-MML_HTMLorMML', False)
app.add_config_value('mathjax_inline', [r'\(', r'\)'], 'html')
app.add_config_value('mathjax_display', [r'\[', r'\]'], 'html')
app.connect('builder-inited', builder_inited)
return {'version': sphinx.__display_version__, 'parallel_read_safe': True}
开发者ID:861008761,项目名称:standard_flask_web,代码行数:11,代码来源:mathjax.py
示例6: setup
def setup(app):
mathbase_setup(app, (html_visit_math, None), (html_visit_displaymath, None))
app.add_config_value('pngmath_dvipng', 'dvipng', 'html')
app.add_config_value('pngmath_latex', 'latex', 'html')
app.add_config_value('pngmath_use_preview', False, 'html')
app.add_config_value('pngmath_dvipng_args',
['-gamma 1.5', '-D 110'], 'html')
app.add_config_value('pngmath_latex_args', [], 'html')
app.add_config_value('pngmath_latex_preamble', '', 'html')
app.add_config_value('pngmath_add_tooltips', True, 'html')
app.connect('build-finished', cleanup_tempdir)
开发者ID:DEShawResearch,项目名称:SIMPLEchangepoint,代码行数:11,代码来源:pngmath.py
示例7: setup
def setup(app):
mathbase_setup(app, (html_visit_math, None), (html_visit_displaymath, None))
app.add_config_value('pngmath_dvipng', 'dvipng', 'html')
app.add_config_value('pngmath_latex', 'latex', 'html')
app.add_config_value('pngmath_use_preview', False, 'html')
app.add_config_value('pngmath_dvipng_args',
['-gamma', '1.5', '-D', '110', '-bg', 'Transparent'],
'html')
app.add_config_value('pngmath_latex_args', [], 'html')
app.add_config_value('pngmath_latex_preamble', '', 'html')
app.add_config_value('pngmath_add_tooltips', True, 'html')
app.connect('build-finished', cleanup_tempdir)
return {'version': sphinx.__display_version__, 'parallel_read_safe': True}
开发者ID:861008761,项目名称:standard_flask_web,代码行数:13,代码来源:pngmath.py
示例8: setup
def setup(app):
mathbase_setup(app, (html_visit_math, None), (html_visit_displaymath, None))
app.add_config_value("imgmath_image_format", "png", "html")
app.add_config_value("imgmath_dvipng", "dvipng", "html")
app.add_config_value("imgmath_dvisvgm", "dvisvgm", "html")
app.add_config_value("imgmath_latex", "latex", "html")
app.add_config_value("imgmath_use_preview", False, "html")
app.add_config_value("imgmath_dvipng_args", ["-gamma", "1.5", "-D", "110", "-bg", "Transparent"], "html")
app.add_config_value("imgmath_dvisvgm_args", ["--no-fonts"], "html")
app.add_config_value("imgmath_latex_args", [], "html")
app.add_config_value("imgmath_latex_preamble", "", "html")
app.add_config_value("imgmath_add_tooltips", True, "html")
app.add_config_value("imgmath_font_size", 12, "html")
app.connect("build-finished", cleanup_tempdir)
return {"version": sphinx.__display_version__, "parallel_read_safe": True}
开发者ID:martin-zheng,项目名称:sphinx,代码行数:15,代码来源:imgmath.py
示例9: setup
def setup(app):
try:
mathbase_setup(app, (html_visit_math, None), (html_visit_displaymath, None))
except ExtensionError:
raise ExtensionError('sphinx.ext.mathjax: other math package is already loaded')
# more information for mathjax secure url is here:
# http://docs.mathjax.org/en/latest/start.html#secure-access-to-the-cdn
app.add_config_value('mathjax_path',
'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?'
'config=TeX-AMS-MML_HTMLorMML', False)
app.add_config_value('mathjax_inline', [r'\(', r'\)'], 'html')
app.add_config_value('mathjax_display', [r'\[', r'\]'], 'html')
app.connect('builder-inited', builder_inited)
return {'version': sphinx.__display_version__, 'parallel_read_safe': True}
开发者ID:LFYG,项目名称:sphinx,代码行数:16,代码来源:mathjax.py
示例10: setup
def setup(app):
app.warn('sphinx.ext.pngmath has been deprecated. Please use sphinx.ext.imgmath instead.')
try:
mathbase_setup(app, (html_visit_math, None), (html_visit_displaymath, None))
except ExtensionError:
raise ExtensionError('sphinx.ext.pngmath: other math package is already loaded')
app.add_config_value('pngmath_dvipng', 'dvipng', 'html')
app.add_config_value('pngmath_latex', 'latex', 'html')
app.add_config_value('pngmath_use_preview', False, 'html')
app.add_config_value('pngmath_dvipng_args',
['-gamma', '1.5', '-D', '110', '-bg', 'Transparent'],
'html')
app.add_config_value('pngmath_latex_args', [], 'html')
app.add_config_value('pngmath_latex_preamble', '', 'html')
app.add_config_value('pngmath_add_tooltips', True, 'html')
app.connect('build-finished', cleanup_tempdir)
return {'version': sphinx.__display_version__, 'parallel_read_safe': True}
开发者ID:AlexEshoo,项目名称:sphinx,代码行数:18,代码来源:pngmath.py
示例11: setup
def setup(app):
# type: (Sphinx) -> Dict[unicode, Any]
try:
mathbase_setup(app, (html_visit_math, None), (html_visit_displaymath, None))
except ExtensionError:
raise ExtensionError('sphinx.ext.imgmath: other math package is already loaded')
app.add_config_value('imgmath_image_format', 'png', 'html')
app.add_config_value('imgmath_dvipng', 'dvipng', 'html')
app.add_config_value('imgmath_dvisvgm', 'dvisvgm', 'html')
app.add_config_value('imgmath_latex', 'latex', 'html')
app.add_config_value('imgmath_use_preview', False, 'html')
app.add_config_value('imgmath_dvipng_args',
['-gamma', '1.5', '-D', '110', '-bg', 'Transparent'],
'html')
app.add_config_value('imgmath_dvisvgm_args', ['--no-fonts'], 'html')
app.add_config_value('imgmath_latex_args', [], 'html')
app.add_config_value('imgmath_latex_preamble', '', 'html')
app.add_config_value('imgmath_add_tooltips', True, 'html')
app.add_config_value('imgmath_font_size', 12, 'html')
app.connect('build-finished', cleanup_tempdir)
return {'version': sphinx.__display_version__, 'parallel_read_safe': True}
开发者ID:atodorov,项目名称:sphinx,代码行数:22,代码来源:imgmath.py
示例12: setup
def setup(app):
mathbase_setup(app, (html_visit_math, None), (html_visit_displaymath, None))
app.add_config_value('jsmath_path', '', False)
app.connect('builder-inited', builder_inited)
return {'version': sphinx.__display_version__, 'parallel_read_safe': True}
开发者ID:861008761,项目名称:standard_flask_web,代码行数:5,代码来源:jsmath.py
示例13: MathExtError
except ImportError, e:
log.error('Error importing sphinx math extension: %s', e)
class MathExtError(SphinxError):
category = 'Math extension error'
def html_visit_math(self, node):
self.body.append(node['latex'])
raise nodes.SkipNode
def html_visit_displaymath(self, node):
self.body.append(node['latex'])
raise nodes.SkipNode
mathbase_setup(app, (html_visit_math, None), (html_visit_displaymath, None))
def setup(app):
#Init dummy math extension
init_math(app)
app.add_builder(PDFBuilder)
# PDF options
app.add_config_value('pdf_documents', [], None)
app.add_config_value('pdf_stylesheets', ['sphinx'], None)
app.add_config_value('pdf_style_path', None, None)
app.add_config_value('pdf_compressed', False, None)
app.add_config_value('pdf_font_path', [], None)
app.add_config_value('pdf_language', 'en_US', None)
app.add_config_value('pdf_fit_mode', '', None),
开发者ID:ajford,项目名称:rst2pdf,代码行数:31,代码来源:pdfbuilder.py
示例14: setup
def setup(app):
mathbase_setup(app, (html_visit_math, None), (html_visit_displaymath, None))
app.add_config_value("jsmath_path", "", False)
app.connect("builder-inited", builder_inited)
return {"version": sphinx.__display_version__, "parallel_read_safe": True}
开发者ID:obelin,项目名称:Train,代码行数:5,代码来源:jsmath.py
示例15: setup
def setup(app):
mathbase_setup(app, (html_visit_math, None), (html_visit_displaymath, None))
app.add_config_value('mathjax_path', '', False)
app.add_config_value('mathjax_inline', [r'\(', r'\)'], 'html')
app.add_config_value('mathjax_display', [r'\[', r'\]'], 'html')
app.connect('builder-inited', builder_inited)
开发者ID:AHudzik,项目名称:modelica-buildings,代码行数:6,代码来源:mathjax.py
示例16: setup
def setup(app):
mathbase_setup(app, (html_visit_math, None), (html_visit_displaymath, None))
app.add_config_value('jsmath_path', '', False)
app.connect('builder-inited', builder_inited)
开发者ID:APSL,项目名称:django-braces,代码行数:4,代码来源:jsmath.py
示例17: setup
def setup(app):
mathbase_setup(app, (html_visit_math, None), (html_visit_displaymath, None))
app.add_config_value("jsmath_path", "", False)
app.connect("builder-inited", builder_inited)
开发者ID:fedor4ever,项目名称:linux_build,代码行数:4,代码来源:jsmath.py
注:本文中的sphinx.ext.mathbase.mathbase_setup函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论