62 questions linked to/from When to use \LetLtxMacro?
132 views

### \let, \renewcommand, and optional arguments [duplicate]

Possible Duplicate: When to use \LetLtxMacro? I have a problem in redefining a command with an optional argument in terms of its old definition. Here is what I did: \newcommand{\testopt}[2][...
65 views

### renewcommand cause memory error when using default argument [duplicate]

I would like to add a warning in my log when using the \todo command. To do so i did: \documentclass{book} \usepackage[colorinlistoftodos,prependcaption,textsize=tiny]{todonotes} \let\oldtodo\todo \...
47 views

### \let on macro defined by \newcommand with optional argument [duplicate]

Suppose we have \newcommand{\foo}[2][optional]{#1 #2} defined somewhere (e.g. some package) and want to redefine it and re-use the original definition. This usually works with \let like described in ...
11 views

### Renewenvironment of with optional arguments enumerate goes wrong with enumitem (compilation stalls) [duplicate]

I want to modify the enumerate environment (from enumitem) to always be passed a certain optional argument. I expected the following code to work, but it always stalls (takes forever). \documentclass{...
20k views

### “Closed” (square) root symbol

I found a cool trick in the LaTeX wikibook which allows the square root sign to be altered such that it "closes" over its contents. Here's an example: ("closed" root on the left, normal one on the ...
712 views

### A new environment to decide dynamically which commands to run?

I am having some user defined commands defined and used in my latex document. I need a way to check whether any of the commands is used. I want to make decisions based on the argument used in the ...
3k views

### Duplicating Environments

When I want to globally modify a command in my document, I will often use a duplicated version of the original in the stencil, with the help of the \let macro. For example, if I wanted to do ...
5k views

### How to redefine a command properly to avoid recursive call to itself? [duplicate]

I'm trying to renew a command in terms of its old definition... something similar to this: \renewcommand{\vec}[1]{\vec{\mathbf{#1}}} But this seems to send the interpreter in an infinite loop. How ...
1k views

### Changing all single quotes to be straight when within texttt

I have a document with many ' characters inside of texttt. Is there a way to make them all appear straight when in texttt? I know that I can search/replace all ' with \textsinglequote: Adding ...
962 views

### TeX \newcommand and D.R.Y. (don't repeat yourself)

My goal is to create a list within a varwidth, and alternate the colors of each item. At the time, the best I could do is this: \documentclass{article} \usepackage[T1]{fontenc} \usepackage[utf8]{...
10k views

### Redefine \emph to be both bold and italic

2k views

### Problem with \renewcommand

I am trying to use \renewcommand to change the size of footnotes throughout the main text. I do this by changing \footenotesize to a different command, \scriptsize. Later on, I would like the command \...
2k views

### Command that returns current font size as a length?

I need a way to get the current fontsize as a length. I hope I didn't overlook anything that already provides this. What I found that I can do \makeatletter \newlength{\fsize} \setlength{\fsize}{\f@...