zoukankan      html  css  js  c++  java
  • enable orgmode latex preview to support retina on mac

    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

  • 相关阅读:
    web3g163(网易)邮箱和博客数据架构设计
    webQQ(腾讯)EmailTMessage(腾讯微博记事本)
    ASP.net MVC 4 中Security.FormsAuthentication验证用户的状态(匿名|已登录)
    ASP.net:查找框设默认
    webQQ(腾讯)EMailQQMsg(仿QQ短信)数据库设计
    webQQ(腾讯)QZone仿QQ投票和测试程序数据库设计
    ASP.NET MVC 3 RTM
    【技术贴】Eclipse||Myeclipse tab缩进转换为空格教程
    【技术贴】解决Eclipse启动不了,一闪而过的问题
    【技术贴】解决U盘无法复制:磁盘被写保护,请去掉写保护或使用另一张磁盘。
  • 原文地址:https://www.cnblogs.com/galaxy-gao/p/6725773.html
Copyright © 2011-2022 走看看