When I looked for a solution to auto-resize pairs of delimiters without using \left and \right I found this topic: auto-resizing parenthesis in math formulas. It works as expected but it can't be used inside e.g align due to & and \\. Is there any way to make it work with align-like enviromnents?
I have tried to solve this issue in dumb way using some workaround from mathtools manual:
\documentclass[a4paper,12pt]{article}
\usepackage{mathtools,unicode-math,xparse}
\newcommand*\autoop{\lrparen(}
\newcommand*\autoob{\lrbrack[}
\AtBeginDocument{
\mathcode`( 32768
\mathcode`[ 32768
\begingroup
\lccode`\~`(
\lowercase{%
\endgroup
\let~\autoop}
\begingroup
\lccode`\~`[
\lowercase{%
\endgroup
\let~\autoob}
}
\delimiterfactor 1001
\newcommand\MTkillspecial[1]{% helper macro
\bgroup
\catcode`\&=9
\let\\\relax%
\scantokens{#1}%
\egroup
}
\NewDocumentCommand\lrparen{d()}{
\mathopen{\left(\vphantom{\MTkillspecial{#1}}\kern-\nulldelimiterspace\right.}
#1
\mathclose{\left.\kern-\nulldelimiterspace\vphantom{\MTkillspecial{#1}}\right)}}
\NewDocumentCommand\lrbrack{o}{
\mathopen{\left[\vphantom{\MTkillspecial{#1}}\kern-\nulldelimiterspace\right.}
#1
\mathclose{\left.\kern-\nulldelimiterspace\vphantom{\MTkillspecial{#1}}\right]}}
\begin{document}
\begin{align*}
[[ ( a,\\ b ) ]]
\end{align*}
\end{document}
but it fix only line break problem. Last answer in mentioned topic use some sort of queue or stack, so I wonder if this problem could be solved by expl3 or luatex because I don't see the way to rewrite original answer to play with align and friends.
\biggl(rather than\left(so there is very little call for this.breqnmay be the nearest thing to this that is availableout of the box– David Carlisle Mar 12 '20 at 10:19breqnactually do that? Isn't itnaththat could do autoscaling of everything, but then againnathis incompatible with almost everything. – daleif Mar 12 '20 at 10:56fix only line break problem? doesn't your scantokens make&safe during the measuring part? You don't give an example using&– David Carlisle Mar 12 '20 at 10:58\\. In my solution\\works but&throw errors. Try[[ ( &a,\\ &b ) ]]insidealign. – Serafiel Mar 12 '20 at 11:12