when publishing, automatically calculate element size.