How to get a single PDF document from Doxygen?
When I generate Doxygen documentation in PDF format, I get plenty of different files with a single diagram in each.
Is it possible to obtain a single PDF document, organized as a book, roughly as the HTML version? Is it possible to get it automatically, i.e. without dealing manually with开发者_如何学编程 the latex files?Thank's!
See Converting a LaTeX document to a PDF document.
When Doxygen is finished processing, in the latex directory there's a file called 'refman.tex'.
There are three ways you can use that file to get 'a book' out of Doxygen:
LaTeX -> dvips -> ps2pdf
latex myfile
dvips myfile
ps2pdf myfile.ps
LaTeX -> dvipdfm
latex myfile
dvipdfm myfile
pdflatex (or pdftex for plain TeX)
pdflatex myfile
Assuming that doxygen is configured correctly, under Linux:
doxygen
cd latex
make
The generated file will be refman.pdf unless it's configured otherwise.
Using Doxygen 1.8.4+ (on Windows), there is also a make.bat script so you don't even need to open the command line.
Configure Doxygen for LaTeX output.
GENERATE_LATEX = YES LATEX_OUTPUT = latex OUTPUT_DIRECTORY =
Set up all your images for LaTeX output.
\image html application.jpg \image latex application.eps "My application" width=10cm
Run Doxygen.
- Run
{OUTPUT_DIRECTORY}\{LATEX_OUTPUT}\make.bat.
- Open
{OUTPUT_DIRECTORY}\{LATEX_OUTPUT}\refman.pdf
.
If refman.pdf is not created, run make.bat from a command window and read the errors.
Errors like:
'pdflatex' is not recognized as an internal or external command,
...
Mean that you do not have the prerequisites to run latex at all. Other errors may be due to missing latex packages or doxygen bugs causing invalid .tex files.
Once you have all the prerequisites installed, and a good version of doxygen, the simpler procedure should work every time.
Patel is right - you need to run Doxygen, then Latex of some sort to create the single doc.
For me, using Doxygen 1.7.3, the root file for the latex build seems to be "refman.tex".
Doxygen creates a Makefile, too, so if you've got make (I don't on my Win7 box), you can just type make
in the latex directory.
I point my TeXnicCenter app at refman.tex, and build that way.
Hope this helps,
-Matt
Other people didn't mention a detail:
For the pdflatex route to work, your current working directory needs to be the generated latex folder, otherwise you get errors like doxygen.sty cannot be found
.
I would add one additional advise. Don't ignore the latex warnings. pdflatex can fail to produce an output file as well as any meaningful errors.
I had a similar annoying situation and just fixing all the warnings helped to produce the correct output file without any further issues.
精彩评论