鴨川η

Emacs tips and settings

Install Emacs

On OSX environment, you can install via homebrew:

$ brew install emacs --with-cocoa

Install prelude

$ curl -L https://github.com/bbatsov/prelude/raw/master/utils/installer.sh | zsh

Add alias

$ cat ~/.zshrc

...
alias es='emacs --daemon'
alias et='emacsclient -t'
alias ec='emacsclient -c'
alias vim='emacsclient -t'
alias vi='emacsclient -t'

org-mode+lualatex

It is difficult for me to use minted

Add this code snippet to ~/.emacs.d/personal/settings.el

You could write raw tex code in an org file.

\begin{algorithm}
\begin{algorithmic}[1]
\State {$c \gets 1$}
\While {$b \geq 0$}
  \State {$c \gets ac$}
  \State {$b \gets b-1$}
\EndWhile
\end{algorithmic}
\end{algorithm}

Change default font

(add-to-list 'default-frame-alist '(font . "Ricty Diminished Discord-15"))

org-ref

Requirement

All bibliographies in ~/Dropbox/papers/library.bib (mendely)

Procedures
  • Install org-ref from M-x package-list-packages
  • Add the code snippet below to your init.el
  (setq reftex-default-bibliography '("~/Dropbox/papers/library.bib"))
  (setq org-ref-default-bibliography '("~/Dropbox/papers/library.bib"))
  (setq bibtex-completion-bibliography "~/Dropbox/papers/library.bib")
  (require 'org-ref)
  • Add code below tail of your org file
bibliographystyle:junsrt
bibliography:~/Dropbox/papers/library.bib
  • Execute M-x org-ref-helm-cite-link and then select a bibliography where you want to add cite in an org file.

Realtime-preview for Latex

  1. Install LaTeXPreviewPane
  2. When you edit latex file, you execute the command: M-x latex-preview-pane-mode [RET]