August 13, 2009, 1:13 pm
I’m using Doxygen to document some C source code. This tool generates multiple sections in the Latex document (one for each variable). These sections are empty (i.e. they only have a title, no text). The problem is that Latex doesn’t automatically break the page when it should, and the section titles go beyond the margins (in fact many titles are not displayed at all).
To solve the issue add the following code to the document’s preamble:
1
2
3
| \makeatletter
\renewcommand\@afterheading{}
\makeatother |
August 12, 2009, 1:01 pm
Doxygen generates collaboration diagrams in EPS format. If you want to include these graphics in a Latex document that produces PDF output, you have to convert them, for example, to PNG format. To make the conversion we’re going to use Convert. Convert provides image conversion between different formats and belongs to the ImageMagick suite of tools. Just navigate to the directory containing the EPS files and type this command:
for var in `ls|grep eps`;do convert $var ${var}.png;done
This produces PNG images with an .eps.png extension. If you want to leave just the png extension run this python script:
1
2
3
4
| #!/usr/bin/python
import os
for fname in os.listdir(os.getcwd()):
os.rename(fname, fname.replace('.eps.png','.png')) |
July 14, 2009, 2:06 pm
Today I tried to extract documentation from source code programmed in Visual Studio using doxygen. The Latex document didn’t compile correctly because of encoding problems. Googling for a solution I’ve discovered that Visual Studio may include some strange characters in the saved files.
To fix the files I’d recommend using an Hexadecimal Editor. In my case I’ve chosen hexedit. Opening the file with Hexedit shows those unwanted characters at the beginning of the file. By removing them and saving the file the problem with Latex disappeared. Hope it helps in case someone runs into the same issue.
