Skip to content

Conversation

nadr0
Copy link
Contributor

@nadr0 nadr0 commented Jul 12, 2016

Here is a quick sample of MathJax working. I am using their servers for the rendering of MathJax because the library is rather large. Whenever an algorithm is clicked it loads all the data and the last call is to render the MathJax. Also if this goes through I can help change each algorithm to use latex for the time/space complexity. I only changed a few to see if we want to use MathJax.

Notes:
You will need to add an extra \ for every \ when writing the latex in a javascript string. I currently do not know a work around for this.
Latex: $$O(n\,(log\,n)(log\,log\,n))$$
Javascript Version: $$O(n\\,(log\\,n)(log\\,log\\,n))$$

You can also write latex inside the algorithm description, i.g.

{
  "Knight’s tour problem": "A knight's  $$LATEX CAN GO HERE! \\Theta$$ tour is a sequence of moves of a knight on a chessboard such that the knight visits every square only once. If the knight ends on a square that is one knight's move from the beginning square (so that it could tour the board again immediately, following the same path), the tour is closed, otherwise it is open.",
  "Complexity": {
    "time": "Worst $$O(8^{N^{2}})$$",
    "space": "Worst $$O(N^2)$$"
  },
  //etc...
}

@nadr0 nadr0 mentioned this pull request Jul 12, 2016
@TornjV TornjV merged commit dc1ceda into algorithm-visualizer:master Jul 12, 2016
64json pushed a commit that referenced this pull request Jul 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants