It seems that the maxWidth option only affects pixel images like png, bmp, etc. It affects the actual image size, so with maxWidth set to 3, you get images with a maximum width of 3 pixels. It is not controlled by the format itself, for example, the width argument in html or latex. The PUBLISH function uses XML as an intermediate format, and I believe this is a problem with the existing XML schema design.
In latex format, PUBLISH uses the epsc2 print driver by default and creates an EPS vector image. Therefore maxWidth is simply ignored. If you use ...'imageFormat','png',... in the publish call, you will notice that the size of the png output file changes according to maxWidth . In any case, the image size in the tex document will be 4 inches (with poor image resolution in the case of a small width), as set in the default style sheet for latex.
There seems to be no way to change this behavior in PUBLISH.
You can change the xml stylesheet (matlabroot / toolbox / matlab / codetools / private / mxdoom2latex.xls).
Check out these lines:
<xsl:template match="img"> \includegraphics [width=4in]{<xsl:value-of select="@src"/>} </xsl:template>
Copy this file, modify and specify a new file with the stylesheet option.
Or just change the width argument in the output .tex (s) file.
source share