「TeX数式のチェック」の版間の差分
ナビゲーションに移動
検索に移動
編集の要約なし |
細編集の要約なし |
||
| 6行目: | 6行目: | ||
なお、Googleは 本機能を非推奨に分類しています。ご承知おきください。<br> | なお、Googleは 本機能を非推奨に分類しています。ご承知おきください。<br> | ||
<cite>[https://google-developers.appspot.com/chart/infographics/ The Infographics portion of Google Chart Tools has been officially deprecated as of April 20, 2012. It will continue to work as per our deprecation policy.]</cite><br> | <cite>[https://google-developers.appspot.com/chart/infographics/ The Infographics portion of Google Chart Tools has been officially deprecated as of April 20, 2012. It will continue to work as per our deprecation policy.]</cite><br> | ||
クリップボードに<img>タグの内容がコピーされます。<br> | |||
<pre> | <pre> | ||
| 22行目: | 23行目: | ||
url += encoded_TeXcode; | url += encoded_TeXcode; | ||
}; | }; | ||
ClipboardData.SetData( "<img alt=\"" + sel.Text + "\"" + " src=\"" + url + "\"/> "); | |||
with(objIE) { | with(objIE) { | ||
Width = 300; | Width = 300; | ||
2013年11月26日 (火) 17:56時点における版
TeX形式で記述した数式を画像でチェックできます。
確認したいTeXコードを選択してマクロを実行してください。
Google Chart APIを利用したバージョンとMathjavを利用したバージョンがあります。
1.Google Chart APIを利用したバージョンです。
なお、Googleは 本機能を非推奨に分類しています。ご承知おきください。
The Infographics portion of Google Chart Tools has been officially deprecated as of April 20, 2012. It will continue to work as per our deprecation policy.
クリップボードに<img>タグの内容がコピーされます。
// GetFormulaImage.js
// 20131021
var baseURL_google = 'http://chart.apis.google.com/chart?cht=tx&chl=';
var url = baseURL_google;
var objIE = new ActiveXObject( "InternetExplorer.Application" );
var sel = Editor.ActiveDocument.Selection;
if ( sel.IsEmpty ){
Quit();
} else {
var encoded_TeXcode = encodeURIComponent( sel.Text );
url += encoded_TeXcode;
};
ClipboardData.SetData( "<img alt=\"" + sel.Text + "\"" + " src=\"" + url + "\"/> ");
with(objIE) {
Width = 300;
Height = 200;
AddressBar = false;
MenuBar = false;
StatusBar = false;
ToolBar = false;
Navigate( url );
Visible = true;
}
元のTeXコードも一緒に見たい場合は、
Navigate( url );
の部分を
Navigate( "about:blank" );
document.write("<html><head></head><body>" + "<img src='" + url + "'/><br /><br />" + sel.Text + "</body></html>");
と変更してください。
2.Mathjavを利用したバージョンです。
画像のコピーはできません。
表示部を右クリックすると、メニューがポップアップします。そこからTeXコードとMathMLコードが得られます。
// GetFormulaImage_Mathjav.js
// 20131021
var objIE = new ActiveXObject( "InternetExplorer.Application" );
var sel = Editor.ActiveDocument.Selection;
if ( sel.IsEmpty ){ Quit() };
with(objIE) {
Width = 200;
Height = 150;
AddressBar = false;
MenuBar = false;
StatusBar = false;
ToolBar = false;
Navigate( "about:blank" );
document.write("<html><head>");
document.write("<script type='text/javascript' src='http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML'></script>");
document.write("</head><body>");
document.write("<br />\\(" + sel.Text + "\\)<br />");
document.write("</body></html>");
refresh();
Visible = true;
}
スポンサーリンク