Doxygen: \code tag kills indentation
I had the same problem and it turned out due to the use of a custom HTML_STYLESHEET
: our CSS file defined its own styles for div.fragment
used by Doxygen to wrap code snippets which didn't include white-space: pre
. Adding it fixed the problem.
If you are using Doxygen 1.8.1.1 or older the indentation will be respected. Doxygen Release 1.8.1.2 removes leading indentation shared by the @code lines. Check the Change log released on 12-07-2012.