Sunday, June 28, 2015

Don't Mess with the Pelican (really, don't!)

I like python.

So when I read about Pelican, and I saw people use it and then blog about how they use it and how great it is, I thought I should try to use it too.

Even with plenty of help, I couldn't get much done. I just don't "get" Pelican. Then I started receiving some gentle comments suggesting that maybe Pelican is no Panacea for People Posting Python.

Now I'm here in google, and life is so much easier. So far everything just seems to work for me without much effort.

To add highlighted code, I found this how-to and right now use the Vim theme in hilite.me, though I really should just learn to use pygments.


1
2
3
4
5
def fib(n):
    a, b = 0, 1
    for i in range(n-1):
        a, b = b, a + b
     return a

What about equations? Well, for now I'm going to try ASCII input for MathJax as described in this how-to. Goodies on ASCII input, including a renderer for testing, can be found at asciimath.org and there are some good examples of asciimathjax

MathType (used to be called Equation Editor in Word, PowerPoint, etc.) is supposed to be compatible in both directions, but so far I haven't figured out how. 

So for example, just type this p(x)=(e^-mu mu^x)/(x!) inside backquotes (backticks), that other little thing on the tilde '~' key, and I get this (after adding one line of HTML to the template):

`p(x)=(e^-mu mu^x)/(x!)`

If your equations stop rendering properly, you may have accumulated bits of extra html in your post floating around after some combination of copy/pasting and formatting.

Using MathJax seem to be easy, and for me, intuitive. The equations displayed in the browser can be accessed by right clicking (or control clicking).

Just for example, you can set it so the equations will zoom on command:

Or you can capture the codes in various formats:











No comments:

Post a Comment

Note: Only a member of this blog may post a comment.