I would like to "store" the definition of \includegraphics into \something so that the following logics will work:

% the following line is what I am looking for
store(\includegraphics, \something)
% and then I want to achieve what follows




% now I can again use \includegraphics with its usual definition

Is it possible and easily achievable?

but why?!

I want to disable the command \includegraphics in some parts on my document and be able to get again the usual \includegraphics after. This question is related to this post (the solution does not work if the \includegraphics command is active.

  • 2
    To store it: \let\savedincludegraphics\includegraphics and then to restore it \let\includegraphics\savedincludegraphics – Dan Mar 20 '14 at 17:52
  • Can we assume the local 'place' can form a group (defined scope, not definitions need to 'escape')? – Joseph Wright Mar 20 '14 at 17:54
  • @JosephWright I don't understand all the terms of your question, but I think, more or less: YES. – Colas Mar 20 '14 at 18:11

You want something like




for disabling the command; for reenabling it


For the specific command \let might be sufficient, but \LetLtxMacro is safer for commands that accept optional arguments.

See When to use \LetLtxMacro? for more information about \LetLtxMacro.

For environments it depends on how they are defined, but the comment package may reveal useful.


It seems that you are looking for \let:


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.