Linked Questions

35
votes
8answers
1k views

How can I specify a long list of math operators?

The preambles of my LaTeX documents often include many many lines of \DeclareMathOperator instructions, e.g. \DeclareMathOperator{\Rep}{Rep} \DeclareMathOperator{\Tet}{Tet} ...
24
votes
2answers
864 views

How to understand and write LaTeX code?

LaTeX is like a language. In order to write LaTeX code I have to understand the "word" and the "sentences structure". I have searched on wiki, some LaTeX books, but they just give the LaTeX command, ...
16
votes
3answers
889 views

Does `\noexpand` have to be a primitive?

Background: I'm trying to deepen my understanding of TeX and how the intricacies work (spurred a little by this place, I should say, and hoping one day to not be a "Cargo Cult Programmer" - see When ...
11
votes
4answers
792 views

Re-using the title of the previous Beamer slide

Is there a way to reference the title of the previous Beamer slide? Often, a sequence of slides have the same title, and I'd like to avoid having to repeat the title. I could define a macro for the ...
12
votes
3answers
329 views

Expansion of first token in a tabular cell

Background I currently do some work on the collcell package which collects the content of a tabular/array cell and provides it to a user defined macro, e.g. using ...
8
votes
3answers
535 views

\expandafter, \csname issue related to test for macro being defined

Just when I think I starting to understand \expandafter I run into this problem where I am trying to test if \ConditionG, \ConditionH, etc are defined in a loop. I tried all the combinations I could ...
9
votes
2answers
433 views

I'm a cargo cult programmer …

... because I don't know why this works \def\my@addextraoption#1{% \xdef\my@extraoptions{% \@ifundefined{my@extraoptions}\@empty\my@extraoptions,% \zap@space#1 \@empty}} ...
8
votes
2answers
242 views

How to control whether and when a macro gets expanded during another definition?

I wish to define a meta-command that, whenever invoked, will define an instance of another command; but this inner command must include a progressive number (somewhat similar to what happens with ...
8
votes
2answers
90 views

How to use \edef to wrap an existing macro with @inmatherr?

I have a handful of existing macros that I want to wrap in some custom processing. Here's an example of the kind of thing I'm aiming to do: \makeatletter \let\olddag\textdagger ...
7
votes
2answers
628 views

Using \nameref within \path

Background Looking to apply a consistent style to file and directory names. The book's appendix has a subsection for every file referenced by the book. Every subsection has a label whose value is ...
8
votes
1answer
345 views

Print name of command, defined by \csname

First off: I do not understand \expandafter and \noexpand completely which is probably the main problem. I have found a question that explains what it does, but still I cannot seem to make it work. I ...
5
votes
1answer
120 views

Gobble every occurrence of \mypath../

Is there a neat way to remove all instances of the text \mypath../ from the input, using TeX's text processing capabilities? The ifthen approach below works, but seems to be a bit heavyweight. Also, ...
3
votes
2answers
229 views

having problems using arrayjobx with tikz - how can i use arrays in tikz?

I need the help of some smart people ;) I want to draw a picture with TikZ, which is heavily based on randomization and I want to make it quite parametrized. It's actually a graph of n nodes where ...
8
votes
1answer
155 views

Adding to section names based on their contents

I've got a document that talks about requirements fulfilled. Each requirement has an official name, and so I've made macros that consume a requirement name and make marginpars and index entries with ...
3
votes
1answer
39 views

Expansion in \endnote-argument for hints after exercises

A desired feature for the latex-templates that we're using for exercises is to give hints in a way that the students have the option of trying to solve the exercise without it (i.e. not directly below ...