0

I want to include \s\p in the final documentation generated by doxygen. Below is an example comment block from a Java file:

/**
 * @section Sample sample
 * Need to use \s\p in the file.
 *
 */

and the resulting documentation should read Need to use \s\p in the file. However, when I run doxygen it replaces the \s\p with <computeruotput/> and the result in the doxygen XML output is Need to use <computeruotput/> in the file. How can I get \s\p in the final output rather than <computeruotput/>?

Chris
  • 44,602
  • 16
  • 137
  • 156
Doxyuser
  • 63
  • 3
  • 8

1 Answers1

1

This is because the backslash \ indicates a special command in doxygen. \p for example is used to format text with a typewriter font. To get \s\p in your output try using \\s\\p, i.e. replace a single backslash \ with two \\. \\ is a special command in doxygen which simply prints a single \.

albert
  • 8,285
  • 3
  • 19
  • 32
Chris
  • 44,602
  • 16
  • 137
  • 156
  • Thank you Chris for your valuable info. – Doxyuser Aug 10 '12 at 10:00
  • No problem. Don't forget to accept this answer if it has solved your problem, see [How does accepting an answer work?](http://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work). – Chris Aug 10 '12 at 10:03
  • I have just noticed that you already asked this as a [separate question](http://stackoverflow.com/q/11861109/623518). Please don't post duplicates, edit the first question if you need to change anything or add additional information. Duplicate questions are likely to be closed. Anyway, does my comment on that other question not help? – Chris Aug 10 '12 at 10:14
  • Thank you Chris for your valuable info which is very helpful. I am getting same problem when the comment in java contains , tags. Could you please let me know why it is creating instead of actual tags? Also Could you please let me know what are the other special characters/codes which will generate ? – Doxyuser Aug 10 '12 at 10:19
  • @Doxyuser All the special commands are in the link in my question and my previous comment. Have a look through that page to see what they all do. If you want to include tags like `` in your final output wrap them with the [`\verbatim`](http://www.stack.nl/~dimitri/doxygen/commands.html#cmdverbatim) and [`\endverbatim`](http://www.stack.nl/~dimitri/doxygen/commands.html#cmdendverbatim) commands, as I mentioned in my [comment to your previous post](http://stackoverflow.com/q/11861109/623518). – Chris Aug 10 '12 at 10:57