1 enable orgmode latex preview to support retina on mac

By default orgmode latex preview do not support retina, so on mac with retina screen, latex preview will be fuzzy.
However, we can hack org.el to achieve the function. Just follow steps below:

1.1 get the proper version of emacs

To instead use the Yamamoto Mitsuharu version of Emacs 25.1 (with more mac-specific features):

brew tap railwaycat/emacsmacport
brew install emacs-mac

and finally link it to your Applications folder:

brew linkapps emacs-mac

this version emacs will support retina image display.

1.2 change org-format-latex-options

change scale from 1.0 to 2.0, to generate 2x size image.

1.3 delete org.elc

1.4 add function to org.el

(defun galaxy-compose-image-filename-2x(image-file-name)
(concat (file-name-directory image-file-name) (file-name-base image-file-name) "@2x." (file-name-extension image-file-name)))

and eval the function.

1.5 modify function org-format-latex

change fragment:

(unless (file-exists-p movefile)
(org-create-formula-image value movefile options forbuffer processing-type)

to

(unless (file-exists-p movefile)
(org-create-formula-image value movefile options forbuffer processing-type)
(setq filename-2x (galaxy-compose-image-filename-2x movefile))
(rename-file movefile filename-2x)
(call-process-shell-command "convert" nil nil nil nil (concat "\"" filename-2x "\" -scale \"50%\" -quality \"100%\"" ) (concat "\"" movefile "\"" )))

and eval the function.

Now, you can preview latex with 2x size image for mac retina screen.

Author: galaxy

Created: 2017-04-18 Tue 00:11

Validate

enable orgmode latex preview to support retina on mac的更多相关文章

  1. OWIN support for the Web API 2 and MVC 5 integrations in Autofac

    Currently, in the both the Web API and MVC frameworks, dependency injection support does not come in ...

  2. Sublime-text markdown with Vim mode and auto preview

    说明 最近看到markdown相关的东西,被其书写方式吸引,其实以前就在找这种类似的工具,但是也没找到,由于习惯了Vim,可Vim不支持markdown预览,这点可能不是很好,于是找到Sublime- ...

  3. Solution for Latex error: "Cannot determine size of graphic"

    I'm trying to include graphics in my Latex-file, which I compiled with latex+dvipdf on OS X. Latex h ...

  4. VS code 配置为 Python R LaTeX IDE

    VS code配置为Python R LaTeX IDE VS code的中文断行.编辑功能强大,配置简单. VSC的扩展在应用商店搜索安装,快捷键ctrl+shift+x调出应用商店. 安装扩展后, ...

  5. image-set实现Retina屏幕下图片显示详细介绍

    支持image-set:如果你的浏览器支持image-sete,而且是普通显屏下,此时浏览器会选择image-set中的@1x背景图像: Retina屏幕下的image-set:如果你的浏览器支持im ...

  6. SharePoint online Multilingual support - Settings

    博客地址:http://blog.csdn.net/FoxDave This post will talk about how to enable sharepoint online site mul ...

  7. [转]The NTLM Authentication Protocol and Security Support Provider

    本文转自:http://davenport.sourceforge.net/ntlm.html#ntlmHttpAuthentication The NTLM Authentication Proto ...

  8. Retina屏幕下image-set

    实现Retina屏幕下图像的显示方法,还特别给我截取了一段代码: .soso .logo .qqlogo { display: block; width: 134px; height: 44px; b ...

  9. 如何判断retina,如何判断设备的比例

    http://www.189works.com/article-95647-1.html 说起iPhone 4带来的革新,retina display绝对是最吸引眼球的一项,以至于我现在看电脑的显示屏 ...

随机推荐

  1. C++知识点总结(二)

    1.字符串的部分拷贝 ① 利用标准库函数strncpy(),可以将一字符串的一部分拷贝到另一个字符串中.strncpy()函数有3个参数:第一个参数是目录字符串:第二个参 数是源字符串:第三个参数是一 ...

  2. Windchill 查询功能

    一.使用SearchCondition 查询语句中用容器中的containerReference.key.id名称来代替数据库中的字段idA3containerReference /**      * ...

  3. [hdu1402]A * B Problem Plus(NTT)

    解题关键:快速数论变换NTT模板. 注意$ans$数组的$ans[n]$一定要注意置$0$,或者结果从$n-1$开始遍历,这里很容易出错. 代码1:ACdreamer 的板子. 为什么要reverse ...

  4. UI线程中非安全操作与安全操作

    ------------------siwuxie095                             工程名:SwingUIThreadSafeTest 包名:com.siwuxie095 ...

  5. Spring入门第六课

    XML配置里的Bean自动装配 Spring IOC容器可以自动装配Bean.需要做的仅仅是在<bean>的autowire属性里指定自动装配的模式 ByType(根据类型自动装配):若I ...

  6. URAL 2018 The Debut Album (DP)

    题意:给出n长度的数列,其实1的连续个数不超过a,2的连续个数不超过b. 析:dp[i][j][k] 表示前 i 个数,以 j 结尾,并且连续了k个长度,要用滚动数组,要不然MLE. 代码如下: #p ...

  7. hdu1082

    #include<iostream> #include<stack> #include<string> #include<cctype> using n ...

  8. 将一个mapList转换为beanList

    public static <T> List<T> copyMapToBean(   List<Map<String, Object>> resultM ...

  9. CODING 告诉你硅谷的研发项目管理之道(4)

    写在前面 优秀的项目管理者是怎么工作的,如何帮助研发团队高效工作?一直是 CODING 关注的重要话题,我们不断地打磨 CODING 研发系统来让开发更简单.近期我们精心挑选了几篇硅谷科技公司研发管理 ...

  10. pb_ds的优先队列实现dijkstra

    用pb_ds的优先队列来做dijkstra..据说noip能用哟. 先来篇关于仿函数的文章. 由于pb_ds支持由迭代器访问元素,并且push操作会返回一个迭代器,merge操作会更新迭代器,相当于帮 ...