Doxygen commands cheatsheet
This page lists common Doxygen commands and brief descriptions. No styling — plain HTML only.
Comment block styles
/** ... */
— Javadoc-style block comment./*! ... */
— Qt-style block comment./// ...
— Triple-slash single-line comment (C++-style).//! ...
— Single-line Qt-style.
Basic tags
Command | Usage | Description |
---|---|---|
\file / @file | \file filename | Document the file (overrides file brief). |
\brief / @brief | \brief Short description | Short one-line description shown in summaries. |
\details / @details | \details Longer text... | Longer, detailed description. |
\param / @param | \param[in] name Description | Describe function parameters. Direction specifiers: in , out , in,out . |
\return / @return | \return Description | Describe return value. |
\retval / @retval | \retval value Description | Document specific return values (enum or int codes). |
\see / @see | \see OtherFunction | Reference another symbol or topic. |
\note / @note | \note Important note | Small note shown in documentation. |
\warning / @warning | \warning Dangerous | Display a warning callout. |
\author / @author | \author Name | Author of the file or module. |
\version / @version | \version 1.2 | Version string. |
\date / @date | \date 2025-10-13 | Date associated with the documentation. |
\deprecated / @deprecated | \deprecated Use NewFunction() | Marks API as deprecated and suggests alternatives. |
\todo / @todo | \todo Implement this | List a TODO item to appear in the TODO list. |
Grouping and modules
Command | Example | Purpose |
---|---|---|
\defgroup | \defgroup grpname "Group Title" | Create a named group/module. |
\ingroup | \ingroup grpname | Assign a symbol to a group. |
\addtogroup | \addtogroup grpname "Title" | Add subsequent documentation to the group. |
\weakgroup | \weakgroup name | Create a group without showing it in module index (less common). |
Sections & subsections (within comments)
\section label Title
— top-level section.\subsection label Title
— subsection.\subsubsection label Title
— sub-subsection.
Formatting and inline markup
Markup | Example | Result |
---|---|---|
\c | \c value | Inline code or identifier. |
\b | \b bold text | Bold text (simple emphasis). |
\a | \a ampersand | Alternative emphasis (rare). |
\em | \em emphasized | Emphasis / italics. |
\verbatim | \verbatim ... \endverbatim | Preformatted block (no markup processing). |
\code | \code ... \endcode | Formatted code block (supports syntax highlighting). |
\f$ ... \f$ | \f$ a^2 + b^2 = c^2 \f$ | Inline mathematical formula (LaTeX-like). |
\f[ ... \f] | \f[ E = mc^2 \f] | Displayed (block) math. |
\n | Line1\nLine2 | New line in some contexts. |
\link ... \endlink | \link URL Text \endlink | Creates a link with text. |
\a ref | See \ref other_func | Reference another documented symbol. |
Special blocks
- Example:
\code ... \endcode
or\snippet file start_marker end_marker
- Inline formulas:
\f$ ... \f$
and block math\f[ ... \f]
. - HTML-only:
\htmlonly ... \endhtmlonly
— include raw HTML in output where supported. - Man page:
\manonly ... \endmanonly
- LaTeX-only:
\latexonly ... \endlatexonly
Including images and files
Command | Example | Notes |
---|---|---|
\image | \image html figure.png "Caption" | Include an image; first argument is format (html, latex, rtf). |
\include | \include file.txt | Include a file verbatim into the documentation. |
\verbinclude | \verbinclude file.cpp | Include file as verbatim/code. |
\snippet | \snippet source.cpp marker_start marker_end | Include a portion of a source file marked by special comments. |
Cross-references and anchors
\anchor name
— create a location you can\ref
to.\ref symbol
— link to another documented symbol.\link url text \endlink
— create a link to an external URL with text.
Advanced / miscellaneous
\cond
/\endcond
— conditionally include text.\if
/\endif
— preprocessor-like conditional content.\internal
/\endinternal
— content only for internal documentation.\addindex{term}
— add an entry to the index.\dontinclude
— exclude a file region from inclusion.\htmlonly
,\latexonly
,\rtfonly
— format-specific sections.
Examples (short)
/** * \file example.h * \brief Example header * * Detailed description goes here. * \author Jane Doe * \date 2025-10-13 */ /** * \brief Compute the sum * \param[in] a first value * \param[in] b second value * \return sum of a and b */ int add(int a, int b);
Further reading
Refer to the official Doxygen manual for complete coverage and advanced features.