MathJax?

A forum about the forums

Moderator: Carleas

MathJax?

Postby wtf » Tue May 09, 2017 11:59 pm

As someone participating in a mathematically oriented discussion, I would love to see MathJax on this site. As I understand it, it's just a short block of javascript in the header of each page. Any chance?
wtf
 
Posts: 199
Joined: Sun Dec 06, 2015 5:47 am

Re: MathJax?

Postby Carleas » Thu May 11, 2017 2:16 pm

Wow, that does look impressively easy to add. And the symbols would be useful for more than just mathematical discussions, assuming it's a full LaTex implementation. Let me look into it more this weekend and see what I can do.
User Control Panel > Board preference > Edit display options > Display signatures: No.
Carleas
Magister Ludi
 
Posts: 5413
Joined: Wed Feb 02, 2005 8:10 pm
Location: Washington DC, USA

Re: MathJax?

Postby wtf » Fri May 12, 2017 12:12 am

Thanks, let me know if there's anything I can do. It's a full implementation as far as math and physics markup. You can't define your own macros or pull in libraries it doesn't already know about. You can't do Tikz for diagrams for example. But it does all the standard markup.
wtf
 
Posts: 199
Joined: Sun Dec 06, 2015 5:47 am

Re: MathJax?

Postby wtf » Tue May 16, 2017 5:42 am

Just an inquiry. Prepping some content now. If markup might show up in a couple of days that would be good for me to know. And if it's not going to, perfectly understandable, running these boards is a lot of work and I know you're busy. Just helpful to me to know if I can't count on markup for my next few posts, that way I do my drafts in ASCII and not LaTeX. In other words I'd love markup but it's totally no prob if it doesn't happen. I just need to know which way it's going.

Thanks.
wtf
 
Posts: 199
Joined: Sun Dec 06, 2015 5:47 am

Re: MathJax?

Postby Peter Kropotkin » Tue May 16, 2017 5:53 am

I read this entire thread and I am still waiting for the English translation of
what was said... it is great being so technical inept.... entire conversations can be
treated like I was reading Greek or Russian......don't bother explaining because
I won't understand that either....I am just commenting on my ignorance in these matters....

Kropotkin
"Those who sacrifice liberty for security
wind up with neither."
"Ben Franklin"
Peter Kropotkin
ILP Legend
 
Posts: 6036
Joined: Thu Apr 07, 2005 1:47 am
Location: blue state

Re: MathJax?

Postby Carleas » Tue May 16, 2017 4:46 pm

wtf: Yes, there is a strong likelihood that MathJax will be added in the next day or so. Just need to get about an hour free after work to make the change. While I can post at work, I can't access the server through the firewall.

Peter, I will explain, because I like explaining, and explaining it helps me wrap my head around it. And I think it's not as hard to understand as it first seems:

When you visit ILP, your computer sends a request to our server for a specific file. Take a look at the URL for this page:

"http://ilovephilosophy.com/viewtopic.php?f=7&t=192817"

That's sending a request to ilovephilosophy.com for the file viewtopic.php. viewtopic.php is a text file containing instructions for ILP's server. The part of the URL after the ? provides additional information that ILP's server will use when following the instructions. The forum you know as 'Meta', the server knows as forum number 7, thus, f=7. Similarly, the server knows the topic as number 192817, so t=192817*.

ILP's server uses that information, follows the instructions in viewtopic.php, to create a file with instructions for your computer to follow in order to display the page, things like "put the picture ilplogorevised.png at the top in the middle". Your computer follows those instructions, and presents the page that you see.

The instructions that your computer receives can tell it to get information from other servers. That's part of how Google and Facebook can track you around the web: your own computer blindly follows the instructions it receives and passes information to Google and Facebook. But it also allows a page at ILP to have e.g. a Youtube video embedded in it.

Another kind of file that your computer can get is Javascript files. They will tell your computer to get additional files from a site, and run some more complex instructions. Javascript powers a lot of the modern web, because HTML doesn't allow for very fancy instructions. And since Javascript instructions are running on your computer instead of on the server, they can make pages that are 'responsive', i.e. that use your actions to determine what you see.

