I want to stretch the \rbrace command by an arbitrary vertical scale factor in order to have precise control over its size inside a TikZ picture. Surely there's a simply command to stretch it, any ideas?
- 603,163
- 23
1 Answers
There are many ways to skin a cat.
The top one is just an
\rbrace, that does not stretch.When used in an equation as part of the
\left. ...\right\}syntax, it can stretch, but it will insist on stretching symmetrically about the math axis, and so it may not align with the content, if it is not vertically symmetricalThe
scalerelpackage allows one to scale or stretch a glyph to fit the size of something specified, or to a numerical size. In this case, it is scaled directly tot he size of the\rule. The\rulecan be hidden by using\scalerel*{\}}{\rule...}or\scaleto{\}}{10ex}.Here is a variant of 3., in which the maximum width of the scale is limited to 1.5ex
This one is very versatile. It is an extensible brace, originally horizontal, which I rotated vertically. It fills the box of whatever size you place it in (its one deficiency is that it cannot shrink below a certain minimum size).
\documentclass{article}
\usepackage{scalerel}
\parskip 1em
\begin{document}
$\rule[-2ex]{1ex}{5ex}\rbrace$
$\left.\rule[-5ex]{1ex}{10ex}\right\rbrace$
\scaleleftright{.}{\rule[-1ex]{1ex}{10ex}}{\rbrace}
\scaleleftright[1.5ex]{.}{\rule[-1ex]{1ex}{10ex}}{\rbrace}
\rotatebox{90}{\makebox[10ex]{\upbracefill}}
\end{document}

- 237,551
-
I've gone with the last, the minor drawback you mentioned doesn't affect me so its perfect. Thanks for that. – James Wood Apr 02 '14 at 17:53