Add a little bit of revenue. Subtract partners. Control costs. That math helped a number of California law firms boost their profitability in 2012 despite shaky demand for legal services.

At Irell & Manella, a 5 percent increase in gross revenue and a 9 percent drop in partners contributed to a 19 percent surge in profits per partner. As Munger, Tolles & Olson’s partnership contracted, its profits per partner shot up 16 percent — more than triple the rise in revenue. At Orrick, Herrington & Sutcliffe, a 2 percent increase in revenue and a 5 percent drop in partners combined for a 10 percent jump in profits per partner.