1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
\documentclass{article}
\usepackage{xspace}
\usepackage{dsfont}
\usepackage{multidef}
%% basic definition
\multidef[p=cal]{\ensuremath{\mathcal{#1}}}{A-Z}
%% example with noerr, nowarn
\multidef[noerr,nowarn,suffix=name]{#1}{contents->Table des mati\`eres,
ref->R\'ef\'erences,
part->Partie}
%% with one argument
\multidef[arg=1]{\ensuremath{\mathsf{#1}(##1)}}{first,last}
%% global + robust
\makeatletter
\bgroup
\multidef[noerr,global,p=bb,args=1,robust]
{\@ifnextchar+{\ensuremath{\mathds{#1}^+}\@gobble}
{\ensuremath{\mathds{#1}}}}
{A,B,C,H,N,Q,R,T,Z,
Z , Z ,one->1}
\egroup
\begin{document}
\section{\protect\(\bbZ\protect\) would fail if not robust}
\calT\ should write $\mathcal T$
\first a should write $\mathsf{first}(a)$
\end{document}
|