3
votes

I'm attempting to convert latex to pdf, using doxygen generated latex files. I am using Doxygen 1.8.7. However, I keep getting this error:

!LaTex Error: Unknown float option 'H'.
...
1.6 \begin<figure>[H]

I've narrowed it down to a .tex file, which contains the following:

\hypertarget{group___a_m_s___common}{\section{A\+M\+S\+\_\+\+Common}
\label{group___a_m_s___common}\index{A\+M\+S\+\_\+\+Common@{A\+M\+S\+\_\+\+Common}}
}
Collaboration diagram for A\+M\+S\+\_\+\+Common\+:
 \nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=334pt]{group___a_m_s___common}
\end{center}
\end{figure}
\subsection*{Modules}
\begin{DoxyCompactItemize}
\item 
\hyperlink{group___common___error___codes}{A\+M\+S Common Error Codes}
\end{DoxyCompactItemize}


\subsection{Detailed Description}

Where do I go from here? Am I right in saying that it's looking for an image that it can't find?

2

2 Answers

2
votes

This does indeed seem to be an issue with the float package. I had the same problem. However, just adding EXTRA_PACKAGES=float didn't fix it for me. I finally found this page which describes a conflict between the fixltx2e package and the float package which generates this error about the unknown H option. So, I commented out line 11 where it says \usepackage{fixltx2e} in the doxygen generated tex file (called refman.tex for me). Then it converted to pdf without any further problems.

2
votes

As the latex error says, it's not looping for an image it can't find, but rather encountered an option to a floating element it doesn't understand. The 'H' option for float placement forces a figure to appear exactly at the place it appears in the latex code and essentially not to float. It requires the "float" package.

Thus in order to get your code working, add the following to the preamble:

\usepackage{float}

I'm not sure how to tell Doxygen that this package is required so as to not have to touch the automatically generated latex files.. In fact according to the doxygen documentation here adding the following to your configuration file should do the trick:

EXTRA_PACKAGES=float

There's a discussion on the 'H' option over here and a rather detailed discussion on latex float placement in general here.