add open-pdf function and enable latex preview mode at startup.