After some experiments and tests, I managed to create the following code for \upbracefill and \downbracefill in Plain XeTeX, which it seems is that used for \underbrace and \overbrace:

\lower.5\dimen0\box0 }

\raise.5\dimen0\hbox{\special{x:gsave}\special{x:rotate 90}}}%


\XeTeXmathchardef\bracelu = 0 3 `\⎧
\XeTeXmathchardef\bracemu = 0 3 `\⎨
\XeTeXmathchardef\braceru = 0 3 `\⎩
\XeTeXmathchardef\bracebar = 0 3 `\⎪
\XeTeXmathchardef\braceld = 0 3 `\⎫
\XeTeXmathchardef\bracemd = 0 3 `\⎬
\XeTeXmathchardef\bracerd = 0 3 `\⎭


Where Cambria Math is loaded for the 3. family.
However, the height of these braces are bigger because of the middle part of the brace, and I can't find a way to shrink/limit the height of the box, without which the brace would fall apart.

I originally used the :vertical parameter for the font, which I figured has no dimension in horizontal text.

So how can I make this horizontal brace height smaller? (preferably to the character width, which is now the height.)

  • I'm really going to have to remember this for unicode-math... – Will Robertson Sep 26 '10 at 9:51
  • Again, not a real answer, but if I were you, I'd save myself the trouble and use LuaTeX instead which already have \Umathaccent, \Umathbotaccent, \Umathaccents and more, check ntg.nl/maps/38/04.pdf. You can use luaotfload package with plain TeX, and most of your code can be reused, but you get better quality OpenType math. – Khaled Hosny Sep 26 '10 at 18:06
  • I understand and accept that as an option, but generally if I meet a problem, I prefer to solve it, if that is possible. (Not very efficient though.) – Adam L. S. Sep 27 '10 at 23:18
  • @Adam, I do so all the time, but emulating TeX's math engine in macros is no fun. – Khaled Hosny Oct 5 '10 at 8:24
  • 1
    @Khaled: On the contrary, I find it can be lots of “fun” :) – Will Robertson Oct 5 '10 at 10:48

After I saw that \upbracefill is used for \underbrace, I felt the need to correct this problem, so I take some time to it and look at it to see what choices do I have. Soon I realized that the only good solution is if I shrink the bounding box of each character, with the help of \setbox. (The only problem was to do this in the characters right state.) Since the most biggest character is the middle one, I arrange their height to that. (The rest of that characters height is aligned to that, however 0pt height is also ok.)
So here is the result using the above \rotatebrace and \midshift macros:



Here is an example: Horizontal braces example in foreign language text The example above uses Calibri for normal text and Cambria for mathematical equations, (just as Office 2007 does) as well as for the braces, as in a Hungarian notes of a class of mine.
Note: In some viewer in certain zoom it appears as if it would fallen apart, and the join of the characters seems thicker than they should be. This will be OK in print.

  • This means, that I dare to share this beta “package”, as soon as I finish writing the documentation for it ASAP. (With full of spelling errors. :-() – Adam L. S. Oct 10 '10 at 15:46
  • I'd certainly be happily willing to accept a patch to unicode-math if you were interested in taking a look into it. – Will Robertson Oct 10 '10 at 16:54
  • I'm interested of such challenges. Now that I take a look at it's site, I'm seriously thinking of offering this pack, and my support. – Adam L. S. Oct 10 '10 at 17:16
  • I have the feeling, that somehow the ⏟ (U+23DF) and ⏞ (U+23DE) characters should be used, instead of the brace elements (since the font should do this trick, as it works for hat->widehat and tilde->widetilde for Cambria Math), and it may solve a problem; that the braces cannot be smaller a certain size, depending on the element size. – Adam L. S. Oct 24 '10 at 9:20
  • The hat and tilde solved with combining dialectical marks and \XeTeXmathaccent – Adam L. S. Oct 24 '10 at 9:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.