The \Set command (from the braket package) is useful for set builder notation, but it adds spaces before and after the brackets.
Compare \Set{1, 2, 3}:

To \{1, 2, 3\}:

Looking through the source code, \Set seems to add \, spaces before and after each curly bracket. How do I temporarily make these spaces zero-width? I'd like to re-define \set to be just \Set with the spaces taken out, but neither seem to be defined with \newcommand.
I tried something like this, but it gets some sort of TeX "stack overflow" (! TeX capacity exceeded, sorry [input stack size=5000].).
\renewcommand{\set}[1]{%
\let \lbrace = \{\!%
\let \rbrace = \!\}%
%
\Set{#1}%
%
\let \lbrace = \{%
\let \rbrace = \}%
}
Even if I do get the redefined command to work, my approach won't account for the other spaces. Here's a minimal working example:
\documentclass[12pt]{article}
\usepackage{braket}
\begin{document}
\noindent Compare \[
\Set{1, 2, 3}
\]
%
To \[
\{1, 2, 3\}
\]
\end{document}



\newcommand\Set#1{\{#1\}}if that's the layout you want? – David Carlisle Mar 13 '14 at 18:34\Setlets you write\Set{ x \in S | x > 0 }, which is equivalent to\left\{\, x \in S \mid x > 0 \,\right\}. – Blender Mar 13 '14 at 18:35\newcommand{\SET}[1]{\Set{\!#1\!}}and use\SETinstead? – Werner Mar 13 '14 at 18:38\leta command equal to more than one token. Instead of\let\lbrace\{\!, you would need\def\lbrace{\{\!}, although that wouldn't work either: LaTeX defines\{in terms of\lbraceand trying to define\lbracein terms of\{leads to an infinite loop. – Dan Mar 13 '14 at 19:17