opencollab / jlatexmath

A Java API to render LaTeX
Other
514 stars 109 forks source link

\longleftarrow has gap #42

Closed murkle closed 3 years ago

murkle commented 6 years ago

\longleftarrow has a gap/notch in when drawn large: longleftarrow

Definition: TeXFormula.predefinedTeXFormulasAsString.put("longleftarrow", "\\leftarrow\\joinrel\\relbar");

\joinrel has a constant of -2.6f

public static final Atom joinrel_macro() throws ParseException {
  return new TypedAtom(TeXConstants.TYPE_RELATION, TeXConstants.TYPE_RELATION, new SpaceAtom(
    TeXConstants.UNIT_MU, -2.6f, 0, 0));
}

changing this to around -3.4f seems to fix this case, which matches the value in XLeftRightArrowFactory but I don't know if this will break other things

Box kern = new SpaceAtom(TeXConstants.UNIT_MU, -3.4f, 0, 0).createBox(env);