All Projects → linjer → Jekyll Katex

linjer / Jekyll Katex

Licence: mit
Jekyll plugin for easy server-side math rendering via KaTeX

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Jekyll Katex

Jekyll Spaceship
🚀 A Jekyll plugin to provide powerful supports for table, mathjax, plantuml, mermaid, emoji, video, audio, youtube, vimeo, dailymotion, soundcloud, spotify, etc.
Stars: ✭ 196 (+168.49%)
Mutual labels:  jekyll, jekyll-plugin, latex, katex
Pages Gem
A simple Ruby Gem to bootstrap dependencies for setting up and maintaining a local Jekyll environment in sync with GitHub Pages
Stars: ✭ 1,670 (+2187.67%)
Mutual labels:  jekyll, github-pages, jekyll-plugin
Hanuman
A responsive, lightning-fast Jekyll theme built using AMP (Accelerated Mobile Pages) to speed up your blogs and websites.
Stars: ✭ 100 (+36.99%)
Mutual labels:  jekyll, github-pages, jekyll-plugin
jekyll-default-layout
Silently sets default layouts for Jekyll pages and posts
Stars: ✭ 45 (-38.36%)
Mutual labels:  jekyll, jekyll-plugin, github-pages
Minimal
Minimal is a Jekyll theme for GitHub Pages
Stars: ✭ 753 (+931.51%)
Mutual labels:  jekyll, github-pages
Cayman
Cayman is a Jekyll theme for GitHub Pages
Stars: ✭ 719 (+884.93%)
Mutual labels:  jekyll, github-pages
Dinky
Dinky is a Jekyll theme for GitHub Pages
Stars: ✭ 70 (-4.11%)
Mutual labels:  jekyll, github-pages
Jekyll Scholar
jekyll extensions for the blogging scholar
Stars: ✭ 872 (+1094.52%)
Mutual labels:  jekyll, jekyll-plugin
Jekyll Uno
Jekyll-Uno - a minimal, responsive theme for Jekyll based on Uno for Ghost
Stars: ✭ 559 (+665.75%)
Mutual labels:  jekyll, github-pages
Jekyll Theme Chirpy
A minimal, sidebar, responsive web design Jekyll theme that focuses on text presentation.
Stars: ✭ 773 (+958.9%)
Mutual labels:  jekyll, github-pages
Chalk
Chalk is a high quality, completely customizable, performant and 100% free Jekyll blog theme.
Stars: ✭ 987 (+1252.05%)
Mutual labels:  jekyll, github-pages
Mdmath
LaTeX Math for Markdown inside of Visual Studio Code.
Stars: ✭ 675 (+824.66%)
Mutual labels:  latex, katex
Type Theme
A free and open-source Jekyll theme with responsive design. Great for blogs and easy to customize.
Stars: ✭ 657 (+800%)
Mutual labels:  jekyll, github-pages
Jekyll Minibundle
A minimalistic asset bundling plugin for Jekyll
Stars: ✭ 65 (-10.96%)
Mutual labels:  jekyll, jekyll-plugin
Jekyll Redirect From
🔀 Seamlessly specify multiple redirections URLs for your pages and posts.
Stars: ✭ 630 (+763.01%)
Mutual labels:  jekyll, jekyll-plugin
Aviaryan.github.com Retired 2018
My website (retired)
Stars: ✭ 10 (-86.3%)
Mutual labels:  jekyll, github-pages
Minimal Mistakes
📐 Jekyll theme for building a personal site, blog, project documentation, or portfolio.
Stars: ✭ 8,967 (+12183.56%)
Mutual labels:  jekyll, github-pages
Jekyll Timeline
Timeline / Résumé Theme with Jekyll
Stars: ✭ 46 (-36.99%)
Mutual labels:  jekyll, github-pages
Mzlogin.github.io
Jekyll Themes / GitHub Pages 博客模板 / A template repository for Jekyll based blog
Stars: ✭ 1,060 (+1352.05%)
Mutual labels:  jekyll, github-pages
Jekyll Github Deploy
Jekyll Site Automated Deployer to GitHub Pages
Stars: ✭ 67 (-8.22%)
Mutual labels:  jekyll, github-pages

jekyll-katex

Build Status Latest Release

This is a Jekyll plugin for performing compile-time math rendering via the KaTeX library. KaTeX is a library for rending math on the web using LaTeX, similar to MathJax.

KaTeX differs from MathJax in that it displays faster rendering speed and renders to pure HTML rather than PNGs. There are various resources in benchmarking and comparing their performance, for more info, start here.

Comes packaged with KaTeX 0.11.1 but you can specify a different version in your Jekyll _config.yml (see below).

Installation

  1. In your Jekyll project, add the plugin to your _config.yml, e.g.:

    plugins:
      - jekyll-katex
    
  2. Add jekyll-katex to your gems.rb/Gemfile plugin block:

    group :jekyll_plugins do
      gem 'jekyll-katex'
    end
    

    Once done, execute bundle install.

  3. Add KaTeX CSS and Fonts. Follow the installation instructions on the KaTeX README. You can skip including the .js file unless you want to do client-side in-browser rendering, as well.

    Put the following (adjusting for your version) in your page headers:

    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css" integrity="sha384-zB1R0rpPzHqg7Kpt0Aljp8JPLqbXI3bhnPWROx27a9N0Ll6ZP/+DiW/UqRcLbRjq" crossorigin="anonymous">
    

Configuration

Supported configuration values, shown with default values:

katex:
  js_path: "{{ Gem::lib_path }}/assets/js"  # Path used to search for katex.min.js
  rendering_options:
    # Default KaTeX rendering options. See https://github.com/Khan/KaTeX#rendering-options
    throw_error: true                       # throwOnError - set to false if you want rendering to output error as text rather than a build error
    error_color: "#cc0000"                  # errorColor

Usage

There are two liquid tags: katex and katexmm.

katex

Use the katex liquid tag for LaTeX math equations like so:

{% katex %}
c = \pm\sqrt{a^2 + b^2}
{% endkatex %}

If you want the equation to be rendered in display mode (on its own line, centered, large symbols), just pass in the display parameter:

{% katex display %}
c = \pm\sqrt{a^2 + b^2}
{% endkatex %}

katexmm

The katex liquid tag can be cumbersome, particularly if you have many inline blocks, which would need to be opened and closed repeatedly, cluttering the source text. katexmm is an alternative that supports fenced math mode blocks similar to standard latex:

{% katexmm %}
This is a mixed environment where you can have normal text and $c = \pm\sqrt{a^2 + b^2}$ fenced math. \$!
{% endkatexmm %}
  • $ for inline
  • $$ for display mode
  • \$ to escape $ anywhere within the katexmm environment

Development

$ bundle install
$ rake build

Contributing

Feel free to open issues and pull requests.

License

The gem is available as open source under the terms of the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].