Linked Questions
29 questions linked to/from What is the difference between \let and \def?
4 votes
0 answers
695 views
Can I make a "deep copy" of a macro? [duplicate]
I would like to make a deep copy of macro that I don't have control of, because various packages might change it. So I want to take the current meaning of the macro, patching it, but without changing ...
0 votes
0 answers
31 views
How to change $\epsilon$ to $\varepsilon$ while preserving $\epsilon$ in another command? [duplicate]
For most of my purposes, I use \varepsilon, so I have a \renewcommand{\epsilon}{\varepsilon} in my personal .sty file. A recent homework problem in my numerical calculus class has meant that I would ...
403 votes
5 answers
170k views
What is the difference between \def and \newcommand?
Inspired by a question about \let and \def, I have some that essentially all boil down to asking What are the differences between \def and \newcommand? In particular, I wonder Is it possible to have ...
84 votes
4 answers
23k views
What is the difference between \let and \edef?
When you write \edef\a{\b} \let\a\b the results are often identical. What is the difference between these two commands? When do they behave the same? When do they not? (The question isn't for me; ...
21 votes
5 answers
3k views
What do the pgfkeys key handlers .get and .store in do?
When I need to retrieve the value of a key in a macro, I use the key handlers .get and .store in. Here is what is written in the pgfkeys documentation: Key handler key /.get= macro Executes a \let ...
21 votes
2 answers
6k views
How to store a counter value at some point in the document?
I'm beginning to learn LaTeX and I need some help with counters. My goal is to store the value a certain counter reaches at some point in the document and use it later. This is my attempt: \...
18 votes
1 answer
2k views
Simple un-obfuscation of some LaTeX internals
Here's an example of some code from LaTeX's \DeclareFontFamily: \def\reserved@a{#3} \global \expandafter\let\csname #1+#2\expandafter\endcsname \ifx \reserved@a\@empty \@empty \...
6 votes
2 answers
3k views
TOC and Subfiles: which TOC pkg for unique TOC compilation with each subfile?
The Subfiles package makes compiling individual parts of a LaTex document convenient. The package works so that each subfile inherits the master preamble main.tex and the user is able to compile ...
8 votes
1 answer
2k views
Can I reobtain a command I've overwritten with renewcommand?
I've overwritten the \bullet command using \renewcommand (which in hindsight, was a bad idea...). After using the new \bullet command for quite a while, I've realized that it behaves badly in certain ...
12 votes
2 answers
339 views
An environment which parses periods differently to redefine their behavior
I have a collection of documents that I want to read into a LaTeX environment. The problem is that these documents are not exactly formatted the way I would like. I would like to create an ...
11 votes
2 answers
355 views
How do I prevent a command from being invoked by a user while not disabling it?
Let's say I'm working on a LaTeX document collaboratively with someone else. I have defined a bunch of command aliases (such as \true for \top and \false for \bot); their precise purpose doesn't ...
7 votes
2 answers
448 views
Can I rename a standard LaTeX symbol and use the old one?
I've got myself into a stupid situation: I am writing a document about entropy, and decided to use \H as a macro for \mathbf{H}. But then I had a problem because I had written the name Erd\H{o}s ...
7 votes
1 answer
981 views
Merging \newcommand and \renewcommand
Is there a merged command \maybenewcommand that is either \newcommand or \renewcommand, depending on the situation: if the command is not yet defined, use \newcommand and use \renewcommand otherwise. ...
1 vote
1 answer
3k 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}{...
4 votes
1 answer
1k views
customising the footnote rule in reledmac
I would like to ask, please, by which code it may be possible to change the rule belonging to a specific series of footnotes in reledmac. As I have learned from a previous answer, it is possible to ...