Skip to content →

Tag: markdown

Link problems : Markdown versus latex2wp.py

As John Baez (and hopefully others) noticed most links here on NeB are now screwed up.

For years I’ve used the Markdown syntax to include links in posts (that is something like [this is what you see](and here is the URL)). NeB used an older version ( Version 1.0.1k) of php Markdown to convert these to proper links (as I did have problems with the newer version).

Ever since the Return to LaTeX post, I’m trying to re-educate myself to write posts in LaTeX and convert them into wp-format using the Latex2WP python script.

Unfortunately this script doesn’t go together nicely with the Markdown-syntax, forcing me to go over the converted latex-file almost line by line fixing errors in order to be able to post. Not the time-saver I had in mind…

I hope to post a lot of new material once the semester finishes and therefore disabled the Markdown-plugin. This causes all links to remain in Markdown-format, which is a nuisance but, if you really want to follow the link it is still there for you to copy-paste. Depending on how exciting the christmas-break will be I’ll try to hard-code the links in some of the more popular posts.

If someone knows of an elegant solution, such as a micro-markdown wp-plugin only parsing links, please drop a comment.

UPDATE : I have downloaded the Markdown quicktags plugin. It replaces the standard HTML-editor of WordPress with a Markdown-editor. There is an option “Render” which transforms Markdown to HTML and then updating the post will save the HTML-version. This looks like a relative quick way to get my old post-links back. So far, I’ve rescued the posts of the last year, more later. Hopefully, this causes no overload in your RSS-aggregator…

Comments closed

Writing & Blogging

Terry Tao is reworking some of his better blogposts into a book, to be published by the AMS (here’s a preliminary version of the book “What’s New?”)

After some thought, I decided not to transcribe all of my posts from last year (there are 93 of them!), but instead to restrict attention to those articles which (a) have significant mathematical content, (b) are not announcements of material that will be published elsewhere, and (c) are not primarily based on a talk given by someone else. As it turns out, this still leaves about 33 articles from 2007, leading to a decent-sized book of a couple hundred pages in length.

If you have a blog and want to turn it into a LaTeX-book, there’s no need to transcribe or copy every single post, thanks to the WPTeX tool. Note that this is NOT a WP-plugin, but a (simple at that) php-program which turns all posts into a bookcontent.tex file. This file can then be edited further into a proper book.

Unfortunately, the present version chokes on LaTeXrender-code (which is easy enough to solve doing a global ‘find-and-replace’ of the tex-tags by dollar-signs) but worse, on Markdown-code… But then, someone fluent in php-regex will have no problems extending the libs/functions.php file (I hope…).

At the moment I’m considering turning the Mathieu-games-posts into a booklet. A possible title might be Mathieumatical Games. Rereading them (and other posts) I regret to be such an impatient blogger. Often I’m interested in something and start writing posts about it without knowing where or when I’ll land. This makes my posts a lot harder to get through than they might have been, if I would blog only after having digested the material myself… Typical recent examples are the tori-crypto-posts and the Bost-Connes algebra posts.

So, I still have a lot to learn from other bloggers I admire, such as Jennifer Ouellette who maintains the Coctail Party Physics blog. At the moment, Jennifer is resident blogger-journalist at the Kavli Institute where she is running a “Journal Club” workshop giving ideas on how to write better about science.

But the KITP is also committed to fostering scientific communication. That’s where I come in. Each Friday through April 26th, I’ll be presiding over a “Journal Club” meeting focusing on some aspect of communicating science.

Her most recent talk was entitled To Blog or Not to Blog? That is the Question and you can find the slides as well as a QuickTime movie of her talk. They even plan to set up a blog for the participants of the workshop. I will surely follow the rest of her course with keen interest!

Leave a Comment

NeB on Leopard and iPhone

If you have an iPhone or iPod Touch and point your Safari browser to this blog you can now view it in optimised format, thanks to the iWPhone WordPress Plugin and Theme. I’ve only changed the CSS slightly to have the same greeny look-and-feel of the current redoable theme.

Upgrading a WordPress-blog running under Tiger (Mac OS 10.4) to Leopard produces a few anxiety moments. All of the standard tools (Apache, PHP and MySQL) seem no longer to work as before. For those of you who do not want to waste too much time over it, I’ll walk through the process.

After upgrading to Leopard you want to check whether your blog is still alive, so you fire up Safari and will be greeted by the message that Safari cannot find your server. Sure enough you forgot to start the WebServer in SystemPreferences/Sharing/Web Sharing. Having fixed this you will see the default Apache-screen because Leopard put these default-files in your webserver-root directory (/Library/WebServer/Documents). In case you installed your blog under a user account you will get a message that you enter forbidden territory, see below for the solution to that problem. Having removed all those index.html files (making sure NOT to delete the index.php of your blog) a more serious problem presents itself : you see the text-version of index.php meaning that PHP isnt working. You check the /etc/httpd/httpd.conf file and it still contains all the changes you made to it to get PHP running under Tiger, so what is going on?

Googling for something like ‘enabling PHP under Leopard’ you’ll discover that the configuration file used by the webserver is in a different location. It now resides at /private/etc/apache2/httpd.conf. You will have to remove the hash sign (#) at the beginning of line 114 so that it reads

LoadModule php5_module libexec/apache2/libphp5.so

Next, you have to create a php.ini file and change one line. The first thing is settled by the following Terminal-commands

cd /private/etc
sudo cp php.ini.default php.ini

and in the php.ini you have to modify line 305 so that it becomes (removing the latter part of the line)

error_reporting = E_ALL

Restarting the webserver enables PHP. If you need more details check out the article Enabling PHP and Apache in Leopard. However, you are not quite done yet. Your blog will now show the WordPress-page that something is wrong with your mysql-database. However, mysql seems to be running fine as you can check from the Terminal so PHP cannot find it.

To remedy this, you have to add the locations (after the = sign) in the follwing two lines of the php.ini file

mysql.default_socket = /private/tmp/mysql.sock
mysqli.default_socket = /private/tmp/mysql.sock

Restarting the webserver should resolve the problem. But then your blog can still choke on old PHP-code in one of the plugins you use. In my case I was using an ancient version of the PHP-Markdown plugin but after replacing it with the newest version NeB looked just like I left it with Tiger…

A final point : webpages stored in personal Sites-folders cannot be served by Apache2 and will produce a message that you have not enough privileges to view the page. To resolve this, type the following command from the Terminal

sudo cp /private/etc/httpd/users/*.conf /private/etc/Apache2/users

Leave a Comment