Class: Javascript2latex
- Inherits:
-
Object
- Object
- Javascript2latex
- Defined in:
- lib/javascript2latex.rb
Overview
Utility class for creating a latex expression from a JavaScript expression.
Defined Under Namespace
Classes: ExpressionNode
Class Method Summary collapse
-
.make_tex(javascript_expression) ⇒ string
Converts the given mathematical expression written in JavaScript into latex syntax.
Class Method Details
.make_tex(javascript_expression) ⇒ string
Converts the given mathematical expression written in JavaScript into latex syntax.
259 260 261 262 263 264 265 266 267 |
# File 'lib/javascript2latex.rb', line 259 def self.make_tex(javascript_expression) begin root = ExpressionNode.new(javascript_expression) return "$#{root}$" rescue return '$$' Rails.logger.error 'Invalid JavaScript expression' end end |