How to read .rst files with Latex? - latex

I'm using javasphinx to generate a javadoc and it works, it generates the .rst files. I would like to create a PDF about these files, but I do not know how to import them into a .tex document to edit it.
javasphinx-apidoc -f -o . ../../src/main/java/

Finally I decided to use the .rst files to use them in a sphinx project for conversion to HTML http://www.sphinx-doc.org/en/stable/rest.html

Related

adding latex packages to doxygen can not work

I want to add some graphics to my doxygen generated output. For that I need to add some more packages:
\usepackage{tikz}
\usepackage{tikz-timing}
\usetikzlibrary{mindmap}
\usetikzlibrary{arrows,shadows}
The first two lines can be added to the Doxyfile with
EXTRA_PACKAGES = {tikz} \
{tikz-qtree}
But the 2 other ones are not.
Is there a chance to add a .tex file into the generated output files before pdflatex starts?
Adding
LATEX_EXTRA_STYLESHEET = packages.tex
will not work. It used my file but the output is broken. Seems that the packages are loaded at the wrong place or time.
The third thing i tried was writing a header file with
doxygen -w latex ....
This works and changing the header.tex file is ok, but this ends up in always in generating the header, patching the header, run doxygen again with own header. This is very stupid!
Any idea?
The EXTRA_PACKAGES option is equivalent to the \usepackage tag in Latex. This of course doesn't work for the \usetikzlibrary tags.
You can add your modified Latex header using the tag LATEX_HEADER in the Doxyfile, e.g.:
LATEX_HEADER = ./templates/latex/YourCustomHeader.tex
Then Doxygen pulls this Latex header file when generating the documentation. In this file you can add the used packages and libraries.
By the way: The custom stylesheet isn't used before you run the make.bat script, so it is sufficient if you copy the modified 'doxygen.sty' file to the output folder after Doxygen generated the Latex files, but before you run the 'make.bat' script to generate the PDF file. I do this by a script which first calls doxygen then copies the necessary files to the output folder and finally calls the 'make.bat' script...

read latex commands in rst files with sphinx

I'm pretty new with latex and I'm trying to combine latex rules within a sphinx project created with sphinx-quickstart.
I followed this guide in order to understand how to create custom commands in latex. Looking inside the sphinx generated .tex file I see that my custom stylesheet is correctly imported and read.
The question now is: how can I call the commands created in the latex-stylesheet in all the .rst files?
The aim is pretty simple: in the latex-stylesheet I define a role in order to have some red text that I want to call in the .rst files with :redtext:`this should be red`.
I tried with:
:command:text
.. class:
.. role:
but none worked.
Did someone have some useful suggestion?

use LDoc to generate document for whole lua project with index page

I want to generate documentation for my lua project
but with Ldoc i generate docs for each single lua file and the output file every time overwrite the index.html file .
So my question is how i can generate generate documentation for the whole project with index page that has link to the all pages.
I tried to do that with see tag but i don't know if i can use it to reference to another file not another part in the document
I used this:
ldoc.lua.bat pathtomyproject/filename.lua
The output is the default path myluainstallationpath/doc/index.html.
Try ldoc.lua.bat pathtomyproject instead. This will generate the docs for all the files in pathtomyproject and will generate an index.html that links to each file used in that folder..

Printing out Javadocs

Something that I've had a good hard look for and I have not been able to find, is how to efficiently obtain a hard copy of Javadocs? Obviously, one solution is simply to navigate to each page and execute a browser print, but there's got to be a better way! Do you guys have any ideas?
You can use DocBook Doclet (dbdoclet) to create DocBook XML from your JavaDoc Comments. The DocBook XML can then be transformed to PDF or (Singlepage-)HTML.
You can call the tool from the commandline. Point it to your class files and it will generate the DocBook XML. This works similar to the javadoc command which will generate the JavaDoc HTML. Example:
./dbdoclet -sourcepath ~/my-java-program/src/main/java -subpackages org.example
The result is a DocBook XML file in a dbdoclet subdirectory which can be used to create a PDF or HTML file. This can also be done from the command line; I am using the docbkx-maven-plugin for this.
You can do mass conversions with it, but it would require some time to make it work the way you want.

How to include LaTeX snippets directly in Doxygen comments?

I would like to be able to edit LaTeX parts of some Doxygen comments externally with some suitable editor. I would use that only for complex environments. To do that, I figured I can have LaTeX-only files and include them from Doxygen. I did create Doxygen aliases for \begin and \end to make the syntax compatible.
(For example, I know how to set-up Emacs/AUCTex for working with LaTeX snippets that have no preamble and document structure.)
Is there a way to include the contents of a .tex file inside a Doxygen comment? I look for something analogous to \htmlinclude, but for TeX files. Is there some way to emulate the functionality, given my requirements for having a TeX-only external source?
You may use something like
\latexonly
\input <file>
\endlatexonly
where <file> is the path to the file to include, either absolute or relative to the directory in which the latex documentation is generated.
Have you tried the \verbinclude command? This command includes any file verbatim in the documentation (in contrast to \include, which is used to include source files).
From the doxygen manual:
\verbinclude <file-name>
This command includes the file <file-name> verbatim in the documentation. The command is equivalent to pasting the file in the documentation and placing \verbatim and \endverbatim commands around it.
Files or directories that doxygen should look for can be specified using the EXAMPLE_PATH tag of doxygen's configuration file.
Edit: I just had a thought that you may wish to strip the preamble from your .tex file before including the rest of the file in the documentation. you could do this using the \dontinclude command which, together with the \line, \skip, \skipline, and \until commands allows you to include specific lines/blocks of a particular file. See the example in the \dontinclude documentation.

Resources