[[
emacs
]]
Applied Mechanics Lab. WIKI
トレース:
文書の表示
以前のリビジョン
最近の変更
サイトマップ
ログイン
この文書は読取専用です。文書のソースを閲覧することは可能ですが、変更はできません。もし変更したい場合は管理者に連絡してください。
====== emacs ====== * reference.pdf があるとショートカットを覚えるのに便利 * [[http://clip.dia.fi.upm.es/~albegarcia/emacs-reference.pdf]] 以下,微妙に使うショートカットを一部抜粋 | M-= | 文字数のカウント | ===== 背景を黒く ===== 背景が黒の方が目にやさしいらしい。 .zshrcか何かに、 <code bash> alias emacs='emacs -r' </code> でおk。もっと凝ったことをしたければ、 http://www.emacswiki.org/emacs/ColorTheme なんてのもあるらしい。 load-pathの通った場所 ((.emacsに <code lisp> (setq load-path (cons (expand-file-name "~/適当な/ディレクトリの/名前") load-path)) </code> を書けばよい)) にcolor-theme.elを置いて、 .emacsに <code lisp> (require 'color-theme) </code> と書いて、M-x color-theme-[Tab]で気に入ったものを探せばよろしい。 ただし、拾ってきたcolor-theme.elにはbugがいる模様。common-color-configurationの部分をコメントアウトすれば、一応動くようにはなる。FIXME ===== ispell-buffer ===== M-x(Alt押しながらx)ispell-bufferで、スペルチェックしてくれる。 Error: No word lists can be found for the language "ja_JP".と怒られるかも。 ~/.aspell.confというファイルを新規作成して、 <code bash> lang en_US </code> と書いておく。 ===== emacsから日本語文書を直接印刷 ===== * gs-cjk-resource, cmap-adobe-japan1が必要 <code bash> sudo apt-get install gs-cjk-resource cmap-adobe-japan1 </code> * ~/.emacs.el に以下の設定を追記. <code> (setq ps-multibyte-buffer 'non-latin-printer) (require 'ps-mule) (defalias 'ps-mule-header-string-charsets 'ignore) </code> * M-x ps-print-buffer かメニューバーからFile => print Postscript Bufferで印刷. ===== anthyの設定 ===== <code lisp> ; Anthy, swith mode by CTRL- (load-library "anthy") (setq default-input-method "japanese-anthy") ;(setq its-hira-period ".") ;(setq its-hira-comma ",") (anthy-change-hiragana-map "," ",") (anthy-change-hiragana-map "." ".") </code> ===== スタートアップスクリーン ===== デフォルトで分割されている窓を1つに <code lisp> (custom-set-variables ;; custom-set-variables was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(inhibit-startup-screen t)) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. ) </code> ===== yatexの設定 ===== <code lisp> ;;*.texで自動的にYaTeXモード (setq auto-mode-alist (cons (cons "\\.tex$" 'yatex-mode) auto-mode-alist)) (autoload 'yatex-mode "yatex" "Yet Another LaTeX mode" t) ;;TeX typeset (setq tex-command "platex") ;;dvi preview (setq dvi2-command "xdvi") ;; Kanji code ;;; 1=Shift JIS ;;; 2=JIS ;;; 3=EUC (setq YaTeX-kanji-code 3) ;;use LaTeX2e and AMS-LaTeX (setq YaTeX-use-LaTeX2e t) (setq YaTeX-use-AMS-LaTeX t) ;;font latex hook (add-hook 'yatex-mode-hook '(lambda () (require 'font-latex) (font-latex-setup))) ;;RefTeX mode ;(add-hook 'yatex-mode-hook '(lambda () (reftex-mode t))) ;;auto fill mode ;(add-hook 'yatex-mode-hook '(lambda () (auto-fill-mode t) (setq fill-column 70))) ;;color ;;(setq YaTeX-use-font-lock t) ;; section color ;;(setq YaTeX-hilit-sectioning-face '(light時のforecolor/backcolor dark時の forecolor/backcolor)) ;;(setq YaTeX-hilit-sectioning-face '(white/snow3 snow1/snow3)) ;(add-hook 'yatex-mode-hook ;'(lambda () (require 'font-latex) ; (font-latex-setup) ; (progn ; (modify-syntax-entry ?% "<" (syntax-table)) ; (modify-syntax-entry 10 ">" (syntax-table)) ; (make-variable-buffer-local 'outline-level) ; (setq outline-level 'latex-outline-level) ; (make-variable-buffer-local 'outline-regexp) ; (setq outline-regexp ; (concat "[ \t]*\\\\\\(documentstyle\\|documentclass\\|chapter\\|" ; "section\\|subsection\\|subsubsection\\|paragraph\\)" ; "\\*?[ \t]*[[{]") ; )))) ;;outline-minor-mode ;(add-hook 'yatex-mode-hook '(lambda () (outline-minor-mode t))) ;(setq-default outline-level 'outline-level) ; ;(defun latex-outline-level () ; (save-excursion ; (looking-at outline-regexp) ; (let ((title (buffer-substring (match-beginning 1) (match-end 1)))) ; (cond ((equal (substring title 0 4) "docu") 20) ; ((equal (substring title 0 4) "para") 15) ; ((equal (substring title 0 4) "chap") 0) ; ((equal (substring title 0 4) "appe") 0) ; (t (length title)))))) ; ;;misc mode ;(add-hook 'yatex-mode-load-hook ; (function ; (lambda () ; (YaTeX-define-key "w" 'sdic-describe-word) ; (YaTeX-define-key "\C-w" 'YaTeX-switch-mode-menu)))) ; ;math-sign の追加 ; ;(setq ; YaTeX-math-sign-alist-private ; '( ; ("q" "Q" "(Q)") ; ("z" "Z" "ZZ") ; ("t""text""text") ; ("qu" "quad" "__") ; ("qq" "qquad" "____") ; ("ls" "varlimsup" "___\nlim") ; ("li" "varliminf" "lim\n---") ; ("il" "varinjlim" "lim\n-->") ; ("pl" "varprojlim" "lim\n<--") ; ("st" "text{ s.t. }" "s.t.") ; ("bigop" "bigoplus" "_\n(+)~") ; ("bigot" "bigotimes" "_\n(x)\n ~") ; )) ;;dvipdfmxの追加 ;; dviからpdfを作成する%sはファイル名 (setq dviprint-command-format "dvipdfmx %s") ;; latexmkを使う場合 ; (setq tex-command "latexmk -dvi") ;;mendexの指定 † ;(setq makeindex-command "mendex") ;;テンプレート ;; ~/.LaTeX-templateは新規ファイル作成時に自動挿入するファイル名 ;(setq YaTeX-template-file "~/.LaTeX-template") </code> ===== a2psjを使った印刷 ===== a2psjが必要. <code bash> sudo apt-get install a2ps-perl-ja </code> <code lisp> ;;;==================================== ;;;; print - 印刷設定 ;;;==================================== ;;; Postscript で印刷 (setq print-command-format "a2psj| lpr") (defun print-region (begin end) (interactive "r") (shell-command-on-region begin end print-command-format)) (defun print-buffer () (interactive) (print-region (point-min) (point-max))) (setq print-function (function print-buffer)) </code> ===== emacs.elのサンプル ===== <code lisp> (setq ps-multibyte-buffer 'non-latin-printer) (require 'ps-mule) (defalias 'ps-mule-header-string-charsets 'ignore) (custom-set-variables ;; custom-set-variables was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(inhibit-startup-screen t)) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. ) ;;*.texで自動的にYaTeXモード (setq auto-mode-alist (cons (cons "\\.tex$" 'yatex-mode) auto-mode-alist)) (autoload 'yatex-mode "yatex" "Yet Another LaTeX mode" t) ;;TeX typeset (setq tex-command "platex") ;;dvi preview (setq dvi2-command "xdvi") ;; Kanji code ;;; 1=Shift JIS ;;; 2=JIS ;;; 3=EUC (setq YaTeX-kanji-code 3) ;;use LaTeX2e and AMS-LaTeX (setq YaTeX-use-LaTeX2e t) (setq YaTeX-use-AMS-LaTeX t) ;;font latex hook (add-hook 'yatex-mode-hook '(lambda () (require 'font-latex) (font-latex-setup))) ;;RefTeX mode ;(add-hook 'yatex-mode-hook '(lambda () (reftex-mode t))) ;;auto fill mode ;(add-hook 'yatex-mode-hook '(lambda () (auto-fill-mode t) (setq fill-column 70))) ;;color ;;(setq YaTeX-use-font-lock t) ;; section color ;;(setq YaTeX-hilit-sectioning-face '(light時のforecolor/backcolor dark時の forecolor/backcolor)) ;;(setq YaTeX-hilit-sectioning-face '(white/snow3 snow1/snow3)) ;(add-hook 'yatex-mode-hook ;'(lambda () (require 'font-latex) ; (font-latex-setup) ; (progn ; (modify-syntax-entry ?% "<" (syntax-table)) ; (modify-syntax-entry 10 ">" (syntax-table)) ; (make-variable-buffer-local 'outline-level) ; (setq outline-level 'latex-outline-level) ; (make-variable-buffer-local 'outline-regexp) ; (setq outline-regexp ; (concat "[ \t]*\\\\\\(documentstyle\\|documentclass\\|chapter\\|" ; "section\\|subsection\\|subsubsection\\|paragraph\\)" ; "\\*?[ \t]*[[{]") ; )))) ;;outline-minor-mode ;(add-hook 'yatex-mode-hook '(lambda () (outline-minor-mode t))) ;(setq-default outline-level 'outline-level) ; ;(defun latex-outline-level () ; (save-excursion ; (looking-at outline-regexp) ; (let ((title (buffer-substring (match-beginning 1) (match-end 1)))) ; (cond ((equal (substring title 0 4) "docu") 20) ; ((equal (substring title 0 4) "para") 15) ; ((equal (substring title 0 4) "chap") 0) ; ((equal (substring title 0 4) "appe") 0) ; (t (length title)))))) ; ;;misc mode ;(add-hook 'yatex-mode-load-hook ; (function ; (lambda () ; (YaTeX-define-key "w" 'sdic-describe-word) ; (YaTeX-define-key "\C-w" 'YaTeX-switch-mode-menu)))) ; ;math-sign の追加 ; ;(setq ; YaTeX-math-sign-alist-private ; '( ; ("q" "Q" "(Q)") ; ("z" "Z" "ZZ") ; ("t""text""text") ; ("qu" "quad" "__") ; ("qq" "qquad" "____") ; ("ls" "varlimsup" "___\nlim") ; ("li" "varliminf" "lim\n---") ; ("il" "varinjlim" "lim\n-->") ; ("pl" "varprojlim" "lim\n<--") ; ("st" "text{ s.t. }" "s.t.") ; ("bigop" "bigoplus" "_\n(+)~") ; ("bigot" "bigotimes" "_\n(x)\n ~") ; )) ;;dvipdfmxの追加 ;; dviからpdfを作成する%sはファイル名 (setq dviprint-command-format "dvipdfmx %s") ;; latexmkを使う場合 ; (setq tex-command "latexmk -dvi") ;;mendexの指定 † ;(setq makeindex-command "mendex") ;;テンプレート ;; ~/.LaTeX-templateは新規ファイル作成時に自動挿入するファイル名 ;(setq YaTeX-template-file "~/.LaTeX-template") ;;;==================================== ;;;; print - 印刷設定 ;;;==================================== ;;; Postscript で印刷 (setq print-command-format "a2psj| lpr") (defun print-region (begin end) (interactive "r") (shell-command-on-region begin end print-command-format)) (defun print-buffer () (interactive) (print-region (point-min) (point-max))) (setq print-function (function print-buffer)) </code>
emacs.1252322895.txt.gz
· 最終更新: 2009/09/07 20:28 by
10.232.95.26
文書の表示
以前のリビジョン
[unknown link type]
文書の先頭へ