[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Generating C++ documentation in LaTeX Format



Francois Fayard <fayard@ens.fr> writes:
FF> I need to document a lot of C++ code in LaTeX. What kind of tools
FF> are available for that. I'm thinking of both scripts that creates
FF> a LaTeX file from a C++ code (To start the documentation), or
FF> a LaTeX style.

There are a couple of options, depending on what you actually want.
Someone else already mentioned doxygen; it's a system somewhat similar
to javadoc that parses specially formatted comments in your source
code to create an API reference.  doxygen has both HTML and LaTeX
backends, and can produce various sorts of interesting class graphs.

Another very different alternative is one of the Web-like systems;
I've worked on a couple of projects that have used noweb (Debian
nowebm package).  noweb lets you embed bits of code into your
"document":

<<noweb code sample>>=
class sample
{
public:
  <<sample public methods>>
};
@

You can also easily insert verbatim references to things like
[[sample_method]], and insert code blocks verbatim into other blocks.

<<sample public methods>>=
void sample_method(void);
@

The downside of using a Web-like system is that your "source document"
is neither TeXish nor C++ish, but rather somewhere in between; you
need to run notangle to produce your source code, and noweave to
produce HTML or LaTeX document output.  I think there's a version
closer to the original Web that actually tries to do some formatting
of your source code, but I haven't looked into it; one of noweb's
strengths is its simplicity.

-- 
David Maze         dmaze@debian.org      http://people.debian.org/~dmaze/
"Theoretical politics is interesting.  Politicking should be illegal."
	-- Abra Mitchell



Reply to: