1

As I understand it, when a delimiter is marked \left or \right, its size will be chosen from among the available sizes. Suppose I define some new sizes, how can I make \left and \right use them when appropriate?


To make this concrete, let’s say I have defined some custom sizes for delimiters:

\usepackage{graphicx}
\def\bbig#1{\vcenter{\hbox{\scalebox{0.88}[0.77]{\Big#1}}}}
\def\biig#1{\vcenter{\hbox{\scalebox{0.95}[0.88]{\Big#1}}}}
\def\Biig#1{\vcenter{\hbox{\scalebox{0.95}[0.88]{\bigg#1}}}}
\def\biigg#1{\vcenter{\hbox{\scalebox{0.95}[0.9]{\Bigg#1}}}}
\def\Biigg#1{\vcenter{\hbox{\scalebox{1.05}[1.1]{\Bigg#1}}}}

Then I can use them like this:

$$
\Biigg\{ \Bigg\{ \biigg\{ \bigg\{ \Biig\{ \Big\{ \biig\{ \bbig\{ \big\{ \{
$$

Which produces:

Bracket sizes

So far so good. These are the sizes I want, and I can use them with any delimiter. (To use them outside of math mode we’d need to put {\hbox{$...$}} in the definitions.) Throw in the -l and -r versions with \mathopen and \mathclose, and we’re off and running.

However, I would rather use \left and \right instead of manually specifying delimiter sizes. How can I make \left and \right aware of my custom sizes, so they will be chosen when appropriate?

(Alternatively, is there a better way to do this?)

NevinBR
  • 133

1 Answers1

1

I am not sure if that answers your question but I personally use a different approach.

I created new macros \fleft and \fright with an optional parameters, which stand for fixed left and fixed right. With a non-empty argument in use, the size of brackets is "fixed". Otherwise, it is the equivalent to the regular \leftX...\rightX.

For instance, in the code below, \fleft(...\fright) (without arguments) adapts bracket dimensions to a size of the matrix. On the other hand, with non-empty arguments \fleft[3]\{...\fright[3]\}, brackets are fixed.

The factor when equal or larger than 3 corresponds to any next big bracket "bigger" than \BigglX...\BiggrX. The interval is 0.5, hence providing 3 and 3.5 would typeset brackets similar to \biggglX...\bigggrX and \BigggrX...\BiggglX, respectively.

enter image description here

\documentclass{article}
\usepackage{etoolbox}
\usepackage{mathtools}
\makeatletter
\NewDocumentCommand\fleft{O{}}{%
    \IfValueTF{#1}{\notblank{#1}{\mathopen\bBigg@{#1}}{\left}}{\left}}
\NewDocumentCommand\fright{O{}}{%
    \IfValueTF{#1}{\notblank{#1}{\mathopen\bBigg@{#1}}{\right}}{\right}}
\makeatother

\begin{document} [ \fleft( \begin{bmatrix}a\b\c\s\e\end{bmatrix} X \fright) \fleft[3]{ \begin{bmatrix}a\b\c\s\e\end{bmatrix} X \fright[3]} ] \end{document}

Celdor
  • 9,058