-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Solution for formatting algorithms #103
Comments
LaTeX solutions for reference: https://www.overleaf.com/learn/latex/Algorithms. Some are more like code blocks and some are more like tables. I think a code-like version would be easier with R markdown, perhaps with a pseudocode language engine. |
Quick demo of using pseudocode.js (https://saswat.padhi.me/pseudocode.js/) with R Markdown to mimic algorithm from LaTeX Maybe it could help. Otherwise texPreview is always an option to have an image version of a LaTeX rendering part. They have a nice engine. Hope it helps |
The pseudocode.js option looks like a good solution as returns proper HTML and MathJax. @ajgodfrey can you read the rendered algorithms in https://rpubs.com/cderv/pseudocodejs? I guess the style could also be controlled via CSS to be more like the HTML tables. |
Main JS library (https://saswat.padhi.me/pseudocode.js/) offers solution for more recent MathJaX or even KaTeX. So if one of those solution is better, I believe it can also be used with R Markdown. The example on rPubs is quite old - so it could also have been updated since then regarding accessibility. I see there is now support for MathJax 4 even: https://github.com/SaswatPadhi/pseudocode.js |
I'm not aware of a tool to format algorithms in markdown, possibly something could be provided by rjtools as a consistent solution.
As an example, I tried to format the algorithm from here: https://tex.stackexchange.com/a/452565/21118.
Apart from "do" and "end" not being highlighted it's not a bad solution. However it's not compatible with rjtools::rjournal_web_article:
What might be a better solution that could be recommended to authors?
The text was updated successfully, but these errors were encountered: