Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
  • Jan 03 2016 02:45
    @kevinbarabash banned @acx01b
Katex's auto-render ofc
Where is the 'K' in KaTeX coming from?
Tesla I. Zhang‮
Is it KKSK?
I'm stuck.
I need aligned equations with regular text in between. The closest I can get is Combine like terms10=yNow add 3 to both sides and then do something else3+10=y+3\begin{aligned} \text{Combine like terms} \\ 10 & = y \\ \text{Now add 3 to both sides and then do something else} \\ 3 + 10 & = y + 3 \end{aligned}
But, I can't get the text to align to the left. \shortintertext works regularly, but not with Katex cause it's automatically in math mode. If anyone can help it would be awesome!
Uncompiled it's
\text{Combine like terms} \
10 & = y\
\text{Now add 3 to both sides and then do something else} \
3 + 10 & = y + 3
Ron Kok
How about:
\text{Combine like terms} \
\hphantom{3 + \vphantom{x}}10 = y\
\text{Now add 3 to both sides and then do something else} \
3 + 10 = y + 3
Thanks for the input! Unfortunately, that solution is impractical for more than a few equations + the equations themselves are no longer centered.
i'm an actuary (and katex newby) and am interested in being able to use katex for actuarial symbols (see above). i don't see native support in katex, but found this library: https://ctan.org/pkg/actuarialangle which can do it. is there a way to have this library loaded into katex?
Hey Shaneleib, Katex is pretty limited when it comes to adding your own latex packages/symbols. My understanding is that you can't use a symbol unless it's explicitly supported: https://katex.org/docs/supported.html
Alex J Best
Hi, at LMFDB we have a few pages with incredibly large math strings, such as http://beta.lmfdb.org/NumberField/47.47.6807739517051283990370106856968124192474229146184900948675688481754810058334971205734548194436392534997735758198660848138706901604387352879006731328411841.1 on these large strings KaTeX does not run, I was wondering if anyone knew the mechanism by this fails, and any way I could convince KaTeX to try really hard here or whatever? thank!

@tbrodbeck : "Where is the 'K' in KaTeX coming from?"

I believe the "K" stands for "Khan Academy".

Is there any "for dummies" guide to KaTeX, starting with "here is where you put the stylesheet call" and extending through "here is how to enter an expression within, say, a paragraph (as a span); or on its own line (as a div)", including what is meant by "element" in "katex.render("c = \pm\sqrt{a^2 + b^2}", element, {throwOnError: false});" and whether a third argument (here, the "throwOnError" portion) is required? Thank you!
Hi, I try to use % to comment out Katex code, it seems to it does not work. Do I need to config somewhere to use '%' as comment like Latex?
my current renderMathInElement is :
        {delimiters: [ // mind the order of delimiters(!?)
        {left: "$", right: "$", display: true},
        {left: "$", right: "$", display: false},
        {left: "\\[", right: "\\]", display: true},
        {left: "\\(", right: "\\)", display: false},
any help would be appreciated!
a & b \
c & d
I have no problem to display the matrix,
but add '% my comment' will be problem
Heya, quick question to devs familiar with KaTeX: if one wanted to convert KaTeX output into another markup than HTML, would it be best to work from the HTML generated (with all the <span>s), or would it be better to use some other internal structure of KaTeX? If the latter, is there a good place to start looking? And for the former, is there a good place to get an overview of all the different classes and styles that KaTeX might apply?
In other words, what's the best way of getting the awesome layout data from KaTeX in order to render it into custom output?
Ron Kok
@lazingor There another option, which is to use the KaTeX's MathML output instead of it's HTML output.
If I understand correctly, that won't include positioning information? For example when it comes to aligning superscripts, subscripts, fractions etc. according to TeX's style
Ron Kok
Browser support for MathML is limited, for now, to Firefox and Safari. The Chromium browsers will support it later this year. So yes, if you need it now and you need positioning information, then MathML is not sufficient.
I only offer the MathML option because manipulation of the KaTeX HTML sounds like a daunting task and the KaTeX/KaTeX#376 is now over four years old.
Ah, thanks for the link to that issue. That intermediate 'box model' format is exactly what I'm after, I guess. Looks like some people have made some efforts, but that it's not an easy task
Jason Sachs
KaTeX seems to have a really weird side effect on scroll-into-view behavior -- can anyone help explain? https://stackoverflow.com/questions/60202460/why-does-running-katex-change-my-pages-scroll-element-into-view-behavior
anyone live?
Eric Eastwood
Hey @sobanmomin Better to just ask your question right away instead of waiting for someone to respond. Don't ask to ask, just ask
hey guys, who could help me to set a font in katex. I actually set the css class with .katex {
font-family: 'KaTeX_Fraktur' !important;
and nothing happens. greets
Ed Darnell
I use katex to add labels on top of Canvas drawn diagrams. Is there any way to find out the dimensions of the rendered maths? Labelling an angle or the mid-point of a line needs this to correctly position the text. Any suggestions on the best approach?
Hi there, does anyone know how to use actual math in a <Latex> component in React? The output looks like a mix of text and math. Thanks!
Hi guys, noobs here, I'm trying to display this formula with katex, but I can't render the % symbol :\%_{acquis} = \frac{I}{V_{prem}+I}. If I replace \% by a letter, it works fine.
what am I doing wrong ?
Eric Eastwood

@nidupb Does it look correct here in Gitter? %acquis=IVprem+I\%_{acquis} = \frac{I}{V_{prem}+I} https://gitlab.com/gitlab-org/gitter/webapp/-/blob/develop/docs/messages.md#katex-math-formulas

Perhaps it's the renderer you are using

yes it does, I actually just found out a way to render it correctly : $$\\%\_{acquis} = \frac{I}{V_{prem}+I}$$
Eric Eastwood
@nidupb Thanks for the follow-up!
Anshul Singhvi
Hey, so this might be a long shot, but I'm working on a plotting package in Julia, and I wanted to use KaTeX to typeset math, and extract glyph positions, scales and offsets. Is there a way I can do that through the KaTeX API?
Hey, how is it possible to change the font to an another font of the lib? I.E. to Katex_SansSerif? If I try it, it change only the plus and minus signs 🤔 Pls help
Hi, is there any command who permit to align left : like this one \begin{left}
Ricardo Navarro
exist the webpage support functions for v0.7.1 ?
Is it possible to repeat a command n times in KaTeX?
What would be the easiest way to calculate the coordinates of the bounding box (width, height, left x, top y) of a symbol or sub-expression in a certain rendered expression, given the path to obtain that symbol/sub-expression from the KaTeX build tree?
Hi @ronkok; and @kevinbarabash . Is it possible to use jsPDF to convert html KaTeX rendered equations and graphics to a PDF. Kindly suggest for the way forward. Thank you.
Christophe Calvès
Hi everyone, I try to find a way to prevent KaTeX from breaking inline math formulas. Is it possible?