adding latex packages to doxygen can not work - latex

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...

Related

How to read .rst files with 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

Doxygen for Lua

I am trying to get lua2dox running but it's not generating the examples.
What I do is download the zip file and download doxygen 1.8.8. I'll then place the doxygen.exe file into the extracted content od lua2dox and simply call
> doxygen.exe
in my command line. The docs/ directory is getting created but it does not look like the example docs as it is shown e.g. here.
The generated documentation has just the list of files - and that's it.
I've checked the Doxygen file but I can't find anything that seems to be wrong.
What I am not sure about is if lua2dox_filter.bat is actually getting used by doxygen. As I run it, I do not see some output from this script, not even if I add some echo but maybe it's just doxygen itself suppressing it.
Two things: The only modification I had to make was to lua2dox_filter.bat. In order to run Lua it has to prompt lua5.1 instead of just lua as it is in the script.
Also the Doxyfile didn't point to the examples/lua directory so I hat to set it:
INPUT = examples/lua/
Answer: Don't use Doxygen 1.8.8.
I didn't test it with later versions but it worked with Doxygen v1.8.2. Apparently things broke later on for lua2dox.

Latextools does not display cite keys if .tex file is in subfolder

The wonderful LatexTools plugin for Sublime Text 2 autocompletes references when using \cite. Everything works perfectly when the .bib filed is in the same folder as the .tex file, and the .tex file includes the \bibliography command.
Unfortunately, for my larger projects, I keep my chapter .tex files in a subfolder. The \bibliography command only appears once in the master .tex file, and the .bib file lives with the master .tex file.
Is there a way to "point" LatexTools to my bibliography for all of the sub .tex files which do not include the \bibliography command, so that I can get autocomplete working?
LatexTools searches for a root file that is specified in the subfile you are editing. When it finds such a file, it will look for bibliography related commands there and load the corresponding data. You provide the root file by placing the line
%!TEX root = ../my_main_file.tex
in the (first line of the) subfile.

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.

Compiling LaTex bib source

I am writing my thesis in Latex, and I have the references in an own thesis.bib
file which look as follows
#Article{xxx,
author = "D.A. Reinhard",
title = "Case Study",
year = "1985",
}
and I reference them in my main document as ~\cite{xxx}
When I compile then the main document with: pdflatex main.tex than
it shows me question marks instead of the proper references to the bibliography.
Do I also need to compile the bib source on its own? If yes, can somebody please
tell me the command for Linux
Many thanks!
You need to compile the bibtex file.
Suppose you have article.tex and article.bib. You need to run:
latex article.tex (this will generate a document with question marks in place of unknown references)
bibtex article (this will parse all the .bib files that were included in the article and generate metainformation regarding references)
latex article.tex (this will generate document with all the references in the correct places)
latex article.tex (just in case if adding references broke page numbering somewhere)
You have to run 'bibtex':
latex paper.tex
bibtex paper
latex paper.tex
latex paper.tex
dvipdf paper.dvi
I am using texmaker as the editor.
you have to compile it in terminal as following:
pdflatex filename (with or without extensions)
bibtex filename (without extensions)
pdflatex filename (with or without extensions)
pdflatex filename (with or without extensions)
but sometimes, when you use \citep{}, the names of the references don't show up. In this case, I had to open the references.bib file , so that texmaker could capture the references from the references.bib file. After every edition of the bib file, I had to close and reopen it!! So that texmaker could capture the content of new .bbl file each time. But remember, you have to also run your code in texmaker too.
Just in case it helps someone, since these questions (and answers) helped me really much; I decided to create an alias that runs these 4 commands in a row:
Just add the following line to your ~/.bashrc file (modify the main keyword accordingly to the name of your .tex and .bib files)
alias texbib = 'pdflatex main.tex && bibtex main && pdflatex main.tex && pdflatex main.tex'
And now, by just executing the texbib command (alias), all these commands will be executed sequentially.

Resources