ytliu74 / obsidian-pseudocode

An obsidian plugin that helps to render a LaTeX-style pseudocode inside a code block.
MIT License
84 stars 4 forks source link

Latex within Pseudocode does not render properly for $ symbol, renders as `undefined` #5

Closed altundasbatu closed 1 year ago

altundasbatu commented 1 year ago

When adding the sample pseudocode provide, the rendering converts $ to undefined as seen in the attached screenshot.

Used pseudocode:

    ```pseudo
    \begin{algorithm}
    \caption{Quicksort}
    \begin{algorithmic}
      \Procedure{Quicksort}{$A, p, r$}
        \If{$p < r$}
          \State $q \gets $ \Call{Partition}{$A, p, r$}
          \State \Call{Quicksort}{$A, p, q - 1$}
          \State \Call{Quicksort}{$A, q + 1, r$}
        \EndIf
      \EndProcedure
      \Procedure{Partition}{$A, p, r$}
        \State $x \gets A[r]$
        \State $i \gets p - 1$
        \For{$j \gets p$ \To $r - 1$}
          \If{$A[j] < x$}
            \State $i \gets i + 1$
            \State exchange
            $A[i]$ with $A[j]$
          \EndIf
        \State exchange $A[i]$ with $A[r]$
        \EndFor
      \EndProcedure
      \end{algorithmic}
    \end{algorithm}


Renders as:
![image](https://github.com/ytliu74/obsidian-pseudocode/assets/8697912/bfaeca8d-cbbf-449c-98c6-c6a32bcaaa18)
ytliu74 commented 1 year ago

OHHH! This is a critical bug. I apologize for the inconvenience and I am currently working on resolving it.

ytliu74 commented 1 year ago

I have fixed the bug and created a new release. Please update to the latest version and let me know if everything is working as expected.

ytliu74 commented 1 year ago

For now, I will be closing this issue. If you encounter any further problems, please do not hesitate to inform me.