SublimeText / LaTeXTools

LaTeX plugin for Sublime Text
https://latextools.readthedocs.io/
2k stars 362 forks source link

math preview issue with different commands #1572

Closed linzha0 closed 1 year ago

linzha0 commented 1 year ago

Hi, I am using sublime in ubuntu. when I using \prescript and \mathbf together, they are preview fine and build fine. But when I using \prescript and \bm together, the math preview is failed and pdf build still works fine.

The working code:

    \begin{align}\label{eq:ht}
    \prescript{G}{}{\mathbf{P}}_{f_j} 
      &= \prescript{G}{I_k}{\mathbf{T}} \prescript{I_k}{C_k}{\mathbf{T}} 
         \prescript{C_k}{}{\mathbf{P}}_{f_j} 
    \end{align}

The failed code:

    \begin{align}\label{eq:ht}
    \prescript{G}{}{\bm{P}}_{f_j} 
      &= \prescript{G}{I_k}{\bm{T}} \prescript{I_k}{C_k}{\bm{T}} 
         \prescript{C_k}{}{\bm{P}}_{f_j} 
    \end{align}

Check system: looks all good.

any suggestions will be perfect, thanks for the help.

ig0774 commented 1 year ago

You probably need to play around with the preview_math_template_packages. The math preview function doesn’t load the same packages as your preamble, but rather a selection of common, math-related packages (see here). The goal is to keep the list of packages used in previews minimal to reduce the time it takes to build the preview (IIRC, initially we loaded the whole preamble at one point but with realistic documents, generating the preview could take several minutes).

linzha0 commented 1 year ago

@ig0774 , thanks it solved my issue. just added \bm package for preview_math_template_packages and it's working.