Skip to content
View hbghlyj's full-sized avatar

Highlights

  • Pro

Block or report hbghlyj

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Maximum 250 characters. Please don’t include any personal information such as legal names or email addresses. Markdown is supported. This note will only be visible to you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
hbghlyj/README.txt
// ==UserScript==
// @name         GitHub Markdown MathJax v4 Loader
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Injects MathJax v4 to GitHub Markdown math renderer
// @match        https://github.com/*.md
// @grant        none
// @run-at       document-end
// ==/UserScript==
document.querySelectorAll('math-renderer').forEach(oldElement => {
    const newElement = document.createElement('tex');
    for (const attr of oldElement.attributes) {
      newElement.setAttribute(attr.name, attr.value);
    }
    newElement.innerHTML = oldElement.innerHTML.replaceAll('amp;','');
    oldElement.replaceWith(newElement);
});
window.MathJax = {
  startup: {
    elements: ['article']
  },
  tex: {
    inlineMath: {'[+]': [['$', '$']]}
  },
  options: {
    enableEnrichment: false
  }
};
const script = document.createElement('script');
script.src = 'https://cdn.jsdelivr.net/npm/mathjax@4/tex-svg.js';
script.async = true;
script.onerror = () => alert('Failed to load MathJax script.');
document.head.appendChild(script);
    const style = document.createElement('style');
    style.type = 'text/css';
const sheet = style.sheet;
(function() {
    // Create the <style> tag
    var style = document.createElement("style");

    // WebKit hack
    style.appendChild(document.createTextNode(""));

    // Add the <style> element to the page
    document.head.appendChild(style);
    console.log(style.sheet.cssRules); // length is 0, and no rules

    return style;
})().sheet.insertRule("mjx-container[display] { margin: 0 ! important}",0);

Popular repositories Loading

  1. mathHandbook mathHandbook Public

    《数学手册》高等教育出版社

    3 2

  2. Unembed-PDF-base14-fonts-in-LaTeX Unembed-PDF-base14-fonts-in-LaTeX Public

    Unembed PDF base14 fonts in LaTeX to reduce font size. This also makes the text editable in Adobe Acrobat. (Danger: \sum in Symbola font only works in Mozilla PDF.js and does not work in other viewer)

    TeX 1

  3. a0-crawlers a0-crawlers Public

    Forked from approach0/a0-crawlers

    Crawlers for Approach Zero search engine.

    Python 1

  4. selfstudy selfstudy Public

    for self-study

    1

  5. Math-editor Math-editor Public

    JavaScript

  6. Rings Rings Public

    "Rings & Modules" notes reproduction《环与模》讲义重刻