Javascript 使用django和ckeditor时,Mathjax按钮不出现

Javascript 使用django和ckeditor时,Mathjax按钮不出现,javascript,python,django,ckeditor,mathjax,Javascript,Python,Django,Ckeditor,Mathjax,我正在我的django博客中实现 我正在尝试激活mathjax,但遇到了问题 我使用自述文件中的默认配置,并添加了mathjax,如下所示: CKEDITOR_CONFIGS = { 'default': { 'skin': 'moono', 'toolbar_Basic': [ ['Source', '-', 'Bold', 'Italic'] ], 'toolbar_YouCustomToolbarConfig': [ {'name': 'document', 'items'

我正在我的django博客中实现

我正在尝试激活mathjax,但遇到了问题

我使用自述文件中的默认配置,并添加了mathjax,如下所示:

CKEDITOR_CONFIGS = {
'default': {
'skin': 'moono',
'toolbar_Basic': [
    ['Source', '-', 'Bold', 'Italic']
],
'toolbar_YouCustomToolbarConfig': [
    {'name': 'document', 'items': ['Source', '-', 'Save', 'NewPage', 'Preview', 'Print', '-', 'Templates']},
    {'name': 'clipboard', 'items': ['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo']},
    {'name': 'editing', 'items': ['Find', 'Replace', '-', 'SelectAll']},
    {'name': 'forms',
     'items': ['Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton',
               'HiddenField']},
    '/',
    {'name': 'basicstyles',
     'items': ['Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat']},
    {'name': 'paragraph',
     'items': ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', 'CreateDiv', '-',
               'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', '-', 'BidiLtr', 'BidiRtl',
               'Language']},
    {'name': 'links', 'items': ['Link', 'Unlink', 'Anchor']},
    {'name': 'insert',
     'items': ['Image', 'Flash', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar', 'PageBreak', 'Iframe']},
    '/',
    {'name': 'styles', 'items': ['Styles', 'Format', 'Font', 'FontSize']},
    {'name': 'colors', 'items': ['TextColor', 'BGColor']},
    {'name': 'tools', 'items': ['Maximize', 'ShowBlocks']},
    {'name': 'about', 'items': ['About']},
    {'name': 'mathjax', 'items': ['MathJax']},
    '/',  # put this to force next toolbar on new line
    {'name': 'youcustomtools', 'items': [
        # put the name of your editor.ui.addButton here
        'Preview',
        'Maximize',

    ]},
],
'toolbar': 'YouCustomToolbarConfig',  # put selected toolbar config here
# 'toolbarGroups': [{ 'name': 'document', 'groups': [ 'mode', 'document', 'doctools' ] }],
# 'height': 291,
# 'width': '100%',
# 'filebrowserWindowHeight': 725,
# 'filebrowserWindowWidth': 940,
# 'toolbarCanCollapse': True,
'mathJaxLib': '//cdn.mathjax.org/mathjax/2.2-latest/MathJax.js?config=TeX-AMS_HTML',
'tabSpaces': 4,
'extraPlugins': ','.join(
    [
        # you extra plugins here
        'div',
        'autolink',
        'autoembed',
        'embedsemantic',
        'autogrow',
        # 'devtools',
        'widget',
        'lineutils',
        'clipboard',
        'dialog',
        'dialogui',
        'elementspath',
        'mathjax'
    ]),
 }
}

在管理面板中,mathjax图标不会出现。有人知道会发生什么吗?

我发现了问题所在。不知何故,mathjax库没有正确加载。我不得不手动修改
ckeditor init.js
。我替换了:

CKEDITOR.replace($(this).attr('id'), $(this).data('config'));
为此:

CKEDITOR.replace( $(this).attr('id'), {
    extraPlugins: 'mathjax',
    height: 500,
    mathJaxLib: 'http://cdn.mathjax.org/mathjax/2.2-latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'
} );

来自未来的注意:cdn.mathjax.org即将结束,请检查mathjax.org/cdn-shutdown以了解迁移提示。来自未来的注意:cdn.mathjax.org即将结束,请检查mathjax.org/cdn-shutdown以了解迁移提示。