1

I am working on a library of mathematical functions. As part of the Scaladoc, I would like to include the formula of each function. E.g.

/**
 * Sum squared function:
 * \(f(x) = \sum_i^n x_i^2\)
 */
def sumSquared[T](x: Seq[T]) = x.map(xi => xi * xi).sum

I am using MathJax to display the formula. It works if I manually edit the generated html to include the required MathJax javascript, but I want to automate this.

So far the only solutions I've found are:

If these are the only options then okay, however I'd like do this using only sbt (no external scripts). Is there a way to do this by maybe setting scalacOptions as in How to ScalaDoc?

Community
  • 1
  • 1
robgarden
  • 11
  • 2

1 Answers1

1

I added an answer to Is there a way to include math formulae in Scaladoc? with an sbt task that does the job, but still using MathJax.

I don't know of any code that would actually replace the latex formula to images in the generated api files

Community
  • 1
  • 1
Juh_
  • 14,628
  • 8
  • 59
  • 92