Assistance regarding configuring mathjax output

34 views
Skip to first unread message

Sunil

unread,
Jan 14, 2016, 9:50:23 AM1/14/16
to MathJax Users
Dear All,

We are working on a learning management system. As part of this, we are saving the maths and chemistry equations in mysql database.  Text and equations would be stored after being formatted as LaTeX text in the table directly.

We are using mathjax to render the equations on the web-portal.

However, we are facing challenges regarding allignement and linesbreak. I have attached sample image for your reference. The radio buttons and the options are not in correct order and even in the question I see line breaks before and after math equation.

I have tried various below options to disable line break, however it is not working out.

<script type="text/x-mathjax-config">
MathJax.Hub.Config({
  CommonHTML: { linebreaks: { automatic: false } },
  "HTML-CSS": { linebreaks: { automatic: false } },
         SVG: { linebreaks: { automatic: false } }
});
</script>

Look forward your suggestions and inputs.

Regards
Sunil M
error.PNG

Davide P. Cervone

unread,
Jan 17, 2016, 5:47:03 PM1/17/16
to mathja...@googlegroups.com
Note that line-breaking is off by default, so there is no need to configure it specifically.  Note also that line breaking refers to breaking WITHIN an expression to make it fit within the horizontal width of the expression's container.  That is not what is happening in your case.

You do not give the code that you are actually using to mark up the math in the radio buttons, so it is hard to tell what is going on.  I wonder if you are using $$...$$ or \[...\] as the math delimiters.  These cause the math to be inserted on a separate line, which seems to be what is happening for you.  You want to use in-line math, which by default uses \(...\) as the delimiters.  Note, however, that content-management system you are using may have defined different delimiters.

If you are using in-line delimiters, then the issue probably has to do with the CSS that controls the page.  We can't tell you anything about that without seeing an actual page where it is occurring.  If you can make a live page (in jsfiddle or codebin), then perhaps we could give you some more advice.

Davide


--
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/d/optout.
<error.PNG>

m sunil

unread,
Jan 18, 2016, 12:44:07 AM1/18/16
to mathja...@googlegroups.com

Hi David,

Thanks for you suggestion.

Yup, the problem was with delimiter. Now, it is working fine with in-line delimiter.

I have one more query, can you share your suggestion on this.

I am using Mysql as database and utf8mb4 as collation type. The font style looks different for text and math equation.

I used various options within "HTML-CSS", but not getting same style for text and equation. Any inputs on this will be really helpful.

Regards
Sunil M

--
You received this message because you are subscribed to a topic in the Google Groups "MathJax Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mathjax-users/27gnHFNxqaQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mathjax-user...@googlegroups.com.

Davide P. Cervone

unread,
Jan 19, 2016, 8:31:49 AM1/19/16
to mathja...@googlegroups.com

I am using Mysql as database and utf8mb4 as collation type. The font style looks different for text and math equation.

I used various options within "HTML-CSS", but not getting same style for text and equation. Any inputs on this will be really helpful.


Fonts that have the needed characters for mathematical display are not common, and MathJax can only use certain fonts that it knows have the correct characters.  It provides 6 different fonts (see https://docs.mathjax.org/en/latest/font-support.html for details), but you will not be able to use arbitrary fonts for the math in MathJax.  See also


for some approaches to using sans-serif fonts if that matches your text better.

Davide

Reply all
Reply to author
Forward
0 new messages