Fix resizing window in latex mode