Konstantin Weitz
Konstantin Weitz

Reputation: 6422

Latex Javadoc generation

Is there a way to generate a latex document from my java sourcefile's documentation? I don't want to include LaTeX Elements in my documentation comments, I simply want to create LaTeX files instead of HTML.

Thanks

Upvotes: 6

Views: 8126

Answers (3)

Arie
Arie

Reputation: 12385

If you don't want to rely on any doclet dependency, but rather on a javascript one, you can just add the following javadoc param:

-header "<script type='text/javascript' src='http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'></script>"

and simply use clean latex inside your comments such as \(\sum_i a_i\) or \[\sum_i a_i\]

Upvotes: 1

Paŭlo Ebermann
Paŭlo Ebermann

Reputation: 74760

An alternative to Texdoclet is the ltxdoclet I created.

I think the main difference is that it also includes the source code, not only the Javadoc comments, though you can switch this off.

It is not very well documented on the github site - just download the code and do ant pdfdoku for an example output (ant latexdoku if you only want the LaTeX files). (It is documented in german, though.)

I really should add a readme file there.


For now, here is the jar file - download it somewhere, and then use

 javadoc -docletpath ltxdoclet.jar -doclet de.dclj.paul.ltxdoclet.DocletStart -help

to see a list of options available. (This will be in german, if you have no english locale. Prefix it with "LC_ALL=en_US" or similar on bash to get the english version, or have a look at help_en.txt instead if you don't know german.)

I'm working on a webpage with some more documentation, but I'm not sure when it will be ready.


Now we have a webpage, too. It links the jar file, and also as an example the javadocs when applied to itself.

Upvotes: 6

Michael Borgwardt
Michael Borgwardt

Reputation: 346309

Texdoclet seems to be what you need. As for how to use it: just like any other doclet.

Upvotes: 4

Related Questions