handle scalebox and tikzpicture