diff --git a/docs/yatexadd.doc b/docs/yatexadd.doc index 522777a..0697669 100644 --- a/docs/yatexadd.doc +++ b/docs/yatexadd.doc @@ -34,15 +34,84 @@ ���`����t�@�C������ yatexadd.el(�܂��̓o�C�g�R���p�C�������`�� ��yatexadd.elc)�ɂ��A���̃t�@�C���� load-path ���ɒu���Ă����΁A �쒹�������I�Ƀ��[�h���܂��B����ȊO�̃t�@�C�����ɂ���ꍇ�́A - yatex-mode-hook �ɁA�t���֐����`���� Emacs-Lisp �t�@�C�������[�h - ����悤�Ȏd�|���������Ă����̂��悢�ł��傤�B + yatex-mode-hook �ɕt���֐����`���� Emacs-Lisp �t�@�C�������[�h�� + ��悤�Ȏd�|���������Ă����̂��悢�ł��傤�B -�y�֐����z +�y�֐���`�z - �쐬����t���֐����́A�⊮���͂������O�̐擪�� YaTeX: ��t������ - �����̂ɂ��܂��B�Ⴆ��(begin�^�⊮��) tabular �‹��ɑ΂��ĕt���֐� - ���쐬�������ꍇ�� YaTeX:tabular �Ƃ����֐����Œ�`���܂��B + �t���֐��ɂ́A�eLaTeX�R�}���h�̃I�v�V����������Ԃ��`���̂��́A + section�^�⊮�̈�����Ԃ����́A�̓��ނ�����܂��B + + �O�҂́A�ȉ��̗�̂悤�ɁAbegin�^�⊮�ł�\begin{�‹���}�̒���� + �t�����镶����Asection�^�⊮�ł� LaTeX �R�}���h���Ƒ������̊Ԃ� + �ʒu���镶����Amaketitle�^�⊮�ł� LaTeX �R�}���h���̒���Ɉʒu�� + �镶�����Ԃ��悤�Ȋ֐��ł��B�֋X�ケ�̌`�̕t���֐����A�lj��^�t�� + �֐��ƌĂԂ��Ƃɂ��܂��B + + (��) \begin{table}[ht] (�t���֐��� YaTeX:table) + ~~~~ + \put(100,200){} (�t���֐��� YaTeX:put) + ~~~~~~~~~ + \sum_{i=0}^{n} (�t���֐��� YaTeX:sum) + ~~~~~~~~~~ + + �lj��^�t���֐��́wLaTeX�R�}���h���̑O�� YaTeX: ���‚������O�x�Œ� + �`���܂��B + + ��҂́A�ȉ��̂悤��section�^�R�}���h�̈����ƂȂ镶�����Ԃ� + �֐��ł��B���̌`�̕t���֐��������^�t���֐��ƌĂԂ��Ƃɂ��܂��B + + (��) \newcommand{\foo}{bar} (�t���֐��� YaTeX::newcommand) + ~~~~ ~~~ + + �����^�t���֐��́wLaTeX�R�}���h���̑O�� YaTeX:: ���‚������O�x�Œ� + �`���܂��B�܂������^�t���֐����Ă΂�鎞�ɂ͉��Ԗڂ̈�������͂��� + ����̂��������Ƃ��ēn����܂��B���������āA�����^�t���֐��͐����� + ��������Ž����̂Ƃ��Ē�`���A���̈����̒l�ɂ�菈�������肷�邱 + �ƂɂȂ�܂��B + + +�y��`��z + + �Ⴆ�΁Atabular�‹��̃t�H�[�}�b�g�Ƃ��āA���‚ł� {|c|c|c|} ��� + ��邾���ŗǂ��̂Ȃ�A + + (defun YaTeX:tabular () + "{|c|c|c|}") + + �Ƃ��������΂悭�A�O�q�́A���G�Ȓ�^ tabular �t�H�[�}�b�g��}���� + �邽�߂̊֐����`����ꍇ�͎��̂悤�ɂ��܂��B + + (defun YaTeX:tabular () + "{@{\\vrule width 1pt\\ }|||@{\\ \\vrule width 1pt}}") + + ���̎��AEmacs-Lisp ���̕�����ł́A\ ���g�� \\ �ƕ\�L���邱�ƂȂ� + �ɒ��ӂ��ĉ������B + + �܂��A{} �̒����A�⊮���ɒ��ڃL�[�{�[�h����ǂݍ��܂��������́A + + (defun YaTeX:tabular () + (concat "{" (read-string "Rule: ") "}")) + + �ȂǂƂ���Ηǂ��ł��傤�B + + ���ɁA�����^�t���֐��Ƃ��� \newcommand �̈�����ǂݍ��ފ֐���� + �`����ꍇ��Ꭶ���܂��B\newcommand �̑������͐V���ɒ�`����R�} + ���h���Ȃ̂ŁA�K���擪�� \ �����܂��B�������͂����Ă��̏ꍇ�~�j + �o�b�t�@�ł͕ҏW���Â炢�悤�ȕ��G�Ȓ�`�������̂ŁA�����⊮���Ȃ� + �����ǂ��ł��傤�B������l�����ĕt���֐����`����ƈȉ��̂悤�Ȃ� + �̂ɂȂ�ł��傤�B + + (defun YaTeX::newcommand (n) ;n�͈����̈ʒu + (cond + ((= n 1) ;�������Ȃ�R�}���h�� + (concat "\\" (read-string "Command: "))) + ((= n 2) "") ;�������Ȃ牽������Ȃ� + (t nil))) + + �Ȃ��A�����^�t���֐��� nil ��Ԃ����ꍇ�́A�ʏ�̈������͊֐����� + �΂�܂��B �y�Ă΂���z @@ -51,42 +120,8 @@ ���͎��ɕt���֐��̑��݂𒲂ׂĂ���Ăяo���܂��Bbegin�^�⊮�̏ꍇ \begin{�‹���} ���������͂��ꂽ����ɌĂяo����܂��Bsection�^�⊮ �ł͑������̕⊮�̒��O�Amaketitle�^�⊮�̏ꍇ�́A�R�}���h���̒� - ��(��‚̃X�y�[�X��}�����钼�O)�ɌĂяo����܂��B - - -�y�֐���`�z - - begin�^�⊮�ł́A\begin{�‹���}�̒���ɕt�����镶����Asection�^ - �⊮�ł́ALaTeX�R�}���h���Ƒ������̊ԂɈʒu���镶����Amaketitle - �^�⊮�ł́ALaTeX�R�}���h���̒���Ɉʒu���镶�����Ԃ��悤�Ȋ֐� - ���`���ĉ������B - (��) - \begin{table}[ht] - ~~~~ - \put(100,200){} - ~~~~~~~~~ - \sum_{i=0}^{n} - ~~~~~~~~~~ - ����ɁA���‚ł� {|c|c|c|} �����邾���ŗǂ��̂Ȃ�A - - (defun YaTeX:tabular () - "{|c|c|c|}") - - �Ƃ����A�����΂悭�A�O�q�́A���G�Ȓ�^ tabular �t�H�[�}�b�g��}�� - ���邽�߂̊֐����`����ꍇ�́A���̂悤�ɂ��܂��B - - (defun YaTeX:tabular () - "{@{\\vrule width 1pt\\ }|||@{\\ \\vrule width 1pt}}") - - ���̎��AEmacs-Lisp ���̕�����ł́A\ ���g�́A\\ �ƕ\�L���邱�ƂȂǂ� - ���ӂ��ĉ������B - - �܂��A{} �̒����A�⊮���ɒ��ڃL�[�{�[�h����ǂݍ��܂��������́A - - (defun YaTeX:tabular () - (concat "{" (read-string "Rule: ") "}")) - - �ȂǂƂ���Ηǂ��ł��傤�B + ��(��‚̃X�y�[�X��}�����钼�O)�ɌĂяo����܂��B�����^�t���֐��́A + section�^�R�}���h�̈����̓��͎��ɂ��̓s�x�Ă΂�܂��B �y�Q�l�z diff --git a/docs/yatexgen.doc b/docs/yatexgen.doc index 4709741..b83c620 100644 --- a/docs/yatexgen.doc +++ b/docs/yatexgen.doc @@ -9,7 +9,7 @@ �y�͂��߂Ɂz - �܂��Ayatexadd.doc �ɂ͖ڂ�ʂ��ĉ������B�����ǂ�ŁA�Ȃɂ��� + �܂��Ayatexadd.doc �ɂ͖ڂ�ʂ��ĉ������B�����ǂ�ŁA�Ȃɂ��� ���̊֐��������ɍ�肽���Ȃ������Ȃ��ɂ́A���̃h�L�������g���A yatexgen.el ���K�v�L��܂���B�������AEmacs-Lisp ���悭�m��Ȃ��� �߁A�ǂ̂悤�ɍ���Ă悢�̂��s���Ɨ��Ȃ����̂��߂ɁA�쒹���g�ɕt�� diff --git a/yatex.el b/yatex.el index 28e5b28..93291ef 100644 --- a/yatex.el +++ b/yatex.el Binary files differ diff --git a/yatex.new b/yatex.new index bc87953..4c38a11 100644 --- a/yatex.new +++ b/yatex.new @@ -2,6 +2,11 @@ Yet Another tex-mode for Emacs yatex.el �e�o�[�W�����̕ύX�_�ɂ‚��āB +1.44: �^�C�v�Z�b�g�v���O�����̋N���������������B + �G���[�W�����v�̃E�B���h�E���p�̍œK���B + �������[�h/�C�����[�h�̃��[�h���C���\���C���B + �����‹��⊮���ɂ͎����I�ɐ������[�h�ɓ���B + 1.43: �‹��̃l�X�g�ɉ������C���f���g(�ϐ�YaTeX-environment-indent�Ŏw��)�B �����‹��L���⊮���[�h(yatexmth)�Y�t�B modify-mode �̒l�ŊJ�����ʂ̓�������肷��B diff --git a/yatexadd.el b/yatexadd.el index 824d8f7..cb9c208 100644 --- a/yatexadd.el +++ b/yatexadd.el @@ -2,7 +2,7 @@ ;;; YaTeX add-in functions. ;;; yatexadd.el rev.5 ;;; (c)1991-1993 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp] -;;; Last modified Sat Sep 18 04:13:41 1993 on 98fa +;;; Last modified Wed Oct 6 03:40:30 1993 on 98fa ;;; $Id$ (provide 'yatexadd) @@ -73,6 +73,13 @@ (YaTeX:read-coordinates "Initial position")) ) +(defun YaTeX:equation () + (if (fboundp 'YaTeX-toggle-math-mode) + (YaTeX-toggle-math-mode t)) ;force math-mode ON. +) +(fset 'YaTeX:eqnarray 'YaTeX:equation) +(fset 'YaTeX:displaymath 'YaTeX:equation) + ;;; ;;Sample functions for section-type command. ;;; @@ -224,6 +231,8 @@ (goto-char (point-min)) (message "Collecting labels...") (save-window-excursion + (YaTeX-showup-buffer + YaTeX-label-buffer (function (lambda (x) (window-width x)))) (with-output-to-temp-buffer YaTeX-label-buffer (while (re-search-forward "\\label{\\([^}]+\\)}" nil t) (setq e0 (match-end 0) m1 (match-beginning 1) e1 (match-end 1)) @@ -272,6 +281,8 @@ (defun YaTeX-label-other () (let ((lbuf "*YaTeX mode buffers*") (blist (buffer-list)) (lnum -1) buf rv (ff "**find-file**")) + (YaTeX-showup-buffer + lbuf (function (lambda (x) 1))) ;;Select next window surely. (with-output-to-temp-buffer lbuf (while blist (if (and (buffer-file-name (setq buf (car blist))) diff --git a/yatexprc.el b/yatexprc.el index d97c1ca..18ad7f7 100644 --- a/yatexprc.el +++ b/yatexprc.el @@ -1,8 +1,8 @@ ;;; -*- Emacs-Lisp -*- ;;; YaTeX process handler. -;;; yatexprc.el rev.1.43 +;;; yatexprc.el rev.1.44 ;;; (c)1993 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp] -;;; Last modified Sat Sep 18 04:12:18 1993 on 98fa +;;; Last modified Mon Oct 25 17:48:39 1993 on figaro ;;; $Id$ (require 'yatex) @@ -28,31 +28,34 @@ (defun YaTeX-typeset (command buffer) "Execute jlatex (or other) to LaTeX typeset." (interactive) - (if (and YaTeX-typeset-process - (eq (process-status YaTeX-typeset-process) 'run)) - ;; if tex command is halting. - (YaTeX-kill-typeset-process YaTeX-typeset-process)) - (YaTeX-visit-main t) ;;execution directory - (with-output-to-temp-buffer buffer - (if (eq system-type 'ms-dos) ;if MS-DOS - (progn - (message (concat "Typesetting " (buffer-name) "...")) - (YaTeX-put-nonstopmode) - (call-process shell-file-name - nil buffer nil "/c" command) - (YaTeX-remove-nonstopmode)) - (setq YaTeX-typeset-process ;if UNIX + (let ((window (selected-window))) + (if (and YaTeX-typeset-process + (eq (process-status YaTeX-typeset-process) 'run)) + ;; if tex command is halting. + (YaTeX-kill-typeset-process YaTeX-typeset-process)) + (YaTeX-visit-main t);;execution directory + ;;Select under-most window if there are more than 2 windows and + ;;typeset buffer isn't seen. + (YaTeX-showup-buffer + buffer (function (lambda (x) (nth 3 (window-edges x))))) + (with-output-to-temp-buffer buffer + (if (eq system-type 'ms-dos) ;if MS-DOS + (progn + (message (concat "Typesetting " (buffer-name) "...")) + (YaTeX-put-nonstopmode) + (call-process shell-file-name + nil buffer nil "/c" command) + (YaTeX-remove-nonstopmode)) + (setq YaTeX-typeset-process ;if UNIX (start-process "LaTeX" buffer shell-file-name "-c" command)) - (set-process-sentinel YaTeX-typeset-process 'YaTeX-typeset-sentinel))) - (setq current-TeX-buffer (buffer-name)) - (let ((window (selected-window))) + (set-process-sentinel YaTeX-typeset-process 'YaTeX-typeset-sentinel))) + (setq current-TeX-buffer (buffer-name)) (select-window (get-buffer-window buffer)) - ;;(other-window 1) (use-local-map YaTeX-typesetting-mode-map) (set-syntax-table YaTeX-typeset-buffer-syntax) (setq mode-name "typeset") - (if YaTeX-typeset-process ; if process is running (maybe on UNIX) + (if YaTeX-typeset-process ; if process is running (maybe on UNIX) (cond ((boundp 'MULE) (set-current-process-coding-system YaTeX-latex-message-code YaTeX-coding-system)) @@ -61,13 +64,11 @@ (message "Type SPC to continue.") (goto-char (point-max)) (if (eq system-type 'ms-dos) (message "Done.") - (while (bobp) (message "Invoking process. wait...") (sleep-for 1)) - (insert (message " "))) + (insert (message " ")) + (set-marker (process-mark YaTeX-typeset-process) (1- (point)))) (if (bolp) (forward-line -1)) (recenter -1) - (select-window window) - ;;(other-window -1) - ) + (select-window window)) ) (defun YaTeX-typeset-sentinel (proc mes) @@ -325,6 +326,7 @@ nil ;; if warning or error found (if error-win (select-window error-win) + (select-window (get-lru-window)) (YaTeX-switch-to-buffer error-buffer) (setq error-win (selected-window))) (goto-line YaTeX-error-line) @@ -614,4 +616,28 @@ (pop-to-buffer buffer)) ) +(defun YaTeX-showup-buffer (buffer &optional func) + "Make BUFFER show up in certain window (but current window) +that gives the maximum value by the FUNC. FUNC should take an argument +of its window object" + (or (get-buffer-window buffer) + (< (length (YaTeX-window-list)) 3) + (let ((window (selected-window)) (list (YaTeX-window-list)) win w (x 0)) + (while list + (setq w (car list)) + (if (and (not (eq window w)) + (> (funcall func w) x)) + (setq win w x (funcall func w))) + (setq list (cdr list))) + (select-window win) + (switch-to-buffer buffer) + (select-window window))) +) + +(defun YaTeX-window-list () + (let*((curw (selected-window)) (win curw) (wlist (list curw))) + (while (not (eq curw (setq win (next-window win)))) + (setq wlist (cons win wlist))) + wlist) +) (provide 'yatexprc)