From 349bb1e7c95c58cddcfd2efaffcb134b1bca67ac Mon Sep 17 00:00:00 2001 From: Jeff LANCE Date: Thu, 29 Sep 2016 22:02:27 +0200 Subject: [PATCH] change shortcut for sets R, Q, and so on... to make them run in math or text env --- shortcuts/shortcuts.sty | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/shortcuts/shortcuts.sty b/shortcuts/shortcuts.sty index 0067035..19532ef 100644 --- a/shortcuts/shortcuts.sty +++ b/shortcuts/shortcuts.sty @@ -61,18 +61,19 @@ } % ensembles + \NewDocumentCommand \R { s g } { \IfBooleanTF {#1} { \IfNoValueTF {#2} { - \( \!\!\!\! \mathbb{R} \setminus \{0\} \!\!\! \) + \ensuremath{\!\!\! \mathbb{R} \setminus \{0\} \!\!} }{ - \( \!\!\!\! \mathbb{R} \setminus \{0, #2\} \!\!\! \) + \ensuremath{\!\!\! \mathbb{R} \setminus \{0, #2\} \!\!} } }{ \IfNoValueTF {#2} { - \( \!\!\!\! \mathbb{R} \!\!\! \) + \ensuremath{\!\!\! \mathbb{R} \!\!} }{ - \( \!\!\!\! \mathbb{R} \setminus \{#2\} \!\!\! \) + \ensuremath{\!\!\! \mathbb{R} \setminus \{#2\} \!\!} } } } @@ -82,60 +83,60 @@ \NewDocumentCommand \Q { s g } { \IfBooleanTF {#1} { \IfNoValueTF {#2} { - \( \!\!\!\! \mathbb{Q} \setminus \{0\} \!\!\! \) + \ensuremath{\!\!\! \mathbb{Q} \setminus \{0\} \!\!} }{ - \( \!\!\!\! \mathbb{Q} \setminus \{0, #2\} \!\!\! \) + \ensuremath{\!\!\! \mathbb{Q} \setminus \{0, #2\} \!\!} } }{ \IfNoValueTF {#2} { - \( \!\!\!\! \mathbb{Q} \!\!\! \) + \ensuremath{\!\!\! \mathbb{Q} \!\!} }{ - \( \!\!\!\! \mathbb{Q} \setminus \{#2\} \!\!\! \) + \ensuremath{\!\!\! \mathbb{Q} \setminus \{#2\} \!\!} } } } \NewDocumentCommand \D { s g } { \IfBooleanTF {#1} { \IfNoValueTF {#2} { - \( \!\!\!\! \mathbb{D} \setminus \{0\} \!\!\! \) + \ensuremath{\!\!\! \mathbb{D} \setminus \{0\} \!\!} }{ - \( \!\!\!\! \mathbb{D} \setminus \{0, #2\} \!\!\! \) + \ensuremath{\!\!\! \mathbb{D} \setminus \{0, #2\} \!\!} } }{ \IfNoValueTF {#2} { - \( \!\!\!\! \mathbb{D} \!\!\! \) + \ensuremath{\!\!\! \mathbb{D} \!\!} }{ - \( \!\!\!\! \mathbb{D} \setminus \{#2\} \!\!\! \) + \ensuremath{\!\!\! \mathbb{D} \setminus \{#2\} \!\!} } } } \NewDocumentCommand \Z { s g } { \IfBooleanTF {#1} { \IfNoValueTF {#2} { - \( \!\!\!\! \mathbb{Z} \setminus \{0\} \!\!\! \) + \ensuremath{\!\!\! \mathbb{Z} \setminus \{0\} \!\!} }{ - \( \!\!\!\! \mathbb{Z} \setminus \{0, #2\} \!\!\! \) + \ensuremath{\!\!\! \mathbb{Z} \setminus \{0, #2\} \!\!} } }{ \IfNoValueTF {#2} { - \( \!\!\!\! \mathbb{Z} \!\!\! \) + \ensuremath{\!\!\! \mathbb{Z} \!\!} }{ - \( \!\!\!\! \mathbb{Z} \setminus \{#2\} \!\!\! \) + \ensuremath{\!\!\! \mathbb{Z} \setminus \{#2\} \!\!} } } } \NewDocumentCommand \N { s g } { \IfBooleanTF {#1} { \IfNoValueTF {#2} { - \( \!\!\!\! \mathbb{N} \setminus \{0\} \!\!\! \) + \ensuremath{\!\!\! \mathbb{N} \setminus \{0\} \!\!} }{ - \( \!\!\!\! \mathbb{N} \setminus \{0, #2\} \!\!\! \) + \ensuremath{\!\!\! \mathbb{N} \setminus \{0, #2\} \!\!} } }{ \IfNoValueTF {#2} { - \( \!\!\!\! \mathbb{N} \!\!\! \) + \ensuremath{\!\!\! \mathbb{N} \!\!} }{ - \( \!\!\!\! \mathbb{N} \setminus \{#2\} \!\!\! \) + \ensuremath{\!\!\! \mathbb{N} \setminus \{#2\} \!\!} } } }