Logitech Keyboards (and other non-Apple keyboards) on OS X

2010/02/17

When you use a 3rd party keyboard with OS X you are often stuck with the standard mapping that maps the “Start” key to “Command” and the “Alt” key to “Alt/Option.” This might be fine for you but it annoyed the crap out of me because the “Command” key is no longer next to the space bar! So I tried to install Logitech Control Center 3.2 to correct this but it screwed up my keyboard and made me double type everything (to uninstall this goto Applications > Utilities > LCC Uninstaller, or something like that). I installed Logitech Control Center 3.1 and my keyboard worked but then my mouse was screwed up as if it were permanently clicking everything. I tried so many different things to try to effectively swap the keys and none of the worked (on Snow Leopard) until i found DoubleCommand (http://doublecommand.sourceforge.net/). Here you just install this and go to your System Preferences and check the “Command Key acts as Option” and “Option acts like Command Key” and you are done!

Thank you DoubleCommand!

Add a path to run external programs in MATLAB

2010/01/14

I wanted to add a path to MATLAB to allow me to run external programs while in MATLAB. Copied straight from the MATLAB user guide:

Modify the UNIX System Path that MATLAB Uses. Add the folders to the system path from the shell. The exact steps depend on your shell. This is an example using sh:

  1. At the system command prompt, type
    export PATH="$PATH:<myfolder>"

    where <myfolder> is the folder that contains the program you want to run.

  2. Start MATLAB.
  3. In the MATLAB Command Window, type
    !echo $PATH

The folder containing the file is added to the system path that MATLAB uses. This change applies only to the current session of the terminal window.

Automatically Modify the System Path When MATLAB Starts. If you want to add a folder to the PATH environment variable each time you start MATLAB, perform these steps:

  1. In a text editor, open the file MATLAB/bin/matlab. This file is used to start MATLAB.
  2. Add this line to the beginning of the matlab file
    export PATH="$PATH:<myfolder>"

    where <myfolder> is the folder you want to add to the path.

    If you run a tsch shell instead of a bash shell, use setenv instead of export.

  3. Save the file.

The matlab file will modify the PATH environment variable, and then start MATLAB.

NTFS Support in Snow Leopard

2009/12/02

I have just installed a copy of OS X 10.6.2 Snow Leopard on my computer and found out that my NTFS external hard drive no longer supports read and write even with the NTFS-3G (http://macntfs-3g.blogspot.com/). I found this forum post on how to enable NTFS read/write support natively in Snow Leopard: http://www.overclock.net/mac/585239-how-snow-leopard-enable-native-ntfs.html

If it ever disappears here is the quoted steps from the above webpage:

Here’s how to get full read/write support for NTFS drives in Snow Leopard. First, uninstall NTFS-3G or Paragon if you’re using either one:

1. In Terminal, type diskutil info /Volumes/volume_name, where volume_name is the name of the NTFS volume. From the output, copy the Volume UUID value to the clipboard.

2. Back up /etc/fstab if you have it; it shouldn’t be there in a default install.

3. Type sudo nano /etc/fstab.

4. In the editor, type UUID=, then paste the UUID number you copied from the clipboard. Type a Space, then type none ntfs rw. The final line should look like this: UUID=123-456-789 none ntfs rw, where 123-456-789 is the UUID you copied in the first step.

5. Repeat the above steps for any other NTFS drives/partitions you have.

6. Save the file and quit nano (Control-X, Y, Enter), then restart your system.

That’s it. I’m not sure how reliable it is but I’ll make an edit if it is not.

Best TeX GUI?

2009/11/19

I’ve never been able to use command line programs such as Vim or Emacs to program. I always resort to IDE’s that have nice auto-complete features (e.g. XCode) and project management tools. The same goes for writing technical papers in LaTeX, I could never get used to using command line editors especially with the syntax that you need to remember for symbols, spacing, etc. That’s why I resort to integrated LaTeX environments (ILEs). There are several choices out there including the popular TeXShop (OS X), WinEdt (Windoze), and  the relative newcomer Texmaker (all platforms). But my editor of choice is by far Kile which is inherently built for Linux systems but I have compiled a version (using Fink) for OS X.

Kile running on OS X

Features of Kile I really like:

  • \cite gives you a list of autocompletion options/references even if you use BibTeX!
  • A very comprehensive list of symbols.
  • Good help with LaTeX commands.
  • A comprehensive library of environments.
  • Complete control of your autocompletion options.
  • Very good project manager.

Take a look and let me know if you want to learn how to install this on OS X. It is a beefy setup (since you need to install KDE) but I think it is well worth it since you will be typing LaTeX documents twice as fast now!

Endnote X3 and BibDesk

2009/11/18

I use BibDesk and BibTeX because I am a total proponent to TeX style bibliographies. But recently I was introduced to EndNote X3 (not freeware) software and am simply amazed by the functionality of it. You can just add articles to your online account via using anyone of your search engines (e.g. Web of Science) and sync them to your computer. All the information is copied automatically. In addition, the you can automatically download full text if it is available through your network! It is very seamless and I wondered why I’ve been getting research articles any other way.

The one caveat that I do have is that I tend to do a lot of scientific writing exclusively using LaTeX and must use BibTex. I am used to using BibDesk as my reference manager to generate these BibTeX files but could not get EndNote to export them to a file that BibDesk would read correctly. Therefore I did a little searching and found a solution. To export your whole library to a BibDesk compatible file do the following:

  1. Edit > Output Styles > Open Styles Manager
  2. Click on BibTeX Export and then hit the “Edit” button.
  3. Goto Bibliography > Templates
  4. Replace all the instances of “Label” with “cite-key” so that you can automatically generate cite keys in BibDesk.
  5. Close the window and you will be prompted to save the style file. Save it to BibDesk Export or something similar.
  6. Refresh the list of styles available by closing and opening the Styles Manager.
  7. Check the box next to your newly created style.
  8. Goto File > Export and save the file as “Text Only” with the output style “BibDesk Export.” If you want to export all references, uncheck the box below.
  9. Goto finder and rename the file to a .bib extension.
  10. Open up the file in BibDesk and then hit command + k to automatically generate cite keys based on the preferences you set in BibDesk.
  11. Remember down the road to change characters that might be a problem in TeX like “&.” I would just use your favorite text editor and replace all “&” with “\&.”
  12. Feel free to remove a couple of the fields, they can be annoying for certain bibliographic styles.

This seems like the easiest way to get automatic and custom generated cite keys for your BibTeX files. Let me know if there is a better way.

Details on Installing Fink on Mac OS X

2008/08/24

This is a little put together from all over the place. Hopefully this is all you need to know about installing Fink and Fink Commander on Mac OS X.

Basically, Fink allows you to use Linux type programs (GUIs and command line) native in OS X. I am not going to dive into all the gory detail of what Fink is and is not, I am just going to get it to work. Fink gives you a command line tool to install these programs (much like apt-get for Ubuntu/Debian). Fink Commander is the GUI for Fink.

From my previous journal entry:

Today I have taken the actions to get my Fink installation going. Here are the steps taken so far:

First I had to do a community update of X11 (for Leopard) to fix some bugs Apple will PROBABLY release an official update soon, but I can’t but I can’t wait that long! I updated X11 to version 2.1.1. Goto this website.

Apparently it is MUCH better to install Fink by source. More information can be found here. You can follow the directions in the web page given. There is a little bit of a problem… you will probably have to add the path /sw/bin to your PATH variable at some point. I am not sure if Fink automatically does this or not. You can do so by adding it to .bashrc or .bash profile… I think. I also ran the selfupdate and the update (but of course there is nothing to update).

One should note that Fink is self-containted in the /sw/ directory. If you ever want to remove it and all the programs that were installed via Fink, just delete that directory!

The only commands you will ever need to know:

  • fink list NAMEOFSOFTWARE, scans the available packages and lists those that match your query
  • fink install NAMEOFSOFTWARE, installs the package
  • fink update-all, updates all binary and source packages. You might run into a problem: see this or this
  • fink selfupdate, updates the binary or source version of Fink

If you don’t want to remember these, install Fink Commander. This is the GUI interface and is pretty good. The only thing it wont do is the update-all. So if you have a lot of “outdated” packages run update-all. This will take FOREVER because you will need to build things from source if you installed Fink from source.

Virtual Packages?

From the Fink website: “packages with names like system-perl are placeholder packages. These do not contain actual files, but merely serve as a mechanism for fink to know about programs that have been installed manually outside of fink.

Starting with the 10.3 distribution, most placeholders aren’t even real packages that you can install and remove. Instead, they are “Virtual Packages”, package data structures generated by the fink program itself in response to a pre-configured list of manually installed programs. For each virtual package, fink checks for certain files in certain locations, and if they are found, considers that virtual package “installed”.”

Xfig and PDFLaTeX (or LaTeX)

2008/08/22

Although the GUI for Xfig is a little outdated, in my opinion it is the best software to use for academic vector-based diagrams. It allows the use of LaTeX equations in conjunction with the figure.

Screenshot of Xfig in action!

Screenshot of Xfig in action!

What I prefer is to make a .pdf of the figure through pdflatex and then include the image to the document of interest. The directions parallel the following website:

http://graphics.stanford.edu/lab/howto/xfig_latex.html

When adding LaTeX expressions to a figure use the $…$ to switch to math mode when necessary. Make sure you set the flag on the text to “Special Text” using the “Text Flags” menu on the bottom. Then export the figure from Xfig using the “Combined PS LaTeX (PS and LaTeX part)” to the default name.

Create a driver file (e.g., this case my default export name was fig1 thus I use fig1.tex) containing something like:

\documentclass{article}
\usepackage{epsfig}
\usepackage{color}
\setlength{\textwidth}{100cm}
\setlength{\textheight}{100cm}
\begin{document}
\pagestyle{empty}
\input{fig1.pstex_t}
\end{document}

Then run:

latex fig1.tex
dvips -E fig1.dvi -o fig1.eps
epstopdf fig1.eps

Note that you can change the name “fig1.eps” to anything that you want. I have included the driver file in the path ~\Work\TEX\driver\fig1.tex. There is something wrong with my version the Xfig export so when you export just export it to the name that the file is saved as (e.g. do not enter a new filename). Then change the driver file appropriately.

Some key notes about using Xfig.

  1. It’s always tough to figure out what scale you should draw these things on especially since the units on the border don’t mean all that much. My rule of thumb is to put down an arrow using the “polyline” function and then judge your sizes from then on.
  2. I find it impossible to pan side to side, this will get all your nerves. Zooming in and out is a pain too.
  3. Get a mouse. The middle mouse click is so useful.
  4. Xfig does not make good “3D” drawings (to my knowledge). Does anyone know an alternative?
Example of what you can do with Xfig! This is a diagram I made for my research.

Example of what you can do with Xfig! This is a diagram I made for my research.

Merging (concatenating) and splitting PDF files

2008/08/07

In an attempt to merge PDF files from chapters of a book I started a google search of the methods to do this. There are several ways to do this but the easiest way (for OS X) is to use the JoinPDF. It seems simple enough and it does splitting for you too!

Other methods exist, but are a little more complicated. I assume that taking the Imagemagick route isn’t all too painful though…

For Windows tryout PDFMerge.

Zoom in OS X (Leopard)

2008/08/01

I actually had to use it today because I really couldn’t make out an image on the screen of an equation about Bessel’s functions on Wikipedia. To use this feature make sure it is turned on by going to Preferences > Keyboard & Mouse > Mouse and check the box that belongs to “Zoom using scroll wheel while holding.” Now you can zoom in and out by using the scroll button on your mouse (or trackpad).

The prefernece pane where you find the zooming function.

The prefernece pane where you find the zooming function.

IP printing in OS X

2008/07/30

Nearly everyone who uses OS X knows that one department where the OS is lacking is in the realm of IP printing and IP printing support. For most of us in an academic infrastructure, this is usually how we connect to our printers. But when you look at the configuration of such a printer, you are either only left with a handful of options or you have to follow a maze to find options. But luckily, the underlying printing system is managed by CUPS (Common Unix Printing System). Depending on your version of cups you can easily access all your printers, queues, and options in one convenient place… in your web browser! CUPS has a nice user interface that can be accessed in your web browser by typing the following into your web browser of choice

http://localhost:631

Check it out, it is pretty neat. It’s a nice and tidy place for all your printing needs… now if only OS X could just capture this and translate it into their Preferences pane.

Screenshot of the web interface for CUPS 1.3.x.

Screenshot of the web interface for CUPS 1.3.x.


Follow

Get every new post delivered to your Inbox.