Linked Questions

3
votes
0answers
184 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][...
1
vote
1answer
84 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 ...
2
votes
2answers
69 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 \...
1
vote
0answers
13 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{...
62
votes
3answers
21k 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, ...
16
votes
6answers
754 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 ...
32
votes
2answers
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 ...
25
votes
3answers
4k 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 ...
18
votes
2answers
12k views

Redefine \emph to be both bold and italic

I'm trying to redefine the \emph command to make text bolded in addition to being italic, but when I use \newcommand{\bfemph}[1]{\textbf{\emph{#1}}} \renewcommand{\emph}[1]{\bfemph{#1}} I get an ...
11
votes
5answers
2k 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 \textquotesingle: Adding ...
13
votes
3answers
987 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]{...
10
votes
3answers
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@...
8
votes
3answers
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 \...
14
votes
1answer
11k views

How to rename an existing command?

I would like to know if renaming a command is possible in LaTeX. For instance, could I change the \section by \sec ? I read that some people used something called "alias".
9
votes
2answers
6k views

How to redefine the section symbol (§)?

I'm trying to redefine the section symbol (§) so that it automatically places a space after it. When inserting the symbol in text, I typically write \S{} Section Number which gets me the spacing ...

15 30 50 per page
1
2 3 4 5