// align the top of M in the cell with the top of M in the surrounding font
int dy_for_nicefrac(MetricsBase & mb)
{
// align the top of M in the cell with the top of M in the surrounding font
int dy_for_nicefrac(MetricsBase & mb)
{
void InsetMathFrac::metrics(MetricsInfo & mi, Dimension & dim) const
{
Dimension dim0, dim1, dim2;
void InsetMathFrac::metrics(MetricsInfo & mi, Dimension & dim) const
{
Dimension dim0, dim1, dim2;
cell(0).metrics(mi, dim0);
cell(1).metrics(mi, dim1);
dim.wid = max(dim0.wid, dim1.wid) + 2;
cell(0).metrics(mi, dim0);
cell(1).metrics(mi, dim1);
dim.wid = max(dim0.wid, dim1.wid) + 2;
// is there an extra cell holding the value being given a dimension?
// (this is \unitfracthree)
if (kind_ == UNITFRAC && nargs() == 3) {
// is there an extra cell holding the value being given a dimension?
// (this is \unitfracthree)
if (kind_ == UNITFRAC && nargs() == 3) {
xx += cell(2).dimension(*pi.base.bv).wid + 4;
}
Changer dummy = (kind_ == UNITFRAC) ? pi.base.font.changeShape(UP_SHAPE)
: Changer();
// nice fraction
Changer dummy2 = pi.base.changeScript();
xx += cell(2).dimension(*pi.base.bv).wid + 4;
}
Changer dummy = (kind_ == UNITFRAC) ? pi.base.font.changeShape(UP_SHAPE)
: Changer();
// nice fraction
Changer dummy2 = pi.base.changeScript();
// reference LaTeX code from nicefrac.sty:
// \mkern-2mu/\mkern-1mu
if (latexkeys const * slash = slash_symbol()) {
int mkern = mathed_mu(pi.base.font, 2.0);
// reference LaTeX code from nicefrac.sty:
// \mkern-2mu/\mkern-1mu
if (latexkeys const * slash = slash_symbol()) {
int mkern = mathed_mu(pi.base.font, 2.0);
- mathedSymbolDraw(pi, xx + 2 + dim0.wid - mkern, y, slash);
+ mathedSymbolDraw(pi, xx + 1 + dim0.wid - mkern, y, slash);
Dimension dimslash;
mathedSymbolDim(pi.base, dimslash, slash);
xx += dimslash.wid - mathed_mu(pi.base.font, 3.0);
}
Dimension dimslash;
mathedSymbolDim(pi.base, dimslash, slash);
xx += dimslash.wid - mathed_mu(pi.base.font, 3.0);
}
- pi.pain.line(x + 1, y - dy, x + dim.wid - 2, y - dy,
+ pi.pain.line(x, y - dy, x + dim.wid - 2, y - dy,
Changer dummy =
(kind_ == DBINOM) ? mi.base.font.changeStyle(LM_ST_DISPLAY) :
(kind_ == TBINOM) ? mi.base.font.changeStyle(LM_ST_SCRIPT) :
Changer dummy =
(kind_ == DBINOM) ? mi.base.font.changeStyle(LM_ST_DISPLAY) :
(kind_ == TBINOM) ? mi.base.font.changeStyle(LM_ST_SCRIPT) :
dim.asc = dim0.height() + 1 + dy/2 + dy;
dim.des = max(0, dim1.height() + 1 + dy/2 - dy);
dim.wid = max(dim0.wid, dim1.wid) + 2 * dw(dim.height()) + 4;
dim.asc = dim0.height() + 1 + dy/2 + dy;
dim.des = max(0, dim1.height() + 1 + dy/2 - dy);
dim.wid = max(dim0.wid, dim1.wid) + 2 * dw(dim.height()) + 4;
Dimension const dim = dimension(*pi.base.bv);
Dimension const & dim0 = cell(0).dimension(*pi.base.bv);
Dimension const & dim1 = cell(1).dimension(*pi.base.bv);
Dimension const dim = dimension(*pi.base.bv);
Dimension const & dim0 = cell(0).dimension(*pi.base.bv);
Dimension const & dim1 = cell(1).dimension(*pi.base.bv);
// define the binom brackets
docstring const bra = kind_ == BRACE ? from_ascii("{") :
kind_ == BRACK ? from_ascii("[") : from_ascii("(");
// define the binom brackets
docstring const bra = kind_ == BRACE ? from_ascii("{") :
kind_ == BRACK ? from_ascii("[") : from_ascii("(");
dim.height(), bra);
mathed_draw_deco(pi, x + dim.width() - dw(dim.height()),
y - dim.ascent(), dw(dim.height()), dim.height(), ket);
dim.height(), bra);
mathed_draw_deco(pi, x + dim.width() - dw(dim.height()),
y - dim.ascent(), dw(dim.height()), dim.height(), ket);