Blog Moved

Monday, August 15, 2011

Natbib's Same Name Problem

When working yesterday on my book on Frege's Grundgesetze, I suddenly realized that I had a problem with the bibliography. I have references to papers written by both Charles Parsons and Terence Parsons, one each from 1995. These were coming out in the citations as: (Parsons, 1995a) and (Parsons, 1995b). These are at least unambigious, but they are not what one would want. And, indeed, even if I hadn't had papers published the same year, I'd still be getting: (Parsons, 1965) and (Parsons, 1995), which still isn't what I'd want. What I'd want is: (Parsons, C., 1965) and (Parsons, T., 1995).

Googling turned up several complaints about this, which I would characterize as a bug in the LaTeX package natbib, that being what has traditionally been used with LaTeX for author-year references. Many people now are using biblatex, of course, and perhaps this bug has been resolved there. But I already have a custom bibliography style written for natbib, so I'm not sure I want to do the work to switch over to biblatex yet, anyway.

So, I got to work to solve the problem. My goal was to modify the standard plainnat.bst style so that it would give me the kinds of citation labels I want. It actually turned out not to be that difficult, given that I've worked before with the strange postfix stack language that is used to write BibTeX styles in developing my own bst file. I've posted the results here:
The former is the modified bst file; the latter is a diff against plainnat.bst, so that you can see exactly what I've done. The changes should be fairly easy to port to other bst's---I hope so, since I still need to port them to my own bst---since they are pretty much confined to one part of the file.

There are limits to the approach. First, I deal only with authors and editors. Second, I deal only with single name cases. But I also provide ways to override the calculated labels, so that you can force a certain label if you need to do so. There are two new entry fields for this purpose:
  1. dupelabel
    Defines a label that will be used if a duplicate author is found, e.g.:
    dupelabel = {Parsons, Ch.}
    dupelabel = {Parsons, Ca.}
    might be put in entries by Christopher Parsons and Carrie Parsons, respectively. 
  2. forcelabel
    Defines the label we will use, period. 

Friday, October 22, 2010

Linux LVM

Instructions for creating a new file system via LVM.
I'll assume we have two disks we're going to use, /dev/sde and /dev/sdf.
All of this has to be done as root.
  1. Create partitions on both disks using fdisk. Set the type to 8e (Linux LVM). These may be the full disk, or not. I'll assume these are now /dev/sde1 and /dev/sdf1
  2. Create physical volumes:
    # pvcreate /dev/sde1
    # pvcreate /dev/sdf1
  3. Check our work:
    # pvdisplay
  4. Create a volume group:
    # vgcreate NameOfGroup /dev/sde1 /dev/sdf1
  5. Check our work:
    # vgdisplay
  6. Create the logical volume, which is what Linux will see as if it were a partition:
    # lvcreate  -l 100%VG -n NameOfVolume NameOfGroup
    Note that the -l option can be provided in many forms. This one says to assign 100% of the space in the volume group to this logical volume.
  7. Check our work:
    # lvdisplay
  8. Create the filesystem:
    # mke2fs -j -L VolumeLabel /dev/NameOfGroup/NameOfVolume
  9. Now the new filesystem can be mounted in the usual ways.
Some good links for more info:

Initial Post

This blog is mostly so I can record things I tend to forget. Most of them will be about Linux, but some may be about other things.