LaTeX for Bloggers
March 29, 2019 6:53 AM   Subscribe

I'm thinking of writing a blog post that would require a few lines in math notation, i.e. integral signs, powers, Greek letters, etc. How do I do that?

I was a math major before, meaning before personal computers and before LaTex. I've never picked up any skill in LaTex or any other software that can reproduce math notation. I want to put just a few lines an a blog post (Blogger) in the easiest possible way. How do I do that, and what is the easiest way to learn how?
posted by SemiSalt to Computers & Internet (14 answers total) 3 users marked this as a favorite
 
I would use MathML instead of LaTeX, cuts out a step.
posted by Radiophonic Oddity at 7:04 AM on March 29, 2019 [1 favorite]


I admittedly know LaTeX, but MathML has always looked unbelievably painful to me. MathJax is the major math Javascript library (which uses any of LaTeX, MathML and AsciiMath). KaTeX is another option. In both cases, you'll have to know how to load Javascript on your blog, but that's almost inevitable.

This tutorial I found on google is probably 95% of introduction to LaTeX you need.
posted by hoyland at 7:11 AM on March 29, 2019 [2 favorites]


I would just use Word and the insert->equation function, and use a snipping tool to make an image of it if necessary.
posted by london explorer girl at 7:20 AM on March 29, 2019 [2 favorites]


Agree with @london explorer girl - instead of trying to do markup, make an image of the equation(s) if it's just a few lines.

Advantage - one, you know what it will look like in any other browser, and two, you don't need to fuss with really baroque markup language. Also, it's not clear to me whether Blogger would support embedded MathML markup. I think you can wedge it in, but not sure it's simple. Third, if you ever move your blog to another site / blogging software the images should carry over easily.

The downside is accessibility. Screen readers won't be able to read out whatever your equations are, unless you reproduce it somehow in alt text. MathJax as hoyland suggested seems the least painful way to do it if you go with markup.
posted by jzb at 7:31 AM on March 29, 2019 [1 favorite]


The Word equation editor is pretty powerful nowadays, though "Real Mathematicians" can be jerks about anything not in LaTeX. It will look fine.

If you want to typeset it in LaTeX though for the "Official LaTeX Look", this online editor provides examples and immediate feedback, and you can just copy the image it generates.
posted by BungaDunga at 7:52 AM on March 29, 2019 [1 favorite]


I'm using LaTeX for WordPress, and it thus far has failed to suck.

Here's a shameless self-link to a page on my blog with some math on it. (Scroll down to about the halfway point.)
posted by sourcequench at 8:58 AM on March 29, 2019 [1 favorite]


If it's just a few lines for a one-off I can LaTeX them for you (provided you can explain clearly in words what you want).

Then you can learn by example. It's really, really not that hard to do the basics. E.g. the integral from a to b of f of alpha by alpha is "$\int_a^b f(\alpha) d\alpha$" (ok and if you're really picky and a stickler for making it just right, you put in a little space between the function and the differential so it doesn't look like a product, and put the d in roman case, which is "$\int_a^b f(\alpha) \, \mathrm{d}\alpha$")

The classic introduction lots of us used is The Not So Short Introduction to LaTeX or LaTeX in 139 minutes

(and please, please don't put images in. Every time someone uses images for equations, Donald Knuth dies a little bit inside.)
posted by SaltySalticid at 9:05 AM on March 29, 2019


I'm helping someone with their homework lately and have yacas installed with its built-in Yagy UI... I'm away from the system with yacas on it right now but if I'm recalling correctly you enter a mathematical expression as a text sequence the way you might in a calculator or in a programming language, then press shift-enter to render it, then left click on the rendered version and you get a bunch of "Copy expression as..." options which includes both LaTeX and MathML, iirc
posted by XMLicious at 11:25 AM on March 29, 2019


Seconding MathJax if that's an option. If you end up needing to just do images of your equations (hopefully not), I like this online LaTeX editor quite a bit for generating them.
posted by biogeo at 6:43 PM on March 29, 2019


Another for MathJax. I read one or two sometimes mathy blogs and it's MathJax. I sometimes with MeFi supported MathJax for those occasional questions.
posted by zengargoyle at 2:57 AM on March 30, 2019


I will say up front that I know very little about the web, but inserting an image of math is a bad idea. I have developed considerable "negative appreciation" of web pages that can't be resized (due to the requirements of aging eyes), and a picture of text is usually one of these things. Along with most every "web coolness 3.0" GUIX abomination that resizes elements of pages "intelligently."
posted by Gilgamesh's Chauffeur at 7:16 AM on March 30, 2019


Response by poster: Wow, so many options, so little time. Thanks to everyone, and especially thanks for the links to tutorials and videos. I'll be setting up a sandbox blog page and trying some options.
posted by SemiSalt at 10:19 AM on March 30, 2019


Response by poster: Frustrating failure with MathJax. Adding it to the Theme as per advice here (scroll to Using MathJax in a Theme File) and elsewhere does not work.

Most recent test web page here. Looking at the HTML, the script statement is included as last script before .
posted by SemiSalt at 11:32 AM on March 31, 2019


It turns out yacas can convert mathematical expressions to LaTeX, an XML dialect called OpenMath, C++ code, and ASCII art. The relevant documentation reference page is here.
posted by XMLicious at 1:01 PM on March 31, 2019


« Older Mysterious Smell .....is this possible?   |   A tactful way to negotiate start date at a new job Newer »
This thread is closed to new comments.