10
votes
1answer
84 views

Scan argument for parentheses

I'd like to define a macro which expands to (#1) if #1 does not contain any parentheses, but expands to \big(#1\big) if it does. I'd choose simplicity over generality: if a solution works in the most ...
16
votes
5answers
467 views

Applying an operation only to capitals

I'd like to apply a function to capitals only so that: \emphcaps{YaWeH} Outputs like: \emph{Y}a\emph{W}e\emph{H} Preferably without using too many packages (I already use memoir). NOTES: I use ...