I want to save paper when I print my LaTeX file. That's why I want to hide all my code, inserted wtih lstinputlisting{}

I already know how to exclude tables and images or math but the lstinputlisting{} is a problem.

Hope someone can help me


edit: added lstlisting

1 Answer 1


\lstinputlisting can be redefined via \renewcommand. The macro has one optional and one mandatory argument:

% ignore \lstinputlisting

Environment lstlisting can be excluded as the other environments:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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