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

How to create a enumerate list adding a custom prefix before each item number?

I found this question Adding some common text to enumerated description lists to be the closest: \documentclass{scrbook} \usepackage{enumitem} \newcounter{descriptcount} \newlist{enumdescript}{...
65 views

Relabeling commands before redefining them

I would like to rename a couple of commands so that the commands match the words I think of when I want to use them. I would like to have \iso be what is by default \cong (an equals sign with a \sim ...
95 views

Macro inserted via \everypar in \obeylines context doesn't see some commands

I have the following code which works as expected except, as noted in the code, when a macro begins a line of the xltabular being built: \documentclass{article} \usepackage[papersize={5.5in,8.5in},...
31 views

Change function argument globally in renewcommand

I want to set one argument of a function permanently to a specific value. In my case it is the function \TextField which has the argument bordercolor. I want to set it globally to "nothing" instead of ...
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 ...
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{...
62 views

Package dutchcal and \let command are not playing together as I expected

Given the MWE \documentclass{article} \let\tempcal \mathcal \usepackage{dutchcal} \let\dutchcal\mathcal \let\mathcal\tempcal \begin{document} $$\dutchcal H~~~\mathcal H~~~\tempcal H$$ \end{document}...
287 views

Macro only to be defined in math mode

I often use short macros in mathematical formulas for frequently used symbols, e.g. \d x for a differential dx or, say, \v if I need a vector v very often in my text to make things more readable. ...
50 views

Creating two different modified versions of the same environment

In an earlier question, I defined a modified version of the quoting environment using \tcolorboxenvironment. But now I want a different, and hopefully better, modified version of the quoting ...
278 views

Empty optional argument or Not giving optional argument at all?

I learnt that \parbox has five arguments, that is: \parbox[<align>][<height>][<inner-align>]{<width>}{<text>}. So I constrcut my own \myparbox in which I add \sloppy\...
81 views

Pagenumber within \cref command

I am writing a script for a lecture in math and have quite a few cross-references in it. Now i have the problem, that the cross-references are sometimes pretty far away from the theorems they refer to....
231 views

Add prefix command(s) - counter of todos

I would like to see the number of todos I have left. Therefor I tried to redefine the todo command as follows: \newcounter{todocounter} \renewcommand{\todo}[2][]{\stepcounter{todocounter}\todo[#1]{#2}...
78 views

Adding content to nonexpandable commands without a huge hassle

I'm wondering if there is a package or method to add content around delicate commands without changing the command's name. For example, let's say I want to change \sqrt[#1]{#2} command to yield \...
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 ...
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 ...

15 30 50 per page