## Using math notation in Bogleheads posts

### Using math notation in Bogleheads posts

Is there any interest in displaying math notation in bogleheads posts?

Standard phpBB does not support any math markup. Alex is understandably reluctant to use non-standard phpBB. But we can still put some math markup in posts and then convert it to math notation after the post is displayed in our browsers.

AsciiMath is an easy math markup language. Here are some examples.

A=P(1+i/f)^(ft) becomes `A=P(1+i/f)^(ft)`

V=sum_(i=1)^n(P_i/(1+r_i))^i becomes `V=sum_(i=1)^n(P_i/(1+r_i))^i`

"rate" = ("ending value"/"begining value")-1 becomes `"rate" = ("ending value"/"begining value")-1`

gMS=sum_(i=1)^n (1/(prod_(j=1)^i(1+r_j))) becomes `gMS=sum_(i=1)^n (1/(prod_(j=1)^i(1+r_j)))`

Use the online renderer at http://asciimath.org/ to write the markup. Enclose it in backticks (grave accent) so MathJax can recognize it then paste it in a post.

MathJax is a display engine that converts the AsciiMath markup into math notation. A MathJax script needs to be added to the page in the browser. One way to do that is to use the bookmarklet I posted here.

A user script is another way to insert the MathJax script automatically every time a bogleheads.org forum page is loaded. To use a user script you first need to install a user script manager extension for you browser. This page lists some user script extensions for various browsers. https://greasyfork.org/en

