Doxygen Pdf Output



Doxygen is a utility that extracts documentation from source files. It can generate HTML output and/or PDF output as well as a few other types. In addition to basic information gathered from non-comment portions of the source files (i.e. Function names, parameters, etc.), it attempts to pick up comments and place them in the documentation where appropriate. And output is generated is devoid of any pdf.but includes html refman and latex format. I trust it is the latex format output coz the output is larger in size than.c source files. What is the correct way of generating pdf using doxygen.It would be extremely helpful for me to find the correct way of usage. Doxygen is the de facto standard tool for generating documentation from annotated C sources, but it also supports other popular programming languages such as C, Objective-C, C#, PHP, Java, Python, IDL (Corba, Microsoft,.

This article introduces the usage of Doxygen, and generates data structure for Linux kernel project.

Doxygen is the de facto standard tool for generating documentation from annotated C++ sources, but it also supports other popular programming languages such as C, Objective-C, C#, PHP, Java, Python, IDL (Corba, Microsoft, and UNO/OpenOffice flavors), Fortran, VHDL, Tcl, and to some extent D.

Doxygen can help you in three ways:

  • It can generate an on-line documentation browser (in HTML) and/or an off-line reference manual (in LaTeX) from a set of documented source files. There is also support for generating output in RTF (MS-Word), PostScript, hyperlinked PDF, compressed HTML, and Unix man pages. The documentation is extracted directly from the sources, which makes it much easier to keep the documentation consistent with the source code.

  • You can configure doxygen to extract the code structure from undocumented source files. This is very useful to quickly find your way in large source distributions. Doxygen can also visualize the relations between the various elements by means of include dependency graphs, inheritance diagrams, and collaboration diagrams, which are all generated automatically.

  • You can also use doxygen for creating normal documentation.

Doxygen is developed under Mac OS X and Linux, but is set-up to be highly portable. As a result, it runs on most other Unix flavors as well. Furthermore, executables for Windows are available.

Run the following command to install Doxygen:

You can also install doxygen from source code if you like to do so, refer to Doxygen Installation.

According to Getting started, the following figure shows the relation between the tools and the flow of information between them:

And here is the steps of using Doxygen:

  • Step 0: Check if doxygen supports your programming language
  • Step 1: Creating a configuration file
  • Step 2: Running doxygen
  • Step 3: Documenting the sources

Create Configuration File

Edit the configuration file linux-kernel-config and change the values of the following TAGs. Refer to Doxygen Configuration for more explanation of each TAG.

Run Doxygen in Linux Kernel

Create output directory by command:

Then, run Doxygen in directory ~/linux/kernel/ to check the data structure in Linux kernel:

Open Output in Browser

The output is generated in output directory ~/linux_doxygen/output. Check the output by Firefox:

For instance, here is the data structure of struct worker:



How to create PDF documentation with Doxygen/MiKTeX automatically
Let us suppose you need to make API Reference Guide with Doxygen as a PDF file.
You can do it in several steps:
1. Your development environment should have make tool.
Cygwin is a good one
2. Download distributives for the following software:
Doxygen - http://www.stack.nl/~dimitri/doxygen/
ghostscript http://pages.cs.wisc.edu/~ghost/
Miktex http://www.miktex.org/
or much active TeX Live
TeX Live 2013 is available over the Internet and on DVD. It was released on 18 June 2013
http://www.tug.org/texlive/
http://www.tug.org/texlive/acquire-netinstall.html
Graphviz http://www.graphviz.org/ - optionally
3. Install Doxygen. Now you are able to create a configuration file for your doxy-documentation. Use Doxywizard for that purpose: File -> Save as...
#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
#---------------------------------------------------------------------------
GENERATE_LATEX = YES
LATEX_OUTPUT = doxygen/latex
LATEX_CMD_NAME = latex
MAKEINDEX_CMD_NAME = makeindex
COMPACT_LATEX = NO
PAPER_TYPE = letter
EXTRA_PACKAGES =
LATEX_HEADER =
PDF_HYPERLINKS = YES
USE_PDFLATEX = NO
LATEX_BATCHMODE = NO
LATEX_HIDE_INDICES = YES
4. Install Ghostscript.
4.1 http://www.ghostscript.com/download/
Add ghostscript installation directory to your PATH environment variable
EG: C:Program Filesgsgs9.10bin
4.2 install Ghostview

