|
Warning: this is an htmlized version!
The original is here, and the conversion rules are here. |
;; eeqtree.el - version 0
;; Author: Eduardo Ochs <eduardoochs@gmail.com>
;; Version: 2008nov05 0:30AM
;; Public domain.
;; (find-es "tex" "qtree")
;; Preparation:
;; mkdir ~/.eev/
;; cd ~/.eev/
;; wget http://www.ling.upenn.edu/advice/latex/qtree/qtree.sty
(require 'eev)
(setq eeqtree-pre "\\documentclass[12pt]{article}
\\usepackage{fullpage}
\\usepackage{qtree}
\\begin{document}\n")
(setq eeqtree-post "\n\\end{document}\n")
(setq eeqtree-file "~/.eev/eeqtree.tex")
(setq eeqtree-command
"cd ~/.eev/ && latex eeqtree.tex && dvipdf eeqtree.dvi && ls -l eeqtree.*")
(defun eeqtree (s &optional e)
"Save `eeqtree-pre'+region+`eeqtree-post' in `eeqtree-file'.
If S is a string write then write the string instead. See `ee-write'.
Example: (eeqtree \"\\Tree [.Root [.Left a b ] [.Right c d ] ]\")\n"
(ee-write s e eeqtree-pre eeqtree-post eeqtree-file))
(defun eeqtreenow (s &optional e)
"Save `eeqtree-pre'+region+`eeqtree-post' in `eeqtree-file', then
run (find-sh eeqtree-command) to compile `eeqtree-file'.
If S is a string write then write the string instead. See `ee-write'.
Example: (eeqtreenow \"\\Tree [.Root [.Left a b ] [.Right c d ] ]\")\n"
(ee-write s e eeqtree-pre eeqtree-post eeqtree-file)
(find-sh eeqtree-command))
(eeb-define 'eeqtree-bounded 'eeqtree 'ee-delimiter-percent nil t t)
(eeb-define 'eeqtreenow-bounded 'eeqtreenow 'ee-delimiter-percent nil t t)
(defun qtree-block ()
"Insert a \"qtree block\" at point."
(interactive)
(insert "\n%*
% (eeqtree-bounded)
% (eeqtreenow-bounded)
% (find-man \"1 xpdf\" \"Reload the current PDF file.\")
% (find-xpdfpage \"~/.eev/eeqtree.pdf\")
% (find-bgcommand \"open ~/.eev/eeqtree.pdf\")
%*
"))
;; (defun c () (interactive) (find-sh eeqtree-command))
(provide 'eeqtree)