我未能在django-ckeditor中加载mathjax。
这篇文章包含了我的virtualenv配置、CKEDITOR_CONFIGS、printscreen和一个来自Source页面的元素。
虚拟主机
>pip freeze
Django==1.10.2
django-appconf==1.0.2
django-ckeditor==5.1.1
django-compressor==2.1
django-debug-toolbar==1.6
Pillow==3.4.2
psycopg2==2.6.2
rcssmin==1.0.6
rjsmin==1.0.12
sqlparse==0.2.1CKEDITOR_CONFIGS
CKEDITOR_CONFIGS = {
'default': {
'skin': 'moono',
# 'skin': 'office2013',
'toolbar_Custom': [
{'name': 'document', 'items': [
'Subscript', 'Superscript', ]},
{'name': 'source', 'items': [
'Source', ]},
],
'toolbar': 'Custom',
'mathJaxLib': '//cdn.mathjax.org/mathjax/2.2-latest/MathJax.js?config=TeX-AMS_HTML',
'height': 200,
'width': 600,
'extraPlugins': ','.join(['mathjax', ]),
},
}根据关于mathjax #256的问题的说法,我已经更改了ckeditor-init.js。我还尝试了各种组合,包括‘{'name': 'math', 'items': ['mathjax', ]},’列表中的{'name': 'math', 'items': ['Matjax', ]}和toolbar_Custom。
屏幕

如您所见,源代码包含配置中的所有配置i设置,但包含mathjax。但是,页面源包含"toolbar_Basic“、"toolbar_Full”和"toolbar_Custom“。根据我的配置,我不确定是否应该有基本的和完整的。
< div class = "django-ckeditor-widget"
data - field - id = "id_false_answer_text"
style = "display: inline-block;" >
< textarea cols = "40"
id = "id_false_answer_text"
name = "false_answer_text"
rows = "10"
required data - processed = "0"
data - config = '{"toolbar_Basic": [["Source", "-", "Bold", "Italic"]], "toolbar_Full": [["Styles", "Format", "Bold", "Italic", "Underline", "Strike", "SpellChecker", "Undo", "Redo"], ["Link", "Unlink", "Anchor"], ["Image", "Flash", "Table", "HorizontalRule"], ["TextColor", "BGColor"], ["Smiley", "SpecialChar"], ["Source"]], "filebrowserUploadUrl": "/ckeditor/upload/", "skin": "moono", "filebrowserWindowWidth": 940, "filebrowserWindowHeight": 725, "width": 600, "height": 200, "filebrowserBrowseUrl": "/ckeditor/browse/", "language": "en-us", "toolbar": "Custom", "toolbar_Custom": [{"items": ["Subscript", "Superscript"], "name": "document"}, {"items": ["Source"], "name": "source"}, {"items": ["mathjax"], "name": "mathjax"}]}'
data - external - plugin - resources = '[]'
data - id = "id_false_answer_text"
data - type = "ckeditortype" > & lt;
p & gt;
fa4 q1 & lt;
/p></textarea >
</div>,另一个配置,,全插件配置(根据来自web的帖子)也没有显示mathjax图标。无论是否更改“ckeditor-init.js”
CKEDITOR_CONFIGS = {
'default': {
'toolbar': 'none',
'height': 200,
'width': 600,
},
}

因此,作为来自README.rst的示例配置
'//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js‘静态文件 CKEDITOR_JQUERY_URL =

问题是:
如果这是个问题,我该如何尽快解决呢?如果这与配置缺乏经验有关,请您告诉我mathjax的配置示例/正确的配置吗?
打印屏幕来自Django管理,我在这些模型中使用RichTextUploadingField。
发布于 2016-11-06 17:53:55
这是一个配置错误的问题,Django-CKEditor没有问题。mathjax配置的关键部分如下所示。
CKEDITOR_CONFIGS = {
'default': {
'skin': 'moono',
'toolbar_Custom': [
{'name': 'math', 'items': ['Mathjax', ]},
],
'toolbar': 'Custom',
'mathJaxLib': '//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML',
'extraPlugins': ','.join(['mathjax',]),
},
}工具栏和extraPligins都应该存在于配置中,以便mathjax出现并工作。
https://stackoverflow.com/questions/40317268
复制相似问题