MATLAB uses an XSL stylesheet to do the conversion. To remove the Paragraph environment, modify the XSL stylesheet accordingly. For example, see steps below:
1) Execute the following MATLAB commands:
ssdir = fullfile(matlabroot, 'toolbox', 'matlab', 'codetools', 'private');
copyfile(fullfile(ssdir,'mxdom2latex.xsl'),fullfile(ssdir,'mxdom2latex.xsl.old'))
2) Open 'mxdom2latex.xsl' from 'ssdir' directory in MATLAB:
edit([ssdir filesep 'mxdom2latex.xsl'])
3) Near line 104 in ‘mxdom2latex.xsl’, you will see the following:
<!-- HTML Tags in text sections -->
<xsl:template match="p">\begin{par}
<xsl:apply-templates/><xsl:text>
\end{par} \vspace{1em}
</xsl:text>
</xsl:template>
Remove \begin{par}, \end{par}, and \vspace{1em}:
<xsl:template match="p">
<xsl:apply-templates/><xsl:text>
</xsl:text>
</xsl:template>
4) Save the changes
5) Publish to LaTeX
Best Answer