by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 03 2016 02:45
    @kevinbarabash banned @acx01b
bsdshell
@bsdshell
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 :
renderMathInElement(latexElementID,
        {delimiters: [ // mind the order of delimiters(!?)
        {left: "$", right: "$", display: true},
        {left: "$", right: "$", display: false},
        {left: "\\[", right: "\\]", display: true},
        {left: "\\(", right: "\\)", display: false},
        ]}
        );
bsdshell
@bsdshell
any help would be appreciated!
[
\begin{bmatrix}
a & b \
c & d
\end{bmatrix}
]
I have no problem to display the matrix,
but add '% my comment' will be problem
lazingor
@lazingor
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?
lazingor
@lazingor
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
@ronkok
@lazingor There another option, which is to use the KaTeX's MathML output instead of it's HTML output.
lazingor
@lazingor
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
@ronkok
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.
lazingor
@lazingor
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
@jason-s
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
sobanmomin
@sobanmomin
hi
anyone live?
Eric Eastwood
@MadLittleMods
Hey @sobanmomin Better to just ask your question right away instead of waiting for someone to respond. Don't ask to ask, just ask
Dima@finstreet
@dvogtfstr
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
@freemaths
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?
gugar20
@gugar20
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!
nidupb
@nidupb
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
@MadLittleMods

@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

nidupb
@nidupb
yes it does, I actually just found out a way to render it correctly : $$\\%\_{acquis} = \frac{I}{V_{prem}+I}$$
Eric Eastwood
@MadLittleMods
@nidupb Thanks for the follow-up!
Anshul Singhvi
@asinghvi17
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?
Dima@finstreet
@dvogtfstr
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
vingt100-82
@vingt100-82
Hi, is there any command who permit to align left : like this one \begin{left}
thx
Ricardo Navarro
@rnavarro92_gitlab
hi
exist the webpage support functions for v0.7.1 ?
lochiwei
@lochiwei_twitter
Is it possible to repeat a command n times in KaTeX?
Floris
@florisdf
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?
KibikaJ
@KibikaJ
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
@chrilves
Hi everyone, I try to find a way to prevent KaTeX from breaking inline math formulas. Is it possible?
KibikaJ
@KibikaJ
Hi
Hi @chrilves
Ed Darnell
@freemaths
@KibikaJ not quite what you asked for but I have found "print" works well in chrome. If you print a page containing katex and select "print to pdf" then the result is a nicely rendered PDF.
KibikaJ
@KibikaJ
Thank you so much. However, @freemaths , is there a way I can mimic chrome print mechanism in JavaScript or jQuery to print contents of a div containing katex instead of a whole html page?
Ed Darnell
@freemaths
@KibikaJ not that I am aware of. I haven't found any published APIs but you may be able track down open-source. Perhaps try asking on the chromium project?
Ed Darnell
@freemaths
@KibikaJ forgot to mention - what I do is render a different version of the page when prinitng. So you could just print one div if you want. It is a cumbersome mechanism if you only want a quick conversion of something small to PDF. It works fine if you want a PDF version of maths to upload and publish.
KibikaJ
@KibikaJ
@freemaths , I am really in a dilemma, my conversion may not involve so many pages upto a maximum of 20 pages otherwise less than 12 pages in many cases.
@freemaths could you be kind enough to give me your code to enable me make some progress. my email: jwkibika2013@gmail.com , thanks in advance.
KibikaJ
@KibikaJ
@freemaths Have you tried SlimmerJS before
Ed Darnell
@freemaths
@KibikaJ my development is all in React so might not be helpful. The key parts are: if (this.state.print) {
setTimeout(()=>{
window.print()
this.setState({print:false})
},2000)
} and if (this.state.print) return <div ref={r=>{this.maths=r}}>
{this.state.title&&<h5><Maths auto={true}>{this.state.title}</Maths></h5>}
<Maths width={this.state.width} auto={true}>{this.state.maths}</Maths>
</div> My maths class just renders my maths using Katex. I found the timeout was required to give the print page time to render.
KibikaJ
@KibikaJ
Thanks, so if you want to print content in a div
@freemaths I will attempt to mimic the code in JavaScript
KibikaJ
@KibikaJ
@freemaths, Hi, all math equations in KaTeX rendering on pdf appears to repeat with weird square root signs
nicolas moreau
@niikko_gitlab
Hi, I can not render a url link using katex. The command \href{https://katex.org/}{\KaTeX} is displayed in plain text. I set trust=true, is there something else to do ?