Script to generate standalone LaTeX equations

Tags

, , , ,

Sometimes you will write a presentation in something that is not LaTeX or design a poster and you want to include equations. These equations you want to be nicely typeset with LaTeX, but they need to be standalone graphics.

This blog post describes a script which will take an input file of the LaTeX code for the equation and process it into either a bitmap (png) or vector (pdf) graphic.

I have previously blogged on this topic using a different method, here. However, I now prefer this method as it is easier to use and faster to do. It also uses much simpler files for the equations and makes it easier to get a coherent look across all the equations in your presentation or poster by using a common preamble.

Continue reading

Rooting my HTC Desire

Tags

, , , , ,

This post is less of a “how to” and more of a record of what I did. It could be useful to people who are intending to root their phone, but I strongly recommend reading the official updated guides.

I rooted my phone using the very helpful instructions at CyanogenMod, specifically for the HTC Desire please note my HTC Desire is the GSM version. I also used this forum post, which was very helpful in telling me how to use the Data2SD scripts. Data2SD allows you to use the SD card as “internal storage” so you can have a full 2Gb for apps, rather than using the phone’s physical internal storage which is far smaller.

Continue reading

Script to process eps figures to pdf

Tags

, , , , , , , , , , , ,

Often you generate a graph using Gnuplot or something, and export it as an eps. This eps is then included in your LaTeX document and processed using psfrag and pdflatex (see my other post). A fine method, however, journals generally like you to include the final figure as a pdf graphic. I have written a script that does exactly this, it takes your PSfrag commands, and the eps figure, and turns it into a pdf figure.

This blog post is a guide to the script, and explains both how to use it and how it works.

Overview
There are a few stages to the process, first the script constructs a LaTeX file. Then the script processes this LaTeX file, with all the replacements applied. Then it extracts the pdf figure as the output. Finally it cleans up all the temporary files created.
Continue reading

Moving and transcoding an m3u playlist with a bash script.

Tags

, , , , , ,

The problem here is that you have an m3u playlist with your favourite songs in it. You want to put all the songs on your latest mp3 player. However, some of them are in the wrong formats and they are scattered all over your computer. You need some way of easily collecting them all together in one folder, with the playlist order preserved all in mp3 format.

This guide will explain how to write and use a bash script that helps you to do this. Continue reading

Using LaTeX to get pictures of equations

Tags

, , ,

If you’re giving a presentation, for example, and you want to use animations and transitions so don’t want to write it entirely in LaTeX. You may want to still use LaTeX to get well-formatted equations in your presentation. These need to be included as pictures as most presentation programs don’t natively support LaTeX.

This guide will tell you how to use LaTeX to create standalone pictures of equations for use in anything, from presentations to websites. Update: I have now written a bash script to do the same as this, but easier to use and better, explanation in this blog post.

Continue reading

Remove page number of a title page in LaTeX

Tags

, , ,

This problem is exactly what is stated in the title. Removing or changing a page number is easy in LaTeX, however, on a title page it sometimes seems like it doesn’t work.

To remove the page number, you just need to set the page style to empty using:

\pagestyle{empty}

On a title page, it must be put after the \maketitle command. Continue reading

Video editing with FFmpeg on the command line

Tags

, ,

The task here is to edit together videos using just the command line. There is a surprising amount that can be done with just a few simple commands.

You can take a number of source video files, chop them up to just the scenes you want. Then you can put them all together, and encode the final video into virtually any format.

We use FFmpeg for the video encoding. To join it together, we use the cat command from bash. This method is mentioned on FFmpeg’s own FAQ.

Continue reading

Kile

Tags

, , , , , ,

Kile is a LaTeX IDE. It is part of the KDE desktop environment but can be installed independently. This post is a brief review and introduction to it.

Why use kile?
Kile has many useful features. Some of my favourites include:

  • Auto-complete of LaTeX commands including environments
  • One-click compilation of LaTeX document to pdf
  • Document structure tree
  • Auto-complete of your document’s labels

There are other things that I don’t use as well, like preview and the ability to choose commands from menus.

Continue reading

Easy ssh

Tags

, , ,

Normally when using ssh you need to type a long command into the command line, then type your remote user’s password.

This post is about how to set it up so that you don’t need to do all of this. First we’ll set up an ssh keypair, then we’ll set up the server to accept this key. We’ll then create an alias to quickly log in to the server.

Before doing the steps below, make sure you are logged in to the local machine with the user that you want to be able to access the remote machine. It is also helpful if the local machine has a sensible hostname set.

Continue reading

Using scp with special characters

Tags

, , , ,

When using scp or cp, special characters can break the file path. You get around this by escaping the special character.

Using cp you can use the normal method of escaping special characters, which is preceding it with a backslash. For example, a path with a space could be copied using:

cp photo.jpg My\ Pictures/photo.jpg

The remote path in scp doesn’t work escaping using this method. You need to escape the special characters using a double backslash. Using the same example, the My Photos folder would have its space escaped using:

scp photo.jpg "user@remotehost:/home/user/My\\ Photos/photo.jpg"

The double quotes are also important, the whole path with the special characters must be enclosed with double quotes.

Follow

Get every new post delivered to your Inbox.