Tag Info

New answers tagged

3

You could use the xparse package which offers great possibilities for defining user commands: My First attempt: \usepackage{xparse} \DeclareDocumentCommand{\mymat}{o m o} {% \IfNoValueTF{#1} {\IfNoValueTF{#3}{\mathbf{#2}}{\mathbf{#2}^{#3}}} {\IfNoValueTF{#3}{\mathbf{#2}_{#1}}{\mathbf{#2}_{#1}^{#3}}} } Egregs simpler solution with IfValueT ...



Top 50 recent answers are included