A generic method for formulating pulp and paper optimization problems is presented. Two ongoing projects in the framework of the DOTS project illustrate the method: optimization of sizing quality at a specialty paper mill, and optimization of the water and broke systems at a coated paper mill. Explicit and implicit formulations are compared, and different usages of external simulators in conjunction with optimization are discussed. The problems are solved using MATLAB/TOMLAB. Some results from different optimization algorithms are also presented.