简体   繁体   English

Latex Javadoc生成

[英]Latex Javadoc generation

Is there a way to generate a latex document from my java sourcefile's documentation?有没有办法从我的 java 源文件的文档中生成 latex 文档? I don't want to include LaTeX Elements in my documentation comments, I simply want to create LaTeX files instead of HTML.我不想在我的文档注释中包含 LaTeX 元素,我只想创建 LaTeX 文件而不是 HTML。

Thanks谢谢

An alternative to Texdoclet is the ltxdoclet I created. Texdoclet 的替代品是我创建的ltxdoclet

I think the main difference is that it also includes the source code, not only the Javadoc comments, though you can switch this off.我认为主要区别在于它还包括源代码,而不仅仅是 Javadoc 注释,尽管您可以将其关闭。

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 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现在,这里是jar 文件- 在某处下载,然后使用

 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.) (如果您没有英语语言环境,这将是德语。在 bash 上使用“LC_ALL=en_US”或类似前缀来获取英语版本,或者如果您不懂德语,请查看help_en.txt 。)

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 .它链接了 jar 文件,并且还作为示例将javadocs 应用于自身

Texdoclet seems to be what you need. Texdoclet似乎是您所需要的。 As for how to use it: just like any other doclet .至于如何使用它: 就像任何其他 doclet 一样

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:如果您不想依赖任何 doclet 依赖项,而是依赖 javascript 一个,则只需添加以下 javadoc 参数:

-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\]并且只需在您的评论中使用干净的 Z25F7E525B5C0641E1EB1FB3BDEBEB15B5Z ,例如\(\sum_i a_i\)\[\sum_i a_i\]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM