Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • Although you say "it's not very difficult to imagine situations where this can lead to infinite loops", it is a bit difficult to think of one MWE to make the infinite loop. Could you please offer one with some comments about how the loop is caused? Thanks in advance. Commented Nov 24, 2023 at 8:54
  • 1
    @zgc \let\oribfseries\bfseries\DeclareRobustCommand\bfseries{\oribfseries\itshape} Commented Nov 24, 2023 at 9:01
  • I wonder if there is a way to abstract this pattern with NewCommandCopy to a new command. Imagine I would like to redefine a couple of commands and not just one (e.g., to add a new textcolor to them or make them italic). Could we make a macro \colorize{\llbracket}{blue} that redefines \llbracket to be wrapped in \textcolor but so we do not have to spell out the two lines again and again? I tried something like \expandafter\NewCommandCopy\csname old#1\endcsname{\csname #1\endcsname} to generate the name for the old macro but it didn't work. Commented Mar 20, 2024 at 20:39
  • 1
    @PaulProgrammerNoob Yes, but using just \NewCommandCopy and similar commands is clumsy. You can make a new question. Leave a comment here when you do it. Commented Mar 20, 2024 at 21:21
  • @egreg Thank you. :) I posted a new question here. Commented Mar 21, 2024 at 8:17