glebm / katex-ruby

Renders KaTeX from Ruby.
MIT License
25 stars 10 forks source link

Katex unable to render figure environment #10

Closed Npaffen closed 2 years ago

Npaffen commented 2 years ago

I use a jekyll setup to configure my blog hostet on github pages. I used bundel to install jekyll and a header extension to add the katex support for ruby. Is it possible to load any kind of packages for example 'graphicx'? I want to use the figure environment to add some images-files to my blog post.

My _config.yaml looks like this:

# Welcome to Jekyll!
#
# This config file is meant for settings that affect your whole blog, values
# which you are expected to set up once and rarely edit after that. If you find
# yourself editing this file very often, consider using Jekyll's data files
# feature for the data you need to update frequently.
#
# For technical reasons, this file is *NOT* reloaded automatically when you use
# 'bundle exec jekyll serve'. If you change this file, please restart the server process.
#
# If you need help with YAML syntax, here are some quick references for you:
# https://learn-the-web.algonquindesign.ca/topics/markdown-yaml-cheat-sheet/#yaml
# https://learnxinyminutes.com/docs/yaml/
#
# Site settings
# These are used to personalize your new site. If you look in the HTML files,
# you will see them accessed via {{ site.title }}, {{ site.email }}, and so on.
# You can create any custom variable you would like, and they will be accessible
# in the templates via {{ site.myvariable }}.

title: 'DS - A data scientist blog by Nils Paffen'
email: 'data_science_blog@proton.me'
disqus: 'Data meets science'
google_analytics: ' 
author: 'Nils Paffen'
email: 'data_science_blog@proton.me'
avatar: 'Foto_CV.jpg'
description:
url: "" # the base hostname & protocol for your site, e.g. http://example.com
github_username:  Npaffen
remote_theme: ngzhio/jekyll-theme-hamilton

kramdown:
   math_engine: katex
header-includes:
   - \usepackage{graphicx}
# Build settings
plugins:
  - jekyll-remote-theme

# Exclude from processing.
# The following items will not be processed, by default.
# Any item listed under the `exclude:` key here will be automatically added to
# the internal "default list".
#
# Excluded items can be processed by explicitly listing the directories or
# their entries' file path in the `include:` list.
#
# exclude:
#   - .sass-cache/
#   - .jekyll-cache/
#   - gemfiles/
#   - Gemfile
#   - Gemfile.lock
#   - node_modules/
#   - vendor/bundle/
#   - vendor/cache/
#   - vendor/gems/
#   - vendor/ruby/

My head.html looks like this :

<head>
    <link rel="stylesheet" media="none" onload="media='all'" href="https://cdn[...]/katex.min.css">
    <script defer src="https://cdn[...]/katex.min.js"></script>
    <script defer src="https://cdn[...]/contrib/mathtex-script-type.min.js"></script>
  </head>

My actual code I use in my blog-posts looks like this : $$ \begin{figure} \includegraphics[]{./_site/assets/unnamed-chunk-1-1,pdf} \caption{The Effect of School Reforms on Educational Attainment} \floatfoot{The OLS gender-specififc regressions included a constant, country dummies, q, q2 and their interactions with country dummies and the GDP per head at the age when the pupil would have finished compulsory schooling.} \end{figure} $$ As you can see, here at the bottom of the page, this produces the following error "'Unknown environment 'figure'". Is there any way to fix this?

glebm commented 2 years ago

This rubygem is just a wrapper for https://github.com/KaTeX/KaTeX/, please direct questions there (probably https://github.com/KaTeX/KaTeX/discussions is more appropriate than issues)