Jump to content

Coding complicated mathematics equations


mytechgirl

Recommended Posts

Uh, do you mean division? That simply says (3*2 + 4*3 + 2*4 + 3*3 + 4*1) / 13 It is just clearer to draw a horizontal line when you are working with fractions, but writing code doesn't offer that luxury unless you are working in a math-specific program such as Mathematica.

Edited by davej
Link to comment
Share on other sites

Generally, people use images to represent equations, as most browsers don't support MathML and it's a complicated language to learn.Use an equation editor and save the equation as an image, you can use the image's alt attribute to describe the equation to devices that can't see images.

Link to comment
Share on other sites

I find plenty of HTML code for many math symbols, but I am specifically looking for one pictured (the long line)
I guess you mean you could not find a long line here? http://www.w3schools...ref_symbols.asp
But of course you can. It is simply — inserted as many times as is needed.

Edited by davej
Link to comment
Share on other sites

Hmm, the problem is that the character won't be right under the numerator as it should be. OpenOffice and Microsoft Office both have equation editors, there are so many mathematical notations that can't be represented with ordinary character formatting.

Link to comment
Share on other sites

<!DOCTYPE HTML><html><head><style>.cent {text-align: center;}</style></head><body><table class="cent"><tr><td>(3*2) + (4*3) + (2*4) + (3*3) + (4*1)<br/>————————————————<br/>13</td><td>   =  3</td></tr></table></body></html>

Wow, the code editor eats nbsp's. Or tableless...

<!DOCTYPE HTML><html><head><style>.cent {text-align: center;float: left;}</style></head><body><div class="cent">(3*2) + (4*3) + (2*4) + (3*3) + (4*1)<br/>————————————————<br/>13</div><div><br/>   =  3</div></body></html>

Edited by davej
Link to comment
Share on other sites

davej - I appreciate your help, and yes, I do know how to make both the division symbol and a long line, and I often refer to the link you provided. :Pleased: I was hoping there was something I was missing in making the 'inline' horizontal division symbol, so it stayed nicely in place as opposed to taking up 2-3 lines, since often times there is a large chunk of text before and after the equation. As Foxy Mod noted, using a regular long line as you've shown displays the equation over two lines, which does not look good, since it is mid-sentence. After much research, the general consensus here is correct - there really is not an easy fix, and I don't run across it often enough to learn/buy Mathematica or other software, so I'll just stick with the traditional division symbol. Thanks for your help everyone!

Link to comment
Share on other sites

I was hoping there was something I was missing in making the 'inline' horizontal division symbol, so it stayed nicely in place as opposed to taking up 2-3 lines, since often times there is a large chunk of text before and after the equation. As Foxy Mod noted, using a regular long line as you've shown displays the equation over two lines, which does not look good, since it is mid-sentence.
I would think that all you could do is box it up and make it into a figure and then float text around it.
<!DOCTYPE HTML><html><head><style>.cent {text-align: center;border: 1px solid #888;background-color: #ddd;margin-right: 15px;padding: 50px 50px;float: left;border-collapse: collapse;}.title {text-align: center;background-color: #fff;border: 1px solid #888;font-size: small;font-style: italic;}</style></head><body><p>We then multiply and then divide and then multiply and then add and then multiply and then add and then divide and then add. Then we multiply and then we add and then we divide.Then we multiply and then we add and then we divide.Then we multiply and then we add and then we divide.Then we multiply and then we add and then we divide.Then we multiply and then we add and then we divide.Then we multiply and then we add and then we divide.Then we multiply and then we add and then we divide. Then we multiply and then we add and then we divide.</p><table class="cent"><tr><td>(3*2) + (4*3) + (2*4) + (3*3) + (4*1)<br/> ————————————————<br/>13</td><td>   =  3 </td></tr><tr><td colspan="2" class="title">Figure 2-3</td></tr></table><p>We then multiply and then divide and then multiply and then add and then multiply and then add and then divide and then add. Then we multiply and then we add and then we divide.Then we multiply and then we add and then we divide.Then we multiply and then we add and then we divide.Then we multiply and then we add and then we divide.Then we multiply and then we add and then we divide.Then we multiply and then we add and then we divide.Then we multiply and then we add and then we divide. Then we multiply and then we add and then we divide.</p><p>We then multiply and then divide and then multiply and then add and then multiply and then add and then divide and then add. Then we multiply and then we add and then we divide.Then we multiply and then we add and then we divide.Then we multiply and then we add and then we divide.Then we multiply and then we add and then we divide.Then we multiply and then we add and then we divide.Then we multiply and then we add and then we divide.Then we multiply and then we add and then we divide. Then we multiply and then we add and then we divide.</p></body></html>

Edited by davej
Link to comment
Share on other sites

I like what you did, and I will definitely keep that mind for future projects when I don't have such a nightmare of equations. It looks sharp! I'm dealing with line after line of these - and to make matters worse, I am not the only one who will edit the files, a lot of beginners come in behind me and make changes from time to time. So, we'll just be sticking with the "/" for now - as long as the reader gets it, that's what counts. We used to use the entire image, but apparently that doesn't help with search engine results - I'm just a meager designer, not in charge of those big decisions :) Thanks again for all your help!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...