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