Best TeX GUI?

November 19, 2009 by atchieu

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

November 18, 2009 by atchieu

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.

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

August 24, 2008 by atchieu

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)

August 22, 2008 by atchieu

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

August 7, 2008 by atchieu

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)

August 1, 2008 by atchieu

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

July 30, 2008 by atchieu

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.

Syncing iCal and Address Book to Google Calendar and Contacts

July 29, 2008 by atchieu

Here is some help in having some two-way syncing between your calendars in Google Calendar, iCal, Thunderbird, and Microsoft Outlook. Saves me from writing a whole bunch!

Sync Calendars

Unfortunately, Address Book cannot be synced with your Google Contacts unless you have an iPhone (lame)… here is the link to that anyway.

Sync Address Book

MATLAB – filling the “contour” function

July 25, 2008 by atchieu

This is a stupid post but I am just putting it here because I will forget how to fix this in the near future. So the problem with the contour function is that if you want to fill all the contours, it never fills the contour at the lowest limit in which you are interested in, i.e. it will leave an image with a disgusting white splotch where it should really be dark blue.

Look at that ugly white. This is because 'contour' doesn't know any better!

Look at that ugly white. This is because 'contour' doesn't know any better!

A quick fix to this is to set the background of an image as the color that the white areas are supposed to be. To do this, you should run the following lines:

[contours, h_w] = contour(x, y, w, w_level, line_color);

% Here is a nice fix to fill the last contour on a filled plot
set(gca, ‘Color’, [0 0 .5]); % Set background color of “axes”
set(h_w, ‘Fill’, ‘on’); % Set contour filling on
set(gcf, ‘InvertHardCopy’, ‘off’); % Prints background color when printing

Of course, if you change the default color scheme from jet to something else, you will need to change the ‘Color’ accordingly. You should have a resultant picture like this.

Ah, much better.

Ah, much better.

This is just really a temporary fix, someone should really dive into the code and fix this!

Using ImageMagick to convert a series of images to animated GIF

July 24, 2008 by atchieu

I use this a lot for research. I have a series of images in a postscript type format (e.g. EPS or PDF) and then I want to turn the time series of data into an animation. For this i use ImageMagick because it is a really nice command line tool for Unix operating systems to do batch type operations. You can even pipe it to C code! (Make sure you have it installed because it is not usually distributed with a bare Linux OS)

To do a simple conversion of images to an animated GIF we invoke the following

>convert -verbose -delay 20 -loop 0 -density 200 *.pdf output.gif

and we get a nice GIF file. This takes the files named *.pdf in the order that they are listed and makes a GIF out of them with a 20 hundreths of a second delay between each frame. The -loop 0 flag makes it loop indefinitely. You can put 3 in there to loop 3 times etc. The -density 200 flag specifies a DPI of 200 for the image. This is only really used when converting postscript images.

Animation of flow over a cylinder (vorticity) made from MATLAB + ImageMagick.

Animation of flow over a cylinder (vorticity) made from MATLAB + ImageMagick.