Adjusting layout for top document