parent
64bc00be85
commit
bdd7ad4518
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 703 B |
Before Width: | Height: | Size: 784 B |
@ -1,121 +0,0 @@ |
||||
<!DOCTYPE html> |
||||
<!-- |
||||
Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. |
||||
For licensing, see LICENSE.md or http://ckeditor.com/license |
||||
--> |
||||
<html> |
||||
<head> |
||||
<meta charset="utf-8"> |
||||
<title>Widgets: MathJax — CKEditor Sample</title> |
||||
<script src="../../../ckeditor.js"></script> |
||||
<script src="../../../dev/console/console.js"></script> |
||||
<script src="../../../dev/console/focusconsole.js"></script> |
||||
<script src="../../widget/dev/console.js"></script> |
||||
<link href="../../../samples/sample.css" rel="stylesheet"> |
||||
<meta name="ckeditor-sample-name" content="Mathematics"> |
||||
<meta name="ckeditor-sample-group" content="Plugins"> |
||||
<meta name="ckeditor-sample-description" content="Create mathematical equations in TeX and display them in visual form."> |
||||
<meta name="ckeditor-sample-isnew" content="1"> |
||||
<script> |
||||
CKEDITOR.disableAutoInline = true; |
||||
document.domain = 'ckeditor.dev'; |
||||
</script> |
||||
</head> |
||||
<body> |
||||
<h1 class="samples"> |
||||
<a href="../../../samples/index.html">CKEditor Samples</a> » Widgets: MathJax |
||||
</h1> |
||||
|
||||
<h2>Classic (iframe-based) Sample</h2> |
||||
|
||||
<textarea id="editor1" cols="10" rows="10"> |
||||
<h1>Apollo 11</h1> |
||||
|
||||
<div style="background:red;color:blue"> |
||||
<p><strong>Apollo 11</strong> was the spaceflight that landed the first humans, Americans <a href="http://en.wikipedia.org/wiki/Neil_Armstrong">Neil Armstrong</a> and <a href="http://en.wikipedia.org/wiki/Buzz_Aldrin">Buzz Aldrin</a> <span class="math-tex">\(x = {-b \pm \sqrt{b^2-4ac} \over 2a}\)</span>. Armstrong became the first to step onto the lunar surface 6 hours later. Armstrong spent about two and a half hours outside the spacecraft, Aldrin slightly less; and together they collected 47.5 pounds (21.5 kg) of lunar material for return to Earth. A third member of the mission, Michael Collins, piloted the command spacecraft alone in lunar orbit until Armstrong and Aldrin returned to it for the trip back to Earth.</p> |
||||
</div> |
||||
|
||||
<p>Foo foo <span class="userclass mjx">\(J_\alpha(x) = \sum\limits_{m=0}^\infty \frac{(-1)^m}{m! \, \Gamma(m + \alpha + 1)}{\left({\frac{x}{2}}\right)}^{2 m + \alpha}\)</span> bar bar.</p> |
||||
|
||||
<p>Launched by a Saturn V rocket from Kennedy Space Center in Merritt Island, Florida on July 16, Apollo 11 was the fifth manned mission of <a href="http://en.wikipedia.org/wiki/NASA">NASA</a>'s Apollo program. The Apollo spacecraft had three parts: aCommand Module with a cabin for the three astronauts which was the only part which landed back on Earth; a Service Module which supported the Command Module with propulsion, electrical power, oxygen and water; and a Lunar Module for landing on the Moon. After being sent to the Moon by the Saturn V's upper stage, the astronauts separated the spacecraft from it and travelled for three days until they entered into lunar orbit. Armstrong and Aldrin then moved into the Lunar Module and landed in the Sea of Tranquility. They stayed a total of about 21 and a half hours on the lunar surface. After lifting off in the upper part of the Lunar Module and rejoining Collins in the Command Module, they returned to Earth and landed in the Pacific Ocean .</p> |
||||
</textarea> |
||||
|
||||
<h2>Inline Sample</h2> |
||||
|
||||
<div id="editor2" contenteditable="true" cols="10" rows="10"> |
||||
<h1>Apollo 11</h1> |
||||
|
||||
<div style="background:red;color:blue"> |
||||
<p><strong>Apollo 11</strong> was the spaceflight that landed the first humans, Americans <a href="http://en.wikipedia.org/wiki/Neil_Armstrong">Neil Armstrong</a> and <a href="http://en.wikipedia.org/wiki/Buzz_Aldrin">Buzz Aldrin</a> <span class="math-tex">\(x = {-b \pm \sqrt{b^2-4ac} \over 2a}\)</span>. Armstrong became the first to step onto the lunar surface 6 hours later. Armstrong spent about two and a half hours outside the spacecraft, Aldrin slightly less; and together they collected 47.5 pounds (21.5 kg) of lunar material for return to Earth. A third member of the mission, Michael Collins, piloted the command spacecraft alone in lunar orbit until Armstrong and Aldrin returned to it for the trip back to Earth.</p> |
||||
</div> |
||||
|
||||
<p>Foo foo <span class="userclass mjx">\(J_\alpha(x) = \sum\limits_{m=0}^\infty \frac{(-1)^m}{m! \, \Gamma(m + \alpha + 1)}{\left({\frac{x}{2}}\right)}^{2 m + \alpha}\)</span> bar bar.</p> |
||||
|
||||
<p>Launched by a Saturn V rocket from Kennedy Space Center in Merritt Island, Florida on July 16, Apollo 11 was the fifth manned mission of <a href="http://en.wikipedia.org/wiki/NASA">NASA</a>'s Apollo program. The Apollo spacecraft had three parts: aCommand Module with a cabin for the three astronauts which was the only part which landed back on Earth; a Service Module which supported the Command Module with propulsion, electrical power, oxygen and water; and a Lunar Module for landing on the Moon. After being sent to the Moon by the Saturn V's upper stage, the astronauts separated the spacecraft from it and travelled for three days until they entered into lunar orbit. Armstrong and Aldrin then moved into the Lunar Module and landed in the Sea of Tranquility. They stayed a total of about 21 and a half hours on the lunar surface. After lifting off in the upper part of the Lunar Module and rejoining Collins in the Command Module, they returned to Earth and landed in the Pacific Ocean .</p> |
||||
</div> |
||||
|
||||
<h2>Div Editing Area Sample</h2> |
||||
|
||||
<textarea id="editor3" cols="10" rows="10"> |
||||
<h1>Apollo 11</h1> |
||||
|
||||
<div style="background:red;color:blue"> |
||||
<p><strong>Apollo 11</strong> was the spaceflight that landed the first humans, Americans <a href="http://en.wikipedia.org/wiki/Neil_Armstrong">Neil Armstrong</a> and <a href="http://en.wikipedia.org/wiki/Buzz_Aldrin">Buzz Aldrin</a> <span class="math-tex">\(x = {-b \pm \sqrt{b^2-4ac} \over 2a}\)</span>. Armstrong became the first to step onto the lunar surface 6 hours later. Armstrong spent about two and a half hours outside the spacecraft, Aldrin slightly less; and together they collected 47.5 pounds (21.5 kg) of lunar material for return to Earth. A third member of the mission, Michael Collins, piloted the command spacecraft alone in lunar orbit until Armstrong and Aldrin returned to it for the trip back to Earth.</p> |
||||
</div> |
||||
|
||||
<p>Foo foo <span class="userclass mjx">\(J_\alpha(x) = \sum\limits_{m=0}^\infty \frac{(-1)^m}{m! \, \Gamma(m + \alpha + 1)}{\left({\frac{x}{2}}\right)}^{2 m + \alpha}\)</span> bar bar.</p> |
||||
|
||||
<p>Launched by a Saturn V rocket from Kennedy Space Center in Merritt Island, Florida on July 16, Apollo 11 was the fifth manned mission of <a href="http://en.wikipedia.org/wiki/NASA">NASA</a>'s Apollo program. The Apollo spacecraft had three parts: aCommand Module with a cabin for the three astronauts which was the only part which landed back on Earth; a Service Module which supported the Command Module with propulsion, electrical power, oxygen and water; and a Lunar Module for landing on the Moon. After being sent to the Moon by the Saturn V's upper stage, the astronauts separated the spacecraft from it and travelled for three days until they entered into lunar orbit. Armstrong and Aldrin then moved into the Lunar Module and landed in the Sea of Tranquility. They stayed a total of about 21 and a half hours on the lunar surface. After lifting off in the upper part of the Lunar Module and rejoining Collins in the Command Module, they returned to Earth and landed in the Pacific Ocean .</p> |
||||
</textarea> |
||||
|
||||
<script> |
||||
|
||||
CKEDITOR.stylesSet.add('my_custom_style', [ |
||||
{ name: 'My Custom Block', element: 'h1', styles: { color: 'blue'} } |
||||
]); |
||||
|
||||
CKEDITOR.replace( 'editor1', { |
||||
extraPlugins: 'mathjax', |
||||
height: 350, |
||||
allowedContent: true, |
||||
// mathJaxLib: './truncated-mathjax/MathJax.js?config=TeX-AMS_HTML', |
||||
mathJaxClass: 'mjx' |
||||
} ); |
||||
|
||||
CKEDITOR.inline( 'editor2', { |
||||
extraPlugins: 'mathjax', |
||||
height: 350, |
||||
allowedContent: true, |
||||
// mathJaxLib: './truncated-mathjax/MathJax.js?config=TeX-AMS_HTML', |
||||
mathJaxClass: 'mjx' |
||||
} ); |
||||
|
||||
CKEDITOR.replace( 'editor3', { |
||||
extraPlugins: 'mathjax,divarea', |
||||
height: 350, |
||||
allowedContent: true, |
||||
// mathJaxLib: './truncated-mathjax/MathJax.js?config=TeX-AMS_HTML', |
||||
mathJaxClass: 'mjx' |
||||
} ); |
||||
|
||||
CKCONSOLE.create( 'widget', { editor: 'editor1' } ); |
||||
CKCONSOLE.create( 'focus', { editor: 'editor1' } ); |
||||
CKCONSOLE.create( 'widget', { editor: 'editor2' } ); |
||||
CKCONSOLE.create( 'focus', { editor: 'editor2' } ); |
||||
CKCONSOLE.create( 'widget', { editor: 'editor3' } ); |
||||
CKCONSOLE.create( 'focus', { editor: 'editor3' } ); |
||||
|
||||
</script> |
||||
|
||||
<div id="footer"> |
||||
<hr> |
||||
<p> |
||||
CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a> |
||||
</p> |
||||
<p id="copy"> |
||||
Copyright © 2003-2014, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico |
||||
Knabben. All rights reserved. |
||||
</p> |
||||
</div> |
||||
</body> |
||||
</html> |
@ -1,82 +0,0 @@ |
||||
<!DOCTYPE html> |
||||
<!-- |
||||
Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. |
||||
For licensing, see LICENSE.md or http://ckeditor.com/license |
||||
--> |
||||
<html> |
||||
<head> |
||||
<meta charset="utf-8"> |
||||
<title>Mathematical Formulas — CKEditor Sample</title> |
||||
<script src="../../../ckeditor.js"></script> |
||||
<link href="../../../samples/sample.css" rel="stylesheet"> |
||||
<meta name="ckeditor-sample-name" content="Mathematics plugin"> |
||||
<meta name="ckeditor-sample-group" content="Plugins"> |
||||
<meta name="ckeditor-sample-description" content="Create mathematical equations in TeX and display them in visual form."> |
||||
<meta name="ckeditor-sample-isnew" content="1"> |
||||
<script> |
||||
CKEDITOR.disableAutoInline = true; |
||||
</script> |
||||
</head> |
||||
<body> |
||||
<h1 class="samples"> |
||||
<a href="../../../samples/index.html">CKEditor Samples</a> » Mathematical Formulas |
||||
</h1> |
||||
|
||||
<div class="description"> |
||||
<p> |
||||
This sample shows the usage of the CKEditor mathematical plugin that introduces a MathJax widget. You can now use it to create or modify equations using TeX. |
||||
</p> |
||||
<p> |
||||
TeX content will be automatically replaced by a widget when you put it in a <code><span class="math-tex"></code> element. You can also add new equations by using the <strong>Math</strong> toolbar button and entering TeX content in the plugin dialog window. After you click <strong>OK</strong>, a widget will be inserted into the editor content. |
||||
</p> |
||||
<p> |
||||
The output of the editor will be plain TeX with <a href="http://www.mathjax.org/">MathJax</a> delimiters: <code>\(</code> and <code>\)</code>, as in the code below: |
||||
</p> |
||||
<pre class="samples"> |
||||
<span class="math-tex">\( \sqrt{1} + (1)^2 = 2 \)</span> |
||||
</pre> |
||||
<p> |
||||
To transform TeX into a visual equation, a page must include the <a href="http://docs.mathjax.org/en/latest/start.html">MathJax script</a>. |
||||
</p> |
||||
<p> |
||||
In order to use the new plugin, include it in the <code><a class="samples" href="http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-extraPlugins">config.extraPlugins</a></code> configuration setting. |
||||
</p> |
||||
<pre class="samples"> |
||||
CKEDITOR.replace( '<em>textarea_id</em>', { |
||||
<strong>extraPlugins: 'mathjax'</strong> |
||||
} ); |
||||
</pre> |
||||
<p id="ie8-warning"> |
||||
Please note that this plugin is not compatible with Internet Explorer 8. |
||||
</p> |
||||
</div> |
||||
|
||||
<textarea id="editor1" cols="10" rows="10"> |
||||
|
||||
<p>The following equations are represented in the HTML source code as LaTeX expressions.</p><h1>The Cauchy-Schwarz Inequality</h1><p><span class="math-tex">\( \left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right) \)</span></p><h1>The probability of getting <span class="math-tex">\(k\)</span> heads when flipping <span class="math-tex">\(n\)</span> coins is</h1><p><span class="math-tex">\(P(E) = {n \choose k} p^k (1-p)^{ n-k} \)</span></p><p>Finally, while displaying equations is useful for demonstration purposes, the ability to mix math and text in a paragraph is also important. This expression <span class="math-tex">\(\sqrt{3x-1}+(1+x)^2\)</span> is an example of an inline equation. As you see, MathJax equations can be used this way as well, without disturbing the spacing between the lines.</p> |
||||
|
||||
</textarea> |
||||
<script> |
||||
|
||||
CKEDITOR.replace( 'editor1', { |
||||
extraPlugins: 'mathjax', |
||||
height: 350 |
||||
} ); |
||||
|
||||
if ( CKEDITOR.env.ie && CKEDITOR.env.version == 8 ) |
||||
document.getElementById( 'ie8-warning' ).className = 'warning'; |
||||
|
||||
</script> |
||||
|
||||
<div id="footer"> |
||||
<hr> |
||||
<p> |
||||
CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a> |
||||
</p> |
||||
<p id="copy"> |
||||
Copyright © 2003-2014, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico |
||||
Knabben. All rights reserved. |
||||
</p> |
||||
</div> |
||||
</body> |
||||
</html> |
@ -1,13 +1,13 @@ |
||||
/* |
||||
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. |
||||
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. |
||||
For licensing, see LICENSE.md or http://ckeditor.com/license
|
||||
*/ |
||||
CKEDITOR.plugins.setLang( 'mathjax', 'fr', { |
||||
title: 'Mathématiques au format TeX', |
||||
button: 'Math', |
||||
title: 'Formules mathématiques en TeX', |
||||
button: 'Maths', |
||||
dialogInput: 'Saisir la formule TeX ici', |
||||
docUrl: 'http://fr.wikibooks.org/wiki/LaTeX/Math%C3%A9matiques', |
||||
docLabel: 'Documentation du format TeX', |
||||
docLabel: 'Documentation de TeX', |
||||
loading: 'chargement...', |
||||
pathName: 'math' |
||||
pathName: 'maths' |
||||
} ); |
||||
|
@ -1,13 +1,13 @@ |
||||
/* |
||||
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. |
||||
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. |
||||
For licensing, see LICENSE.md or http://ckeditor.com/license
|
||||
*/ |
||||
CKEDITOR.plugins.setLang( 'mathjax', 'nb', { |
||||
title: 'Matematikk i TeX', |
||||
button: 'Matte', |
||||
button: 'Matematikk', |
||||
dialogInput: 'Skriv TeX-koden her', |
||||
docUrl: 'http://en.wikibooks.org/wiki/LaTeX/Mathematics', |
||||
docLabel: 'TeX-dokumentasjon', |
||||
loading: 'laster...', |
||||
pathName: 'matte' |
||||
pathName: 'matematikk' |
||||
} ); |
||||
|
@ -1,13 +1,13 @@ |
||||
/* |
||||
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. |
||||
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. |
||||
For licensing, see LICENSE.md or http://ckeditor.com/license
|
||||
*/ |
||||
CKEDITOR.plugins.setLang( 'mathjax', 'sk', { |
||||
title: 'Matematika v TeX', |
||||
button: 'Matika', |
||||
title: 'Matematika v TeX-u', |
||||
button: 'Matematika', |
||||
dialogInput: 'Napíšte svoj TeX sem', |
||||
docUrl: 'http://en.wikibooks.org/wiki/LaTeX/Mathematics', |
||||
docLabel: 'Dokumentácia TeX', |
||||
loading: 'načítavanie...', |
||||
pathName: 'matika' |
||||
pathName: 'matematika' |
||||
} ); |
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue