Created
May 7, 2011 17:29
-
-
Save nozma/960665 to your computer and use it in GitHub Desktop.
はてダのtex記法をgoogle chart apiを使った数式表現に変換&逆変換
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; latex数式をgoogle chart apiを使った数式表現に変換 | |
(defun latex-to-google-chart-api () | |
(interactive) | |
(replace-regexp "\\[tex:\\(.*?\\)\\]" | |
(query-replace-compile-replacement | |
"<img src=\"http://chart.apis.google.com/chart?cht=tx&chl=\\,(url-hexify-string \\1)\"/>" t) nil (point-min) (point-max))) | |
(global-set-key "\C-c\C-l\C-t" 'latex-to-google-chart-api) | |
;; 逆変換 | |
(defun google-chart-api-to-latex () | |
(interactive) | |
(replace-regexp "<img src=\"http://chart.apis.google.com/chart\\?cht=tx&chl=\\(.*?\\)\"/>" | |
(query-replace-compile-replacement | |
"[tex:\\,(url-unhex-string \\1)]" t) nil (point-min) (point-max))) | |
(global-set-key "\C-c\C-t\C-l" 'google-chart-api-to-latex) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment