LaTeX symbol for single quote mark that MATLAB will recognize

I'm writing MATLAB code in LaTeX and I would like to be able to cut and paste it directly into the MATLAB command window. One critical symbol is the `'` (single quote). When processed by LaTeX it shows up as a curly quote sign, which MATLAB doesn't recognize. I've looked through the "Comprehensive Symbol Table", but I couldn't find anything. The csquotes package looks as though it might be helpful, but I found the manual incomprehensible.

• Use a verbatim-like command or environment (package `listings` or `matlab-prettifier` (which is based on `listings`) are my recommendations). – Paul Gessler Apr 7 '16 at 0:37
• – jub0bs Apr 14 '16 at 23:28

• You should have a look at the `matlab-prettifier` package; it improves upon `mcode` in many ways. See this answer, for instance. – jub0bs Apr 14 '16 at 23:29
• Is there an easy option to add color to all inline statements, i.e., anything separated by "'s? What you mean is unclear, but know that you can alter the style of inline code when defining `"` as a shorthand with `\lstMakeShortInline"`. Try, for instance, `\lstMakeShortInline[basicstyle=\color{red}]"`. [...] it would be nice if I could use a non monospaced font just for comments, i.e, anything after a % sign. Simply pass the desired style to the `mlcommentstyle` key, e.g. `mlcommentstyle = \rmfamily\color[RGB]{034,139,034}`. – jub0bs Apr 16 '16 at 5:44