Logical Structure Detection for Heterogeneous Document Classes