The following source includes a definition of \opair for typesetting ordered pairs, or tuples, that use angle-brackets as the initial and terminal delimiters; that definition appears in https://tex.stackexchange.com/a/592421/13492. (I shrank the 3mu spacings in the original.)
\documentclass{article}
\usepackage{amsmath}
\ExplSyntaxOn
%
\NewDocumentCommand{\opair}{m}
{
\langle\mspace{1mu}
\kaiserkatze_opair:n { #1 }
\mspace{1mu}\rangle
}
\seq_new:N \l__kaiserkatze_opair_items_seq
\tl_new:N \l__kaiserkatze_opair_first_tl
\cs_new_protected:Nn \kaiserkatze_opair:n
{
\seq_set_from_clist:Nn \l__kaiserkatze_opair_items_seq { #1 }
% set off the first item and insert it
\seq_pop_left:NN \l__kaiserkatze_opair_items_seq \l__kaiserkatze_opair_first_tl
\tl_use:N \l__kaiserkatze_opair_first_tl
% now insert commas and allowed breaks
\seq_map_indexed_inline:Nn \l__kaiserkatze_opair_items_seq
{
% comma and thin space
,\mspace{1mu plus 1mu minus 1mu}
% but \allowbreak only after the second item and before the penultimate
\int_compare:nT { 1 < ##1 < \seq_count:N \l__kaiserkatze_opair_items_seq }
{ \allowbreak }
% the item
##2
}
}
\ExplSyntaxOff
\begin{document}
$\opair{1,2}$, $(1,2)$
\begin{gather}
\opair{\opair{1,2}, \opair{3,4}}
\
\bigl((1,2), (3,4)\bigr)
\end{gather}
\end{document}
Compare the output with ordinary use of parentheses and big parentheses for the same thing:
There are two limitations there:
- In the case of an ordered pairs of ordered pairs, the parsing is contrary to the intended meaning.
- As it stands, the definition of
\opairdoes not allow for having larger angle brackets, as contrasted with using\bigl(...\bigr)in the case of parentheses.
How can these limitations be overcome?
Note that for the second issue, it would not suffice to use \left\langle...\right\rangle. I want to be able to control the size of the angle brackets more finely, so as to use also \big\langle...\big\rangle and even \bigg\langle...\bigg\rangle. For this, it would be OK to have separate macros, named, say, \bigopair and \biggopair along with \leftrighopair.
Related: big angle brackets


\opair[\lr], say, that uses\left\langle...\right\rangle(so that the outer delimiters stretch just enough for the included content, just like\left(...\right)` ? – murray Jul 14 '22 at 18:03\opair*(this is documented in themathtoolsmanual). I've added an example of this to my answer. – frougon Jul 14 '22 at 18:17\bigseems much too large as compared with\bigl(...\bigr)whereas normal size parentheses(....)seem to have the same height as\langle...\rangle. – murray Jul 14 '22 at 18:20*version but should not have! (2) math font design noted! – murray Jul 14 '22 at 18:32$\opair[\big]{1,2}$and$\bigl(1,2\bigr)$(see the edited answer). Are you sure you tried this correctly? Maybe you are using a different font? – frougon Jul 14 '22 at 19:17newtxfonts I'm actually using. – murray Jul 15 '22 at 18:58