KaTeX

描述

通过KaTeX WordPress插件,您可以在WordPress网站上使用最快的TeX数学排版引擎 。 您可以在 [katex]...[/katex]简码内或古腾堡区块中包含TeX。 无论哪种方式,数学公式符号都会在您的网站上完美呈现。 使用古腾堡(Gutenberg)区块时,方程将立即在编辑器中呈现!

Equations in blocks or using the [katex display=true]...[/katex] shortcode will render on page in display mode–with bigger symbols–centered on their own line.

For compatibility with other LaTeX plugins, this plugin optionally supports [latex]...[/latex] shortcodes.

插件网站

Assets

This plugin includes minified assets provided by the KaTeX project.
The source code is available in the KaTeX git repository on GitHub.

屏幕截图

  • 在编辑器中预览TeX。
  • TeX呈现在访问者的浏览器中。

区块

该插件提供了 1 个区块.

  • KaTeX

安装

  1. katex文件夹上传到您的/wp-content/plugins/目录,或者通过WordPress的插件管理器自动下载并安装插件;
  2. 在WordPress中激活插件; 和
  3. 在您的帖子和页面中使用[latex]简码或KaTeX 古藤堡块。

常见问题

我可以从LaTeX插件迁移到该插件吗?

You should be able to replace any other LaTeX plugin using [latex] shortcodes without having to make changes to existing posts. Other plugins might handle display-mode latex other than [latex display=true]...[/latex], in which case old posts unfortunately have to be changed.

评价

2025 年 7 月 25 日
Thanks to Tom for reopening this plugin for updates. It must have been a chore to satisfy the “administrators” but the result is great. I have been using KaTeX all the time. Wordpress complained about lack of updates where there was no real reason other than administrative. I am sure also in the future, updating only means adapting to new rules. Ger
2024 年 3 月 31 日
Is it possible to render KaTeX for inline mode in a paragraph (Gutenberg preview)? Please consider this in next update.
2022 年 9 月 12 日
This is a great plugin for everyone who wants to use the power of LaTeX or KaTeX to display properly typeset math on their site. My favourite aspect of this plugin is how the Ka block displays a preview of the formatted text. While you can insert KaTeX statements using the shortcode block, if you do that, then the equations will be left justified, and there is little to do about it. Using the KaTeX block, the calculations will be properly centred between the margins set by your theme. Great job by the developer! I hope that the plugin will continue to be maintained so that we don’t lose compatibility with the latest versions of WordPress, as there are very few options otherwise.
2021 年 9 月 26 日 1 回复
Veny nice plugin. Able to use very easily and without any issues. A cakewalk if you know latex syntax. Rendering is very fast too. There is lot of accounting related math content on my site (eduxir.com) which requires to use math equations. Was able to achieve very easily. One request to the author is that the font and related files are downloaded even on the pages that do not use katex. We need to modify the plugin to disable this option. If a configuration option that could be provided which would retain the configuration even after updating the file, would be of great help.
阅读所有16条评价

贡献者及开发者

「KaTeX」是开源软件。 以下人员对此插件做出了贡献。

贡献者

「KaTeX」插件已被翻译至 7 种本地化语言。 感谢所有译者为本插件所做的贡献。

帮助将「KaTeX」翻译成简体中文。

对开发感兴趣吗?

您可以浏览代码,查看SVN仓库,或通过RSS订阅开发日志

更新日志

2.2.5

  • As per WordPress’s guidelines, remove the ability to fetch KaTeX resources through jsDelivr’s CDN.
  • Various internal improvements based on WordPress’s Plugin Check.

2.2.4

  • Upgrade KaTeX resources to v0.16.22.

2.2.3

  • More robustly render shortcodes (even more robustly than 2.2.2).

2.2.2

  • More robustly render shortcodes.
  • Fix undefined variable notice.

2.2.1

  • Trigger rendering of KaTeX in more cases when the DOM is mutated (in 2.2.0, accidentally only a limited set of cases was checked).

2.2.0

  • Trigger rendering of KaTeX when the DOM is mutated by inserting a .katex-eq node. This allows rendering KaTeX markup that is not present when the page is loaded.
  • Upgrade KaTeX resources to v0.13.13.

2.1.2

  • Always load JavaScript and CSS assets by default. An option is introduced to switch to the old behavior of loading only when KaTeX is used on the page.
  • Make it easier for other code to manually trigger rendering of KaTeX.
  • Upgrade KaTeX resources to v0.13.0.

2.1.1

  • Remove <br> tags added by WordPress to shortcode output.

2.1.0

  • Prevent WordPress from texturizing KaTeX (prior to this change, WordPress would sometimes change e.g. apostrophes to quotation marks).
  • Fix issue where custom class names on the KaTeX block sometimes broke editor rendering.
  • Add some keywords to allow searching for the KaTeX block in the editor’s block list.
  • Update KaTeX resources to v0.12.0.

2.0.2

  • Fix block editor variable scoping.

2.0.1

  • Upgrade KaTeX resources to v0.11.1.

2.0.0

  • Support adding CSS classes to KaTeX Gutenberg Blocks to help with styling. Backwards compatibility note: KaTeX Gutenberg Blocks are now rendered wrapped in a div element on which classes wp-block-katex-display-block and katex-eq are set. You can add more classes to this div through WordPress’s post editor. Previously, KaTeX Gutenberg Blocks were rendered wrapped in an unclassed span. KaTeX shortcodes are still wrapped inside a span with only the class katex-eq set. If you depend on old behavior for styling, you might need to update your styling rules.

1.0.5

  • Fix 1.0.4 release issue: KaTeX resources were not committed correctly.

1.0.4

  • Upgrade KaTeX resources to v0.10.2.

1.0.3

  • Fix warnings related to plugin options that occurred on PHP 5.
  • Clean up the plugin’s options on plugin deletion.

1.0.2

  • Upgrade KaTeX resources to v0.10.1.

1.0.1

  • Fix issue where KaTeX resources would not be loaded on the admin pages.

1.0.0

  • Initial release.