Just a quick post this time. I recently had to upgrade the Subversion (SVN) software on my Ubuntu system to version 1.7. This version is (currently) not included in the regular Ubuntu distribution, but I found the solution in an Ubuntu forum thread - simply run this in a terminal:
echo "deb http://opensource.wandisco.com/ubuntu lucid svn17" | sudo tee /etc/apt/sources.list.d/svn.list
sudo wget -q http://opensource.wandisco.com/wandisco-debian.gpg -O- | sudo apt-key add -
sudo apt-get update
sudo apt-get dist-upgrade
Thursday, 24 January 2013
Monday, 12 November 2012
Batch cropping white space borders in Matlab figures
Matlab figures have, by default, a white space border around them. This is fine if you want to view them by themselves, but wastes space if you want to add them to a text document, where the white borders are "added" to the document margins. It is possible to adjust the border width in Matlab, but if you already have exported the figures to an image file, it's too late. (Note: When exporting to EPS the border is not included by default).
If you want to remove this white space for a large number of image files in one go, ImageMagick is your friend. For example,
mogrify -trim +repage *.png
will remove the white border of all PNG files in the current directory, using the "smart crop" trim option. Consult the ImageMagick documentation on cropping for further options.
If you want to remove this white space for a large number of image files in one go, ImageMagick is your friend. For example,
mogrify -trim +repage *.png
will remove the white border of all PNG files in the current directory, using the "smart crop" trim option. Consult the ImageMagick documentation on cropping for further options.
Tuesday, 16 October 2012
Editing Grub boot menu order and changing default OS
I recently decided to try running a dual-boot system with Windows 7 and Ubuntu. I first installed Windows 7, and then installed Ubuntu. And with Ubuntu comes the GRUB boot loader, which pops up when I start the machine, and lets me choose which OS to use. If I don't choose anything, the item at the top of the list is selevted automatically after about 10 seconds.
I want to use Windows 7 by default, but unfortunatly Windows is at number 6 or 7 on the list. If I'm not paying attention when I start the machine, it boots into Ubuntu, and I have to restart it. How can I make Windows 7 the default OS?
The answer lies in reconfiguring the GRUB menu. There are several ways to do this, but I used the grub-customizer GUI app, which seems both very simple and flexible. Install it using the terminal:
In the grub-customizer, you can reorder the GRUB menu items, and for example check the option "Default OS: Last used OS". You can read more about the grub-customizer on the How-To Geek Blog.
I want to use Windows 7 by default, but unfortunatly Windows is at number 6 or 7 on the list. If I'm not paying attention when I start the machine, it boots into Ubuntu, and I have to restart it. How can I make Windows 7 the default OS?
The answer lies in reconfiguring the GRUB menu. There are several ways to do this, but I used the grub-customizer GUI app, which seems both very simple and flexible. Install it using the terminal:
sudo add-apt-repository ppa:danielrichter2007/grub-customizer
sudo apt-get update
sudo apt-get install grub-customizer
In the grub-customizer, you can reorder the GRUB menu items, and for example check the option "Default OS: Last used OS". You can read more about the grub-customizer on the How-To Geek Blog.
Wednesday, 29 August 2012
Online LaTeX equation editor
Today I got a great tip from my colleague Vidar: A link to an online LaTeX equation editor at codecogs.com. The equations can be downloaded as both raster and vector graphics files. The editor shows a preview of the equation you're writing in "real time", so it's acually also a nice way to test your LaTeX code while you're writing.
Tuesday, 26 June 2012
Creating a simple nomenclature for a PhD thesis (or similar)
The deadline for my PhD thesis is drawing close, and I'm putting on some finishing touches. One of the things I'm currently working on is the nomenclature - a list of all the mathematical symbols. There are several tools for doing this "properly", like the glossaries and nomencl packages, but they work best if you use them consistently through the entire writing process. It's too late for me to use these, so I have to add the symbols to the nomenclature manually. But what formatting should I use? I tried the tabular environment, but my list soon grew too long for a single page.
Luckily, I came upon this post at the howtotex blog written by Frits Wenneker. He suggests using the longtable environment for the nomenclature - which elegantly breaks the table up to fit several pages. Check out his post if you're looking for something similar.
Luckily, I came upon this post at the howtotex blog written by Frits Wenneker. He suggests using the longtable environment for the nomenclature - which elegantly breaks the table up to fit several pages. Check out his post if you're looking for something similar.
Tuesday, 12 June 2012
Using accented characters with BibTeX
When writing scientific articles, I often cite authors with accented characters in their names, for example
Pörtzgen, N., Gisolf, D., & Blacquière, G. (2007).
Inverse wave field extrapolation: A different NDI approach to imaging defects.
IEEE Trans. Ultrason., Ferroelectr., Freq. Control , 54 (1), 118–127.
Such accented characters often creates problems when BibTeX is used. The reason for this is that BibTeX uses 8-bit encoding for the .bib file, as explained in this post at StackOverflow, and also in the LyX wiki.
The simple solution to this problem is to write accented characters in the BibTeX file using special symbols, as explained on the BibTeX webpage. For example, ö is written \"{o} and è is written \`{e}. With these special symbols, the BibTeX source code for the citation above is
@ARTICLE{Poertzgen2007,
author = {Niels P\"{o}rtzgen and Dries Gisolf and Gerrit Blacqui\`{e}re},
title = {Inverse Wave Field Extrapolation: A Different {NDI} Approach to Imaging Defects},
journal = {IEEE Trans. Ultrason., Ferroelectr., Freq. Control},
year = {2007},
volume = {54},
pages = {118-127},
number = {1},
month = {January}
}
Pörtzgen, N., Gisolf, D., & Blacquière, G. (2007).
Inverse wave field extrapolation: A different NDI approach to imaging defects.
IEEE Trans. Ultrason., Ferroelectr., Freq. Control , 54 (1), 118–127.
Such accented characters often creates problems when BibTeX is used. The reason for this is that BibTeX uses 8-bit encoding for the .bib file, as explained in this post at StackOverflow, and also in the LyX wiki.
The simple solution to this problem is to write accented characters in the BibTeX file using special symbols, as explained on the BibTeX webpage. For example, ö is written \"{o} and è is written \`{e}. With these special symbols, the BibTeX source code for the citation above is
@ARTICLE{Poertzgen2007,
author = {Niels P\"{o}rtzgen and Dries Gisolf and Gerrit Blacqui\`{e}re},
title = {Inverse Wave Field Extrapolation: A Different {NDI} Approach to Imaging Defects},
journal = {IEEE Trans. Ultrason., Ferroelectr., Freq. Control},
year = {2007},
volume = {54},
pages = {118-127},
number = {1},
month = {January}
}
Wednesday, 23 May 2012
Adjusting vertical alignment of subfigures in LaTeX
When using subfigures in Latex, I have sometimes found it annoying how the figures are vertically aligned at the bottom, rather than being centered. An example: The following code
\begin{figure}
\subfigure{\includegraphics[width=67mm]{PipeScannerUnderGround}}
\subfigure{\includegraphics[width=47mm]{CylScanGeometryPipe}}
\caption{}
\end{figure}
produces the following figure:
which seems a little lopsided. I found a nice solution at stackoverflow: Use the \raisebox command to adjust the vertical position of individual subfigures, for example
\begin{figure}
\subfigure{\includegraphics[width=67mm]{PipeScannerUnderGround}}
\subfigure{\raisebox{10mm}{\includegraphics[width=47mm]{CylScanGeometryPipe}}}
\caption{}
\end{figure}
which yields the following result:
Much nicer! :)
Subscribe to:
Posts (Atom)


