When publishing an m-file from MATLAB to LaTeX, a vertical space of 1em is inserted after each text paragraph. I frequently input these published files directly into a master document by using the standalone package, but the 1em vspace doesn't look good with the rest of the typography.
My question is then, is there a way to state in the preamble of the master document to somehow ignore the command \vspace{1em}?
mwe:
\documentclass{article}
\usepackage{graphicx}
\usepackage{color}
\sloppy
\definecolor{lightgray}{gray}{0.5}
\setlength{\parindent}{0pt}
\begin{document}
\begin{par}
Some text
\end{par} \vspace{1em}
\begin{verbatim}
syms x
x=solve(3*x-3==2)
\end{verbatim}
\color{lightgray} \begin{verbatim}
x =
5/3
\end{verbatim} \color{black}
\begin{par}
Some more text
\end{par} \vspace{1em}
\end{document}
m-file:
%%
% Some text
syms x
x=solve(3*x-3==2)
%%
% Some more text
par, but the command\par(but LaTeX allows more or less any command as an environment). Second: You seem to want to replace\end{par} \vspace{1em}by\end{par}. I wouldn't do that in TeX (where it is difficult) but in a preprocessor (e.g. insed/perl/python/lua/...) – Martin Schröder Oct 09 '12 at 14:19\vspaceadded. What was your original .m file for that example, and which version of matlab (I use 2012b) – David Carlisle Oct 09 '12 at 15:08%%and then have a comment line with%. If you follow the example given in the documentation with sine_wave.m and add two lines%% code celland% This is a code cellyou will see it. – StrongBad Oct 09 '12 at 15:16