3
votes

Before I'm going into the details, short brief first:

I'm trying to customize the pdf document structure generated by doxygen. I'm already doing this for html and chm output, but for pdf it does not work.
My primary question is, is this restriction by design or am i missing something?
If this is by design, is there any other way I could go starting from doxygen, resulting in a customized pdf document?

Here are the details:

We are using doxygen to generate sourcecode documentation for a C API, which is also wrapped using C++, C# and Java.
We want to document all these languages in one single document, but structure it by language. In order to achieve this we customized the document structure using a DoxygenLayout.xml file in the following way:

  • First come a few pages of descriptive text, that applies to all languages, we call this part "user manual".
  • Second comes the API documentation, which is structured into the different languages.

In other words, we completely disable the standard structure and define our own. The layout definition looks pretty much like in this simplified example:

  <navindex>
    <tab type="mainpage" visible="yes" title="My Project"/>
    <tab type="pages" visible="no" title="" intro=""/>
    <tab type="modules" visible="no" title="" intro=""/>
    <tab type="namespaces" visible="no" title="">
      <tab type="namespacelist" visible="no" title="" intro=""/>
      <tab type="namespacemembers" visible="no" title="" intro=""/>
    </tab>
    <tab type="classes" visible="no" title="">
      <tab type="classlist" visible="no" title="" intro=""/>
      <tab type="classindex" visible="no" title=""/> 
      <tab type="hierarchy" visible="no" title="" intro=""/>
      <tab type="classmembers" visible="no" title="" intro=""/>
    </tab>
    <tab type="files" visible="no" title="">
      <tab type="filelist" visible="no" title="" intro=""/>
      <tab type="globals" visible="no" title="" intro=""/>
    </tab>
    <tab type="examples" visible="no" title="" intro=""/>  

    <tab type="usergroup" title="User Manual">
        <tab type="user" title="Page 1" url="@ref page1"/>
    </tab>

    <tab type="usergroup" title="API documentation">
        <tab type="usergoup" title="C">
            <tab type="user" title="SomeFunction" url="@ref SomeFunction" />
            <tab type="user" title="AnotherFunction" url="@ref AnotherFunction" />
        </tab>
        <tab type="usergoup" title="C#">
            <tab type="usergroup" title="A.Class1">
                <tab type="user" title="SomeFunction" url="@ref A.Class1.SomeFunction" />
            </tab>
            <tab type="usergroup" title="B.Class2">
                <tab type="user" title="AnotherFunction" url="@ref B.Class2.AnotherFunction" />
            </tab>
        </tab>
        <tab type="usergoup" title="Java">
            <tab type="usergroup" title="com.xyz.A.Class1">
                <tab type="user" title="SomeFunction" url="@ref com.xyz.A.Class1.SomeFunction" />
            </tab>
            <tab type="usergroup" title="com.xyz.B.Class2">
                <tab type="user" title="AnotherFunction" url="@ref com.xyz.B.Class2.AnotherFunction" />
            </tab>
        </tab>
    </tab>
</navindex>

This works perfectly fine for chm and html output, but unfortunatly seems to be completely ignored for the latex and docbook output, which could be used to generate pdf. The documentation for the layoutfile implies that it should work independently from the used output:

# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
# by doxygen. The layout file controls the global structure of the generated
# output files in an output format independent way. To create the layout file
# that represents doxygen's defaults, run doxygen with the -l option. You can
# optionally specify a file name after the option, if omitted DoxygenLayout.xml
# will be used as the name of the layout file.
#
# Note that if you run doxygen from a directory containing a file called
# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
# tag is left empty.
LAYOUT_FILE            = "DoxygenLayout.xml"
1

1 Answers

0
votes

Doxygen produces a number of files in the latex directory, in this case the most notable are:

  • refman.tex, with a number of settings and the include of the different chapters, probably most suitable for the things you want.
  • doxygen.sty with a the settings doxygen uses. One can modify this file (not really advise), one can also add extra style sheets by means of the configuration tag LATEX_EXTRA_STYLESHEET where one overrules (e.g. by renew commands) default commands.

Noteworthy are also settings like LATEX_HEADER, LATEX_FOOTER,EXTRA_PACKAGES`, see the documentation (chapter Configuration in http://www.doxygen.nl/manual/) for these and more possibilities.

For docbook output the current version, version 1.8.15, might work a bit better but there is no special "stylesheett" for docbook.