Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Yarakashi-Kikohshi opened this issue Apr 7, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@Yarakashi-Kikohshi
Copy link

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.

@AlphaZTX
Copy link
Owner

AlphaZTX commented Apr 8, 2023

It's a quite good idea to add this feature in a new module, perhaps this summer. Thank you for your passion for this package.

@AlphaZTX
Copy link
Owner

Sorry to response so slowly. I have been being quite busy since May and have had fever twice in the past several months. When I recover better, I’ll try to add this feature in the next version (0.3.x).

@Yarakashi-Kikohshi
Copy link
Author

Please do not worry about it. First of all, I wish you well and hope your health recovers.
I am eagerly awaiting the release of the next version!

@AlphaZTX AlphaZTX added the enhancement New feature or request label Jan 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants