MCPcopy Create free account
hub / github.com/NanoMichael/MicroTeX / parse

Method parse

src/latex.cpp:50–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48}
49
50TeXRender* LaTeX::parse(const wstring& latex, int width, float textSize, float lineSpace, color fg) {
51 bool lined = true;
52 if (startswith(latex, L"$$") || startswith(latex, L"\\[")) {
53 lined = false;
54 }
55 int align = lined ? ALIGN_LEFT : ALIGN_CENTER;
56 _formula->setLaTeX(latex);
57 TeXRender* render =
58 _builder->setStyle(STYLE_DISPLAY)
59 .setTextSize(textSize)
60 .setWidth(UNIT_PIXEL, width, align)
61 .setIsMaxWidth(lined)
62 .setLineSpace(UNIT_PIXEL, lineSpace)
63 .setForeground(fg)
64 .build(*_formula);
65 return render;
66}

Callers

nothing calls this directly

Calls 7

startswithFunction · 0.85
buildMethod · 0.80
setForegroundMethod · 0.80
setWidthMethod · 0.80
setStyleMethod · 0.80
setLaTeXMethod · 0.45
setTextSizeMethod · 0.45

Tested by

no test coverage detected