mathjax.html 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <!DOCTYPE html>
  2. <!--
  3. Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
  4. For licensing, see LICENSE.md or http://ckeditor.com/license
  5. -->
  6. <html>
  7. <head>
  8. <meta charset="utf-8">
  9. <title>Widgets: MathJax &mdash; CKEditor Sample</title>
  10. <script src="../../../ckeditor.js"></script>
  11. <script src="../../../dev/console/console.js"></script>
  12. <script src="../../../dev/console/focusconsole.js"></script>
  13. <script src="../../widget/dev/console.js"></script>
  14. <link href="../../../samples/sample.css" rel="stylesheet">
  15. <meta name="ckeditor-sample-name" content="Mathematics">
  16. <meta name="ckeditor-sample-group" content="Plugins">
  17. <meta name="ckeditor-sample-description" content="Create mathematical equations in TeX and display them in visual form.">
  18. <meta name="ckeditor-sample-isnew" content="1">
  19. <script>
  20. CKEDITOR.disableAutoInline = true;
  21. document.domain = 'ckeditor.dev';
  22. </script>
  23. </head>
  24. <body>
  25. <h1 class="samples">
  26. <a href="../../../samples/index.html">CKEditor Samples</a> &raquo; Widgets: MathJax
  27. </h1>
  28. <h2>Classic (iframe-based) Sample</h2>
  29. <textarea id="editor1" cols="10" rows="10">
  30. <h1>Apollo 11</h1>
  31. <div style="background:red;color:blue">
  32. <p><strong>Apollo 11</strong>&nbsp;was the&nbsp;spaceflight&nbsp;that landed the first humans, Americans <a href="http://en.wikipedia.org/wiki/Neil_Armstrong">Neil Armstrong</a>&nbsp;and&nbsp;<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&nbsp;kg) of lunar material for return to Earth. A third member of the mission,&nbsp;Michael Collins, piloted the&nbsp;command spacecraft&nbsp;alone in lunar orbit until Armstrong and Aldrin returned to it for the trip back to Earth.</p>
  33. </div>
  34. <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>
  35. <p>Launched by a&nbsp;Saturn V&nbsp;rocket from&nbsp;Kennedy Space Center&nbsp;in&nbsp;Merritt Island, Florida&nbsp;on July 16, Apollo 11 was the fifth manned mission of <a href="http://en.wikipedia.org/wiki/NASA">NASA</a>&#39;s&nbsp;Apollo program. The Apollo&nbsp;spacecraft&nbsp;had three parts: aCommand Module&nbsp;with a cabin for the three astronauts which was the only part which landed back on Earth; a&nbsp;Service Module&nbsp;which supported the Command Module with propulsion, electrical power, oxygen and water; and a&nbsp;Lunar Module&nbsp;for landing on the Moon. After being sent to the Moon by the Saturn V&#39;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&nbsp;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&nbsp;Pacific Ocean&nbsp;.</p>
  36. </textarea>
  37. <h2>Inline Sample</h2>
  38. <div id="editor2" contenteditable="true" cols="10" rows="10">
  39. <h1>Apollo 11</h1>
  40. <div style="background:red;color:blue">
  41. <p><strong>Apollo 11</strong>&nbsp;was the&nbsp;spaceflight&nbsp;that landed the first humans, Americans <a href="http://en.wikipedia.org/wiki/Neil_Armstrong">Neil Armstrong</a>&nbsp;and&nbsp;<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&nbsp;kg) of lunar material for return to Earth. A third member of the mission,&nbsp;Michael Collins, piloted the&nbsp;command spacecraft&nbsp;alone in lunar orbit until Armstrong and Aldrin returned to it for the trip back to Earth.</p>
  42. </div>
  43. <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>
  44. <p>Launched by a&nbsp;Saturn V&nbsp;rocket from&nbsp;Kennedy Space Center&nbsp;in&nbsp;Merritt Island, Florida&nbsp;on July 16, Apollo 11 was the fifth manned mission of <a href="http://en.wikipedia.org/wiki/NASA">NASA</a>&#39;s&nbsp;Apollo program. The Apollo&nbsp;spacecraft&nbsp;had three parts: aCommand Module&nbsp;with a cabin for the three astronauts which was the only part which landed back on Earth; a&nbsp;Service Module&nbsp;which supported the Command Module with propulsion, electrical power, oxygen and water; and a&nbsp;Lunar Module&nbsp;for landing on the Moon. After being sent to the Moon by the Saturn V&#39;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&nbsp;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&nbsp;Pacific Ocean&nbsp;.</p>
  45. </div>
  46. <h2>Div Editing Area Sample</h2>
  47. <textarea id="editor3" cols="10" rows="10">
  48. <h1>Apollo 11</h1>
  49. <div style="background:red;color:blue">
  50. <p><strong>Apollo 11</strong>&nbsp;was the&nbsp;spaceflight&nbsp;that landed the first humans, Americans <a href="http://en.wikipedia.org/wiki/Neil_Armstrong">Neil Armstrong</a>&nbsp;and&nbsp;<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&nbsp;kg) of lunar material for return to Earth. A third member of the mission,&nbsp;Michael Collins, piloted the&nbsp;command spacecraft&nbsp;alone in lunar orbit until Armstrong and Aldrin returned to it for the trip back to Earth.</p>
  51. </div>
  52. <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>
  53. <p>Launched by a&nbsp;Saturn V&nbsp;rocket from&nbsp;Kennedy Space Center&nbsp;in&nbsp;Merritt Island, Florida&nbsp;on July 16, Apollo 11 was the fifth manned mission of <a href="http://en.wikipedia.org/wiki/NASA">NASA</a>&#39;s&nbsp;Apollo program. The Apollo&nbsp;spacecraft&nbsp;had three parts: aCommand Module&nbsp;with a cabin for the three astronauts which was the only part which landed back on Earth; a&nbsp;Service Module&nbsp;which supported the Command Module with propulsion, electrical power, oxygen and water; and a&nbsp;Lunar Module&nbsp;for landing on the Moon. After being sent to the Moon by the Saturn V&#39;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&nbsp;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&nbsp;Pacific Ocean&nbsp;.</p>
  54. </textarea>
  55. <script>
  56. CKEDITOR.stylesSet.add('my_custom_style', [
  57. { name: 'My Custom Block', element: 'h1', styles: { color: 'blue'} }
  58. ]);
  59. CKEDITOR.replace( 'editor1', {
  60. extraPlugins: 'mathjax',
  61. height: 350,
  62. allowedContent: true,
  63. // mathJaxLib: './truncated-mathjax/MathJax.js?config=TeX-AMS_HTML',
  64. mathJaxClass: 'mjx'
  65. } );
  66. CKEDITOR.inline( 'editor2', {
  67. extraPlugins: 'mathjax',
  68. height: 350,
  69. allowedContent: true,
  70. // mathJaxLib: './truncated-mathjax/MathJax.js?config=TeX-AMS_HTML',
  71. mathJaxClass: 'mjx'
  72. } );
  73. CKEDITOR.replace( 'editor3', {
  74. extraPlugins: 'mathjax,divarea',
  75. height: 350,
  76. allowedContent: true,
  77. // mathJaxLib: './truncated-mathjax/MathJax.js?config=TeX-AMS_HTML',
  78. mathJaxClass: 'mjx'
  79. } );
  80. CKCONSOLE.create( 'widget', { editor: 'editor1' } );
  81. CKCONSOLE.create( 'focus', { editor: 'editor1' } );
  82. CKCONSOLE.create( 'widget', { editor: 'editor2' } );
  83. CKCONSOLE.create( 'focus', { editor: 'editor2' } );
  84. CKCONSOLE.create( 'widget', { editor: 'editor3' } );
  85. CKCONSOLE.create( 'focus', { editor: 'editor3' } );
  86. </script>
  87. <div id="footer">
  88. <hr>
  89. <p>
  90. CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
  91. </p>
  92. <p id="copy">
  93. Copyright &copy; 2003-2014, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
  94. Knabben. All rights reserved.
  95. </p>
  96. </div>
  97. </body>
  98. </html>