How i can deledete comment from listings code? I included source code file with \lstinputlisting{file.m} where file.m is matlab file. I want delete comment from file. % This is a comment function var = myfunction()

I tried to use comment commentstyle=\color{white} but the result isn't as I expected cause between code there are some withe line that i want totally remove.

Thanks in advance


Just use the right delimiters instead of the ones in my code.

begin /* comment */ end
/* no comment but a blank line remains */
begin/* comment */end


Unfortunately, you cannot get rid of the blank line.

Reference: Delimiters in listings manual

  • I didn't saw the comment from moewe. I think that the links that he provided are more useful than my anwer. ;) – gvgramazio May 2 '18 at 15:54

Not the answer you're looking for? Browse other questions tagged or ask your own question.