Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Controlling Doxygen's LaTeX output for making PDF documentation

I'm using Doxygen to generate documentation for my code. I need to make a PDF version of this and using Doxygen's LaTeX output appears to be the way to do it.

However I've run into a number of annoying problems, and not knowing anything about LaTeX previously haven't really got much of an idea on how to approach them, and the countless references for LaTeX related things are not much help...

I worked out how to create a custom style thing in a sty file and how to get Doxygen to use it. After a lot of searching I found out how to set the page margins etc. through this, and I'm guessing the perhaps this is the file I want for doing the other things I want, but I cant seem to find any commands for doign what I want :(

  1. The table of contents at the start of the document contains a lot of items Id rather it didn't as it makes the contents very long. Is there some way to limit this contents to just say the first two levels, rather than having entries for every single individual function, variable, etc.? Id quite like to keep all the bookmarks however. I did try the "COMPACT_LATEX" option but as well as removing items on the contents pages, it removed the bookmarks and the member lists at the start of each section, which I do really want to keep.

  2. Is there a way to change the order of things, like putting the full class description at the start of the section, rather than after all the members and attributes?

like image 634
Fire Lancer Avatar asked Feb 28 '10 00:02

Fire Lancer


1 Answers

Wow, that's kind of evil of Doxygen.

Okay, to get around the tocdepth counter problem, add the following line to your .sty file:

\AtBeginDocument{\setcounter{tocdepth}{2}}% or whatever level you want

You can set the PDF bookmarks depth to a separate value:

% requires you \usepackage{hyperref} first
\hypersetup{
  bookmarksdepth = section, % of whatever level you want
}

Also note that if you have a list of figures/tables, the tocdepth must be at least 2 for them to show up.

I don't see any way of rearranging those items within the LaTeX files---Doxygen just barfs them out there, so we can't do much. You'll have to poke around the Doxygen documentation to see if there's any way to specify the order I guess. (Here's hoping!)

like image 177
godbyk Avatar answered Sep 17 '22 00:09

godbyk