One formula in two different paragraphs

56 views
Skip to first unread message

huudien...@gmail.com

unread,
Mar 29, 2013, 1:08:52 PM3/29/13
to mathja...@googlegroups.com
Hello everybody,

I am using CKEditor in my forum, and it is configured in such a way that an Enter hit will insert a new paragraph. For example, if I type
\begin{array}{cc} 
a & b \\ 
c & d
\end{array}

I will obtain

<p> \begin{array}{cc} </p> 
<p> a & b \\ </p>
<p> c & d </p>
<p> \end{array} </p>

so MathJax cannot recognize it. 

Can anybody please tell me how to make MathJax be able to read the above formula?

I can re-configure the editor to make Enter hits insert <br/> instead of a new paragraph, but this will lead to a malfunction of other features.

Thank you for your help.

Dayal Purohit

unread,
Mar 29, 2013, 1:20:37 PM3/29/13
to mathja...@googlegroups.com, huudien...@gmail.com
You can include the html elements <p>, </p> inside Tex string.

Peter Krautzberger

unread,
Mar 29, 2013, 1:39:41 PM3/29/13
to mathja...@googlegroups.com, huudien...@gmail.com
MathJax will not parse beyond HTML tags, I'm afraid. Perhaps CKeditor has a way to avoid automatic paragraph breaks via a plugin, but I don't know it that well.

Peter.


--
You received this message because you are subscribed to the Google Groups "MathJax Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mathjax-user...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

J.R.St...@physics.org

unread,
Mar 29, 2013, 1:49:51 PM3/29/13
to mathja...@googlegroups.com, huudien...@gmail.com


On Friday, March 29, 2013 5:39:41 PM UTC, Peter Krautzberger wrote:
MathJax will not parse beyond HTML tags, I'm afraid. Perhaps CKeditor has a way to avoid automatic paragraph breaks via a plugin, but I don't know it that well.
 
JavaScript executed onload but before MathJax could perhaps be used to remove the paragraph markings.
-- 
  (c) John Stockton, near London, UK.  Using Google, no spell-check.
 Mail: J.R.""""""""@physics.org or (better) via Home Page at
 Web:  <http://www.merlyn.demon.co.uk/> (may move soon)
 FAQish topics, acronyms, links, etc.; Date, Lagrange, JavaScript, ..|

Dayal Purohit

unread,
Mar 29, 2013, 7:49:13 PM3/29/13
to mathja...@googlegroups.com, huudien...@gmail.com
I meant you can not include HTML elements in Tex String.

huudien...@gmail.com

unread,
Apr 1, 2013, 2:35:03 PM4/1/13
to mathja...@googlegroups.com, huudien...@gmail.com
So to conclude: the answer is NO, unfortunately.

Thank you very much for your replies.

Davide P. Cervone

unread,
Apr 7, 2013, 7:40:01 PM4/7/13
to mathja...@googlegroups.com
Note that MathJax WILL allow <br> tags within the mathematics, which it will treat as a newline. That is the ONLY tag that MathJax will process.  So if you can get your editor to produce <br> rather than paragraphs, that should work.

Davide


On Apr 1, 2013, at 2:35 PM, <huudien...@gmail.com> <huudien...@gmail.com> wrote:

So to conclude: the answer is NO, unfortunately.

Thank you very much for your replies.

huudien...@gmail.com

unread,
Apr 8, 2013, 4:27:50 AM4/8/13
to mathja...@googlegroups.com
Thanks, Davide.

Yes, I know that MathJax allows <br> tags within the formulas. I mentioned in the first post that:


I can re-configure the editor to make Enter hits insert <br/> instead of a new paragraph, but this will lead to a malfunction of other features.

Such a re-configuration will lead to a malfunction of the new quote system of the new 3.4 IP Board (that should not be detailed here because this is not an IPB forum :P).


For those interested, by default, CKEditor has the following enter mode configuration:
- Enter will insert a new paragraph (<p> </p>)
- Shift + Enter will insert a new line (<br/>)

To change this, it suffices to modify the enterMode and shiftEnterMode entities in the configuration file as follows

config.enterMode = CKEDITOR.ENTER_BR;
config.shiftEnterMode = CKEDITOR.ENTER_P;


Regards.
Reply all
Reply to author
Forward
0 new messages