5. Install Miktex (note that the release will be discontinued end of 2013).
OR
5. Install TexLive

Windows


download and unzip installation package and run
install-tl-advanced.bat


be patient it takes some time..
or
6. Update Miktex.
a. Pick appropriate shortcut (with Admin access for Win7)
b. Pick the nearest package repository

Once the version of miktex has been updated start the update over. This time you'll be able to select all packages

When Doxygen is finished processing,in the latex directory there's a file called 'refman.tex'.
There are three ways you can usethat file to get 'a book' out of Doxygen:
latex myfile
ps2pdf myfile.ps
latex myfile
·pdflatex (or pdftex for plain TeX)

On Ubuntu

Install LaTeX in Ubuntu
Note Updated to work with Ubuntu 10.04 and TeXLive 2009-7
TeX Live 2013 is available over the Internet and on DVD. It was released on 18 June 2013
Installing LaTeX in Ubuntu is actually quite straightforward,
but this guide is a good entry point for other LaTeX tips.
I assume that Ubuntu is already installed on the target machine.
Make sure that Ubuntu is fully updated by running the Update Manager from the System→Administration menu.
Install LaTeX by entering the following in a Terminal.
you can install the full distribution; it has the advantage that you most likely don't have to install any packages afterwards, but at the
cost of disk space - it installs more than a gigabyte of fetish rubber packages including language packages that you will probably never need. You may need to enter your
password to execute the command.
$> sudo apt-get install texlive-full
or
Alternatively you can select to install a complete distribution that only includes the language packages you need by specifying each package to install
$> sudo apt-get install texlive-base
$> sudo apt-get install texlive-binaries
$> sudo apt-get install texlive-common
$> sudo apt-get install texlive-latex-base
$> sudo apt-get install texlive-publishersDoxygen pdf output pdf
$> sudo apt-get install texlive-music
$> sudo apt-get install texlive-latex3
$> sudo apt-get install texlive-generic-recommended
$> sudo apt-get install texlive-omega
$> sudo apt-get install texlive-font-utils
$> sudo apt-get install texlive-plain-extra
$> sudo apt-get install texlive-formats-extra
$> sudo apt-get install texlive-games
$> sudo apt-get install texlive-metapost
$> sudo apt-get install texlive-generic-extra
$> sudo apt-get install texlive-pictures
$> sudo apt-get install texlive-math-extraDoxygen Pdf Output
$> sudo apt-get install texlive-extra-utils
$> sudo apt-get install texlive-latex-recommended
$> sudo apt-get install texlive-bibtex-extra
$> sudo apt-get install texlive-humanities
$> sudo apt-get install texlive-fonts-recommended
$> sudo apt-get install texlive-pstricks
$> sudo apt-get install texlive-science
$> sudo apt-get install texlive-fonts-extra-doc
$> sudo apt-get install texlive-latex-base-doc
$> sudo apt-get install texlive-doc-base
$> sudo apt-get install texlive-latex-recommended-doc
$> sudo apt-get install texlive-humanities-doc
$> sudo apt-get install texlive-pstricks-doc
$> sudo apt-get install texlive-science-doc
$> sudo apt-get install texlive-metapost-doc
$> sudo apt-get install texlive-pictures-doc
$> sudo apt-get install texlive-latex-extra-doc
$> sudo apt-get install texlive-publishers-doc
$> sudo apt-get install texlive-fonts-recommended-doc
$> sudo apt-get install texlive-doc-en
$> sudo apt-get install texlive-lang-danish
$> sudo apt-get install texlive-lang-ukenglish
$> sudo apt-get install texlive-lang-german
$> sudo apt-get install texlive-lang-french
$> sudo apt-get install texlive-lang-greek
$> sudo apt-get install feynmf
$> sudo apt-get install tex4ht
$> sudo apt-get install tex4ht-common
$> sudo apt-get install texinfo tex-common
$> sudo apt-get install libkpathsea5
$> sudo apt-get install libkpathsea-dev
$> sudo apt-get install pgf
$> sudo apt-get install dvipngOutput
$> sudo apt-get install latex-xft-fonts
$> sudo apt-get install xfonts-mathml
$> sudo apt-get install musixtex
$> sudo apt-get install musixlyr
$> sudo apt-get install latex-sanskrit
$> sudo apt-get install latex-xcolor
$> sudo apt-get install lacheck ps2eps
$> sudo apt-get install latex-beamer
$> sudo apt-get install cm-super
$> sudo apt-get install cm-super-minimal
$> sudo apt-get install context
$> sudo apt-get install musixtex-slurps
$> sudo apt-get install preview-latex-style
$> sudo apt-get install prosper
$> sudo apt-get install tipa
$> sudo apt-get install lmodern
$> sudo apt-get install lcdf-typetools
Note that the above installs language packages for Danish, Greek, German and French (English is part of the standard distribution and is always installed).
Now you have a full working LaTeX distribution installed and you can compile your LaTeX document by running
$> pdflatex filename.tex
That is actually how simple it is. I recommend to use either gedit (part of Ubuntu installation) or Eclipse (can be installed using the Synaptics Package Manager or apt-get) to write LaTeX documents, but
you can use whichever plain text editor you prefer.
7. Install Graphviz (optionally)
8. Create makefile with complete scenario.
####################################################################
#
# This is makefile for doxygen documentation.
#
####################################################################
include ./rules
ifeq ($(HOST_OS),WIN)
all:
cd $(PROJECT_PATH)/doc;
$(DOXYGEN_PATH)/doxygen Doxyfile > doxylog.log;
cp $(PROJECT_PATH)/doc/conf/Makefile $(PROJECT_PATH)/doc/latex/Makefile;
cp $(PROJECT_PATH)/doc/conf/pdflatex.input $(PROJECT_PATH)/doc/latex/pdflatex.input;
cd $(PROJECT_PATH)/doc/latex;
$(DOXYGEN_MAKE_PATH)/make;
$(RM) refman.pdf;
$(DOXYGEN_MAKE_PATH)/make;
cp $(PROJECT_PATH)/doc/latex/refman.pdf $(PROJECT_PATH)/doc/$(DOCNAME).pdf
clean:
$(RM) $(PROJECT_PATH)/doc/html/*.*;
$(RM) $(PROJECT_PATH)/doc/latex/*.*
endif
$(DOXYGEN_PATH)/doxygen is the path to the doxygen.exe file,
Doxyfile is the name of your doxy-configuration file,
doxylog.log is the output file to analyze warnings and errors,Doxygen to pdf
pdflatex.input is the helpful file with an answer to all questions. Just letter r. This answer helps you avoid manually typing using a keyboard.
r
$(PROJECT_PATH)/doc/conf/Makefile is the additional makefile especially to create manual.pdf file
With the TexLive package the following Makefile will be autognerated
all: clean refman.dvi
ps: refman.ps
pdf: refman.pdf
ps_2on1: refman_2on1.ps
pdf_2on1: refman_2on1.pdf
refman.ps: refman.dvi
dvips -o refman.ps refman.dvi
refman.pdf: refman.ps
gswin32c -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=refman.pdf -c save pop -f refman.ps
refman.dvi: refman.tex doxygen.sty
echo 'Running latex...'
latex refman.tex
echo 'Running makeindex...'
makeindex refman.idx
echo 'Rerunning latex....'
latex refman.tex
latex_count=5 ;
while egrep -s 'Rerun (LaTeX|to get cross-references right)' refman.log && [ $$latex_count -gt 0 ] ;
do
echo 'Rerunning latex....' ;
latex refman.tex ;
latex_count=`expr $$latex_count - 1` ;
done
refman_2on1.ps: refman.ps
psnup -2 refman.ps >refman_2on1.ps
refman_2on1.pdf: refman_2on1.ps
gswin32c -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=refman_2on1.pdf -c save pop -f refman_2on1.ps
clean:
Outputrm -f *.ps *.dvi *.aux *.toc *.idx *.ind *.ilg *.log *.out refman.pdf
and the last hint is using double building due to well known bug with page indexes
$(DOXYGEN_MAKE_PATH)/make;
$(RM) manual.pdf;
$(DOXYGEN_MAKE_PATH)/make;

Doxygen Image


simply typing make doc in the root project's directory.

Doxygen To Pdf


at the end of make all inside the latex sub folder you should see
(see the transcript file for additional information)

Doxygen Generate Pdf Output

Output written on refman.dvi (1873 pages, 6754516 bytes).

Doxygen Pdf Output


How To Combine Pdfs Without Acrobat

Transcript written on refman.log.

Doxygen Pdf Output Examples