1
votes

The doxygen \image tag documentation specifies that both height and width attributes can be given yet only the first attribute is accepted. The second attribute is output to the resultant XML as descriptive text.

I would like to specify both image attributes as:

\image rtf myimage.png width=100px height=250px

The link to the documentation where it states that both attributes are permitted is: http://www.doxygen.nl/manual/commands.html#cmdimage

Note the relevant section says: "The sizeindication can specify the width or height to be used (or a combination)." What I want to know is: what is the correct syntax? Or, is the documentation in error?

1
I've just pushed a proposed patch to github to include the height as well in the XML output, pull request #6424albert
In the mean time the pul request has been added to master on github.albert

1 Answers

0
votes

I think the

This can be useful for LaTeX or docbook output (i.e. format=latex or format=docbook).

statement might actually mean that it is only useful with those formats. I am unable to get the width/height working myself, and even though it seems to parse the first sizeindicator argument, it does not actually use it.

Theres some old documentation available here that seems to imply that it used to only work for Latex

This is only useful for LaTeX output (i.e. format=latex). The sizeindication can be either width or height. The size should be a valid size specifier in LaTeX (for example 10cm or 6in or a symbolic width like \textwidth).

Also the few posts online I could find regarding this:

Here

and here

lead me to believe this is not working outside Latex formats.

I think this answer might be the only working way to achieve what you want.

Edit:

After looking into the parser code within defaultHandleTitleAndSize in docparser.cpp which is called for \image, it will in fact only handle the first width or height attribute, after which it will stop.