Thursday, November 28, 2013

Emacs spell-checker

Emacs 한글 맞춤법 검사기

Emacs 한글 맞춤법 검사기


;; =================================================
;; εμαcs is ⎋[esc]⌘[meta]⌥[alt]⌃[ctrl]⇧[shift].
;; =================================================

이 문서는 emacs org-mode로 작성된 글입니다.

Operating System Environments

  • Main- : OS X Mavericks (10.9)
  • Sub- : Debian GNU/Linux Wheezy (7.2)
  • Server: Debian GNU/Linux Squeeze || Lenny
  • Mobile: iOS 7.0.4

Emacs 사용 환경

  • OS X: Aquamacs + OS X dictionaries
  • Debian GNU/Linux: Emacs + Hunspell

emacs_lisp in .emacs

OS X: Aquamacs + OS X dictionaries

Aquamacs한글 맞춤법 검사기는 아래에서 다운 받는다.

ko-aff-dic-0.5.6.zip 파일의 압축을 풀어, ko.affko.dic~/Library/Spelling/ (Finder에서 ⌘⇧G) 아래에 복사해 넣는다. 전체 사용자에게 한글 맞춤법 검사기가 동작하게 하려면, /Library/Spelling/ 에 복사해 붙이자. 시스템을 재부팅한다.

여기까지 하면, TextEdit.app이나 Mail.app 등에서 한글 맞춤법 검사기가 잘 동작하는 것을 볼 수 있다. 하지만 여기서 목표는 Aquamacs에서 이를 사용할 수 있게 하는 것이다. Aquamacs에서는 TextEdit.app이나 Mail.app 등과는 다르게 어떤 언어를 사용하여 맞춤법 검사를 할 지를 editor 차원에서 일일이 변경해야 함에 주의하자. 즉, 한글 맞춤법을 검사할 때는 한글로 해서 검사해야 하고, 영문 맞춤법을 검사할 때는 영어로 맞춤법 검사기를 바꾸어 주어야 한다. 또한, 아래의 기술할 방법으로 Aquamacs에서 한글 맞춤법을 쓰게 되면, TextEdit.app이나 Mail.app에서도 한 가지 언어로만 맞춤법 검사를 할 수 있게 됨에도 주의하자. 1

그럼에도 불구하고 Aquamacs에서 한글 및 다른 언어들의 맞춤법 검사를 쓰고 싶으면 다음을 진행하자. 사실, 아래 Emacs Lisp code에 다 적어 놨지만 간단히 방법을 기술하면 아래와 같다.

0째, Aquamacs에서 원할한 한글 사용을 하려면 바람 입력기 사용을 추천한다. 자세한 설치법은 지난 Post를 참고하자. -> "Emacs에서의 한글환경" 바로 가기

첫째, Aquamacs에서 영어 맞춤법을 검사하기를 기본으로 지정하자. 2

  1. OS X Mavericks에서는 System Preferences 을 열어 Keyboard 를 클릭, Text 페널에서 Spelling:U.S. English 로 선택하자.
  2. OS X Mountain Lion에서는 System Preferences 을 열어 Language & Text 를 클릭, Text 페널에서 Spelling:U.S. English 로 선택하자.

여기까지하면 Aquamacs 뿐만 아니라 TextEdit.app이나 Mail.app 등에서도 영어 맞춤법 검사만 가능해진다.

둘째, 이제 아래 Emacs Lisp code를 ~/.emacs 를 열어 적어넣자.

;; -------------------------------------------
;; Aquamacs spell-checker
;; -------------------------------------------
;; ###
;; pre-settings for Mountain Lion: System Preferences -> Language & Text -> [Text: Spelling: U.S. English]
;; pre-settings for Mavericks    : System Preferences -> Keyboard        -> [Text: Spelling: U.S. English]
;; ###
;; ### korean-english-german
;; (let ((langs '("ko" "en" "de")))
;;   (setq lang-ring (make-ring (length langs)))
;;   (dolist (elem langs) (ring-insert lang-ring elem)))
;; (defun cycle-ispell-languages ()
;;   (interactive)
;;   (let ((lang (ring-ref lang-ring -1)))
;;     (ring-insert lang-ring lang)
;;     (ispell-change-dictionary lang)))
;; ###
;; ### korean-english
(let ((langs '("ko" "en")))
  (setq lang-ring (make-ring (length langs)))
  (dolist (elem langs) (ring-insert lang-ring elem)))
(defun cycle-ispell-languages ()
  (interactive)
  (let ((lang (ring-ref lang-ring -1)))
    (ring-insert lang-ring lang)
    (ispell-change-dictionary lang)))
;; ###
;; ### key bindings
(global-set-key (kbd "S-SPC") 'cycle-ispell-languages)
(global-set-key (kbd "A-D") 'ispell-region)   ;; cmd+shift+d
(global-set-key (kbd "A-d") 'ispell-word)     ;; cmd+d

한글과 영어로 맞춤법 검사하기를 활성화 하였고, 맞춤법 검사기 변환은 ⇧SPC 로 지정하였다. 영어로 시작되었을 것이므로 ⇧SPC 한 번 누르면 한글로, 또 누르면 영어로, 또 다시 누르면 다시 한글로 바뀐다. 글을 쓰다가 빨간줄이 그어지면, ⌘d 를 누르면 올바른 단어가 Aquamacs 최상단에 뜬다. 예를 들어, "적어놨지만"이라고 적은 부분에서 ⌘d 하면 아래 화면을 볼 수 있다.

11104767174_46ee950f40_z.jpg

여기서 0 을 누르면 "적어냈지만"으로, 3 을 누르면 "적어 놨지만"으로 바뀐다. Shift-Selction으로 지정한 영역 전체의 맞춤법 검사는 ⌘⇧d (or ⌘D)로 지정해 놓았다. 물론 이 key bindings가 싫으면, 사용자 취향에 따라 원하는 것으로 바꾸면 된다. 세 개 이상의 언어로 맞춤법 검사를 하고 싶으면 이를 확장하면 된다. 위의 Emacs Lisp code에서 주석 처리(;;)해놓은 부분이 바로 "한국어-영어-독어"의 사용 예이다.

Debian GNU/Linux: Emacs + Hunspell

Emacs는 깔려 있는 것으로 가정한다. 역시, 아래 Emacs Lisp code에 다 적어 놨지만 간단히 방법을 기술하면 아래와 같다. 여기서는 "한국어-영어-독어"를 사용하는 것으로 예를 들었다.3

  1. 아래를 실행하여 hunspell, hunspell-en-us, hunspell-ko, hunspell-de-de 를 설치한다.
    $ sudo apt-get install hunspell hunspell-en-us hunspell-ko hunspell-de-de
    
  2. 아래 Emacs Lisp code를 ~/.emacs 를 열어 적어넣자.
    ;; -------------------------------------------
    ;; GNU Emacs spell-checker in Debian GNU/Linux
    ;; -------------------------------------------
    ;; ###
    ;; pre-settings: sudo apt-get install hunspell hunspell-en-us hunspell-ko hunspell-de-de
    (setq ispell-local-dictionary-alist
          '(
            ("korean"
             "[가-힣]" "[^가-힣]" "[0-9a-zA-Z]" nil
             ("-d" "ko_KR")
             nil utf-8)
            ("english"
             "[A-Za-z]" "[^A-Za-z]" "[0-9a-zA-Z]" nil
             ("-d" "en_US")
             nil utf-8)
            ("german"
             "[a-zäöüßA-ZÄÖÜ]" "[^a-zäöüßA-ZÄÖÜ]" "[']" t
             ("-d" "de_DE")
             nil utf-8)
            )
          )  ;; =====> Mandatory I.
    (if (file-exists-p "/usr/bin/hunspell")
        (progn
          (setq ispell-program-name "hunspell")
          (eval-after-load "ispell"
            '(progn (defun ispell-get-coding-system () 'utf-8))))
      )      ;; =====> Mandatory II.
    (setq ispell-local-dictionary "english")
    ;; ###
    ;; ### korean-english-german
    (let ((langs '("korean" "english" "german")))
      (setq lang-ring (make-ring (length langs)))
      (dolist (elem langs) (ring-insert lang-ring elem)))
    (defun cycle-ispell-languages ()
      (interactive)
      (let ((lang (ring-ref lang-ring -1)))
        (ring-insert lang-ring lang)
        (ispell-change-dictionary lang)))
    ;; ###
    ;; ### korean-english
    ;; (let ((langs '("korean" "english")))
    ;;   (setq lang-ring (make-ring (length langs)))
    ;;   (dolist (elem langs) (ring-insert lang-ring elem)))
    ;; (defun cycle-ispell-languages ()
    ;;   (interactive)
    ;;   (let ((lang (ring-ref lang-ring -1)))
    ;;     (ring-insert lang-ring lang)
    ;;     (ispell-change-dictionary lang)))
    ;; ###
    ;; ### key bindings
    (global-set-key (kbd "S-SPC") 'cycle-ispell-languages) ;; shift-spacebar
    (global-set-key (kbd "s-D") 'ispell-region)            ;; cmd+shift+d
    (global-set-key (kbd "s-d") 'ispell-word)              ;; cmd+d
    ;; ### key bindings for windows keyboard
    ;; (global-set-key (kbd "S-SPC") 'cycle-ispell-languages) ;; shift-spacebar
    ;; (global-set-key (kbd "M-D") 'ispell-region)            ;; alt+shift+d
    ;; (global-set-key (kbd "M-d") 'ispell-word)              ;; alt+d
    

key bindings와 사용법은 위와 동일하다. Debian GNU/Linux를 Windows keyboard와 쓰는 경우(대부분은 그렇겠지만)는 위 code의 ;; ### key bindings for windows keyboard 위의 세줄을 주석(;;) 처리하고, 아래 세 줄은 주석(;;) 해제하여 쓰면 된다. 위에서 보다시피 이 경우에는 '단어 검사'와 '영역 검사'를 각각 ⌥d⌥⇧d (or ⌥D)로 지정되었다.

Epilog

Cocoa emacs에서 한글 맞춤법 검사기 사용은 시도해 보았으나… 실패했다. Cocoa emacs에서 OS X 사전을 사용하는 방법도 모르겠고, MacPorts에서 Hunspell port에 한글도 없어서 쓰려면 직접 설치해야 하는데, 귀찮아서 안해봤다. 어차피 Cocoa emacs는 자잘한 bugs가 많아서 쓰지도 않고 추천하지도 않는다.


Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

Footnotes:

1

원래 TextEdit.app이나 Mail.app 등에서는 Input sources에서 지정해준 언어들로 자동으로 그 언어에 맞게 알아서 맞춤법 검사를 해준다.

2

이유는 모르겠지만, 이렇게 하지 않으면 Aquamacs에서 맞춤법을 검사할 사전(⌥x ispell-change-dictionary)이 바뀌지 않는다.

3

참고 사이트들: Ref. #1, Ref. #2, Ref. #3

Created: 2013-11-28 Thu 21:35

Emacs 23.4.1 (Org mode 8.0.2)

Validate XHTML 1.0

Sunday, November 17, 2013

GCC in OS X Mavericks

GCC in OS X Mavericks

GCC in OS X Mavericks


;; =================================================
;; εμαcs is ⎋[esc]⌘[meta]⌥[alt]⌃[ctrl]⇧[shift].
;; =================================================

This post is written with emacs org-mode.

Operating System Environments

  • Main- : OS X Mavericks (10.9)
  • Sub- : Debian GNU/Linux Wheezy (7.2)
  • Server: Debian GNU/Linux Squeeze || Lenny
  • Mobile: iOS 7.0.4

Installation of GCC(gcc48) via MacPorts

GCC is the GNU Compiler Collection, including front ends for C, C++, Objective-C, Objective-C++, Fortran, and Java. In OS X Mavericks a sort of gcc is preinstalled, but it is based on the Clang. This preinstalled gcc is not fully compatible to GCC(GNU Compiler Collection). Moreover it can compile only C, C++, and Objective-C. I need a Fortran compiler.

Up to OS X Mountain Lion (10.8), GCC(GNU Compiler Collection) has been easily installed via MacPorts. However, in OS X Mavericks (10.9) a GCC(GNU Compiler Collection) port seems to be broken. A problem may be caused by the broken libgcc port that is the mainly dependent port of gcc43, gcc44, gcc45, gcc46, gcc47, gcc48. It cannot be installed via sudo port install libgcc. I don't fully understand why, but my conclusion is that any GCC(GNU Compiler Collection) is not possible to be installed via MacPorts in the usual way.

Fortunately I found a way around. It works!!! If you install the port py27-scipy, then GCC(GNU Compiler Collection), particularly gcc48, is going to be automatically installed. (see here.)

The versions of Xcode and MacPorts in my OS X Mavericks are

The proper version of MacPorts for Mavericks is required to be installed or re-installed.

Procedure in Bash shell (Terminal.app)

  1. Install Xcode command line tools.
    $xcode-select --install
    
  2. Update ports and install py27-scipy for gcc48 to be installed.1 Be patient. It takes about 2 hours.
    $sudo port selfupdate
    $sudo port install py27-scipy
    
  3. Set gcc to gcc48. gcc_select port is required. To see all variants of installed gcc, run the second line.2
    $sudo port install gcc_select
    $port select --list gcc
    $sudo port select gcc mp-gcc48
    $hash gcc
    $gcc --version
    

    10900062763_f192a02d82.jpg

  4. Clean up temporary files used in the middle of a port installation procedure.(Optional)3
    $sudo port -f uninstall inactive
    $sudo port -f clean --all all
    

HaPPy coding.

Epilog

Mavericks upgrade 후에 자동으로 깔리는 gcc는 적응이 안된다. C의 경우 options를 조정하면 어찌어찌 그 전에 짜 놓은 C codes를 돌릴 수도 있을 것 같기도 한데… 이렇게 돌린 계산 값의 신뢰도도 조금 우려되고… 어차피 Java나 Fortran을 돌리려면 GCC(GNU Compiler Collection)가 필요하다.

지난 Posts(OS X Mavericks, OS X Mavericks: list of compatible applications)에서 $sudo port selfupdate 가 먹히는 것만 보고 MacPorts가 동작한다고 썼는데, 제대로 쓰려면 현재(<2013-11-17 Sun>) 홈페이지에서 배포하는 MacPorts-2.2.1-10.9-Mavericks.pkg 를 받아 설치를 해야 한다. 그전 버전을 지울 필요는 없었다. 몇몇 ports가 깨져있어서 gcc48 같은 것이 바로 안 깔리는데, 지원자에 자원 봉사자들로 이루어진 MacPorts project를 욕할 생각은 없다. 오히려 고마울 뿐이며, py27-scipy 를 깔면 gcc48이 깔린다는 것을 알아낸 능력자 분께도 감사할 따름이다. Clang… Apple과 Google이 만든 compiler라… 이게 얼마나 좋은 지는 내가 평가할 수는 없지만, 나에게는 이 현상이 Apple이 끊임없이 보여주고 있는 지난 OS 지원 미비 혹은 중단 의 연장선으로 비춰진다.


Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

Footnotes:

1

See Ref. #1.

2

See Ref. #2 and #3.

3

See Ref. #4.

Created: 2013-11-17 Sun 10:36

Emacs 23.4.1 (Org mode 8.0.2)

Validate XHTML 1.0

Monday, November 11, 2013

Veusz in OS X Mavericks

Veusz in OS X Mavericks

Veusz in OS X Mavericks


;; =================================================
;; εμαcs is ⎋[esc]⌘[meta]⌥[alt]⌃[ctrl]⇧[shift].
;; =================================================

This post is written with emacs org-mode.

Operating System Environments

  • Main- : OS X Mavericks (10.9)
  • Sub- : Debian GNU/Linux Wheezy (7.2)
  • Server: Debian GNU/Linux Squeeze || Lenny
  • Mobile: iOS 7.0.3

Veusz in OS X Mountain Lion

Almost everything works fine. There would be no critical problem to use Veusz in OS X Mountain Lion. Current(<2013-11-11 Mon>) version is 1.18. You can download Veusz OS X binary via the following link.

Veusz in OS X Mavericks

It is working but annoying as well.

Problem

Opening a .vsz file directly with Veusz in Finder, Quicksilver, or a launcher is not properly functional. For example, when you directly open a .vsz file having a few linked data, Veusz launches with an empty sheet. It is not definitely caused by updating procedure to OS X Mavericks. Simply Veusz(v1.18) has an unsolved bug in OS X Mavericks. Fortunately(?), a .vsz file itself you have worked or been working has no problem, because you can see that correctly written scripts in that file via an editor like Aquamacs.

Solution

The only way I have found is simple but requires one more step.

  1. Launch Veusz.app
  2. ⌘O to open a .vsz file through Veusz.app

That's all. Don't directly open a .vsz file in Finder. Open Veusz.app first, then open(⌘O) a file you want to use through Veusz.app.

Update(<2013-11-15 Fri>): The bug is gone in the beta-version of Veusz(veusz-1.18.999-AppleOSX.dmg). Don't be confused that there are three nines not two in the name of file.

Created: 2013-11-15 Fri 22:10

Emacs 23.4.1 (Org mode 8.0.2)

Validate XHTML 1.0

Sunday, November 10, 2013

How to change the Finder icon

How to change the Finder icon

How to change the Finder icon


;; =================================================
;; εμαcs is ⎋[esc]⌘[meta]⌥[alt]⌃[ctrl]⇧[shift].
;; =================================================

This post is written with emacs org-mode.

Operating System Environments

  • Main- : OS X Mavericks (10.9)
  • Sub- : Debian GNU/Linux Wheezy (7.2)
  • Server: Debian GNU/Linux Squeeze || Lenny
  • Mobile: iOS 7.0.3

Instruction for changing the finder icon in OS X Mavericks1

  1. Prepare the image that you want to use in the .icns format.
  2. Rename it FinderIcon.icns
  3. Backup2 the /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/FinderIcon.icns, such as FinderIcon_original.icns. It requires your password.
  4. Copy the FinderIcon.icns that you want to use and paste it into /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/. It requires your password.
  5. Run the following commands in Bash shell(Terminal.app)
$sudo find /private/var/folders/ -name com.apple.dock.iconcache -exec rm {} \;
$killall Dock

If it doesn't work, then simply restart your system or change the following two images again.

  • /System/Library/CoreServices/Dock.app/Contents/Resources/finder@2x.png
  • /System/Library/CoreServices/Dock.app/Contents/Resources/finder.png

10781178123_c62b8b93f8_z.jpg


Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

Footnotes:

2

⇧⌘G in Finder and type /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/ in the appearing window.

Created: 2013-11-10 Sun 18:00

Emacs 23.4.1 (Org mode 8.0.2)

Validate XHTML 1.0

OS X Mavericks: list of compatible applications

OS X Mavericks: list of compatible applications

OS X Mavericks: list of compatible applications


;; =================================================
;; εμαcs is ⎋[esc]⌘[meta]⌥[alt]⌃[ctrl]⇧[shift].
;; =================================================

이 문서는 emacs org-mode 로 작성된 글입니다.

Operating System Environments

  • Main- : OS X Mavericks (10.9)
  • Sub- : Debian GNU/Linux Wheezy (7.2)
  • Server: Debian GNU/Linux Squeeze || Lenny
  • Mobile: iOS 7.0.3

Prologue

지난 Post에서 언급한 iBooks for mac의 모든 문제는 1.0.1로 판올림되면서 해결되었다. Mail.app에서 font 문제는 특정 서체에만 생기는 문제로써 그 서체만 다른 font로 바꾸어 주면 된다?!?(그래도 여전히 짜증난다.) 문제가 생겼던 font는 사람들이 잘 쓰지 않는 font (macappware에서 구매한 Brush 88/77 등)이므로 보통은 크게 걱정하지 않아도(?) 된다.

list of compatible applications

현재(<2013-11-10 Sun>)까지 확인해본 잘 동작하는 applicitions는 다음과 같다.

Application Description License
Quicksilver Application launcher + Apache
Aquamacs Emacs for OS X GPL
Skim PDF viewer BSD
Keka Compression/Extraction app  
Spellchecker-korean 한글 맞춤법 검사 Mozilla
MacPorts System maintainer BSD
Bibdesk BibTeX frontend BSD
DjView djvu viewer GPL
Growl-Fork Notification  
AppCleaner Application cleaner  
EzPlusForMac 신한은행  
Max Audio converter GPL
LibreOffice Office suite LGPL
Handbrake Video converter  
VirtualBox Virtualization software GPL+
바람 입력기 한글 입력기 GPL
Cyberduck SFTP/FTP client GPL
Clamxav Anti-virus software  
Emacs(via MacPorts) Emacs(cocoa, v24.3) GPL
MPlayer OSX Extended Media player GPL
Steam Game distribution platform by Valve  
TeamViewer 8 Remote control solution  
Devonthink Information management software  
Prizmo OCR software  

incompatible things

Quicksilver Cube-interface

동작을 안 하는 것은 아닌데, 회전 시 그래픽이 깨진다. 고쳐질까… 정말 오래 썼는데… Primer-interface로 갈아타야겠다.

Veusz

Veusz는 간단히 말해서 GUI Scientific Plotting Tool이다. Fortran이나 C 등으로 계산한 결과를 그래프로 만들 때 쓰는 프로그램인데, OS X Mavericks에서 문제가 심각하다. 프로그램이 실행이 안되거나 돌다가 충돌이 나는 것이 아니라, 원래 가지고 있던 .vsz 파일들을 Veusz로 부르면 link 되어 있던 data가 안 불러진다!!! VirtualBox Debian GNU/Linux에서 path만 바꾸어 부르면 잘 불러지는 것으로 보아, 단순히 Veusz(<2013-11-10 Sun>, v1.18)가 OS X Mavericks에서 동작하는데 문제가 있어 보인다.


Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

Created: 2013-11-10 Sun 16:40

Emacs 23.4.1 (Org mode 8.0.2)

Validate XHTML 1.0

Galaxy Gear in CSAT(College Scholastic Ability Test)

Galaxy Gear in CSAT(College Scholastic Ability Test)

갤럭시 기어 in 대학수학능력시험


;; =================================================
;; εμαcs is ⎋[esc]⌘[meta]⌥[alt]⌃[ctrl]⇧[shift].
;; =================================================

이 문서는 emacs org-mode 로 작성된 글입니다.

한 블로거가 쓴 "갤럭시기어 수능문제 등장" 글을 본 후, 믿을 수가 없고, 아직 어떤 언론사 기사도 없어서, 직접 ebs에서 기출 문제를 확인해 보았다.

다른 모든 한국어 홈페이지가 그렇듯, 바로 해당 글의 url도 없고, 첨부 파일의 url도 없어서, 홈페이지에서 직접 찾아들어가야 한다. 아래 링크로 들어가 두번째 페이지에서 "2014 대학수학능력시험 직업탐구_가사실업 문제지", 첨부파일 "201311_수능_가사실업②_문제지.pdf"에서 확인할 수 있다.

"2014 대학수학능력시험 기출문제 다운로드" 바로 가기

2014학년도 대학수학능력시험 직업탐구 영역 (가사∙실업 2)의 1번 문제는 다음과 같다.

10776218684_66d3977855_z.jpg


Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

Created: 2013-11-10 Sun 13:21

Emacs 23.4.1 (Org mode 8.0.2)

Validate XHTML 1.0

Saturday, November 2, 2013

BibDesk: BibTeX for OS X

Bibliography#02: BibDesk

Bibliography#02: BibDesk


;; =================================================
;; εμαcs is ⎋[esc]⌘[meta]⌥[alt]⌃[ctrl]⇧[shift].
;; =================================================

이 문서는 emacs org-mode 로 작성된 글입니다.

Operating System Environments

  • Main- : OS X Mountain Lion (10.8.5)
  • Sub- : Debian GNU/Linux Wheezy (7.2) || OS X Mavericks (10.9)
  • Server: Debian GNU/Linux Squeeze || Lenny
  • Mobile: iOS 7.0.3

LaTeX 사용환경

  • OS X: Aquamacs + Bash Shell + Skim
  • GNU/Linux: Emacs(+AUCTeX) + Bash Shell + Okular

Bibliography#02: BibDesk

지난 Post에서 LaTeX 문서 작성에서 BibTeX 사용의 장점을 간략하게 살펴보았다.

자신의 모든 references 정보를 하나의 .bib 파일에 모아서 관리한다고 했는데, 그럼 적게는 수십에서 많게는 수백에 이르는 정보를 매번 일일이 브라우저에서 찾아서 복사한 후(⌘C), .bib 파일에 붙여 넣기(⌘V) 해야 하나? 관련된 .pdf 문서도 함께 관리할 수 없나? 이런 문제들을 처리해 주는 몇 프로그램들이 있는데(예를 들어, ZoteroMendeley), 그 중에서 OS X 사용자라면 BibDesk를 한 번 사용해 볼 것을 권한다.

BibDeskBSD License의 BibTeX 관리하는 OS X 전용 프로그램으로, 소위 말하는 논문 관리 프로그램이다. 이를 사용하면 다음의 문제들을 한꺼번에 처리할 수 있다.

  • 자체 브라우저에서 "원클릭"으로 BibTeX 정보를 저장한다.
  • .pdf 문서나 url 주소를 함께 링크할 수 있다.
  • 특히 링크된 문서를 특정 directory에 지정된 이름으로 자동 완성해 준다.
  • iTunes나 Mail.app 처럼 Smart Group 기능이 있다.

Managing References

자체 브라우저에서 바로 논문을 검색해도 되지만, 내가 주로 사용하는 방법은 다음과 같다. 주로 쓰는 브라우저(내 경우는 Firefox)에서 논문을 검색한 후, 그 url을 복사해서 BibDesk에서 [Web]에 붙인 후, [Import] 하는 순서이다.

10624595863_12332d8fc8_z.jpg

아래는 올해(<2013-10-08 Tue>) Nobel Prize in Physics 공동 수상자 중에 한 명인 Peter Higgs의 유명한 논문 Broken Symmetries and the Masses of Gauge Bosons을 가지고, 어떻게 BibDesk에서 BibTeX을 관리하는 지를 보여주는 짧은 동영상이다.1

  1. Search a bibliography via browser
  2. Copy the url
  3. Paste it into BibDesk
  4. Import
  5. Import multiple references

Autocomplete: BibDesk + Quicksilver + Dropbox

BibDesk는 BibTeX만 관리해줄 뿐만 아니라, pdf나 url도 링크해서 관리할 수 있다. 위의 방법대로 BibTeX 정보를 저장했다면 url은 대부분 자동으로 링크가 따라붙는다. 해당 article의 pdf 파일은 직접 넣어주면 이도 함께 관리할 수 있다. 이때 미리 지정해둔 형식으로 자동으로 해당 BibTeX에서 정보를 불러와 이 pdf 파일명을 바꿔주며, 역시 미리 지정해둔 directory로 파일을 자동으로 옮겨준다.2 Quicksilver 사용자라면, 이 directory를 catalog에 등록을 해두면, quicksilver에서 바로 접근할 수 있다. 게다가 Dropbox 사용자라면, pdf 파일의 저장 장소를 ~/Dropbox/ 아래에 적당한 directory로 정해줌으로써 mobile device에서도 자유롭게 열람할 수 있게 된다.

이는 [BibDesk Preferences]->[AutoFile]에서 설정할 수 있다.

10624446665_9907dea66d_z.jpg

파일명을 [BibTeX Type]이라는 directory 아래에 [First Author].[Year].[Unique alphabet].[15 words ofTitle].pdf 로 지정하는 방법은, 위의 그림에서 보듯이, [Auto File Options]->[File papers in fixed location:]에서 ~/Dropbox/bibliography 로 적어주고, [Local file format]->[Preset Format:]을 Custom으로 선택하고 [Advanced…]를 눌러, [Format String:] 아래와 같이 적어주면 된다.

%f{BibTeX Type}/%A1.%Y%u1.%T15%e

10624517734_3a4ba9f75b_z.jpg

아래는 autocomplete에서 파일명을 [BibTeX Type]이라는 directory 아래에 [First Author].[Year].[Unique alphabet].[15 words ofTitle].pdf 로 지정한 후, 실제로 pdf 문서를 link 거는 과정을 간단히 보여준다. 위와 마찬가지로 사용한 예는 Peter Higgs의 논문 Broken Symmetries and the Masses of Gauge Bosons이다.

  1. Setup autocomplete
  2. Search and save a BibTeX again
  3. Download the pdf
  4. Link it into the bibliography

BibDesk + Quicksilver + Dropbox (+ Devonthink)

Devonthink 사용자라면, 여기서 한 발 더 나아갈 수 있다. 위에서 지정한 directory(~/Dropbox/bibliography)를 Devonthink에 "Index…" 시켜두면, BibDesk에서 BibTeX 파일에 링크 걸어둔 pdf 파일들의 위치는 유지되면서, Devonthink에서 바로 열람 및 검색 할 수 있다. 즉, 여기까지 설정하면, BibDesk에서 BibTeX 파일에 링크 걸어둔 pdf 파일들을 1) Quicksilver에서 바로 접근 가능하며, 2) Dropbox를 통해 다른 devices에서도 접근할 수 있고, 3) Devonthink로 바로 검색할 수 있다.

Smart group and advanced search

OS X 사용자라면 iTunes, Mail, iPhoto, 등으로 이미 Smart group 이야 익숙할 것이라고 생각한다. 간단히 말해서, 특정 field를 지정해서 자동으로 group을 만들어 주는 기능이다. 이게 BibDesk에서도 가능한데, 예를 들어, 오늘 수정한 것들만 따로 모으거나, Physical Review B(Phys.Rev.B) Journel 만 본다던가, S.Weinberg 가 저자로 들어간 논문들만 추려낸다던가, 등을 간단하게 할 수 있다.

또한 Regular expression까지는 아니더라도 Wild character를 지원하기 때문에 검색이 용이하다. 저자의 이름이 가물가물할 때, 예를 들어, Weinberg 를 찾고 싶은데 스펠링이 정확하게 기억나지 않을 때는 w**rg 라고 검색하면 나온다. 자세한 내용은 아래를 참고하자.

Export as minimal BibTeX

마지막으로 어떻게 보면 가장 중요한(?) 기능이 바로 Export as minimal BibTeX 이다. 여기까지 설명한 데로 BibTeX을 관리하면 .bib 파일을 직접 열어봤을 때, 링크 걸어둔 모든 정보들이 알 수 없는 문자로 아래처럼 적혀있는 것을 볼 수 있다.

10624690485_758c68ddb4_z.jpg

혼자 개인적인 목적으로 LaTeX을 이용하여 pdf 문서를 만들 때는 어떻게 적혀있던 상관 없으나, 이대로 .bib 파일을 referee나 editor 아니면 coworker에게 보낼 때는 조금 싫은 소리를 들을 수도 있다. 이렇게 남들에게 .bib 파일을 보낼 때는 [File]->[Export…]로 가서 [File Format:]을 Export as minimal BibTeX 로 바꾸면, 깔끔한 .bib 파일이 만들어 진다.

10624598524_a6d42c5bbd_o.png


Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

Footnotes:

1

이 동영상에서는 Quicksilver에 Web Search Module plugin을 깔아서, 이미 Inspire-HEP의 search field를 저장한 상태에서 사용한 모습이다. 즉, "Firefox->Inspire-HEP->검색"의 단계를 거치지 않고, Quicksilver에서 Inspire-HEP 검색을 바로 했다. Quicksilver에 Web Search Module plugin의 자세한 정보는 지난 Post를 참고하자.

2

가끔 자동으로 옮기지 못하는데, 이는 파일명을 바꾸는 지정된 형식에서 정보가 빠졌을 때 발생한다. 예를 들어, 파일명이 [Author].[Year].pdf로 바뀌게 지정해 놓았는데 BibTeX 정보에 year가 빠져 있다면, 여전히 link는 걸려있지만 파일명도 바뀌지 않고 지정된 directory로 옮겨지지도 않는다. 이는 수동으로 해결할 수 있다. [Publication]->[AutoFile Linked Files…]를 클릭한 후, [Move All]을 선택하면 빠진 정보를 제외하고 파일명을 바꾸어 지정된 directory로 옮긴다.

Created: 2013-11-02 Sat 21:00

Emacs 23.4.1 (Org mode 8.0.2)

Validate XHTML 1.0