pseudocode code $$ vs $ #2460
Unanswered
HaydarJawad
asked this question in
Q&A
Replies: 4 comments 3 replies
-
I also tried to make it work, but to no avail. This is really weird. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thank you for trying, it's indeed strange !
…On Mon, 10 Jun 2024 at 15:35, George ***@***.***> wrote:
I also tried to make it work, but to no avail. This is really weird.
—
Reply to this email directly, view it on GitHub
<#2460 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AETEP7LWJRHFJETGPSMKGTDZGW2THAVCNFSM6AAAAABINQ4GG6VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4TOMRYGI2DS>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
2 replies
-
it works perfectly on
https://saswat.padhi.me/pseudocode.js/. if you copy and paste it.
only when you add $$ instead of $ it breaks down.
Regards
Haydar
…On Tue, 11 Jun 2024 at 18:57, George ***@***.***> wrote:
Also pasting it here so it is easier to copy:
% This algorithm checks the axioms of probability for an AI image classification model\begin{algorithm}\caption{Check Probabilities of Image Classification Model}\begin{algorithmic}\PROCEDURE{CheckProbabilities}{$sample\_space, event\_A, event\_B$}
\STATE $total\_images \gets$ \CALL{Length}{$sample\_space$}
\STATE $prob\_A \gets$ \CALL{Length}{$event\_A$} / $total\_images$
\STATE $prob\_B \gets$ \CALL{Length}{$event\_B$} / $total\_images$
\PROCEDURE{NonNegativity}{$prob$}
\IF{$prob \geq 0$}
\STATE \textbf{return} True
\ELSE
\STATE \textbf{return} False
\ENDIF
\ENDPROCEDURE
\PROCEDURE{Normalisation}{$prob\_A, prob\_B$}
\IF{$prob\_A + prob\_B = 1$}
\STATE \textbf{return} True
\ELSE
\STATE \textbf{return} False
\ENDIF
\ENDPROCEDURE
\PROCEDURE{Additivity}{$prob\_A, prob\_B$}
\IF{$prob\_A + prob\_B \leq 1$}
\STATE \textbf{return} True
\ELSE
\STATE \textbf{return} False
\ENDIF
\ENDPROCEDURE
\STATE $is\_non\_negative \gets$ \CALL{NonNegativity}{$prob\_A$} \AND \CALL{NonNegativity}{$prob\_B$}
\STATE $is\_normalised \gets$ \CALL{Normalisation}{$prob\_A, prob\_B$}
\STATE $is\_additive \gets$ \CALL{Additivity}{$prob\_A, prob\_B$}
\IF{$is\_non\_negative$}
\STATE \textbf{print}("Non-negativity check passed")
\ELSE
\STATE \textbf{print}("Non-negativity check failed")
\ENDIF
\IF{$is\_normalised$}
\STATE \textbf{print}("Normalisation check passed")
\ELSE
\STATE \textbf{print}("Normalisation check failed")
\ENDIF
\IF{$is\_additive$}
\STATE \textbf{print}("Additivity check passed")
\ELSE
\STATE \textbf{print}("Additivity check failed")
\ENDIF
\STATE \textbf{print}("Probability of image being a cat: ", $prob\_A$)
\STATE \textbf{print}("Probability of image being a dog: ", $prob\_B$)
\ENDPROCEDURE\end{algorithmic}\end{algorithm}
—
Reply to this email directly, view it on GitHub
<#2460 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AETEP7NQQTVKNZO5FLKSJP3ZG427XAVCNFSM6AAAAABINQ4GG6VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4TONBSGE4TG>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
1 reply
-
Got it, will release an issue there
Thank you
…On Tue, 11 Jun 2024 at 22:11, George ***@***.***> wrote:
Yes, I know. But since they created the package, they might have an idea
of what to do about it. Also we are using MathJax 3, which uses $$ instead
of $, as can be seen in its docs
<https://docs.mathjax.org/en/latest/basic/mathematics.html#tex-and-latex-input>,
and what I did was just use the setup recommended in pseudocode
documentation
<https://github.com/SaswatPadhi/pseudocode.js?tab=readme-ov-file#step-1c--for-mathjax-3x-users>
to integrate it.
—
Reply to this email directly, view it on GitHub
<#2460 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AETEP7JT6CZ7V4Y7XN7HKCLZG5RWTAVCNFSM6AAAAABINQ4GG6VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4TONBTG44TK>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
pseudo.txt
Hi Guys, not sure if you came across this issue. my pseudocode (belwo) works fine on $ on pseudocode.js editor . when i add $$ (as per advice) I lose 50% of it mainly the functions outside the curly brackets. any help appractetetd i have been spending hours with no success. Thank you
% This algorithm checks the axioms of probability for an AI image classification model$total_images \gets$ \CALL{Length}{$sample_space$}$prob_A \gets$ \CALL{Length}{$event_A$} / $total_images$ $prob_B \gets$ \CALL{Length}{$event_B$} / $total_images$
\begin{algorithm}
\caption{Check Probabilities of Image Classification Model}
\begin{algorithmic}
\PROCEDURE{CheckProbabilities}{$sample_space, event_A, event_B$}
\STATE
\STATE
\STATE
\ENDPROCEDURE
\end{algorithmic}
\end{algorithm}
Beta Was this translation helpful? Give feedback.
All reactions