I get an error when trying to view this page on certain browsers, where any Katex shows up as “katex is not defined”.
The issue shows up on Chrome (desktop) and MS Edge, but not on Chrome (mobile) or Firefox (desktop and mobile).
I am using the Iknow theme (version 1.2.6) and WordPress version 5.7.
The issue appears in both Katex Gutenberg blocks and the Katex shortcode within text.
]]>Please how can I change latex font and size
]]>Hey,
we use the plugin and everything works fine.
Just by formulars that are very long they are not shown responsive or scrollable on mobil / smaler screens.
Is there a way to get this fixed.
– By scrolling left / right?
– By decreasing the size of the formular on mobile display?
Thanks for your help!
]]>With the latest version of katex/wp:
When I include [latex] [/latex] or [katex] [/katex] the message ‘katex is not defined’ is all that appears.
]]>Weirdly enough, equations don’t render on mobile but do on desktop and tablet.
Links
Desktop:
https://snipboard.io/LIju4y.jpg
Mobile:
https://snipboard.io/OswmG1.jpg
Hi, while testing the plugin I tried this code
[latex display=true]x = \begin{cases}
a &\text{if } b \\
c &\text{if } d
\end{cases}[/latex]
and this is the output
As you can see there are <br>
tags, which I think are generated by the wpautop function of wordpress. In fact by writing the equation on a single line such as
[latex display=true]x = \begin{cases} a &\text{if } b \\ c &\text{if } d \end{cases}[/latex]
the output is displayed correctly without br tags.
I would like to keep wpautop activated since it is helpful in most of the cases, so I think it is better to edit the plugin.
In the file frontend.php
I noticed the following line
$enc = htmlspecialchars( html_entity_decode( $content ) );
and by removing the function htmlspecialchars
$enc = html_entity_decode( $content );
the problem seems to be solved, in fact the output is correct.
But I am worried that by removing the that function something bad coould happen in some situations.
So is it safe to disable it? Is there a better way to solve the problem?
]]>Dear all,
I’ve used katex for writing an article, but it appears not to be stable at all, depending on browsers / devices / wether I’m logged in in WordPress. In google chrome, I usually can render the equations, but other colleagues can’t and always have “katex is not defined”.
On any mobile device (Android) “katex is not defined”. On mac/safari, same.
It seems like being logged in WordPress allows me to have more often the rendering.
Any hints? I have the 1.11 version I think.
Thanks in advance for your replies!
]]>Does WP-KaTeX support the align environment, or any other way of aligning LaTeX equations? When I tried to use the align environment, it resulted in an error
]]>Hi there.
By default, math text is center aligned. Please advice on how to left align it.
Thank you very much…Carlos
PS. Really easy to use even for non pros.
]]>Hi everyone,
I’m having trouble with vectors and matrices on my website. I’m getting an error, which says I can’t use usual latex syntax like the following \begin{pmatrix}a\\b\end{pmatrix}. Can anyone help me?
Best regards
]]>I plugged in the following code in my CSS
.katex { font-size: 4.1em; }
I set it at a ridiculous number 4.1. However, it does not render the equations large. Take a look, the equations still look small.
What am I doing wrong?
Thanks.
]]>Hi, As you can see in the linked provided katex is not compatible when used in RTL websites. Please visit provided link and you will see what I mean.
]]>How can I define macros in wordpress such that the defined macros will work in every page automatically ?
]]>[latex display="true"]f(x,y) = \begin{cases} \frac{x^2y}{x^3+y}, &\quad (x,y)\neq (0,0)\\ 0, &\quad (x,y)= (0,0)\\ \end{cases}[/latex]
what is wrong?
]]>When I write
KaTeX’s equations $latex a\,b\,a^{-1}$ are $latex a$ not $latex b$ aligned!
then all the latex is rendered correctly, but it is not aligned with the text baseline. That is, all the LaTeX symbols are higher than the regular text (almost above it). This makes KaTeX inline useless to me. Is there a workaround?
]]>I want to add an amp plugin to my site
do you support it? or plan to support?
Katex does not work for wordpress 5.0.3.
]]>this is odd. we can’t get WP-KaTeX to render on our dev site although the same setup works on the live site. all katex css and js files seem to be loaded into dom but it throws ‘katex is not defined’ error. no errors in console or in php errors log. any ideas?
]]>It looks like \fcolorbox{}{} is not working with the plug-in.
For example, \fcolorbox{red}{aqua}{A} renders fine on the katex.org site. However, [latex] \fcolorbox{red}{aqua}{A} [/latex] gives me an error on WordPress.
]]>Hi.
I’ve installed a plugin called ?shortcode in comment?, in order to write some LateX code on the comments sections.
In the config page, I put ?katex? in the white list, but the code doesn’t render properly.
Then, I switched to ?wp-katex? instead of ?katex? in the white list, and nothing happens.
Thanks in advance for your support!
]]>Hi.
Thanks very much for this useful plugin.
My problem is this: on desktop, the formulas render very nice, but on mobile the size of the output is very small compared with the size of the paragraph font.
And also, I can’t use the [latex][/latex] syntax on the comments area.
Thank you in advance for your help.
]]>Hello,
I’ve been using your plugin very happily :), until today… When I uprgaded it, it does not seem to be able to render anything! I get a message “katex is not defined” instead of every equation.
I get the same result going to https://andrewsun.com/projects/wp-katex/ . Is there any settings I could change to fix this issue? Is it related to the upgrade?
Many thanks in advance!
Mateusz BOGDAN
EDIT : NEVERMIND, it just got back to normal… Not sure why it wasn’t cooperative with me…
]]>In the katex documentation, there’s a macro option detailed. Example:
katex.render(“c = \\pm\\sqrt{a^2 + b^2}\\in\\RR”, element, {
displayMode: true,
macros: {
“\\RR”: “\\mathbb{R}”
}
});
Is is possible to set a default set of macros in WP-Katex, either for the page in question, or for all pages?
With the Mathjax-Latex plugin this is possible using something like:
Macros: {
ifrac: [‘{#1}/{#2}’, 2],
Real: [‘{\\textrm{Re}}’, 0],
lr: [‘{\\left(#1\\right)}’, 1],
biglr: [‘{\\Bigl(#1\\Bigr)}’, 1],
Biglr: [‘{\\Biggl(#1\\Biggr)}’, 1],
setlr: [‘{\\left\\{#1\\right\\}}’, 1],
evalbar: [‘{{\\left.{#1}\\right\\vert}_{#2}}’, 2],
evalrange: [‘{{\\left.{#1}\\right\\vert}_{#2}^{#3}}’, 3],
evalnobar: [‘{{#1}_{#2}}’, 2],
Ba: [‘{\\mathbf{a}}’, 0],
…
},
(where the macros are placed in the MathJax/config/mathjax.js configuration file)
]]>Hi,
I noticed that in the new updated version, sometimes, the fraction divisor (using \dfrac) does not appear. This is completely random, on some pages it appears, and on others, it disappears. Sometimes, it appears on a pc, but not on a mobile device. I am not sure of the reason, but I hope you look into this.
Thanks for all the hard work you guys put into this plugin, it is truly amazing!
]]>First of thank you for a great plugin it is awesome and saved me a lot of coding hours and testing.
I have noticed a little bug however. The options are sometimes not set in a pristine installation resulting in PHP warnings on the JSDeliver settings page. It could be a good idea to run katex_settings_init.
]]>Hi there, thanks for providing us with support.
My problem with KaTeX is this.
When I try to write the following line (in HTML) for a new post on my web site with WordPress
[Latex] n \ leq x <n + 2 [/ latex]
I only get this on the way out
N \ leq x <n + 2 [/ latex]
That is, no mathematical symbol appears in the output article.
However if I write equations, such as:
[Latex] ax ^ 2 + bx + c = 0 [/ latex]
(\ Sum_ {k = 1} ^ n a_k ^ 2 \ right) \ left (\ sum_ {k = 1} ^ n a_k b_k \ \ Sum_ {k = 1} ^ n b_k ^ 2 \ right) [/ latex]
Yes they can visualize perfectly.
How is this resolved? I’ve tried everything and I can not fix it.
Thanks in advance for your prompt response.
]]>Hello,
We really enjoy KaTeX, but need to make the font sizes for the equations smaller. Tried editing:
.katex {
font-size: 16px !important;
}
katex.min.css:1
.katex {
font: 400 1.21em KaTeX_Main,Times New Roman,serif;
line-height: 1.2;
white-space: nowrap;
text-indent: 0;
}
without success. How is this done? Thank you.
]]>Hi,
This plugin seems awesome, but I can’t use it for two reasons (Note that I would gladly pay for it if these functionalities are added) :
– No option to choose the environment variables. I already use a plugin (quicklatex to name it) which offers the option to use $ and $$ for formulas. Since
1°) I write pdftex versions of my posts simultaneously,
2°) and already have articles and numerous formulas using $ on my website…
I cannot use [latex][/latex] it would be impractical.
– What packages does this plugin uses by default ? I couldn’t find the info anywhere. I tried the plugin, translated one article and all hell broke loose since I use some unusual packages…
It would be great to be able to add a preamble or to add a few packages and preamble definitions in the settings page.
Will these options be available in the future ?
Thanks,
Johann.
Hello
I have installed successfully Katex and it worrked very well with a few examples
on a page. BUT, when i reopen the page for modification, all the code and text have diseapeared !
How can i fix it ?
Thanks a lot for answering
toto
Hi, I am creating a form, with just one field, and a confirmation webpage.
I want to allow people to see on the confirmation page the compiled latex code they have typed in the form page.
So I entered [latex]x=2[\latex] in the field, but on the confirmation page, it was not compiled.
Bests,
Daniel