14 questions linked to/from What do \@firstoftwo and \@secondoftwo do?
9k views

I've seen many programmers here at tex.se, and I'd like to know how they view TeX/LaTeX as a programming language in relation to other languages, and whether it would boost my progress as a beginner ...
13k views

### Will two-letter font style commands (\bf , \it , …) ever be resurrected in LaTeX?

I understand that \bf and \it are now obsolete in LaTeX and that \textbf and \textit are proper, as they produce more sophisticated (in particular, cumulative and properly kerned) changes to font ...
2k views

As I currently understand them, fully-expandable macros are analogous to pure/effect-free functions in functional programming. Correspondingly, things that are not expandable, such as \def, are ...
17k views

### How can I check in LaTeX (or plain TeX) whether a command exists, by name?

I'm looking for a LaTeX way to control macro expansion, contingent on some macro being defined or not. I'm looking for something like this (but then actually working): \newcommand[1]{\checkfor}{ \...
2k views

### TeX macro idioms, or: understanding advanced macros

I often find that when I look at solutions from the experts here, the macro definitions are completely inscrutable to me. Trying to use standard techniques one would use to understand code in most ...
799 views

### Why the \expandafter\@firstoftwo idiom?

I see a lot of macros which are conditional tests followed by a {true}{false} pair defined so that they result in either: \expandafter\@firstoftwo or \expandafter\@secondoftwo Why are these \...
2k views

### How to implement a command that checks for loaded packages?

I use the following code to check if a package is loaded: \RequirePackage{ltxcmds} \newcommand{\IfPackageLoaded}[2]{\ltx@ifpackageloaded{#1}{#2}{}} However, sometimes I want to check if more than ...
696 views

### Defining tabular rows with macros using \ifnum leads to Incomplete \ifnum

I am trying to define tabular rows using a macro which shall perform an conditional definition of the tabular row according to a given parameter. Please consider the following MWE: \documentclass{...
1k views

### problem with \ifthenelse + multicolumn

I encounter various problems when i want to control the display of a table with a ifthenelse test. For example, consider the following M(non)WE : \documentclass{article} \usepackage{multirow} \...
480 views

### How to specify a default value for overlay specification in \newcommand<>?

I have something like this: \documentclass{beamer} \newcommand<>{\mycommand}[1]{\textcolor#2{red}{#1}} \begin{document} \frame{ \mycommand{test} } \end{document} I want the command to ...
290 views

### \href macro in \section conflicts with local hyperref linking in ToC

If I have a section like so \section{Section 1} then in the ToC, so long as I use the hyperref package, it is linked to that particular section. However, if I use an href tag as the section name,...
131 views

### Conditional based on packageoption

I added a counter to the todonotes packages \todo so I could display the total number of todos I have left. However I also enjoy working with the package option disabled. Therefore I would like to ...