Double square brackets?

1,559 views
Skip to first unread message

Zhen Lin

unread,
Aug 7, 2011, 10:46:05 AM8/7/11
to MathJax Users
The TeX package stmaryrd provides the delimiters \llbracket and
\rrbracket. These are available in Unicode as ⟦ (U+27E6) and ⟧ (U
+27E7), and present in Asana Math, Latin Modern, as well as STIX (in
variable sizes). They are used in logic and computer science to
indicate the denotation of a term or formula. At the moment, they do
not seem to be supported in MathJax. Would it be possible to add these
in the next release?

Frédéric WANG

unread,
Aug 8, 2011, 5:14:59 AM8/8/11
to mathja...@googlegroups.com
Thanks for your report. The \llbracket and \rrbracket are not supported, but you can redefine them with macros that use the  \unicode command:

http://www.mathjax.org/docs/1.1/tex.html#unicode-support

I think MathJax does not stretch this symbols yet, but Davide is adding more stretchy symbols for the next release and these brackets are likely to be added too. For now, you may want to try the native MathML support as some layout engines provide better support for stretchy operators.

Davide P. Cervone

unread,
Aug 8, 2011, 9:28:43 AM8/8/11
to mathja...@googlegroups.com
I was going to suggest the \unicode macro as well.  One caveat is that this relies on the fonts available on the user's computer, since these characters aren't in the MathJax web-based fonts, so you can't guarantee that they will be displayed properly.  

An alternative would be do define \llbracket as [\!\![ and \rrbracket as ]\!\!], which are the "poor man's" versions of these characters.  Of course, they are not stretchy, so can't be used with \left and \right.  

As Fred mentioned, the next release of MathJax does include more stretchy characters, and U+27E6 and U+27E7 are included in that list when the STIX fonts are available on the user's computer.  But the MathJax web fonts dont' include the required characters to make these stretchy characters, so it would require the user to have the STIX fonts installed.  If you want to have this right now, you can use your own configuration file to add these stretchy characters, as follows:

<script type="text/x-mathjax-config">
MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
  var TEXDEFS = MathJax.InputJax.TeX.Definitions;
  TEXDEFS.delimiter["\\llbracket"] = "27E6";
  TEXDEFS.delimiter["\\rrbracket"] = "27E7";
});

MathJax.Hub.Register.StartupHook("HTML-CSS Jax Ready",function () {
  var HTMLCSS = MathJax.OutputJax["HTML-CSS"],
      DELIMITERS = HTMLCSS.FONTDATA.DELIMITERS;

  var GENERAL = "STIXGeneral",
      SIZE1   = "STIXSizeOneSym",
      SIZE2   = "STIXSizeTwoSym",
      SIZE3   = "STIXSizeThreeSym",
      SIZE4   = "STIXSizeFourSym";

  if (HTMLCSS.fontInUse === "STIX") {
    // left white square bracket
    DELIMITERS[0x27E6] = {
      dir: "V", HW: [[.93,GENERAL],[1.23,SIZE1],[1.845,SIZE2],[2.46,SIZE3],[3.075,SIZE4]],
      stretch: {top:[0x2553,GENERAL], ext:[0x2551,GENERAL], bot:[0x2559,GENERAL]}
    };
    // right white square bracket
    DELIMITERS[0x27E7] = {
      dir: "V", HW: [[.93,GENERAL],[1.23,SIZE1],[1.845,SIZE2],[2.46,SIZE3],[3.075,SIZE4]],
      stretch: {top:[0x2556,GENERAL], ext:[0x2551,GENERAL], bot:[0x255C,GENERAL]}
    };
  }
});
</script>

This will define the data needed for the stretchy delimiters, and defined \llbracket and \rrbracket as those delimiters.

Since the characters are only available in the STIX fonts, not the MathJax web-based fonts, you would probably want to change the preferred font to be STIX rather than the MathJax TeX fonts (though if neither is available locally, the web-based MathJax fonts will still be used):

<script type="text/x-mathjax-config">
MathJax.Hub.Config({
  "HTML-CSS": {
    preferredFont: "STIX"
  }
});
</script>

You can, of course, make a local configuration file that includes both of these.

Hope that helps.

Davide

Zhen Lin

unread,
Aug 9, 2011, 3:54:08 AM8/9/11
to MathJax Users
Thanks for the suggestions.

Is there a project roadmap somewhere which has the expected release
dates and features of future versions? I'm actually a user of a
MathJax site, so I can't change the configuration myself, but I was
just wondering when I might be able to start using new symbols.

--
Zhen Lin

Robert Miner

unread,
Aug 11, 2011, 4:12:02 PM8/11/11
to mathja...@googlegroups.com
Hi.

There is a very high-level roadmap in the form of a MathJax 1.2 feature spec together with statuses at

https://sites.google.com/site/mathjaxproject/design-documents/mathjax-1-1-specification/mathjax-1-2-specification

--Robert
Reply all
Reply to author
Forward
0 new messages