MathJax is just one of those Javascript instruction sets. As I understand it, when your computer runs the MathJax instructions, it looks at the file you received from ILP for specific strings of characters, e.g. "$$" (I'm not sure if that's the right character combination, but it's something like that). When it finds the right string, it looks at the subsequent text, passes it through another set of instructions, and returns math syntax instead of text. That lets you type things like 'squrt{}' and get a square root sign. Effectively, MathJax allows users to add instructions to their posts that tell your computer, "insert a graphical square root sign here".

So what wtf is asking for is for me to add a short instruction to the file that ILP returns to users that says, "also get the MathJax Javascript file and follow its instructions". And he wants to know when I'll add it, because if it's not there his posts will look stupid being full of computer instructions that your computer doesn't follow.

*
In fact, the forum number isn't necessary. If you delete "f=7&" from the URL, it will still return this page. I'm not sure why it uses both the forum and the topic number, but it does. Possibly a legacy of an earlier database structure? Or just to be extra-super unambiguous in case a topic number got reused?
User Control Panel > Board preference > Edit display options > Display signatures: No.
Carleas
Magister Ludi
 
Posts: 5413
Joined: Wed Feb 02, 2005 8:10 pm
Location: Washington DC, USA

Re: MathJax?

Postby wtf » Tue May 16, 2017 7:16 pm

Carleas wrote: if it's not there his posts will look stupid being full of computer instructions that your computer doesn't follow.


As opposed to my posts looking stupid for so many other reasons ...

Peter Kropotkin, when Carleas adds MathJax functionality to the forum, people will be able to type things like this directly into the forum instead of having to paste an image as I did here.

Image

Just like I can make something bold or italic by using special forum markup, I can use special math markup to render math. For example the above would be "e^{i \pi} + 1 = 0" delimited by dollar signs. That's a math markup language called LaTeX, pronounced La-tek'. It was invented by computer scientist Donald Knuth.

MathJax is a Javascript thingie that lets message forums and websites render LaTeX.

Carleas, thanks much.
wtf
 
Posts: 199
Joined: Sun Dec 06, 2015 5:47 am

Re: MathJax?

Postby Carleas » Wed May 17, 2017 3:42 am

Testing:

$$e^{i \tau} = 1$$

Here is an inline example: \(\tau\) is better than \(\pi\).
User Control Panel > Board preference > Edit display options > Display signatures: No.
Carleas
Magister Ludi
 
Posts: 5413
Joined: Wed Feb 02, 2005 8:10 pm
Location: Washington DC, USA

Re: MathJax?

Postby Carleas » Wed May 17, 2017 3:55 am

OK, MathJax is up and running. I'll post an announcement tomorrow to let people know how to use it, but it should be working now. If you recommend any LaTeX tutorials or cheatsheets, let me know and I'll link them in the announcement.
User Control Panel > Board preference > Edit display options > Display signatures: No.
Carleas
Magister Ludi
 
Posts: 5413
Joined: Wed Feb 02, 2005 8:10 pm
Location: Washington DC, USA

Re: MathJax?

Postby fuse » Wed May 17, 2017 6:32 am

This is cool.

$$\mathtt {hello \ there} $$
$$\mathfrak {hello \ there} $$
$$\mathbb {REAL} $$
$$\sum_{i=0}^\infty i^2$$
$$p \supset q$$
$$ \spadesuit \ \color{red}{\heartsuit} \ \clubsuit \ \color{red}{\diamondsuit}$$
$$\require{AMScd}$$
\begin{CD}
A @>>> B @>{\text{between B & C}}>> C \\
@. @AAA @| \\
D @= E @<<< F
\end{CD}

\begin{CD}
RCOHR'SO_3Na @>{\text{Hydrolysis,$\Delta, Dil.HCl$}}>> (RCOR')+NaCl+SO_2+ H_2O
\end{CD}

$$ \alpha \lambda \epsilon \xi \alpha \nu \delta \rho \omicron \sigma $$
User avatar
fuse
Philosopher
 
Posts: 4515
Joined: Thu Jul 20, 2006 5:13 pm

Re: MathJax?

Postby wtf » Wed May 17, 2017 6:45 pm

Rock and roll!! Thank you Carleas.

I will see if I can find any good cheat sheets. What I always end up doing is Googling around since I've never found one single cheat sheet that has everything. But I will see if I can find a couple of decent tutorials to get people started.
wtf
 
Posts: 199
Joined: Sun Dec 06, 2015 5:47 am

Re: MathJax?

Postby Carleas » Wed May 17, 2017 7:02 pm

No worries if you don't know one off hand, I'm sure I can find enough to get people started. Worst case scenario I'll just add at lmgtfy link.
User Control Panel > Board preference > Edit display options > Display signatures: No.
Carleas
Magister Ludi
 
Posts: 5413
Joined: Wed Feb 02, 2005 8:10 pm
Location: Washington DC, USA


Return to Meta



Who is online

Users browsing this forum: No registered users