Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add MathJax for LaTeX support #25

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

add MathJax for LaTeX support #25

wants to merge 3 commits into from

Conversation

HHONG-WM
Copy link

No description provided.

@yizeng
Copy link
Owner

yizeng commented Oct 17, 2018

@HHONG-WM

Sorry for the wait!

Just had a look, a small tweak is needed. Basically, what I'm trying to change:

  • Rename MathJax.html to math-jax.html for file naming consistency
  • Move MathJax to post.html, not blog.html. I assume you only need this support inside the blog post, not the blog page itself.
  • Create a configuration key to control it, so that most people won't load this extra JS file.

Tried to tweak a bit directly on GitHub, but only managed to remove but not to add. Below is needed, could you please add it in your branch? Thanks

  1. Add confugration key load_math_jax in both of the _config.yml files:

jekyll-theme-simple-texture/_config.yml
jekyll-theme-simple-texture/starter-kit/_config.yml

# Site Settings
encoding: UTF-8
exclude: ["*.gem", "*.gemspec", "Gemfile", "Gemfile.lock", "node_modules", "Rakefile", "starter-kit", "vendor"]
lang: en # Language code as defined in _data/i18n.yml. en, en-gb, en-us, zh, zh-cn, zh-tw etc.
permalink: /blog/:year/:month/:day/:title/

whitelist: [jekyll-feed, jekyll-redirect-from, jekyll-seo-tag, jekyll-sitemap]
plugins:
  - jekyll-feed
  - jekyll-redirect-from
  - jekyll-seo-tag
  - jekyll-sitemap

markdown: kramdown
kramdown:
  auto_id_prefix: 'heading-'
  smart_quotes: ["apos", "apos", "quot", "quot"]
  toc_levels: 1..3

sass:
  style: compressed

# Site Data
url: # the base hostname & protocol for your site, e.g. http://example.com
baseurl: # the subpath of your site, e.g. /blog
title: Simple Texture
description: "A gem-based responsive simple texture styled Jekyll theme."
keywords: 'jekyll,theme,gem-based,blog'
author:
  name:
  job_title:
  location:
  email:
  social_links:
    - name: facebook
      url:
    - name: github
      url: https://github.com/yizeng/jekyll-theme-simple-texture
    - name: instagram
      url:
    - name: linkedin
      url:
    - name: stackoverflow
      url:
    - name: twitter
      url: 
    - name: vk
      url:
home:
  section1: <h1>Simple Texutre</h1>
  section2: <h2>A gem-based responsive simple texture styled Jekyll theme</h2>
  section3: <div class="social-links"><a class="ico-github btn" href="https://github.com/yizeng/jekyll-theme-simple-texture" title="View on GitHub"></a></div>
blog:
  cc_license: http://creativecommons.org/licenses/by-sa/4.0/ # A link to CC License of your choice.
  cc_license_image: /assets/images/theme/cc-by-sa.png # An image of your CC License. 
  footer_content: A gem-based responsive simple texture styled <a href="http://jekyllrb.com/">Jekyll</a> theme.

disqus:
  shortname: # e.g. yizeng
  public_key: # e.g. ULZ0b9TFefCUJHKQd4JCKv2v3u27YoG7YG8zXPewkWrT333Z0Se9YnxLzoV6VM8W
google_tag_manager: # e.g. 'GTM-KCQJXZ8F'
addthis_public_id: # AddThis sharing plugin. See http://www.addthis.com/. E.g. ra-53329e27694534j5 
load_math_jax: # true to turn it on.

paths:
  home: /
  blog: /blog/
  categories: /blog/categories/
  tags: /blog/tags/
  1. Inside jekyll-theme-simple-texture/_layouts/post.html add the following at the end (with the correct spacing (4 spaces)):

    {% if site.load_math_jax %}
    {% include common/math-jax.html %}
    {% endif %}

  2. Have a test around to see if it still works as you intended

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants