Extensible triple-bracket delimiter with a new symbol
Encouraged by David Carlisle, I eventually resolved to post this answer. I had begun to write a comprehensive one that explained how the solution works, but I soon realized that it would have largely exceeded the 30000 character limit—indeed, only the code amounts to a total of more than 26000 bytes! Maybe I’ll post the explanations as a separate answer, for now please refer to:
How to create a virtual font?;
this answer to How can I create a new extensible symbol?;
my answer to the question Design of new brackets;
my answer to the question Arbitrary \left \right delimiters.
Solution based on virtual fonts; it provides you with two new extensible symbols named \lBbrack
and \rBbrack
, that you can use in exactly the same way (with \bigl
& Co., \left
, \right
, \genfrac
, \DeclarePairedDelimiter
, …) as any other delimiter. So, for instance, along the lines of
\DeclarePairedDelimiter{\Bra}{[}{]}
you could similarly say
\DeclarePairedDelimiter{\WonderBra}{\lBbrack}{\rBbrack}
Instructions for testing the solution:
- Create a new, empty directory and move to it.
- Save the following code into
tripledelimiters10.vpl
:(FAMILY TRIPLEDELIMITERS) (CODINGSCHEME FONTSPECIFIC) (DESIGNSIZE R 10.0) (COMMENT DESIGNSIZE IS IN POINTS) (COMMENT OTHER SIZES ARE MULTIPLES OF DESIGNSIZE) (MAPFONT D 0 (FONTNAME cmex10)) (MAPFONT D 1 (FONTNAME cmsy10)) (MAPFONT D 2 (FONTNAME cmr10)) (FONTDIMEN (SLANT R 0.0) (SPACE R 0.0) (STRETCH R 0.0) (SHRINK R 0.0) (XHEIGHT R 0.430555) (QUAD R 1.000003) (EXTRASPACE R 0.0) ) (CHARACTER O 0 (CHARWD R 0.916672) (CHARHT R 0.039999) (CHARDP R 1.160013) (NEXTLARGER O 20) (MAP (SETCHAR O 0) (MOVELEFT R 0.229168) (SETCHAR O 0) (MOVELEFT R 0.229168) (SETCHAR O 0) ) ) (CHARACTER O 1 (CHARWD R 0.916672) (CHARHT R 0.039999) (CHARDP R 1.160013) (NEXTLARGER O 21) (MAP (SETCHAR O 1) (MOVELEFT R 0.229168) (SETCHAR O 1) (MOVELEFT R 0.229168) (SETCHAR O 1) ) ) (CHARACTER O 2 (CHARWD R 0.833338) (CHARHT R 0.039999) (CHARDP R 1.160013) (NEXTLARGER O 150) (MAP (SETCHAR O 2) (MOVELEFT R 0.2083345) (SETCHAR O 2) (MOVELEFT R 0.2083345) (SETCHAR O 2) ) ) (CHARACTER O 3 (CHARWD R 0.833338) (CHARHT R 0.039999) (CHARDP R 1.160013) (NEXTLARGER O 151) (MAP (SETCHAR O 3) (MOVELEFT R 0.2083345) (SETCHAR O 3) (MOVELEFT R 0.2083345) (SETCHAR O 3) ) ) (CHARACTER O 4 (CHARWD R 0.944448) (CHARHT R 0.039999) (CHARDP R 1.160013) (NEXTLARGER O 152) (MAP (SETCHAR O 4) (MOVELEFT R 0.236112) (SETCHAR O 4) (MOVELEFT R 0.236112) (SETCHAR O 4) ) ) (CHARACTER O 5 (CHARWD R 0.944448) (CHARHT R 0.039999) (CHARDP R 1.160013) (NEXTLARGER O 153) (MAP (SETCHAR O 5) (MOVELEFT R 0.236112) (SETCHAR O 5) (MOVELEFT R 0.236112) (SETCHAR O 5) ) ) (CHARACTER O 6 (CHARWD R 0.944448) (CHARHT R 0.039999) (CHARDP R 1.160013) (NEXTLARGER O 154) (MAP (SETCHAR O 6) (MOVELEFT R 0.236112) (SETCHAR O 6) (MOVELEFT R 0.236112) (SETCHAR O 6) ) ) (CHARACTER O 7 (CHARWD R 0.944448) (CHARHT R 0.039999) (CHARDP R 1.160013) (NEXTLARGER O 155) (MAP (SETCHAR O 7) (MOVELEFT R 0.236112) (SETCHAR O 7) (MOVELEFT R 0.236112) (SETCHAR O 7) ) ) (CHARACTER O 10 (CHARWD R 1.166672) (CHARHT R 0.039999) (CHARDP R 1.160013) (NEXTLARGER O 156) (MAP (SETCHAR O 10) (MOVELEFT R 0.291668) (SETCHAR O 10) (MOVELEFT R 0.291668) (SETCHAR O 10) ) ) (CHARACTER O 11 (CHARWD R 1.166672) (CHARHT R 0.039999) (CHARDP R 1.160013) (NEXTLARGER O 157) (MAP (SETCHAR O 11) (MOVELEFT R 0.291668) (SETCHAR O 11) (MOVELEFT R 0.291668) (SETCHAR O 11) ) ) (CHARACTER O 12 (CHARWD R 0.944448) (CHARHT R 0.039999) (CHARDP R 1.160013) (NEXTLARGER O 104) (MAP (SETCHAR O 12) (MOVELEFT R 0.236112) (SETCHAR O 12) (MOVELEFT R 0.236112) (SETCHAR O 12) ) ) (CHARACTER O 13 (CHARWD R 0.944448) (CHARHT R 0.039999) (CHARDP R 1.160013) (NEXTLARGER O 105) (MAP (SETCHAR O 13) (MOVELEFT R 0.236112) (SETCHAR O 13) (MOVELEFT R 0.236112) (SETCHAR O 13) ) ) (CHARACTER O 14 (CHARWD R 0.666668) (CHARDP R 0.600006) (VARCHAR (REP O 14) ) (MAP (SETCHAR O 14) (MOVELEFT R 0.166667) (SETCHAR O 14) (MOVELEFT R 0.166667) (SETCHAR O 14) ) ) (CHARACTER O 20 (CHARWD R 1.194448) (CHARHT R 0.039999) (CHARDP R 1.760019) (NEXTLARGER O 22) (MAP (SETCHAR O 20) (MOVELEFT R 0.298612) (SETCHAR O 20) (MOVELEFT R 0.298612) (SETCHAR O 20) ) ) (CHARACTER O 21 (CHARWD R 1.194448) (CHARHT R 0.039999) (CHARDP R 1.760019) (NEXTLARGER O 23) (MAP (SETCHAR O 21) (MOVELEFT R 0.298612) (SETCHAR O 21) (MOVELEFT R 0.298612) (SETCHAR O 21) ) ) (CHARACTER O 22 (CHARWD R 1.472229) (CHARHT R 0.039999) (CHARDP R 2.360025) (NEXTLARGER O 40) (MAP (SETCHAR O 22) (MOVELEFT R 0.36805725) (SETCHAR O 22) (MOVELEFT R 0.36805725) (SETCHAR O 22) ) ) (CHARACTER O 23 (CHARWD R 1.472229) (CHARHT R 0.039999) (CHARDP R 2.360025) (NEXTLARGER O 41) (MAP (SETCHAR O 23) (MOVELEFT R 0.36805725) (SETCHAR O 23) (MOVELEFT R 0.36805725) (SETCHAR O 23) ) ) (CHARACTER O 24 (CHARWD R 1.055562) (CHARHT R 0.039999) (CHARDP R 2.360025) (NEXTLARGER O 42) (MAP (SETCHAR O 24) (MOVELEFT R 0.2638905) (SETCHAR O 24) (MOVELEFT R 0.2638905) (SETCHAR O 24) ) ) (CHARACTER O 25 (CHARWD R 1.055562) (CHARHT R 0.039999) (CHARDP R 2.360025) (NEXTLARGER O 43) (MAP (SETCHAR O 25) (MOVELEFT R 0.2638905) (SETCHAR O 25) (MOVELEFT R 0.2638905) (SETCHAR O 25) ) ) (CHARACTER O 26 (CHARWD R 1.166672) (CHARHT R 0.039999) (CHARDP R 2.360025) (NEXTLARGER O 44) (MAP (SETCHAR O 26) (MOVELEFT R 0.291668) (SETCHAR O 26) (MOVELEFT R 0.291668) (SETCHAR O 26) ) ) (CHARACTER O 27 (CHARWD R 1.166672) (CHARHT R 0.039999) (CHARDP R 2.360025) (NEXTLARGER O 45) (MAP (SETCHAR O 27) (MOVELEFT R 0.291668) (SETCHAR O 27) (MOVELEFT R 0.291668) (SETCHAR O 27) ) ) (CHARACTER O 30 (CHARWD R 1.166672) (CHARHT R 0.039999) (CHARDP R 2.360025) (NEXTLARGER O 46) (MAP (SETCHAR O 30) (MOVELEFT R 0.291668) (SETCHAR O 30) (MOVELEFT R 0.291668) (SETCHAR O 30) ) ) (CHARACTER O 31 (CHARWD R 1.166672) (CHARHT R 0.039999) (CHARDP R 2.360025) (NEXTLARGER O 47) (MAP (SETCHAR O 31) (MOVELEFT R 0.291668) (SETCHAR O 31) (MOVELEFT R 0.291668) (SETCHAR O 31) ) ) (CHARACTER O 32 (CHARWD R 1.500004) (CHARHT R 0.039999) (CHARDP R 2.360025) (NEXTLARGER O 50) (MAP (SETCHAR O 32) (MOVELEFT R 0.375001) (SETCHAR O 32) (MOVELEFT R 0.375001) (SETCHAR O 32) ) ) (CHARACTER O 33 (CHARWD R 1.500004) (CHARHT R 0.039999) (CHARDP R 2.360025) (NEXTLARGER O 51) (MAP (SETCHAR O 33) (MOVELEFT R 0.375001) (SETCHAR O 33) (MOVELEFT R 0.375001) (SETCHAR O 33) ) ) (CHARACTER O 34 (CHARWD R 1.500004) (CHARHT R 0.039999) (CHARDP R 2.360025) (NEXTLARGER O 52) (MAP (SETCHAR O 34) (MOVELEFT R 0.375001) (SETCHAR O 34) (MOVELEFT R 0.375001) (SETCHAR O 34) ) ) (CHARACTER O 35 (CHARWD R 1.500004) (CHARHT R 0.039999) (CHARDP R 2.360025) (NEXTLARGER O 53) (MAP (SETCHAR O 35) (MOVELEFT R 0.375001) (SETCHAR O 35) (MOVELEFT R 0.375001) (SETCHAR O 35) ) ) (CHARACTER O 40 (CHARWD R 1.58334) (CHARHT R 0.039999) (CHARDP R 2.9600315) (NEXTLARGER O 60) (MAP (SETCHAR O 40) (MOVELEFT R 0.395835) (SETCHAR O 40) (MOVELEFT R 0.395835) (SETCHAR O 40) ) ) (CHARACTER O 41 (CHARWD R 1.58334) (CHARHT R 0.039999) (CHARDP R 2.9600315) (NEXTLARGER O 61) (MAP (SETCHAR O 41) (MOVELEFT R 0.395835) (SETCHAR O 41) (MOVELEFT R 0.395835) (SETCHAR O 41) ) ) (CHARACTER O 42 (CHARWD R 1.166672) (CHARHT R 0.039999) (CHARDP R 2.9600315) (NEXTLARGER O 62) (MAP (SETCHAR O 42) (MOVELEFT R 0.291668) (SETCHAR O 42) (MOVELEFT R 0.291668) (SETCHAR O 42) ) ) (CHARACTER O 43 (CHARWD R 1.166672) (CHARHT R 0.039999) (CHARDP R 2.9600315) (NEXTLARGER O 63) (MAP (SETCHAR O 43) (MOVELEFT R 0.291668) (SETCHAR O 43) (MOVELEFT R 0.291668) (SETCHAR O 43) ) ) (CHARACTER O 44 (CHARWD R 1.277782) (CHARHT R 0.039999) (CHARDP R 2.9600315) (NEXTLARGER O 64) (MAP (SETCHAR O 44) (MOVELEFT R 0.3194455) (SETCHAR O 44) (MOVELEFT R 0.3194455) (SETCHAR O 44) ) ) (CHARACTER O 45 (CHARWD R 1.277782) (CHARHT R 0.039999) (CHARDP R 2.9600315) (NEXTLARGER O 65) (MAP (SETCHAR O 45) (MOVELEFT R 0.3194455) (SETCHAR O 45) (MOVELEFT R 0.3194455) (SETCHAR O 45) ) ) (CHARACTER O 46 (CHARWD R 1.277782) (CHARHT R 0.039999) (CHARDP R 2.9600315) (NEXTLARGER O 66) (MAP (SETCHAR O 46) (MOVELEFT R 0.3194455) (SETCHAR O 46) (MOVELEFT R 0.3194455) (SETCHAR O 46) ) ) (CHARACTER O 47 (CHARWD R 1.277782) (CHARHT R 0.039999) (CHARDP R 2.9600315) (NEXTLARGER O 67) (MAP (SETCHAR O 47) (MOVELEFT R 0.3194455) (SETCHAR O 47) (MOVELEFT R 0.3194455) (SETCHAR O 47) ) ) (CHARACTER O 50 (CHARWD R 1.61112) (CHARHT R 0.039999) (CHARDP R 2.9600315) (NEXTLARGER O 70) (MAP (SETCHAR O 50) (MOVELEFT R 0.40278) (SETCHAR O 50) (MOVELEFT R 0.40278) (SETCHAR O 50) ) ) (CHARACTER O 51 (CHARWD R 1.61112) (CHARHT R 0.039999) (CHARDP R 2.9600315) (NEXTLARGER O 71) (MAP (SETCHAR O 51) (MOVELEFT R 0.40278) (SETCHAR O 51) (MOVELEFT R 0.40278) (SETCHAR O 51) ) ) (CHARACTER O 52 (CHARWD R 1.61112) (CHARHT R 0.039999) (CHARDP R 2.9600315) (MAP (SETCHAR O 52) (MOVELEFT R 0.40278) (SETCHAR O 52) (MOVELEFT R 0.40278) (SETCHAR O 52) ) ) (CHARACTER O 53 (CHARWD R 1.61112) (CHARHT R 0.039999) (CHARDP R 2.9600315) (MAP (SETCHAR O 53) (MOVELEFT R 0.40278) (SETCHAR O 53) (MOVELEFT R 0.40278) (SETCHAR O 53) ) ) (CHARACTER O 60 (CHARWD R 1.750006) (CHARHT R 0.039999) (CHARDP R 1.760019) (VARCHAR (TOP O 60) (BOT O 100) (REP O 102) ) (MAP (SETCHAR O 60) (MOVELEFT R 0.4375015) (SETCHAR O 60) (MOVELEFT R 0.4375015) (SETCHAR O 60) ) ) (CHARACTER O 61 (CHARWD R 1.750006) (CHARHT R 0.039999) (CHARDP R 1.760019) (VARCHAR (TOP O 61) (BOT O 101) (REP O 103) ) (MAP (SETCHAR O 61) (MOVELEFT R 0.4375015) (SETCHAR O 61) (MOVELEFT R 0.4375015) (SETCHAR O 61) ) ) (CHARACTER O 62 (CHARWD R 1.333338) (CHARHT R 0.039999) (CHARDP R 1.760019) (VARCHAR (TOP O 62) (BOT O 64) (REP O 66) ) (MAP (SETCHAR O 62) (MOVELEFT R 0.3333345) (SETCHAR O 62) (MOVELEFT R 0.3333345) (SETCHAR O 62) ) ) (CHARACTER O 63 (CHARWD R 1.333338) (CHARHT R 0.039999) (CHARDP R 1.760019) (VARCHAR (TOP O 63) (BOT O 65) (REP O 67) ) (MAP (SETCHAR O 63) (MOVELEFT R 0.3333345) (SETCHAR O 63) (MOVELEFT R 0.3333345) (SETCHAR O 63) ) ) (CHARACTER O 64 (CHARWD R 1.333338) (CHARHT R 0.039999) (CHARDP R 1.760019) (VARCHAR (BOT O 64) (REP O 66) ) (MAP (SETCHAR O 64) (MOVELEFT R 0.3333345) (SETCHAR O 64) (MOVELEFT R 0.3333345) (SETCHAR O 64) ) ) (CHARACTER O 65 (CHARWD R 1.333338) (CHARHT R 0.039999) (CHARDP R 1.760019) (VARCHAR (BOT O 65) (REP O 67) ) (MAP (SETCHAR O 65) (MOVELEFT R 0.3333345) (SETCHAR O 65) (MOVELEFT R 0.3333345) (SETCHAR O 65) ) ) (CHARACTER O 66 (CHARWD R 1.333338) (CHARDP R 0.600006) (VARCHAR (TOP O 62) (REP O 66) ) (MAP (SETCHAR O 66) (MOVELEFT R 0.3333345) (SETCHAR O 66) (MOVELEFT R 0.3333345) (SETCHAR O 66) ) ) (CHARACTER O 67 (CHARWD R 1.333338) (CHARDP R 0.600006) (VARCHAR (TOP O 63) (REP O 67) ) (MAP (SETCHAR O 67) (MOVELEFT R 0.3333345) (SETCHAR O 67) (MOVELEFT R 0.3333345) (SETCHAR O 67) ) ) (CHARACTER O 70 (CHARWD R 1.777782) (CHARDP R 0.900009) (VARCHAR (TOP O 70) (MID O 74) (BOT O 72) (REP O 76) ) (MAP (SETCHAR O 70) (MOVELEFT R 0.4444455) (SETCHAR O 70) (MOVELEFT R 0.4444455) (SETCHAR O 70) ) ) (CHARACTER O 71 (CHARWD R 1.777782) (CHARDP R 0.900009) (VARCHAR (TOP O 71) (MID O 75) (BOT O 73) (REP O 76) ) (MAP (SETCHAR O 71) (MOVELEFT R 0.4444455) (SETCHAR O 71) (MOVELEFT R 0.4444455) (SETCHAR O 71) ) ) (CHARACTER O 72 (CHARWD R 1.777782) (CHARDP R 0.900009) (VARCHAR (TOP O 70) (BOT O 72) (REP O 76) ) (MAP (SETCHAR O 72) (MOVELEFT R 0.4444455) (SETCHAR O 72) (MOVELEFT R 0.4444455) (SETCHAR O 72) ) ) (CHARACTER O 73 (CHARWD R 1.777782) (CHARDP R 0.900009) (VARCHAR (TOP O 71) (BOT O 73) (REP O 76) ) (MAP (SETCHAR O 73) (MOVELEFT R 0.4444455) (SETCHAR O 73) (MOVELEFT R 0.4444455) (SETCHAR O 73) ) ) (CHARACTER O 74 (CHARWD R 1.777782) (CHARDP R 1.800018) (VARCHAR (REP O 77) ) (MAP (SETCHAR O 74) (MOVELEFT R 0.4444455) (SETCHAR O 74) (MOVELEFT R 0.4444455) (SETCHAR O 74) ) ) (CHARACTER O 75 (CHARWD R 1.777782) (CHARDP R 1.800018) (MAP (SETCHAR O 75) (MOVELEFT R 0.4444455) (SETCHAR O 75) (MOVELEFT R 0.4444455) (SETCHAR O 75) ) ) (CHARACTER O 76 (CHARWD R 1.777782) (CHARDP R 0.300003) (VARCHAR (REP O 76) ) (MAP (SETCHAR O 76) (MOVELEFT R 0.4444455) (SETCHAR O 76) (MOVELEFT R 0.4444455) (SETCHAR O 76) ) ) (CHARACTER O 77 (CHARWD R 1.333338) (CHARDP R 0.600006) (MAP (SETCHAR O 77) (MOVELEFT R 0.3333345) (SETCHAR O 77) (MOVELEFT R 0.3333345) (SETCHAR O 77) ) ) (CHARACTER O 100 (CHARWD R 1.750006) (CHARHT R 0.039999) (CHARDP R 1.760019) (VARCHAR (TOP O 70) (BOT O 73) (REP O 76) ) (MAP (SETCHAR O 100) (MOVELEFT R 0.4375015) (SETCHAR O 100) (MOVELEFT R 0.4375015) (SETCHAR O 100) ) ) (CHARACTER O 101 (CHARWD R 1.750006) (CHARHT R 0.039999) (CHARDP R 1.760019) (VARCHAR (TOP O 71) (BOT O 72) (REP O 76) ) (MAP (SETCHAR O 101) (MOVELEFT R 0.4375015) (SETCHAR O 101) (MOVELEFT R 0.4375015) (SETCHAR O 101) ) ) (CHARACTER O 102 (CHARWD R 1.750006) (CHARDP R 0.600006) (VARCHAR (REP O 102) ) (MAP (SETCHAR O 102) (MOVELEFT R 0.4375015) (SETCHAR O 102) (MOVELEFT R 0.4375015) (SETCHAR O 102) ) ) (CHARACTER O 103 (CHARWD R 1.750006) (CHARDP R 0.600006) (VARCHAR (REP O 103) ) (MAP (SETCHAR O 103) (MOVELEFT R 0.4375015) (SETCHAR O 103) (MOVELEFT R 0.4375015) (SETCHAR O 103) ) ) (CHARACTER O 104 (CHARWD R 1.222226) (CHARHT R 0.039999) (CHARDP R 1.760019) (NEXTLARGER O 34) (MAP (SETCHAR O 104) (MOVELEFT R 0.3055565) (SETCHAR O 104) (MOVELEFT R 0.3055565) (SETCHAR O 104) ) ) (CHARACTER O 105 (CHARWD R 1.222226) (CHARHT R 0.039999) (CHARDP R 1.760019) (NEXTLARGER O 35) (MAP (SETCHAR O 105) (MOVELEFT R 0.3055565) (SETCHAR O 105) (MOVELEFT R 0.3055565) (SETCHAR O 105) ) ) (CHARACTER O 120 (CHARWD R 0.77778) (CHARHT R 0.75) (CHARDP R 0.25) (NEXTLARGER O 0) (MAP (SELECTFONT D 2) (SETCHAR O 50) (MOVELEFT R 0.194445) (SETCHAR O 50) (MOVELEFT R 0.194445) (SETCHAR O 50) ) ) (CHARACTER O 121 (CHARWD R 0.77778) (CHARHT R 0.75) (CHARDP R 0.25) (NEXTLARGER O 1) (MAP (SELECTFONT D 2) (SETCHAR O 51) (MOVELEFT R 0.194445) (SETCHAR O 51) (MOVELEFT R 0.194445) (SETCHAR O 51) ) ) (CHARACTER O 122 (CHARWD R 0.555558) (CHARHT R 0.75) (CHARDP R 0.25) (NEXTLARGER O 2) (MAP (SELECTFONT D 2) (SETCHAR O 133) (MOVELEFT R 0.1388895) (SETCHAR O 133) (MOVELEFT R 0.1388895) (SETCHAR O 133) ) ) (CHARACTER O 123 (CHARWD R 0.555558) (CHARHT R 0.75) (CHARDP R 0.25) (NEXTLARGER O 3) (MAP (SELECTFONT D 2) (SETCHAR O 135) (MOVELEFT R 0.1388895) (SETCHAR O 135) (MOVELEFT R 0.1388895) (SETCHAR O 135) ) ) (CHARACTER O 124 (CHARWD R 0.888892) (CHARHT R 0.75) (CHARDP R 0.25) (NEXTLARGER O 4) (MAP (SELECTFONT D 1) (SETCHAR O 142) (MOVELEFT R 0.222223) (SETCHAR O 142) (MOVELEFT R 0.222223) (SETCHAR O 142) ) ) (CHARACTER O 125 (CHARWD R 0.888892) (CHARHT R 0.75) (CHARDP R 0.25) (NEXTLARGER O 5) (MAP (SELECTFONT D 1) (SETCHAR O 143) (MOVELEFT R 0.222223) (SETCHAR O 143) (MOVELEFT R 0.222223) (SETCHAR O 143) ) ) (CHARACTER O 126 (CHARWD R 0.888892) (CHARHT R 0.75) (CHARDP R 0.25) (NEXTLARGER O 6) (MAP (SELECTFONT D 1) (SETCHAR O 144) (MOVELEFT R 0.222223) (SETCHAR O 144) (MOVELEFT R 0.222223) (SETCHAR O 144) ) ) (CHARACTER O 127 (CHARWD R 0.888892) (CHARHT R 0.75) (CHARDP R 0.25) (NEXTLARGER O 7) (MAP (SELECTFONT D 1) (SETCHAR O 145) (MOVELEFT R 0.222223) (SETCHAR O 145) (MOVELEFT R 0.222223) (SETCHAR O 145) ) ) (CHARACTER O 130 (CHARWD R 1.000004) (CHARHT R 0.75) (CHARDP R 0.25) (NEXTLARGER O 10) (MAP (SELECTFONT D 1) (SETCHAR O 146) (MOVELEFT R 0.250001) (SETCHAR O 146) (MOVELEFT R 0.250001) (SETCHAR O 146) ) ) (CHARACTER O 131 (CHARWD R 1.000004) (CHARHT R 0.75) (CHARDP R 0.25) (NEXTLARGER O 11) (MAP (SELECTFONT D 1) (SETCHAR O 147) (MOVELEFT R 0.250001) (SETCHAR O 147) (MOVELEFT R 0.250001) (SETCHAR O 147) ) ) (CHARACTER O 132 (CHARWD R 0.77778) (CHARHT R 0.75) (CHARDP R 0.25) (NEXTLARGER O 12) (MAP (SELECTFONT D 1) (SETCHAR O 150) (MOVELEFT R 0.194445) (SETCHAR O 150) (MOVELEFT R 0.194445) (SETCHAR O 150) ) ) (CHARACTER O 133 (CHARWD R 0.77778) (CHARHT R 0.75) (CHARDP R 0.25) (NEXTLARGER O 13) (MAP (SELECTFONT D 1) (SETCHAR O 151) (MOVELEFT R 0.194445) (SETCHAR O 151) (MOVELEFT R 0.194445) (SETCHAR O 151) ) ) (CHARACTER O 134 (CHARWD R 0.555558) (CHARHT R 0.75) (CHARDP R 0.25) (NEXTLARGER O 14) (MAP (SELECTFONT D 1) (SETCHAR O 152) (MOVELEFT R 0.1388895) (SETCHAR O 152) (MOVELEFT R 0.1388895) (SETCHAR O 152) ) ) (CHARACTER O 150 (CHARWD R 0.944448) (CHARHT R 0.039999) (CHARDP R 1.760019) (NEXTLARGER O 24) (MAP (SETCHAR O 150) (MOVELEFT R 0.236112) (SETCHAR O 150) (MOVELEFT R 0.236112) (SETCHAR O 150) ) ) (CHARACTER O 151 (CHARWD R 0.944448) (CHARHT R 0.039999) (CHARDP R 1.760019) (NEXTLARGER O 25) (MAP (SETCHAR O 151) (MOVELEFT R 0.236112) (SETCHAR O 151) (MOVELEFT R 0.236112) (SETCHAR O 151) ) ) (CHARACTER O 152 (CHARWD R 1.055562) (CHARHT R 0.039999) (CHARDP R 1.760019) (NEXTLARGER O 26) (MAP (SETCHAR O 152) (MOVELEFT R 0.2638905) (SETCHAR O 152) (MOVELEFT R 0.2638905) (SETCHAR O 152) ) ) (CHARACTER O 153 (CHARWD R 1.055562) (CHARHT R 0.039999) (CHARDP R 1.760019) (NEXTLARGER O 27) (MAP (SETCHAR O 153) (MOVELEFT R 0.2638905) (SETCHAR O 153) (MOVELEFT R 0.2638905) (SETCHAR O 153) ) ) (CHARACTER O 154 (CHARWD R 1.055562) (CHARHT R 0.039999) (CHARDP R 1.760019) (NEXTLARGER O 30) (MAP (SETCHAR O 154) (MOVELEFT R 0.2638905) (SETCHAR O 154) (MOVELEFT R 0.2638905) (SETCHAR O 154) ) ) (CHARACTER O 155 (CHARWD R 1.055562) (CHARHT R 0.039999) (CHARDP R 1.760019) (NEXTLARGER O 31) (MAP (SETCHAR O 155) (MOVELEFT R 0.2638905) (SETCHAR O 155) (MOVELEFT R 0.2638905) (SETCHAR O 155) ) ) (CHARACTER O 156 (CHARWD R 1.333338) (CHARHT R 0.039999) (CHARDP R 1.760019) (NEXTLARGER O 32) (MAP (SETCHAR O 156) (MOVELEFT R 0.3333345) (SETCHAR O 156) (MOVELEFT R 0.3333345) (SETCHAR O 156) ) ) (CHARACTER O 157 (CHARWD R 1.333338) (CHARHT R 0.039999) (CHARDP R 1.760019) (NEXTLARGER O 33) (MAP (SETCHAR O 157) (MOVELEFT R 0.3333345) (SETCHAR O 157) (MOVELEFT R 0.3333345) (SETCHAR O 157) ) )
- Type the following at the shell prompt:
vptovf tripledelimiters10.vpl
This will generate two files called
tripledelimiters10.tfm
andtripledelimiters10.vf
, always in the same directory. - Save the following code into
tridelim.sty
:\NeedsTeXFormat{LaTeX2e}\relax % LaTeX2e is required! \ProvidesPackage{tridelim} [2018/03/25 v0.01 (development)]
\DeclareFontFamily{U}{tridelim}{\hyphenchar\font \m@ne} \DeclareFontShape{U}{tridelim}{m}{n}{<->tripledelimiters10}{}
\DeclareSymbolFont{triplesymbols}{U}{tridelim}{m}{n} \DeclareMathDelimiter{\lPparen}{\mathopen} {triplesymbols}{"50}{triplesymbols}{"50} \DeclareMathDelimiter{\rPparen}{\mathclose} {triplesymbols}{"51}{triplesymbols}{"51} \DeclareMathDelimiter{\lBbrack}{\mathopen} {triplesymbols}{"52}{triplesymbols}{"52} \DeclareMathDelimiter{\rBbrack}{\mathclose} {triplesymbols}{"53}{triplesymbols}{"53} \DeclareMathDelimiter{\lFfloor}{\mathopen} {triplesymbols}{"54}{triplesymbols}{"54} \DeclareMathDelimiter{\rFfloor}{\mathclose} {triplesymbols}{"55}{triplesymbols}{"55} \DeclareMathDelimiter{\lCceil}{\mathopen} {triplesymbols}{"56}{triplesymbols}{"56} \DeclareMathDelimiter{\rCceil}{\mathclose} {triplesymbols}{"57}{triplesymbols}{"57} \DeclareMathDelimiter{\lBbrace}{\mathopen} {triplesymbols}{"58}{triplesymbols}{"58} \DeclareMathDelimiter{\rBbrace}{\mathclose} {triplesymbols}{"59}{triplesymbols}{"59} \DeclareMathDelimiter{\lAangle}{\mathopen} {triplesymbols}{"5A}{triplesymbols}{"5A} \DeclareMathDelimiter{\rAangle}{\mathclose} {triplesymbols}{"5B}{triplesymbols}{"5B} \DeclareMathDelimiter{\Vvert}{\mathord} {triplesymbols}{"5C}{triplesymbols}{"5C} \DeclareMathDelimiter{\lVvert}{\mathopen} {triplesymbols}{"5C}{triplesymbols}{"5C} \DeclareMathDelimiter{\rVvert}{\mathclose} {triplesymbols}{"5C}{triplesymbols}{"5C} \DeclareMathDelimiter{\Aarrowvert}{\mathord} {triplesymbols}{"3C}{triplesymbols}{"3C} \DeclareMathDelimiter{\Bbracevert}{\mathord} {triplesymbols}{"3E}{triplesymbols}{"3E} \DeclareMathDelimiter{\lGgroup}{\mathopen} {triplesymbols}{"3A}{triplesymbols}{"3A} \DeclareMathDelimiter{\rGgroup}{\mathclose} {triplesymbols}{"3B}{triplesymbols}{"3B}
- Save the following code into
test.tex
:% My standard header for TeX.SX answers: \documentclass[a4paper]{article} % To avoid confusion, let us explicitly % declare the paper format.
\usepackage[T1]{fontenc} % Not always necessary, but recommended. \usepackage[utf8]{inputenc} % Not always necessary, but recommended. % End of standard header. What follows pertains to the problem at hand.
\usepackage{mathtools} \usepackage{tridelim}
\DeclarePairedDelimiter{\tripleparen}{\lPparen}{\rPparen} \DeclarePairedDelimiter{\triplebrack}{\lBbrack}{\rBbrack} \DeclarePairedDelimiter{\triplefloor}{\lFfloor}{\rFfloor} \DeclarePairedDelimiter{\tripleceil} {\lCceil} {\rCceil} \DeclarePairedDelimiter{\triplebrace}{\lBbrace}{\rBbrace} \DeclarePairedDelimiter{\tripleangle}{\lAangle}{\rAangle} \DeclarePairedDelimiter{\triplevert} {\lVvert} {\rVvert} \DeclarePairedDelimiter{\triplegroup}{\lGgroup}{\rGgroup} \DeclarePairedDelimiter{\triplearrowvert}{\Aarrowvert}{\Aarrowvert} \DeclarePairedDelimiter{\triplebracevert}{\Bbracevert}{\Bbracevert}
\DeclarePairedDelimiterX\triplebracket[3]{\lAangle}{\rAangle} {#1\,\delimsize\Vvert\,\mathopen{}#2\,\delimsize\Vvert\,\mathopen{}#3}
\newcommand*{\testfraction}{\frac{a}{b}} \newcommand*{\testbigfraction}{% \frac{\,\frac{d^{n}}{dt^{n}}\,}{n!}% } \newcommand*{\testmatrix}{% \begin{matrix}% 1&0&0&0\\% 0&1&0&0\\% 0&0&1&0\\% 0&0&0&1% \end{matrix}% }
\begin{document}
We begin with a simple formula: \( P\lPparen x\rPparen \). Is it OK in sub-\slash superscripts too? Let’s check: \( Z^{P\lPparen x\rPparen} \), and \( 2^{Z_{P\lPparen x\rPparen}} \). It works, but is suboptimal: indeed, compare it closely with \( Z^{P(x)} \) and \( 2^{Z_{P(x)}} \).
Here are the normal sizes, in display: \begin{align*} & x \tripleparen{y} z & & x \triplebrack{y} z & & x \triplefloor{y} z & & x \tripleceil {y} z & & x \triplebrace{y} z \\ & x \tripleangle{y} z & & x \triplevert {y} z & & y \triplearrowvert*{x} z & % needs "\left" and "\right" & y \triplebracevert*{x} z % needs "\left" and "\right" \end{align*}
Here are the \verb|\big| sizes, in display: \begin{align*} & x \tripleparen[\big]{y} z & & x \triplebrack[\big]{y} z & & x \triplefloor[\big]{y} z & & x \tripleceil [\big]{y} z & & x \triplebrace[\big]{y} z \\ & x \tripleangle[\big]{y} z & & x \triplevert [\big]{y} z & & x \triplearrowvert[\big]{y} z & & x \triplebracevert[\big]{y} z \end{align*}
Here are the \verb|\Big| sizes, in display: \begin{align*} & x \tripleparen[\Big]{\testfraction} z & & x \triplebrack[\Big]{\testfraction} z & & x \triplefloor[\Big]{\testfraction} z & & x \tripleceil [\Big]{\testfraction} z & & x \triplebrace[\Big]{\testfraction} z \\ & x \tripleangle[\Big]{\testfraction} z & & x \triplegroup[\Big]{\testfraction} z & % not available at smaller sizes & x \triplevert [\Big]{\testfraction} z & & x \triplearrowvert[\Big]{\testfraction} z & & x \triplebracevert[\Big]{\testfraction} z \end{align*}
Here are the \verb|\bigg| sizes, in display: \begin{align*} & x \tripleparen[\bigg]{\testfraction} z & & x \triplebrack[\bigg]{\testfraction} z & & x \triplefloor[\bigg]{\testfraction} z & & x \tripleceil [\bigg]{\testfraction} z & & x \triplebrace[\bigg]{\testfraction} z \\ & x \tripleangle[\bigg]{\testfraction} z & & x \triplegroup[\bigg]{\testfraction} z & & x \triplevert [\bigg]{\testfraction} z & & x \triplearrowvert[\bigg]{\testfraction} z & & x \triplebracevert[\bigg]{\testfraction} z \end{align*}
Here are the \verb|\Bigg| sizes, in display: \begin{align*} & x \tripleparen[\Bigg]{\testbigfraction} z & & x \triplebrack[\Bigg]{\testbigfraction} z & & x \triplefloor[\Bigg]{\testbigfraction} z & & x \tripleceil [\Bigg]{\testbigfraction} z \\ & x \triplebrace[\Bigg]{\testbigfraction} z & & x \tripleangle[\Bigg]{\testbigfraction} z & & x \triplegroup[\Bigg]{\testbigfraction} z \\ & x \triplevert [\Bigg]{\testbigfraction} z & & x \triplearrowvert[\Bigg]{\testbigfraction} z & & x \triplebracevert[\Bigg]{\testbigfraction} z \end{align*}
And finally, the glorious auto-sizing delimiters, always in display: \begin{align*} & x \tripleparen*{\testmatrix} z & & x \triplebrack*{\testmatrix} z & & x \triplefloor*{\testmatrix} z \\ & x \tripleceil* {\testmatrix} z & & x \triplebrace*{\testmatrix} z & & x \triplegroup*{\testmatrix} z \\ & x \triplevert* {\testmatrix} z & & x \triplearrowvert*{\testmatrix} z & & x \triplebracevert*{\testmatrix} z \end{align*}
For the following example, cf.~p.~26 of the manual of the \textsf{mathtools} package: \( \triplebracket[\big]{B}{\sum_{k} f_k}{C} \).
\end{document}
- Compiling
test.tex
should produce the following output:
You can use \DeclarePairedDelimiterX{\tbr}[1]{\llbracket}{\rrbracket}{\mkern-5mu\delimsize\llbracket \mathopen{}#1 \mathclose{} \delimsize\rrbracket\mkern-5mu}
You can find further information on page 26 in the mathtools manual. Basically \DeclarePairedDelimiterX{〈cmd〉}[〈num args〉]{〈left_delim〉}{〈right_delim〉}{〈body〉}
allows you to additionally specify a macro surrounded by the outer brackets. \delimsize
gives the sizes of the outer brackets. \mathopen{}
and \mathclose{}
fix problem with the spacing which may occur (see this answer and the footnote on page 26 in the mathtools manual).
EDIT: Here is what I have so far . There is a slight displacement with the smallest brackets and the starred version does not work. For better results I think one have to redefine \DeclarePairedDelimiter
.
\documentclass{article}
\usepackage{mathtools,stmaryrd}
\usepackage{xcolor}
\DeclarePairedDelimiter{\dbr}{\llbracket}{\rrbracket}
\DeclarePairedDelimiterX{\tbr}[1]{\llbracket}{\rrbracket}{\nhphantom{$\delimsize\llbracket$}\delimsize\llbracket \mathopen{} #1 \mathclose{} \delimsize\rrbracket \nhphantom{$\delimsize\rrbracket$}}
\newcommand{\nhphantom}[1]{\sbox0{#1}\hspace{-0.751\wd0}}
\begin{document}
Double brackets:
\[
\dbr{x} \quad \dbr[\big]{T^T}
\]
Triple brackets:
\[
\tbr{x} \quad \tbr[\big]{T^T}
\]
\[
{\llbracket}\nhphantom{$\llbracket$}{\textcolor{red}{\llbracket}} \quad
{\big\llbracket}\nhphantom{$\big\llbracket$}{\textcolor{red}{\big\llbracket}} \quad
{\Big\llbracket}\nhphantom{$\Big\llbracket$}{\textcolor{red}{\Big\llbracket}} \quad
{\bigg\llbracket}\nhphantom{$\bigg\llbracket$}{\textcolor{red}{\bigg\llbracket}} \quad
{\Bigg\llbracket}\nhphantom{$\Bigg\llbracket$}{\textcolor{red}{\Bigg\llbracket}}
\]
\end{document}
Result: