hamen (owner)

Revisions

gist: 136064 Download_button fork
public
Public Clone URL: git://gist.github.com/136064.git
Embed All Files: show embed
Ubiquity LaTex Command #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
CmdUtils.CreateCommand({
  name: "latex",
  description: "Write LaTex and render it with mimetex ",
  help: "Write down some LaTex statement, i.e. \frac{1}{S^2 - 1}",
  author: {name: "Ivan Morgillo", email: "imorgillo [at] sanniolug [dot] org"},
  license: "GPL v3",
  homepage: "http://hamen.org",
  arguments: {object: noun_arb_text},
  preview: function(pblock, args) {
    var postdata = args.object.text;
    var url = "http://operaez.net/mimetex/";
    if(postdata != ""){
      CmdUtils.previewGet(pblock, url, postdata, function(data){
        pblock.innerHTML = "Get this image <table bgcolor='white'><tr><td><img src=http://operaez.net/mimetex/\\HUGE{" + postdata + "}></td></tr></table>http://operaez.net/mimetex/\\HUGE{" + postdata + "}";
      });
    }else{
      pblock.innerHTML = "Write down some LaTex stuff";
    }
  },
  execute: function(args) {
    var postdata = args.object.text;
    Utils.openUrlInBrowser("http://operaez.net/mimetex/\\LARGE{" + postdata + "}");
  }
});