I'd like to write a macro that surrounds an argument with two round parentheses which are correctly sized to the argument. Currently I'm using the following macro,
\newcommand{\inpl}[1]{{\left(\kern-.2em\left({#1} \right)\kern-.2em\right)}}
This looks fine when #1 isn't tall, but when it is there's too much whitespace between the brackets.

Changing the kerning amount (e.g. to -.3em) does make the larger brackets look better at the expense of making the smaller ones look too close together.
I think a proper solution would be to change the amount of kerning done depending on the vertical height of #1, effectively replicating what \left does, but I don't know how to write such a macro.
Could anyone tell me how to get the vertical height of the enclosed text as a value that I can compare against, or how macros that dynamically change depending on the vertical height are usually defined?
\leftis a TeX primitive, it's not easy to implement that using macros & • you can make a macro that takes the content, put it in a box, measure the height of the box and do things (read TeXbook etc. for details). That may be more complex than somehow using mathrlap or something to do proper kerning though. – user202729 Aug 16 '22 at 13:16unicode-mathto get the two parentheses symbol. Though even then, I still think I'd run into issues with sizing since I don't know if there are codepoints for differently sized double-parentheses. Thanks for outlining how to proceed though – Gautam Chaudhuri Aug 16 '22 at 13:39