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

Support for ForEach and break #15

Closed rosshjb closed 7 months ago

rosshjb commented 10 months ago

Could you supportForEach, break and continue command?

ytliu74 commented 10 months ago

Oh, break and continue are actually supported, but I appear to have omitted them from auto-completion. Currently, ForEach is not supported. I will address these issues during winter break. Sorry about that.

rosshjb commented 9 months ago

Is there option to do not display end if, end for and end while...?

ytliu74 commented 9 months ago
  1. Hi, the \Break and \Continue now can be correctly shown in auto-completion. But I need to look into the the source code of pseudocode.js to help support Foreach
  2. In the plugin settings, you can toggle the "No End" option to control whether to show 'end'.
rosshjb commented 9 months ago

It seems that ForEach can be replaced with \in as a workaround.

\For{$e \in A$}
    \State{iterate A}
\EndFor

image

ytliu74 commented 9 months ago

This could indeed be a workaround. The original pseudocode.js also supports Forall, which might be an alternative to Foreach.

ytliu74 commented 7 months ago

Hi, ForAll is actually supported. And I believe it can be serve as the same meaning of ForEach. And ForAll is also included into the auto-complete now.