Skip to content

Instantly share code, notes, and snippets.

@astronasutarou
Last active August 2, 2016 05:06
Show Gist options
  • Select an option

  • Save astronasutarou/f8e2b4c730c31c004dfc to your computer and use it in GitHub Desktop.

Select an option

Save astronasutarou/f8e2b4c730c31c004dfc to your computer and use it in GitHub Desktop.
NASA ADS の abstract にて自動的に MathJax をインポートする GreaseMonkey スクリプト
// ==UserScript==
// @name ADS+MathJax
// @namespace http://xr0038.net
// @description automatically load MathJax in SAO/NASA ADS
// @include http://adsabs.harvard.edu/abs/*
// @version 1.1
// @grant none
// ==/UserScript==
(function(URL){
var scriptElem=document.createElement('SCRIPT');
scriptElem.setAttribute('type', 'text/x-mathjax-config');
scriptElem.innerHTML = 'MathJax.Hub.Config({ "HTML-CSS": {scale: 80}, tex2jax: {inlineMath: [ [\'$\',\'$\'] ]} });';
document.body.appendChild(scriptElem);
var scriptElem=document.createElement('SCRIPT');
scriptElem.setAttribute('language','JavaScript');
scriptElem.setAttribute('src',URL);
document.body.appendChild(scriptElem);
})('http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment