# Create a resizable symbol?

Some symbols can be resized automatically with \middle when placed between a \left. and a \right. They can usually also be resized using \big or \bigg. Examples of such symbols are |and / and pretty much all the brackets; (, [, \{, \langle, and so on. I have never seen a complete list of symbols which can be resized this way. Are they special in some way or is it possible to create new resizable symbols? If it is possible: What is the "correct" way to create a new resizable symbol? By that, I mean a symbol \mysymbol such that, e.g.

\left( \somethinghuge \middle\mysymbol b \right)


will have the "correct" size. Of course, bear in mind that one would usually want to apply this to already existing symbols which do not resize. Like the \# symbol, for instance.

-
The ability to stretch this way is a feature of the font metrics, so the list of extendible symbols depends on which font set you are using. –  David Carlisle Feb 23 at 16:22
So that's basically a "no", right? Assuming that the symbol is not already extendible in the font I am using, there is no way to make it extendible? –  Jesko Hüttenhain Feb 23 at 16:25
You should never say no, but basically that is the case. You can of course load the font at different sizes (or use \scalebox) together with some macros that measure something and choose an appropriate size for your symbol, but this will not work naturally with \left\right\middle –  David Carlisle Feb 23 at 16:28
A list of resizable symbols can be found in the "Comprehensive LaTeX symbol list" or unimath-symbols.pdf for the fontspec package. –  Toscho Feb 23 at 18:34

The characters which can be resized with \left, \middle and \right are those with a non zero \delcode. Commands are also allowed, provided their expansion starts with \delimiter; they are defined by \DeclareMathDelimiter in fontmath.ltx:

%%% characters
\DeclareMathDelimiter{(}{\mathopen} {operators}{"28}{largesymbols}{"00}
\DeclareMathDelimiter{)}{\mathclose}{operators}{"29}{largesymbols}{"01}
\DeclareMathDelimiter{[}{\mathopen} {operators}{"5B}{largesymbols}{"02}
\DeclareMathDelimiter{]}{\mathclose}{operators}{"5D}{largesymbols}{"03}
\DeclareMathDelimiter{<}{\mathopen}{symbols}{"68}{largesymbols}{"0A}
\DeclareMathDelimiter{>}{\mathclose}{symbols}{"69}{largesymbols}{"0B}
\DeclareMathDelimiter{/}{\mathord}{operators}{"2F}{largesymbols}{"0E}
\DeclareMathSymbol{/}{\mathord}{letters}{"3D}
\DeclareMathDelimiter{|}{\mathord}{symbols}{"6A}{largesymbols}{"0C}
%%% commands
\DeclareMathDelimiter{\lmoustache}   % top from (, bottom from )
{\mathopen}{largesymbols}{"7A}{largesymbols}{"40}
\DeclareMathDelimiter{\rmoustache}   % top from ), bottom from (
{\mathclose}{largesymbols}{"7B}{largesymbols}{"41}
{\mathord}{symbols}{"6A}{largesymbols}{"3C}
\DeclareMathDelimiter{\Arrowvert}    % double arrow without arrowheads
{\mathord}{symbols}{"6B}{largesymbols}{"3D}
\DeclareMathDelimiter{\Vert}
{\mathord}{symbols}{"6B}{largesymbols}{"0D}
\let\|=\Vert
\DeclareMathDelimiter{\vert}
{\mathord}{symbols}{"6A}{largesymbols}{"0C}
\DeclareMathDelimiter{\uparrow}
{\mathrel}{symbols}{"22}{largesymbols}{"78}
\DeclareMathDelimiter{\downarrow}
{\mathrel}{symbols}{"23}{largesymbols}{"79}
\DeclareMathDelimiter{\updownarrow}
{\mathrel}{symbols}{"6C}{largesymbols}{"3F}
\DeclareMathDelimiter{\Uparrow}
{\mathrel}{symbols}{"2A}{largesymbols}{"7E}
\DeclareMathDelimiter{\Downarrow}
{\mathrel}{symbols}{"2B}{largesymbols}{"7F}
\DeclareMathDelimiter{\Updownarrow}
{\mathrel}{symbols}{"6D}{largesymbols}{"77}
\DeclareMathDelimiter{\backslash}    % for double coset G\backslash H
{\mathord}{symbols}{"6E}{largesymbols}{"0F}
\DeclareMathDelimiter{\rangle}
{\mathclose}{symbols}{"69}{largesymbols}{"0B}
\DeclareMathDelimiter{\langle}
{\mathopen}{symbols}{"68}{largesymbols}{"0A}
\DeclareMathDelimiter{\rbrace}
{\mathclose}{symbols}{"67}{largesymbols}{"09}
\DeclareMathDelimiter{\lbrace}
{\mathopen}{symbols}{"66}{largesymbols}{"08}
\DeclareMathDelimiter{\rceil}
{\mathclose}{symbols}{"65}{largesymbols}{"07}
\DeclareMathDelimiter{\lceil}
{\mathopen}{symbols}{"64}{largesymbols}{"06}
\DeclareMathDelimiter{\rfloor}
{\mathclose}{symbols}{"63}{largesymbols}{"05}
\DeclareMathDelimiter{\lfloor}
{\mathopen}{symbols}{"62}{largesymbols}{"04}
\DeclareMathDelimiter{\lgroup} % extensible ( with sharper tips
{\mathopen}{largesymbols}{"3A}{largesymbols}{"3A}
\DeclareMathDelimiter{\rgroup} % extensible ) with sharper tips
{\mathclose}{largesymbols}{"3B}{largesymbols}{"3B}
\DeclareMathDelimiter{\bracevert} % the vertical bar that extends braces
{\mathord}{largesymbols}{"3E}{largesymbols}{"3E}


Other may be defined by other packages.

In order to know whether a character corresponds to a resizable delimiter, inspect its \delcode:

\showthe\delcode(


would output 164608. For a command, use \show; for instance, \show\bracevert would output

\bracevert:
macro:->\delimiter "033E33E


Some delimiters are arbitrarily resizable like braces, which in large sizes are made up by repeatable parts. Others, like / have a maximum size.

-

Using \scalerel, one can make one argument match the vertical extent of another argument. The optional argument is a max-width constraint (in this case, I chose 2ex). Here's an example of the same code working on two different \somethinghuge arguments. In this case, I chose \mysymbol as a / sign.

\documentclass{article}
\usepackage{scalerel}
\def\mysymbol{/}
\begin{document}
\def\somethinghuge{\rule[-2.2ex]{2ex}{6ex}}
$\left( \somethinghuge \scalerel*[2ex]{\mysymbol}{\somethinghuge} b \right)$
\def\somethinghuge{\rule[-3.2ex]{2ex}{8ex}}
$\left( \somethinghuge \scalerel*[2ex]{\mysymbol}{\somethinghuge} b \right)$
\end{document}


Here's an equivalent syntax that would allow you to avoid typing \somethinghuge twice.

$\left( \scaleleftright[2ex]{.}{\somethinghuge}{\mysymbol} b \right)$
`
-