Add \overleftrightarrow command.

This is simply another Style command with custom CSS to make a line with an
arrowhead at each end.

There were a couple of small issues here:
1. :after is used to fill empty blocks, but I need :after for the right
   arrowhead.

   This was resolved by using min-width and min-height.  Both are extremely
   common CSS at this point.

2. The original \overleftarrow and \overrightarrow work upon which this is
   based do not scale well.

   I made no effort to fix the scaling issue.  The current arrows misalign with
   the line if the font-size changes even slightly.  Using \overleftarrow in
   the visual test page, where the base font is .8em causes issues.

   Without using JavaScript to alter inline styles, I think that end users will
   have to write custom styles if they are using non-standard font sizes.  This
   is no worse than the original implementation, so I feel confident that the
   \overleftrightarrow is as good as what currently exists for the other arrow
   types.

3. The collapsed arrowheads for \overleftrightarrow collapse on top of one
   another when the block is empty.  It looks like an asterisk.

   The min-width could be made larger.  This is part of a set of geometric
   markers that need at least two identifiers underneath.  No line segment,
   ray, or line can be defined without at least two points.

   Given that the current \over* markers do not have enough space when empty
   for two characters, I concluded that two space was not necessary here
   either.  The difference, however, is that the single-arrowhead lines do not
   present a visual miscue when collapsed to a single character width.

   This would be an easy change.  Given the variable width nature of Symbola, I
   recommend that the min-width be set to 1.5em if this change is desired.
   Our custom CSS that we apply on top of MathQuill's base CSS for our product
   does use the 1.5em min-width.
2 files changed
tree: 00e97ddd130632e1fcd53dfa4d48e64e261f2ab5
  1. docs/
  2. script/
  3. src/
  4. test/
  5. .gitattributes
  6. .gitignore
  7. BUILDING
  8. CHANGELOG.md
  9. circle.yml
  10. Makefile
  11. mkdocs.yml
  12. package.json
  13. README.md
README.md

MathQuill

by Han, Jeanine, and Mary (maintainers@mathquill.com)

MathQuill is a web formula editor designed to make typing math easy and beautiful.

The MathQuill project is supported by its partners. We hold ourselves to a compassionate Code of Conduct.

MathQuill is resuming active development and we‘re committed to getting things running smoothly. Find a dusty corner? Let us know in Slack. (Prefer IRC? We’re #mathquill on Freenode.)

Getting Started

MathQuill has a simple interface. This brief example creates a MathQuill element and renders, then reads a given input:

var htmlElement = document.getElementById('some_id');
var config = {
  handlers: { edit: function(){ ... } },
  restrictMismatchedBrackets: true
};
var mathField = MQ.MathField(htmlElement, config);

mathField.latex('2^{\\frac{3}{2}}'); // Renders the given LaTeX in the MathQuill field
mathField.latex(); // => '2^{\\frac{3}{2}}'

Check out our Getting Started Guide for setup instructions and basic MathQuill usage.

Docs

Most documentation for MathQuill is located on ReadTheDocs.

Some older documentation still exists on the Wiki.

Open-Source License

The Source Code Form of MathQuill is subject to the terms of the Mozilla Public License, v. 2.0: http://mozilla.org/MPL/2.0/

The quick-and-dirty is you can do whatever if modifications to MathQuill are in public GitHub forks. (Other ways to publicize modifications are also fine, as are private use modifications. See also: MPL 2.0 FAQ)