I noticed that the automatic adjustment size for parentheses by use of \left(...\right)
"fails" in two cases I use a lot:
Case one:
When a upper index is set as \text{...}
. I typeset label-indices as \text{...}
(for example $y^\text{p}$
for predicted y-values) since this is how they are usually formatted in the physics context to distinguish labels from mathematical indices.
I marked the upper and lower ends of the parentheses for just brackets (green), \left(...\right)
(red) and \left(...^\text{...}\right)
(blue). Note that the bracket size for the latter is adjusted, but not to the right size.
Case two:
When having large equations in parentheses spanning multiple lines, I break the lines with
\begin{align}
\left[ ... \right. \\
\left. ... \right]
\end{align}
In this case, the size of the square brackets is not adjusted synchronously. I understand that this is because the size is determined within a line instead of within the \left[...\right]
pair.
Question:
The question connecting this two cases is: Is it possible to access the logic of how the sizes are determined? (Another use case is to increase nested brackets automatically).
Example:
MWE:
\documentclass[preview]{standalone}
\usepackage{amsmath}
\usepackage{listings}
\lstset{language=TeX,
basicstyle=\footnotesize\ttfamily,
}
\begin{document}
Case one:
\begin{align*}
(y_i^f) + \left(y_i^f\right) + \left(y_i^\text{f}\right)
\end{align*}
Case two:
\begin{align*}
y=& \left[ \frac{x}{c} \right. \\
&+\left. f(x)\right]
\end{align*}
\end{document}
\text{f}
is wrong markup (and slow) it will pick up whatever font is current outside the math, better to use^{\mathrm{f}}
– David Carlisle Dec 21 '20 at 15:52\bigl... \bigr
,\Bigr ... \Bigr
and the like. – Bernard Dec 21 '20 at 15:53\bigl(
and\bigr)
, I'll find a link to the standard answer. – David Carlisle Dec 21 '20 at 15:54