Thursday, February 16, 2017

Blogging from Overleaf

Using Overleaf as a blogging client

I use Overleaf for all my writing and presentations. I’d like to use Overleaf for blogging as well. I usually write my blog like posts in Medium but Medium cannot yet show posts that contain tables, figures, and citations. So, I was looking for a workflow that might be useful for bringing in the power of Overleaf and blogging where one can customize the appearance of the paper and share in an html format.
I suppose one can go in a number of directions. From the simple to a little more complex,
  • I can convert a LaTeXdocument I’d write in Overleaf to HTML and email the document to a Blogger or Wordpress site. That might be the easiest?
  • If I want a little more flexibility in terms of how I want the site to appear and tweak things, I can use Github to use Github pages to push and serve my article as a static file that people can read
  • An alternative way is to use static site generators and a web hosted solution such as Surge or Netlify to serve the paper.

Publishing an Overleaf Article as a blog post through Wordpress or Blogger

For this, you need the following:
  • An Overleaf Account (Free, you get 1 GB free space)
  • A Blogger or Wordpress Account.
  • An installation of Pandoc
  • An installation of Git
  • An Email Client
Here is a workflow for using Overleaf with blogger to set up blogging.
Go to blogger, set up an account if you do not have one, or select a blog where you want to work. Then set up your account so that you can email files to blogger directly and get published instantly. Here is a screenshot:

Configure blogger to set up your email address


Once you have set it up, you can write your post in Overleaf. Write posts in the LaTeXmarkup. In the main.tex file, input the file. Then, use git to clone the Overleaf article repository to your local repository.
git clone URL
Now you use Pandoc to generate the html from the LaTeXdocument, and the code is
pandoc -f latex -t html â€"filter pandoc-citeproc â€"bibliography sample.bib -o post1.html main.tex

Explanation of this code

  • pandoc is for invoking the pandoc programme
  • -f and -t are from and to, so from latex to html
  • filter: use it if you’d like to use a bibliography file and references, in this case the file name is sample.bib
  • -o is for output and give it a file name, in this case post1.html
  • main.tex is the name of the file that gets converted
In your blogging folder it will generate a file titled post1.html. If the image files, the bibliography files and the html files are then emailed to your blogger email address this will show up.

Issues

While this gives a quick workable solution for posts with few images, if you have to include a large number of images, this might work but quite cumbersome. An alternative approach would be to keep the images in the Web and use markdown to write your posts. This is where creating Jekyll sites powered by Jekyll-Pandoc and serving with Surge becomes quite a useful option, a topic I will turn to next.

Monday, May 30, 2016

Classeur01

How to connect between Markdown and Medium

Medium is a great place to share articles, thoughts, ideas, and stories. Markdown is a great way to write text. It supports plain text, codes, citations, a whole lot of features. But Medium does not support Markdown. Markdown does not enable one to directly export to Medium. Markdown can however be written on a regular web page and then can be formatted to export to other blog clients, for example Wordpress and Blogger.

Enter Classeur.io

Classeur.io is a great service and I learned about classeur.io while surfing Stackedit.io, my favourite web based markdown editor. Unlike stackedit.io, classeur.io has a desktop app as well. Like Stackedit.io, classeur.io has a nice front end where I can write really nice post. I really like the aesthetics of the classeur.io now. It has a very pleasing interface. It also has a desktop app for your platform. I really like it. Here’s how it looks:

gradepro

You can add tables which Medium natively doesn’t support

Medium natively Markdown to Medium
Lovely Interface Classeur has nice interface as well
Does not support Math This one supports Math

Quite nice features. One of the things you can do with this one is to use footnotes 1

How to connet the two

  1. Write everything in Classeur
  2. Publish as an html file

  1. Can be used to insert references, solves an issue of writing scientific texts or scholarly texts in Medium
    Also, this can be used to push articles towards Authorea.

Sunday, April 26, 2015

Nepal Earthquake Notes - 2 - Response

Our experiences their experiences

phresponse
(This photo was taken from the Canterbury Public Health Response Document)

In 2011 February 22nd, Christchurch was struck with a 6.4 earthquake at about 12.51 PM in the afternoon. The epicentre of the earthquake was around a place known as Lyttleton. The city centre was badly affected, many buildings collapsed and particularly in the Eastern suburbs of Christchurch, the devastation was remarkable as hundreds of houses were immediately destroyed or were rendered useless for living. People were displaced and were accommodated in several shelters across the city and a massive restoration operation was launched. Immediately following the earthquake, the death tally stood at 185. Following the initial earthquake, the city suffered about 12,000 more aftershocks over the next three years. The citizens battled the aftershocks as they rebuilt the city. Four years later, Christchurch is again coming back to her former glory and plans are afoot for the renvewal of the city. But in the rebuild and reconstruction of the city of Christchurch hangs a tale that can have important lessons for everyone around the world.

In 2015 April 25th, Nepal, in Kathmandu suffered the result of a similar earthquake of much larger intensity 7.9 Richter scale epicentre located at Lamjang in the Kathmandu Valley and not far from Everest. This also led to massive damage, about 1900 lives lost in the first 24 hours itself, and massive losses of property. Several villages disappeared, and there were avalanches from Mount Everest and other mountains that added to the woe. At the time of writing this, rescue operations are underway and several aftershocks have already taken place.

At the time of writing this, a massive recovery operation is taking place, and you can learn more about the recovery operations here

I write this on the third day of the Nepal earthquake and would like to highlight some aspects of earthquake disaster management and strategies that I saw implemented in Christchurch. Some public health and disaster management measures certainly helped people of Christchurch and led to far fewer deaths and destructions that would otherwise occur. In no particular order,

  1. Immediately after the earthquake, the public health department issued warnings about boiling drinking water and restriction of the “flushing the toilet”. Which meant, the advisories were about conservation of water and keeping in mind that it was possible that the drinking water might be contaminated. It turns out that these two activities alone led to really less load of people with stomach related diseases that would otherwise occur.
  2. The city government formed a crisis management team and the mayor oversaw the operations. The control room effectively managed hundreds of visitors and worker bees who turned up to set up search and rescue operations that led to the recovery of bodies and clearing of people who were trapped in the debris.
  3. Several volunteer organisations set up shelters that allowed people to camp out and provided food, shelter, and clothing.
  4. In addition to medical services, several additional services such as mental health services and care were pressed into action.
  5. A thorough evaluation of every building was undertaken, and each building in each residential zone was “sticker”-ed, or colour coded so that the status of the building would be known.
  6. Fresh water was provided to the affected neighbourhoods
  7. Recovery operations were televised and tally of the deceased and recovered were made available to people.

A good description of the steps are available with the Wikipedia entry