sphinx の mathjax 拡張に手を加えて簡単な TeX マクロを使えるようにしてみました。
- 改造した mathjax.py を conf.py のある場所に置く
| import sys | |
| import numpy | |
| array = numpy.loadtxt("test.npy", converters={0: lambda s: eval(s)}).view(complex).reshape(-1) | |
| print array |
| #include <iostream> | |
| #include <boost/function.hpp> | |
| #include <boost/bind.hpp> | |
| #include <boost/random/mersenne_twister.hpp> | |
| #include <boost/random/uniform_real_distribution.hpp> | |
| #include <boost/random/normal_distribution.hpp> | |
| int main(int argc, char* argv[]) | |
| { | |
| size_t seed = 1234567890; |
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| import numpy as np | |
| from matplotlib import pyplot as plt | |
| histc = np.loadtxt("test.npy") | |
| n_bins = histc.size | |
| edges = np.linspace(-5, 5, n_bins) | |
| edges2 = np.repeat(histc, 2)[1:-1] | |
| histc2 = np.repeat(histc, 2)[:-2] |
| MathJax.Hub.Config({ | |
| TeX: { | |
| Macros: { | |
| dif: ["\\frac{d{#1}}{d{#2}}", 2], | |
| pdif: ["\\frac{\\partial{#1}}{\\partial{#2}}", 2], | |
| Tr: "\\mathop{\\rm Tr}\\limits", | |
| real: "\\mathop{\\rm Re}\\nolimits", | |
| imag: "\\mathop{\\rm Im}\\nolimits", | |
| Res: "\\mathop{\\rm Tr}\\limits", | |
| sn: "\\mathop{\\rm sn}\\nolimits", |
sphinx の mathjax 拡張に手を加えて簡単な TeX マクロを使えるようにしてみました。
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| # classify downloaded items into date directory | |
| # by Akihiro Uchida, CC0 dedicated to the public domain | |
| # see http://creativecommons.org/publicdomain/zero/1.0/ | |
| import os | |
| import time | |
| import shutil | |
| import itertools | |
| from datetime import datetime |
| 著者: | 打田 旭宏 |
|---|---|
| ライセンス: | CC-BY 3.0 |
| 更新日時: | |time| |
tboffice さんという方が `Sphinx Advent Calendar 2012`_ に
| function FindProxyForURL(url, host) { | |
| var proxy = "PROXY proxy.ritsumei.ac.jp:3128"; | |
| var domain = ".ritsumei.ac.jp"; | |
| if (dnsDomainIs(host, domain) || | |
| isPlainHostName(host) || | |
| isInNet(host, "127.0.0.1", "255.255.255.255") || | |
| isInNet(host, "192.168.0.0", "255.255.0.0") || | |
| isInNet(host, "172.16.0.0", "255.240.0.0") || | |
| isInNet(host, "10.0.0.0", "255.0.0.0")) | |
| return "DIRECT"; |
| #!/bin/bash | |
| # MacTeX uninstaller script based on pkgutil command | |
| # by Akihiro Uchida, CC0 dedicated to the public domain | |
| # see http://creativecommons.org/publicdomain/zero/1.0/ | |
| IFS=$(echo -en "\n") | |
| for pkg in $(pkgutil --pkgs|grep org.tug.mactex); do | |
| volume="$(pkgutil --pkg-info "$pkg"|grep volume|cut -d' ' -f2-)" | |
| location="$(pkgutil --pkg-info "$pkg"|grep location|cut -d' ' -f2-)" | |
| echo "remove all of the files installed under the $pkg" | |
| for file in $(pkgutil --files "$pkg"); do |