I am wondering is there a way to hide or comment out all lstinputlisting from latex without actually removing them.

My codes are all like this:

\lstinputlisting[language=Python, caption=NewHope implemented using SageMath]{code_snippets/LWE-KEX/NewHope.sage}

I tried to use comment package it as suggested here and also \renewcommand{\lstinputlisting}{}, both did not work.


1 Answer 1


Try with the following redefinition:


Not the answer you're looking for? Browse other questions tagged .