Once the user script extension is installed you can go here to get my user script that adds MathJax to bogleheads. (You won't be able to see the examples above until you do.)

https://greasyfork.org/en/scripts/38610 ... ds-mathjax

Try it and see what you think.

Ron

Standard phpBB does not support any math markup. Alex is understandably reluctant to use non-standard phpBB. But we can still put some math markup in posts and then convert it to math notation after the post is displayed in our browsers.

AsciiMath is an easy math markup language. Here are some examples.

A=P(1+i/f)^(ft) becomes `A=P(1+i/f)^(ft)`

V=sum_(i=1)^n(P_i/(1+r_i))^i becomes `V=sum_(i=1)^n(P_i/(1+r_i))^i`

"rate" = ("ending value"/"begining value")-1 becomes `"rate" = ("ending value"/"begining value")-1`

gMS=sum_(i=1)^n (1/(prod_(j=1)^i(1+r_j))) becomes `gMS=sum_(i=1)^n (1/(prod_(j=1)^i(1+r_j)))`

Use the online renderer at http://asciimath.org/ to write the markup. Enclose it in backticks (grave accent) so MathJax can recognize it then paste it in a post.

MathJax is a display engine that converts the AsciiMath markup into math notation. A MathJax script needs to be added to the page in the browser. One way to do that is to use the bookmarklet I posted here.

A user script is another way to insert the MathJax script automatically every time a bogleheads.org forum page is loaded. To use a user script you first need to install a user script manager extension for you browser. This page lists some user script extensions for various browsers. https://greasyfork.org/en

Once the user script extension is installed you can go here to get my user script that adds MathJax to bogleheads. (You won't be able to see the examples above until you do.)

https://greasyfork.org/en/scripts/38610 ... ds-mathjax

Try it and see what you think.

Ron

Money is fungible |
Abbreviations and Acronyms

### Re: Using math notation in Bogleheads posts

I think the absence of math typesetting capability encourages the mathematically inclined to be mindful of composing their postings in a manner that fosters broad interest.

Risk is not a guarantor of return.

- saltycaper
**Posts:**2610**Joined:**Thu Apr 24, 2014 8:47 pm**Location:**The Tower

### Re: Using math notation in Bogleheads posts

I would not rely on end-users taking any action. Even people interested in the math might not be so interested in fiddling with their browser. Perhaps the easiest way for readers would be to post the input text as text (to facilitate copying, easy changes by others, and permanence in case images are later lost) and to post the output as an image.

Quod vitae sectabor iter?

### Re: Using math notation in Bogleheads posts

Since many people are able to currently post figures and charts and it seems everybody can see them, I would think that folks who want to show non-simple math can render a picture and post it.

### Re: Using math notation in Bogleheads posts

OP: What you are proposing was originally designed and implemented by Donald Knuth, Professor Emeritus at Stanford University.

https://en.wikipedia.org/wiki/TeX

*TeX*https://en.wikipedia.org/wiki/TeX

"I don't worry too much about pointing fingers at the past. I operate on the theory that every saint has a past, every sinner has a future." -- Warren Buffett

- pondering
**Posts:**937**Joined:**Fri Jan 30, 2015 11:04 pm**Location:**412-977-3526, originally 718-273-2422

### Re: Using math notation in Bogleheads posts

Most people will just post a screen shot of the graphic they want to display.

--Robert Sterbal |
412-977-3526 call/text

### Re: Using math notation in Bogleheads posts

And you can download TeX / LaTeX software which can take that markup and spit out a PDF or image file, which can then be uploaded and embedded in a post. Even Office 365 now supports LaTeX markup in their math environment ("math zone"), so it's not that hard to create an image from the formula: https://blogs.msdn.microsoft.com/murray ... in-office/Shikoku wrote: ↑Sat Feb 17, 2018 6:19 pmOP: What you are proposing was originally designed and implemented by Donald Knuth, Professor Emeritus at Stanford University.

TeX

https://en.wikipedia.org/wiki/TeX

So there's no reason to encourage people to install client-side scripts. Just plug the formula into some TeX software or Office's LaTeX mode and create an image. All browsers know how to render images and phpBB supports linking to image hosting sites.

Of course, those of us who wrote many papers and a thesis or dissertation in TeX / LaTeX can just read the math environment formula and visualize it internally after so many nights spent getting formulas just right in our own works.

- nisiprius
- Advisory Board
**Posts:**35171**Joined:**Thu Jul 26, 2007 9:33 am**Location:**The terrestrial, globular, planetary hunk of matter, flattened at the poles, is my abode.--O. Henry

### Re: Using math notation in Bogleheads posts

I wouldn't mind the ability to include really rudimentary things like superscripts in Bogleheads' posts.

For many things, when I do need to post a formula, the reason is often related to the possibility of using a spreadsheet to do calculations, and I feel that an Excel "formula" is good enough.

I agree with those who say "convert it to an image and post the image." Frankly, I am more annoyed by the decision not to enable the built-in phpBB image posting feature than any issue with math notation.

(If I could derail things with a side comment on image hosting. The powers that be are concerned with possibility of abuse in image posting--I'm not sure I understand the concern but I shrug and say, well, that's their decision. So, I use free image hosting services. I don't like that either--recently I've gotten fairly concerned about weird behavior surrounding postimg.org that makes me think the service itself could be propagating malware--possibly in ads it hosts, but I've gotten some strange warnings that postimg.org might be hijacked or redirecting to a sketchy site. I hope imgur.com is OK. I am too unclear on anonymous my identity would be if I linked to my dropbox account to want to use that...)

For many things, when I do need to post a formula, the reason is often related to the possibility of using a spreadsheet to do calculations, and I feel that an Excel "formula" is good enough.

I agree with those who say "convert it to an image and post the image." Frankly, I am more annoyed by the decision not to enable the built-in phpBB image posting feature than any issue with math notation.

(If I could derail things with a side comment on image hosting. The powers that be are concerned with possibility of abuse in image posting--I'm not sure I understand the concern but I shrug and say, well, that's their decision. So, I use free image hosting services. I don't like that either--recently I've gotten fairly concerned about weird behavior surrounding postimg.org that makes me think the service itself could be propagating malware--possibly in ads it hosts, but I've gotten some strange warnings that postimg.org might be hijacked or redirecting to a sketchy site. I hope imgur.com is OK. I am too unclear on anonymous my identity would be if I linked to my dropbox account to want to use that...)

Annual income twenty pounds, annual expenditure nineteen nineteen and six, result happiness; Annual income twenty pounds, annual expenditure twenty pounds ought and six, result misery.

### Re: Using math notation in Bogleheads posts

I don't see any effect of the equations you posted because I don't have the user script or display engine. Making every user install something to their browser isn't realistic. phpBB can display math. Here's an example:Oicuryy wrote: ↑Sat Feb 17, 2018 5:50 pmAsciiMath is an easy math markup language. Here are some examples.

A=P(1+i/f)^(ft) becomes `A=P(1+i/f)^(ft)`

V=sum_(i=1)^n(P_i/(1+r_i))^i becomes `V=sum_(i=1)^n(P_i/(1+r_i))^i`

"rate" = ("ending value"/"begining value")-1 becomes `"rate" = ("ending value"/"begining value")-1`

gMS=sum_(i=1)^n (1/(prod_(j=1)^i(1+r_j))) becomes `gMS=sum_(i=1)^n (1/(prod_(j=1)^i(1+r_j)))`

Use the online renderer at http://asciimath.org/ to write the markup. Enclose it in backticks (grave accent) so MathJax can recognize it then paste it in a post.

MathJax is a display engine that converts the AsciiMath markup into math notation. A MathJax script needs to be added to the page in the browser. One way to do that is to use the bookmarklet I posted here.

A user script is another way to insert the MathJax script automatically every time a bogleheads.org forum page is loaded. To use a user script you first need to install a user script manager extension for you browser. This page lists some user script extensions for various browsers. https://greasyfork.org/en

Once the user script extension is installed you can go here to get my user script that adds MathJax to bogleheads. (You won't be able to see the examples above until you do.)

https://greasyfork.org/en/scripts/38610 ... ds-mathjax

Try it and see what you think.

Ron

http://www.sosmath.com/CBB/viewtopic.php?f=2&t=69399

As a user I don't have to do anything special to see the equations there.

Harry Sit, taking a break from the forums.

### Re: Using math notation in Bogleheads posts

The math formulas displayed there are images. Hovering my mouse over each image, I get an alt-text popup box that has the original TeX / LaTeX markup. Looking at the source code for the page, each image is hosted in a directory on the forum's server and the path contains the phrase "latexrender".tfb wrote: ↑Sun Feb 18, 2018 1:23 pmI don't see any effect of the equations you posted because I don't have the user script or display engine. Making every user install something to their browser isn't realistic. phpBB can display math. Here's an example:

http://www.sosmath.com/CBB/viewtopic.php?f=2&t=69399

As a user I don't have to do anything special to see the equations there.

Since that forum is a math forum, it is highly likely that they have installed an extension (or perhaps even created an extension) to turn LaTeX markup (it appears to support more than just the math environment) into images, then embed the images into the post. This forum will not install extensions, so this is not an option here.

### Re: Using math notation in Bogleheads posts

Thanks for the replies. It looks like there is no interest in this.

Ron

Ron

Money is fungible |
Abbreviations and Acronyms

### Re: Using math notation in Bogleheads posts

For the forum, I would agree.

The wiki has a MathML extension installed: Extension:Math

You can see it in action here: Help:Math formulas in the wiki

However, it depends on a 3rd party site to render the formulas, which are actually translated into images. The reliability of this 3rd party server is low - I often get timeout errors trying to edit a formula. I've tried several servers and variations of the math type (MathML, LaTEX, etc.). Due to the low reliability of these servers, I'm hesitant to use equations.

This is a different problem than what's discussed here, but it is a good opportunity to show what we have in the wiki.

The wiki has a MathML extension installed: Extension:Math

You can see it in action here: Help:Math formulas in the wiki

However, it depends on a 3rd party site to render the formulas, which are actually translated into images. The reliability of this 3rd party server is low - I often get timeout errors trying to edit a formula. I've tried several servers and variations of the math type (MathML, LaTEX, etc.). Due to the low reliability of these servers, I'm hesitant to use equations.

This is a different problem than what's discussed here, but it is a good opportunity to show what we have in the wiki.

### Re: Using math notation in Bogleheads posts

Sorry for the delay. Rudimentary formatting is available as a "stock" software feature.

I have added superscript and subscript formatting to the post editing menu.

"s" - strikethrough (existing)

"sub" - subscript (new)

"super" - superscript (new)

You can build a fraction by combining "superscript / subscript" like this:

Code: Select all

`[super]1[/super]/[sub]2[/sub]`

^{1}/

_{2}

Use in a formula:

1 =

^{1}/

_{2}+

^{1}/

_{2}