{"action":"created","comment":{"url":"https://api.github.com/repos/SublimeText/LaTeXTools/pulls/comments/81661707","pull_request_review_id":2625631,"id":81661707,"diff_hunk":"@@ -0,0 +1,157 @@\n+import os\n+import shutil\n+import threading\n+import time\n+\n+import sublime\n+\n+\n+_ST3 = sublime.version() >= \"3000\"\n+if _ST3:\n+    from .latextools_utils import cache, get_setting\n+\n+\n+_lt_settings = {}\n+\n+\n+def plugin_loaded():\n+    global _lt_settings\n+    _lt_settings = sublime.load_settings(\"LaTeXTools.sublime-settings\")\n+\n+\n+def convert_installed():\n+    \"\"\"Return whether ImageMagick/onvert is available in the PATH.\"\"\"\n+    if hasattr(convert_installed, \"result\"):\n+        return convert_installed.result\n+\n+    convert_installed.result = shutil.which(\"convert\") is not None","path":"preview_utils.py","position":27,"original_position":27,"commit_id":"188f56a29261cea4ff4db7c160c1c6b12ab035c3","original_commit_id":"188f56a29261cea4ff4db7c160c1c6b12ab035c3","user":{"login":"ig0774","id":212893,"avatar_url":"https://avatars.githubusercontent.com/u/212893?v=3","gravatar_id":"","url":"https://api.github.com/users/ig0774","html_url":"https://github.com/ig0774","followers_url":"https://api.github.com/users/ig0774/followers","following_url":"https://api.github.com/users/ig0774/following{/other_user}","gists_url":"https://api.github.com/users/ig0774/gists{/gist_id}","starred_url":"https://api.github.com/users/ig0774/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ig0774/subscriptions","organizations_url":"https://api.github.com/users/ig0774/orgs","repos_url":"https://api.github.com/users/ig0774/repos","events_url":"https://api.github.com/users/ig0774/events{/privacy}","received_events_url":"https://api.github.com/users/ig0774/received_events","type":"User","site_admin":false},"body":"On the other hand, will any of this work on ST2... I suppose not if it's based on phantoms.","created_at":"2016-10-03T23:26:38Z","updated_at":"2016-10-03T23:26:39Z","html_url":"https://github.com/SublimeText/LaTeXTools/pull/785#discussion_r81661707","pull_request_url":"https://api.github.com/repos/SublimeText/LaTeXTools/pulls/785","_links":{"self":{"href":"https://api.github.com/repos/SublimeText/LaTeXTools/pulls/comments/81661707"},"html":{"href":"https://github.com/SublimeText/LaTeXTools/pull/785#discussion_r81661707"},"pull_request":{"href":"https://api.github.com/repos/SublimeText/LaTeXTools/pulls/785"}}},"pull_request":{"url":"https://api.github.com/repos/SublimeText/LaTeXTools/pulls/785","id":78582858,"html_url":"https://github.com/SublimeText/LaTeXTools/pull/785","diff_url":"https://github.com/SublimeText/LaTeXTools/pull/785.diff","patch_url":"https://github.com/SublimeText/LaTeXTools/pull/785.patch","issue_url":"https://api.github.com/repos/SublimeText/LaTeXTools/issues/785","number":785,"state":"open","locked":false,"title":"Math Live Preview and Preview Images","user":{"login":"r-stein","id":12573621,"avatar_url":"https://avatars.githubusercontent.com/u/12573621?v=3","gravatar_id":"","url":"https://api.github.com/users/r-stein","html_url":"https://github.com/r-stein","followers_url":"https://api.github.com/users/r-stein/followers","following_url":"https://api.github.com/users/r-stein/following{/other_user}","gists_url":"https://api.github.com/users/r-stein/gists{/gist_id}","starred_url":"https://api.github.com/users/r-stein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/r-stein/subscriptions","organizations_url":"https://api.github.com/users/r-stein/orgs","repos_url":"https://api.github.com/users/r-stein/repos","events_url":"https://api.github.com/users/r-stein/events{/privacy}","received_events_url":"https://api.github.com/users/r-stein/received_events","type":"User","site_admin":false},"body":"Add the functionality to preview the currently edited math formula using phantoms and preview images using a hover popup (default) or phantoms.\r\n\r\nPreview math:\r\n\r\n![preview_math](https://cloud.githubusercontent.com/assets/12573621/19031529/13413d20-8955-11e6-923d-2b1e871f2a49.gif)\r\n\r\n\r\nPreview Image:\r\n\r\n![preview_image](https://cloud.githubusercontent.com/assets/12573621/18833728/728597f8-83f2-11e6-8074-b1d6900e7292.gif)\r\n\r\n\r\nHow does math live preview work?\r\n\r\n1. extract the content of the current math scope\r\n2. wrap this inside a document template\r\n3. write this into a `*.tex` document\r\n4. compile to document do create a pdf (using `pdflatex`)\r\n5. convert the pdf into a png (using ImageMagick - `convert`)\r\n6. open a html popup, which displays the generated image\r\n\r\n\r\nPreview image features:\r\n\r\n- images are rescaled to fit into a user defined dimension\r\n- image types like `.pdf` are supported by creating thumbnails with ImageMagick\r\n- provides a button to open the image and the image folder\r\n\r\n\r\nTODO:\r\n- [x] high dpi support\r\n- [x] configurable latex program (not only `pdflatex`)\r\n- [x] image tinting according to colorscheme\r\n- [x] user configurable document template?\r\n- [x] read several variables from the setting and listen to setting changes\r\n- [x] check which latex math environments can be used with star (we don't want equation numbering)\r\n- [x] clear the cache with the generated files\r\n- [x] check, that ImageMagick is installed\r\n- [ ] ST3(b3114)/ST2 compatibility\r\n- [ ] several code improvements\r\n\r\nFuture ideas:\r\n- extract and inject used packages (?) and command definitions (?) from the edited document","created_at":"2016-07-23T21:22:14Z","updated_at":"2016-10-03T23:26:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f795c45ba7503c2574dd71e989564853566704af","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/SublimeText/LaTeXTools/pulls/785/commits","review_comments_url":"https://api.github.com/repos/SublimeText/LaTeXTools/pulls/785/comments","review_comment_url":"https://api.github.com/repos/SublimeText/LaTeXTools/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SublimeText/LaTeXTools/issues/785/comments","statuses_url":"https://api.github.com/repos/SublimeText/LaTeXTools/statuses/188f56a29261cea4ff4db7c160c1c6b12ab035c3","head":{"label":"r-stein:preview_math","ref":"preview_math","sha":"188f56a29261cea4ff4db7c160c1c6b12ab035c3","user":{"login":"r-stein","id":12573621,"avatar_url":"https://avatars.githubusercontent.com/u/12573621?v=3","gravatar_id":"","url":"https://api.github.com/users/r-stein","html_url":"https://github.com/r-stein","followers_url":"https://api.github.com/users/r-stein/followers","following_url":"https://api.github.com/users/r-stein/following{/other_user}","gists_url":"https://api.github.com/users/r-stein/gists{/gist_id}","starred_url":"https://api.github.com/users/r-stein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/r-stein/subscriptions","organizations_url":"https://api.github.com/users/r-stein/orgs","repos_url":"https://api.github.com/users/r-stein/repos","events_url":"https://api.github.com/users/r-stein/events{/privacy}","received_events_url":"https://api.github.com/users/r-stein/received_events","type":"User","site_admin":false},"repo":{"id":42114808,"name":"LaTeXTools","full_name":"r-stein/LaTeXTools","owner":{"login":"r-stein","id":12573621,"avatar_url":"https://avatars.githubusercontent.com/u/12573621?v=3","gravatar_id":"","url":"https://api.github.com/users/r-stein","html_url":"https://github.com/r-stein","followers_url":"https://api.github.com/users/r-stein/followers","following_url":"https://api.github.com/users/r-stein/following{/other_user}","gists_url":"https://api.github.com/users/r-stein/gists{/gist_id}","starred_url":"https://api.github.com/users/r-stein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/r-stein/subscriptions","organizations_url":"https://api.github.com/users/r-stein/orgs","repos_url":"https://api.github.com/users/r-stein/repos","events_url":"https://api.github.com/users/r-stein/events{/privacy}","received_events_url":"https://api.github.com/users/r-stein/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/r-stein/LaTeXTools","description":"LaTeX plugin for Sublime Text 2 and 3","fork":true,"url":"https://api.github.com/repos/r-stein/LaTeXTools","forks_url":"https://api.github.com/repos/r-stein/LaTeXTools/forks","keys_url":"https://api.github.com/repos/r-stein/LaTeXTools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/r-stein/LaTeXTools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/r-stein/LaTeXTools/teams","hooks_url":"https://api.github.com/repos/r-stein/LaTeXTools/hooks","issue_events_url":"https://api.github.com/repos/r-stein/LaTeXTools/issues/events{/number}","events_url":"https://api.github.com/repos/r-stein/LaTeXTools/events","assignees_url":"https://api.github.com/repos/r-stein/LaTeXTools/assignees{/user}","branches_url":"https://api.github.com/repos/r-stein/LaTeXTools/branches{/branch}","tags_url":"https://api.github.com/repos/r-stein/LaTeXTools/tags","blobs_url":"https://api.github.com/repos/r-stein/LaTeXTools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/r-stein/LaTeXTools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/r-stein/LaTeXTools/git/refs{/sha}","trees_url":"https://api.github.com/repos/r-stein/LaTeXTools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/r-stein/LaTeXTools/statuses/{sha}","languages_url":"https://api.github.com/repos/r-stein/LaTeXTools/languages","stargazers_url":"https://api.github.com/repos/r-stein/LaTeXTools/stargazers","contributors_url":"https://api.github.com/repos/r-stein/LaTeXTools/contributors","subscribers_url":"https://api.github.com/repos/r-stein/LaTeXTools/subscribers","subscription_url":"https://api.github.com/repos/r-stein/LaTeXTools/subscription","commits_url":"https://api.github.com/repos/r-stein/LaTeXTools/commits{/sha}","git_commits_url":"https://api.github.com/repos/r-stein/LaTeXTools/git/commits{/sha}","comments_url":"https://api.github.com/repos/r-stein/LaTeXTools/comments{/number}","issue_comment_url":"https://api.github.com/repos/r-stein/LaTeXTools/issues/comments{/number}","contents_url":"https://api.github.com/repos/r-stein/LaTeXTools/contents/{+path}","compare_url":"https://api.github.com/repos/r-stein/LaTeXTools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/r-stein/LaTeXTools/merges","archive_url":"https://api.github.com/repos/r-stein/LaTeXTools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/r-stein/LaTeXTools/downloads","issues_url":"https://api.github.com/repos/r-stein/LaTeXTools/issues{/number}","pulls_url":"https://api.github.com/repos/r-stein/LaTeXTools/pulls{/number}","milestones_url":"https://api.github.com/repos/r-stein/LaTeXTools/milestones{/number}","notifications_url":"https://api.github.com/repos/r-stein/LaTeXTools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/r-stein/LaTeXTools/labels{/name}","releases_url":"https://api.github.com/repos/r-stein/LaTeXTools/releases{/id}","deployments_url":"https://api.github.com/repos/r-stein/LaTeXTools/deployments","created_at":"2015-09-08T13:44:46Z","updated_at":"2016-01-11T16:06:47Z","pushed_at":"2016-10-03T20:21:40Z","git_url":"git://github.com/r-stein/LaTeXTools.git","ssh_url":"git@github.com:r-stein/LaTeXTools.git","clone_url":"https://github.com/r-stein/LaTeXTools.git","svn_url":"https://github.com/r-stein/LaTeXTools","homepage":"tekonomist.wordpress.com","size":2055,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"SublimeText:master","ref":"master","sha":"ba222092cf7cf9957cec133048bd67f55cf53ece","user":{"login":"SublimeText","id":684879,"avatar_url":"https://avatars.githubusercontent.com/u/684879?v=3","gravatar_id":"","url":"https://api.github.com/users/SublimeText","html_url":"https://github.com/SublimeText","followers_url":"https://api.github.com/users/SublimeText/followers","following_url":"https://api.github.com/users/SublimeText/following{/other_user}","gists_url":"https://api.github.com/users/SublimeText/gists{/gist_id}","starred_url":"https://api.github.com/users/SublimeText/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SublimeText/subscriptions","organizations_url":"https://api.github.com/users/SublimeText/orgs","repos_url":"https://api.github.com/users/SublimeText/repos","events_url":"https://api.github.com/users/SublimeText/events{/privacy}","received_events_url":"https://api.github.com/users/SublimeText/received_events","type":"Organization","site_admin":false},"repo":{"id":1530210,"name":"LaTeXTools","full_name":"SublimeText/LaTeXTools","owner":{"login":"SublimeText","id":684879,"avatar_url":"https://avatars.githubusercontent.com/u/684879?v=3","gravatar_id":"","url":"https://api.github.com/users/SublimeText","html_url":"https://github.com/SublimeText","followers_url":"https://api.github.com/users/SublimeText/followers","following_url":"https://api.github.com/users/SublimeText/following{/other_user}","gists_url":"https://api.github.com/users/SublimeText/gists{/gist_id}","starred_url":"https://api.github.com/users/SublimeText/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SublimeText/subscriptions","organizations_url":"https://api.github.com/users/SublimeText/orgs","repos_url":"https://api.github.com/users/SublimeText/repos","events_url":"https://api.github.com/users/SublimeText/events{/privacy}","received_events_url":"https://api.github.com/users/SublimeText/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SublimeText/LaTeXTools","description":"LaTeX plugin for Sublime Text 2 and 3","fork":false,"url":"https://api.github.com/repos/SublimeText/LaTeXTools","forks_url":"https://api.github.com/repos/SublimeText/LaTeXTools/forks","keys_url":"https://api.github.com/repos/SublimeText/LaTeXTools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SublimeText/LaTeXTools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SublimeText/LaTeXTools/teams","hooks_url":"https://api.github.com/repos/SublimeText/LaTeXTools/hooks","issue_events_url":"https://api.github.com/repos/SublimeText/LaTeXTools/issues/events{/number}","events_url":"https://api.github.com/repos/SublimeText/LaTeXTools/events","assignees_url":"https://api.github.com/repos/SublimeText/LaTeXTools/assignees{/user}","branches_url":"https://api.github.com/repos/SublimeText/LaTeXTools/branches{/branch}","tags_url":"https://api.github.com/repos/SublimeText/LaTeXTools/tags","blobs_url":"https://api.github.com/repos/SublimeText/LaTeXTools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SublimeText/LaTeXTools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SublimeText/LaTeXTools/git/refs{/sha}","trees_url":"https://api.github.com/repos/SublimeText/LaTeXTools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SublimeText/LaTeXTools/statuses/{sha}","languages_url":"https://api.github.com/repos/SublimeText/LaTeXTools/languages","stargazers_url":"https://api.github.com/repos/SublimeText/LaTeXTools/stargazers","contributors_url":"https://api.github.com/repos/SublimeText/LaTeXTools/contributors","subscribers_url":"https://api.github.com/repos/SublimeText/LaTeXTools/subscribers","subscription_url":"https://api.github.com/repos/SublimeText/LaTeXTools/subscription","commits_url":"https://api.github.com/repos/SublimeText/LaTeXTools/commits{/sha}","git_commits_url":"https://api.github.com/repos/SublimeText/LaTeXTools/git/commits{/sha}","comments_url":"https://api.github.com/repos/SublimeText/LaTeXTools/comments{/number}","issue_comment_url":"https://api.github.com/repos/SublimeText/LaTeXTools/issues/comments{/number}","contents_url":"https://api.github.com/repos/SublimeText/LaTeXTools/contents/{+path}","compare_url":"https://api.github.com/repos/SublimeText/LaTeXTools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SublimeText/LaTeXTools/merges","archive_url":"https://api.github.com/repos/SublimeText/LaTeXTools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SublimeText/LaTeXTools/downloads","issues_url":"https://api.github.com/repos/SublimeText/LaTeXTools/issues{/number}","pulls_url":"https://api.github.com/repos/SublimeText/LaTeXTools/pulls{/number}","milestones_url":"https://api.github.com/repos/SublimeText/LaTeXTools/milestones{/number}","notifications_url":"https://api.github.com/repos/SublimeText/LaTeXTools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SublimeText/LaTeXTools/labels{/name}","releases_url":"https://api.github.com/repos/SublimeText/LaTeXTools/releases{/id}","deployments_url":"https://api.github.com/repos/SublimeText/LaTeXTools/deployments","created_at":"2011-03-26T18:59:50Z","updated_at":"2016-10-02T20:59:32Z","pushed_at":"2016-10-03T20:21:41Z","git_url":"git://github.com/SublimeText/LaTeXTools.git","ssh_url":"git@github.com:SublimeText/LaTeXTools.git","clone_url":"https://github.com/SublimeText/LaTeXTools.git","svn_url":"https://github.com/SublimeText/LaTeXTools","homepage":"tekonomist.wordpress.com","size":3480,"stargazers_count":1278,"watchers_count":1278,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":279,"mirror_url":null,"open_issues_count":166,"forks":279,"open_issues":166,"watchers":1278,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SublimeText/LaTeXTools/pulls/785"},"html":{"href":"https://github.com/SublimeText/LaTeXTools/pull/785"},"issue":{"href":"https://api.github.com/repos/SublimeText/LaTeXTools/issues/785"},"comments":{"href":"https://api.github.com/repos/SublimeText/LaTeXTools/issues/785/comments"},"review_comments":{"href":"https://api.github.com/repos/SublimeText/LaTeXTools/pulls/785/comments"},"review_comment":{"href":"https://api.github.com/repos/SublimeText/LaTeXTools/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SublimeText/LaTeXTools/pulls/785/commits"},"statuses":{"href":"https://api.github.com/repos/SublimeText/LaTeXTools/statuses/188f56a29261cea4ff4db7c160c1c6b12ab035c3"}}}}
{"actor":{"display_login":"ig0774"}}