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. 从Github远程库安装Node.JS

    3)从Github远程库安装Node.JS在这个方法中我们需要一些步骤来把Node.js的从Github上的远程的仓库克隆到本地仓库目录 在开始克隆(克隆)包到本地并且配制之前,我们要先安装以下依赖包 ...

  2. Flask07 Jinja2模板测试器、控制语句IF/FOR、变量/块 赋值、作用域、块级作用域

    1 测试器及其使用 在模板中的 {{}} 可以书写测试器,格式如下 {{ 变量 is 测试器名称  }} 1.1 在python中导入 Jinja2 的模板 from jinja2 import te ...

  3. 第四课4、ROS客户端

    ROS客户端提供一些列库文件用于用户开发.它利用许多ROS概念并使它通过代码可以获取. 下面是ROS程序中的接口 ROSCPP客户端(c++客户端) 首先新建一个包 然后catkin_make一下 在 ...

  4. sublime text 3如何安装插件和设置字号

    使用ctrl + ~(这个符号是键盘上1前面那个),如果不能调用出就需要修改快捷键,在Preferences ->Key Bindings - Default打开文件后,大概在248行,这里我修 ...

  5. div设置滚动条内容任然显示不全

    <div style="overflow:scroll;height:100%"></div> 注意:高度需设置为100%,不然内容显示不全

  6. js复习笔记

    isNaN(x) 1.判断结果不是纯数字, var a=1234var b =isNan(a) //b是 false 因为a是纯数字 var a="abc123"var b =is ...

  7. SpringBoot应用篇(一):自定义starter

    一.码前必备知识 1.SpringBoot starter机制 SpringBoot中的starter是一种非常重要的机制,能够抛弃以前繁杂的配置,将其统一集成进starter,应用者只需要在mave ...

  8. C++基础之预处理和语句

    (1)C++语言源程序中可以使用一些预处理中的编译命令,这些命令在程序被正常编译之前执行,被称为预处理命令,这些命令所实现的功能被称为预处理功能(2)常用的预处理命令有文件包含命令.宏定义命令和条件编 ...

  9. libguestfs知识点

    libguestfs 是一组 Linux 下的 C 语言的 API ,用来访问虚拟机的磁盘映像文件.其项目主页是http://libguestfs.org/ , 该工具包内包含的工具有virt-cat ...

  10. 2017-10-4 清北刷题冲刺班p.m

    P102zhx a [问题描述]你是能看到第一题的 friends 呢.——hja两种操作:1.加入一个数.2.询问有多少个数是?的倍数.[输入格式]第一行一个整数?,代表操作数量.接下来?行,每行两 ...