Skip to content

Automatic determination of brackets shape according to depth of nest #9

@yarakos95

Description

@yarakos95

This package is very good. Problems with the physics package have been resolved, and I believe that this package will continue to growth in the future. Thank you very much.

Future Request

The command I request changes the bracket shapes to the nesting depth when nesting the same command.

A \CMD{ \frac{B}{2} \CMD{ C \CMD{ D + 1 } } }
$$A \left[ \frac{B}{2} \left\{ C \left( D + 1 \right) \right\} \right]$$

Bracket shape depends on nesting depth and is determined automatically. Of course, I expect the brackets to resize automatically, like \ab(...).

However, some authors may want to change the order of brackets shapes for nesting. So it would be nice to be able to change this from the options.

\usephysicsmodules[
    nestlevel1 = paren,
    nestlevel2 = brace,
    nestlevel3 = bracket
  ]{ab.nest?}

Background for this idea: “The Chicago Manual of Style”

In the manual, the handling of brackets in formulas is written as follows.

12.26 Common delimiters.

Three sorts of symbols are commonly used to group mathematical expressions: parentheses (), brackets [], and braces {}. They are used in pairs, and their normal order is {[()]}. When necessary, the sequence of delimiters can be extended by large parentheses, brackets, and braces as follows:

{ [ ( { [ ( ) ] } ) ] }

In text, the braces are sometimes omitted from this sequence. Angle brackets, vertical bars, and double vertical bars carry special mathematical significance and should not be used to supplement the sequence of common delimiters.

In light of this, the brackets in a formula must be nested in a certain order, regardless of the author's intention.

The \ab(...) notation by physics2 package is convenient, but there is no need to explicitly code considering the depth of nests. This is hopefully automated by this package.


Thank you for your consideration of this request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions