fixed plugin and detection for latex