yatex

changeset 51:b0371b6ed799

Created `ChangeLog'. Log hereafter will be written in `ChangeLog'.
author yuuji
date Tue, 20 Dec 1994 21:00:21 +0000
parents b1e036697b20
children 5d94deabb9f9
files docs/yatex.ref docs/yatexe.tex docs/yatexj.tex help/YATEXHLP.eng help/YATEXHLP.jp yatex.el yatex.new yatex19.el yatexadd.el yatexgen.el yatexlib.el yatexmth.el yatexprc.el
diffstat 13 files changed, 2658 insertions(+), 880 deletions(-) [+]
line diff
     1.1 --- a/docs/yatex.ref	Fri Nov 25 08:26:13 1994 +0000
     1.2 +++ b/docs/yatex.ref	Tue Dec 20 21:00:21 1994 +0000
     1.3 @@ -141,7 +141,7 @@
     1.4  	◆おまかせ改行			ESC RET
     1.5  
     1.6  	  「おまかせ改行」は tabular, array, itemize, enumerate, list,
     1.7 -	description 環境でで有効です。
     1.8 +	description 環境で有効です。
     1.9  
    1.10  							       広瀬雄二
    1.11  						    yuuji@ae.keio.ac.jp
     2.1 --- a/docs/yatexe.tex	Fri Nov 25 08:26:13 1994 +0000
     2.2 +++ b/docs/yatexe.tex	Tue Dec 20 21:00:21 1994 +0000
     2.3 @@ -25,25 +25,25 @@
     2.4  @cindex YaTeX
     2.5  
     2.6  @menu
     2.7 -* What is YaTeX?::              
     2.8 -* Main features::               
     2.9 -* Installation::                
    2.10 -* Typesetting::                 
    2.11 -* %# notation::                 
    2.12 -* Completion::                  
    2.13 -* Local dictionaries::          
    2.14 -* Commenting out::              
    2.15 -* Cursor jump::                 
    2.16 -* Changing and Deleting::       
    2.17 -* Filling an item::             
    2.18 -* Updation of @code{\includeonly}::  
    2.19 -* What column?::                
    2.20 -* Intelligent newline::         
    2.21 -* Online help::                 
    2.22 -* Cooperation with other packages::  
    2.23 -* Customizations::              
    2.24 -* Etcetera::                    
    2.25 -* Copying::                     
    2.26 +* What is YaTeX?::              Introduction
    2.27 +* Main features::               What YaTeX can do
    2.28 +* Installation::                Guide to install
    2.29 +* Typesetting::                 Call typesetting processes
    2.30 +* %# notation::                 Quick notation of controlling YaTeX
    2.31 +* Completion::                  Input LaTeX commands with completion
    2.32 +* Local dictionaries::          Directory dependent completion
    2.33 +* Commenting out::              Commenting/uncommenting text
    2.34 +* Cursor jump::                 Jumping to related position
    2.35 +* Changing and Deleting::       Changing/deleting certain unit of text
    2.36 +* Filling::                     Filling an item or paragraph
    2.37 +* Updation of @code{\includeonly}::  Maintaining @code{\includeonly}
    2.38 +* What column?::                Column position guide in tabular
    2.39 +* Intelligent newline::         Guess requisites of new line
    2.40 +* Online help::                 On-line documentation of LaTeX
    2.41 +* Cooperation with other packages::  Work well with gmhist, min-out
    2.42 +* Customizations::              How to breed `Wild Bird'
    2.43 +* Etcetera::                    YaTeX is acquisitive.
    2.44 +* Copying::                     Redistribution
    2.45  
    2.46   --- The Detailed Node Listing ---
    2.47  
    2.48 @@ -265,7 +265,13 @@
    2.49  @end example
    2.50  
    2.51  @noindent
    2.52 -anywhere in the source text.  And if you split the source text and
    2.53 +anywhere in the source text.  This is useful for changing
    2.54 +typesetter.
    2.55 +
    2.56 +@node Splitting input files, Static region for typesetting, Changing typesetter, %# notation
    2.57 +@comment  node-name,  next,  previous,  up
    2.58 +
    2.59 +  And if you split the source text and
    2.60  edit subfile that should be included from main text.
    2.61  
    2.62  @example
    2.63 @@ -285,13 +291,14 @@
    2.64  Note that YaTeX  assumes the component  before the  last period of
    2.65  the last word in this line as base name of the main La@TeX{} source.
    2.66  
    2.67 -  Here are the restrictions on splitting sources.
    2.68 +  To make best use of the feature of inter-file jumping by
    2.69 +@kbd{[prefix] g} (see @ref{Cursor jump}), take described below into
    2.70 +consideration.
    2.71  
    2.72  @itemize
    2.73 -@item All the file name should be different.
    2.74  @item You can put split texts in sub directory, but not in
    2.75   sub directory of sub directory.
    2.76 -@item In the main text,specify the file with relative path name
    2.77 +@item In the main text, specify the child file name with relative path name
    2.78   such as \include{chap1/sub}, when you include the file in
    2.79   a sub-directory.
    2.80  @item In a sub-text, write @code{%#!latex main.tex} even if @file{main.tex}
    2.81 @@ -864,12 +871,14 @@
    2.82  minibuffer, YaTeX asks you with the following prompt;
    2.83  
    2.84  @example
    2.85 -  `foo' is not in table. Register into: U)serTable L)ocal N)one
    2.86 +  `foo' is not in table. Register into: U)serDic L)ocalDic N)one D)iscad
    2.87  @end example
    2.88  
    2.89  @noindent 
    2.90 -In this menu, typing `u' updates your `user dictionary', `l' updates your
    2.91 -local dictionary, and `n' updates no dictionary and throws the word away.
    2.92 +In this menu, typing @kbd{u} updates your `user dictionary', @kbd{l}
    2.93 +updates your local dictionary, @kbd{n} updates only on-memory dictionary
    2.94 +which go through only current Emacs session, and @kbd{d} updates no
    2.95 +dictionary and throws the new word away.
    2.96  
    2.97    If you find this switching feature meaningless and bothersome, put the
    2.98  next expression into your @file{~/.emacs}
    2.99 @@ -948,6 +957,8 @@
   2.100  @cindex cursor jump
   2.101  @cindex prefix g
   2.102  
   2.103 +@section Jump to corresponding object
   2.104 +
   2.105    Typing
   2.106  
   2.107  @table @kbd
   2.108 @@ -970,14 +981,27 @@
   2.109  
   2.110    On a @code{\begin},@code{\end} line, typing @kbd{[prefix] g} moves the
   2.111  cursor to the corresponding @code{\end},@code{\begin} line, if its partner
   2.112 -really exists.  The behaviour on the line @code{%#BEGIN} and @code{%#END}
   2.113 +really exists.  The behavior on the line @code{%#BEGIN} and @code{%#END}
   2.114  are the same.  Note that if the correspondent of @code{label/ref} or
   2.115 -@code{cite/bibitem} exists in another file, that file have to be opend to
   2.116 +@code{cite/bibitem} exists in another file, that file have to be opened to
   2.117  make a round trip between references by @kbd{[prefix] g}.
   2.118  
   2.119    If you type @code{[prefix] g} on the line of @code{\include@{chap1@}},
   2.120  typically in the main text, YaTeX switches buffer to @file{chap1.tex}.
   2.121 -The key strokes below work to the contrary.  Typing
   2.122 +
   2.123 +@table @kbd
   2.124 +@item [prefix] 4 g
   2.125 +        @dots{} go to corresponding object in other window
   2.126 +@end table
   2.127 +
   2.128 +@noindent
   2.129 +do the same job as @kbd{[prefix] g} except it's done in other window.
   2.130 +Note that this function doesn't work on @code{begin/end},
   2.131 +@code{%#BEGIN/%#END} pairs because it is meaningless.
   2.132 +
   2.133 +@section Jump to main file
   2.134 +
   2.135 +  Typing
   2.136  
   2.137  @table @kbd
   2.138  @item [prefix] ^
   2.139 @@ -991,6 +1015,8 @@
   2.140  in a sub text switch the buffer to the main text specified by
   2.141  @code{%#!}  notation.
   2.142  
   2.143 +@section Other jumping features
   2.144 +
   2.145    And these are the functions which work on the current La@TeX{}
   2.146  environment:
   2.147  
   2.148 @@ -1006,7 +1032,7 @@
   2.149  @cindex M-C-e
   2.150  @cindex M-C-@@
   2.151  
   2.152 -@node Changing and Deleting, Filling an item, Cursor jump, Top
   2.153 +@node Changing and Deleting, Filling, Cursor jump, Top
   2.154  @comment  node-name,  next,  previous,  up
   2.155  @chapter Changing and Deleting
   2.156  
   2.157 @@ -1084,13 +1110,16 @@
   2.158         ~(cursor)
   2.159  @end example
   2.160  
   2.161 -@node Filling an item, Updation of @code{\includeonly}, Changing and Deleting, Top
   2.162 +@node Filling, Updation of @code{\includeonly}, Changing and Deleting, Top
   2.163  @comment  node-name,  next,  previous,  up
   2.164 -@chapter Filling an item
   2.165 +@chapter Filling
   2.166 +@cindex filling
   2.167 +
   2.168 +@section Filling an item
   2.169  @cindex filling an item
   2.170  @cindex prefix i
   2.171  
   2.172 -  To fill a term (sentence) of @code{\item}, type
   2.173 +  To fill a term (descriptive sentences) of @code{\item}, type
   2.174  
   2.175  @table @kbd
   2.176  @item [prefix] i
   2.177 @@ -1102,7 +1131,7 @@
   2.178  
   2.179    YaTeX uses the value of  the variable @code{YaTeX-item-regexp} as the
   2.180  regular expression to search item header  in  itemize environment.
   2.181 -If you make a newcommand to itemize terms(eg. @code{\underlineitem}), put
   2.182 +If you make a newcommand to itemize terms(e.g. @code{\underlineitem}), put
   2.183  
   2.184  @lisp
   2.185          (setq YaTeX-item-regexp
   2.186 @@ -1114,7 +1143,42 @@
   2.187  for Emacs-Lisp, name  a newcommand  for  `itemize' beginning  with
   2.188  @code{\item} such as @code{\itembf}, not @code{\bfitem}.
   2.189  
   2.190 -@node Updation of @code{\includeonly}, What column?, Filling an item, Top
   2.191 +  This function -- YaTeX-fill-item -- reformats the @code{\item} into
   2.192 +`hang-indented' style.  When you separate the topic word and its
   2.193 +description, use @kbd{M-q} instead.  For example:
   2.194 +
   2.195 +@example
   2.196 +Hang indentation:
   2.197 +       >
   2.198 +       >\item[foo] `foo' is the typical word for describing an
   2.199 +       >           arbitrarily written....
   2.200 +
   2.201 +Normal indentation:
   2.202 +       >
   2.203 +       > \item bar
   2.204 +       >
   2.205 +       > When the word `for' is used as an arbitrarily word, `bar' 
   2.206 +       > is bound to follow it.
   2.207 +@end example
   2.208 +
   2.209 +  Note that the indent depth of the @code{\item} and its descriptive
   2.210 +paragraph are the same in latter case.  If you want to use different
   2.211 +depth, invoke fill-paragraph at the beginning of non-whitespace
   2.212 +character(see below).
   2.213 +
   2.214 +@section Filling paragraph
   2.215 +@cindex Filling paragraph
   2.216 +@cindex M-q
   2.217 +
   2.218 +  Fill-paragraph is little bit adapted for La@TeX{} sources.  It retains from
   2.219 +filling in certain environments where formatting leads to a disaster such
   2.220 +as verbatim, tabular, or so.  And it protects @code{\verb} expressions
   2.221 +from being folded (The variable @code{YaTeX-verb-regexp} controls this).
   2.222 +Besides, putting cursor on the first occurrence of non-whitespace
   2.223 +character on a line changes the fill-prefix temporarily to the depth of
   2.224 +the line.
   2.225 +
   2.226 +@node Updation of @code{\includeonly}, What column?, Filling, Top
   2.227  @comment  node-name,  next,  previous,  up
   2.228  @chapter Updation of @code{\includeonly}
   2.229  @cindex includeonly
   2.230 @@ -1448,6 +1512,11 @@
   2.231          Regexp of La@TeX{} itemization command (@code{"\\\\(sub\\)*item"})
   2.232  @end defvar
   2.233  
   2.234 +@defvar YaTeX-verb-regexp
   2.235 +        Regexp of La@TeX{} verb command family.  Omit \\\\.
   2.236 +        (@code{"verb\\*?\\|path"})
   2.237 +@end defvar
   2.238 +
   2.239  @defvar         YaTeX-nervous
   2.240          T for using local dictionary (@code{t})
   2.241  @end defvar
   2.242 @@ -1475,6 +1544,12 @@
   2.243          Switch math-mode automatically(@code{t})
   2.244  @end defvar
   2.245  
   2.246 +@defvar YaTeX-math-key-list-private
   2.247 +        User defined alist, math-mode-prefix vs completion alist
   2.248 +        used in image completion(@code{nil}).  See @file{yatexmth.el}
   2.249 +        for the information about how to define a completion alist.
   2.250 +@end defvar
   2.251 +
   2.252  @defvar YaTeX-default-pop-window-height
   2.253          Initial height of typesetting buffer when one-window.
   2.254          Number for the lines of the buffer, numerical string for
   2.255 @@ -1624,7 +1699,7 @@
   2.256  concatenating `YaTeX::' and section-type command, is called automatically
   2.257  with an integer argument which indicates which argument of section-type
   2.258  command is being read.  Thus the add-in should determine the
   2.259 -job refering the value of its argument.
   2.260 +job referring the value of its argument.
   2.261  
   2.262  @menu
   2.263  * Defining `option add-in'::    
   2.264 @@ -1718,13 +1793,13 @@
   2.265  @itemx [A]
   2.266  Base prompt, X-axis prompt, Y-axis prompt     (each optional)        
   2.267  @itemx [D]
   2.268 -  Read the coodinates with the prompt ``BasePrompt X-axisPrompt:'' for
   2.269 +  Read the coordinates with the prompt ``BasePrompt X-axisPrompt:'' for
   2.270  X-axis, ``BasePrompt Y-axisPrompt:'' for Y-axis, and return it in the form 
   2.271 -of ``(X,Y)''.  The default prompts are @code{Dimention}, @code{X},
   2.272 +of ``(X,Y)''.  The default prompts are @code{Dimension}, @code{X},
   2.273  @code{Y} respectively.
   2.274  
   2.275  @item [F]
   2.276 -YaTeX:check-comletion-type
   2.277 +YaTeX:check-completion-type
   2.278  @itemx [A]
   2.279  One of the symbols: 'begin, 'section, or 'maketitle
   2.280  @itemx [D]
   2.281 @@ -1831,9 +1906,9 @@
   2.282  @item Position
   2.283  read positional option (like [htbp])
   2.284  @item Coord.
   2.285 -read coodinates
   2.286 +read coordinates
   2.287  @item Quit
   2.288 -quit from genarating
   2.289 +quit from generating
   2.290  @end table
   2.291  
   2.292    Since (A) is the optional argument to specify the location of included
   2.293 @@ -1930,7 +2005,7 @@
   2.294  @subsection Contribution
   2.295  
   2.296    If you get your own pretty function and you let it be in public, please 
   2.297 -steel yourself in the happy atomospher and do not send me the function.
   2.298 +steel yourself in the happy atmosphere and do not send me the function.
   2.299  I do know it is not fine because it is generated by yatexgen:-p.
   2.300  
   2.301  @node Etcetera, Copying, Customizations, Top
   2.302 @@ -1944,6 +2019,8 @@
   2.303  use completion  in order to  enrich your dictionary,  and you will
   2.304  also find `Wild Bird' growing suitable for your La@TeX{} style.
   2.305  
   2.306 +  The package name `Wild Bird' is the English translation of Japanese
   2.307 +title `Yachou', which is a trick on words of Japanese.
   2.308  
   2.309  @node Copying,  , Etcetera, Top
   2.310  @comment  node-name,  next,  previous,  up
     3.1 --- a/docs/yatexj.tex	Fri Nov 25 08:26:13 1994 +0000
     3.2 +++ b/docs/yatexj.tex	Tue Dec 20 21:00:21 1994 +0000
     3.3 @@ -24,23 +24,74 @@
     3.4  * Intro::                       はじめに
     3.5  * Main features::               主な機能
     3.6  * Installation::                インストール
     3.7 -* Invocation::                  外部コマンドの起動
     3.8 +* Invocation::                  プロセス起動
     3.9  * %#notation ::                 %#記法
    3.10  * Completion::                  補完入力
    3.11  * Local dictionary::            ローカル辞書
    3.12  * Commenting out::              コメントアウト
    3.13  * Cursor jump::                 カーソルジャンプ
    3.14 -* Modifying/Deleting::          変更/削除
    3.15 -* Filling item::                itemの桁揃え
    3.16 -* Includeonly::                 勝手にincludeonly
    3.17 -* What column::                 ここはどこ?
    3.18 +* Modifying/Deleting::          LaTeXコマンドの変更/削除
    3.19 +* Filling::                     桁揃え
    3.20 +* Includeonly::                 勝手に includeonly
    3.21 +* What column::                 カラム位置ガイド
    3.22  * Intelligent newline::         おまかせ改行
    3.23 -* Online help::                 オンラインヘルプ
    3.24 +* Online help::                 LaTeXオンラインヘルプ
    3.25  * Cooperation with other packages::  他パッケージとの連携
    3.26  * Customizations::              カスタマイズ
    3.27  * Etc::                         その他
    3.28  * Copying::                     取り扱い
    3.29  * Concept Index::               索引
    3.30 +
    3.31 + --- The Detailed Node Listing ---
    3.32 +
    3.33 +latexコマンド起動
    3.34 +
    3.35 +* Calling typesetter::          タイプセッタ起動
    3.36 +* Print out::                   プリントアウト用コマンドの起動
    3.37 +
    3.38 +%#記法
    3.39 +
    3.40 +* Changing typesetter::         タイプセット用コマンドの変更
    3.41 +* Splitting input files::       入力ファイル分割
    3.42 +* Fix region for typesetting::  領域の固定
    3.43 +* lpr format::                  プリントアウトコマンド用フォーマット
    3.44 +* Editing %# notation::         %#記法の編集
    3.45 +
    3.46 +補完入力
    3.47 +
    3.48 +* begin型補完::                 
    3.49 +* section型補完::               
    3.50 +* large型補完::                 
    3.51 +* maketitle型補完::             
    3.52 +* Arbitrary completion::        随時補完
    3.53 +* end補完::                     
    3.54 +* Accent mark completion::      アクセント記号補完
    3.55 +* Image completion::            数式記号イメージ補完
    3.56 +* Greek letter completion::     ギリシャ文字補完
    3.57 +
    3.58 +section型補完
    3.59 +
    3.60 +* 2個以上の引数をとる section型コマンド::  
    3.61 +* Enclose region-type command::  
    3.62 +* Recursive completion::        再帰補完
    3.63 +* view-sectioning::             セクション区切りのアウトライン表示
    3.64 +
    3.65 +変更/削除
    3.66 +
    3.67 +* Changing LaTeX command::      La@TeX{} コマンドの変更
    3.68 +* Killing LaTeX command::       La@TeX{} コマンドの削除
    3.69 +
    3.70 +カスタマイズ
    3.71 +
    3.72 +* Lisp variables::              lisp 変数
    3.73 +* Add-in functions::            付加関数(アドイン関数)
    3.74 +
    3.75 +lisp 変数
    3.76 +
    3.77 +* All customizable variables::  カスタマイズ変数一覧
    3.78 +* Sample definitions::          カスタマイズ変数設定例
    3.79 +* Hook variables::              hook変数
    3.80 +* Hook file::                   hook用ファイル
    3.81  @end menu
    3.82  
    3.83  @node Intro, Main features, Top, Top
    3.84 @@ -233,7 +284,7 @@
    3.85  @cindex 起動するコマンドを変える[きとうするこまんとをかえる]
    3.86  
    3.87  @example
    3.88 -        %#!jlatex-ntt example
    3.89 +        %#!jlatex-ntt
    3.90  @end example
    3.91  
    3.92  NTT jTeX と、ASCII jTeX を使い分けたいような場合に便利でしょう。
    3.93 @@ -267,12 +318,12 @@
    3.94  なお、この行の最後の単語のピリオド以前を「メインファイル」のベース
    3.95  ネームであると仮定します(上の2つの場合どちらも@file{main})。
    3.96  
    3.97 -  入力ファイル分割時には次のことに注意して下さい。
    3.98 +  @kbd{[prefix] g} (@ref{Cursor jump}参照) での
    3.99 +ファイル間ジャンプを有効に機能させるため、入力ファイル分割時には次のことに
   3.100 +注意して下さい。
   3.101  
   3.102  @enumerate
   3.103  @item
   3.104 -同時に編集するファイル群の名前は重複のないようにする。
   3.105 -@item
   3.106  サブディレクトリを作って、その中にサブファイルを置くことはできるが
   3.107  サブディレクトリのサブディレクトリには置けない。
   3.108  @item
   3.109 @@ -904,7 +955,6 @@
   3.110  @chapter ローカル辞書
   3.111  @cindex ローカル辞書[ろおかるししよ]
   3.112  @cindex .yatexrc
   3.113 -@cindex 変な単語[へんなたんこ]
   3.114  
   3.115    補完入力用の候補は三種類の辞書から構成されています。一つは
   3.116  @file{yatex.el}に組み込まれた「標準辞書」、もう一つはユーザが個人的に常用
   3.117 @@ -915,13 +965,14 @@
   3.118  来ます。
   3.119  
   3.120  @example
   3.121 -  `foo' is not in table. Register into: U)serTable L)ocal N)one
   3.122 +  `foo' is not in table. Register into: U)serDic L)ocalDic N)one D)iscard
   3.123  @end example
   3.124  
   3.125  @noindent 
   3.126  というプロンプトに対し、@kbd{u}と答えると「ユーザ辞書」を、@kbd{l}と答える
   3.127 -とローカル辞書を更新することになり、@kbd{n}と答えると新たな単語を学習せず
   3.128 -に捨てることになります。
   3.129 +とローカル辞書を更新し、@kbd{n}と答えると辞書ファイルは更新せず現在のEmacs
   3.130 +セッションのみ有効な単語とし、@kbd{d}と答えると新たな単語を学習せずに捨て
   3.131 +ることになります。
   3.132  
   3.133    もし、ローカル辞書の機能はいらず、全てユーザ辞書の更新のみでよいと言う場
   3.134  合には@file{~/.emacs}などで、
   3.135 @@ -934,6 +985,11 @@
   3.136  @noindent 
   3.137  として下さい。
   3.138  
   3.139 +@cindex 変な単語[へんなたんこ]
   3.140 +  もし、綴の間違ったものなど、変な単語が学習されてしまった場合は
   3.141 +
   3.142 +
   3.143 +
   3.144  @node Commenting out, Cursor jump, Local dictionary, Top
   3.145  @comment  node-name,  next,  previous,  up
   3.146  @chapter コメントアウト
   3.147 @@ -1004,6 +1060,8 @@
   3.148  @cindex カーソルジャンプ[かあそるしやんふ]
   3.149  @cindex prefix g
   3.150  
   3.151 +@section 対応オブジェクトへのジャンプ
   3.152 +
   3.153    文書中のいろいろな場所で
   3.154  
   3.155  @table @kbd
   3.156 @@ -1028,11 +1086,24 @@
   3.157  ない場合はエラーになります。またこれは、領域固定のための @code{%#BEGIN} と 
   3.158  @code{%#END} のペアに対しても同様に動作します。なお、@code{label/ref}や
   3.159  @code{cite/bibitem}対応するものが別ファイルにある時は、ジャンプ先となるファ
   3.160 -イルがオープンされていなければなりません。
   3.161 -@xref{%#記法}
   3.162 +イルがオープンされていなければなりません。@xref{%#記法}
   3.163 +メインの .tex ファイルの @code{\include{chap1}} などにカーソルを合わせ、
   3.164 +@kbd{[prefix] g} を押すと、@file{chap1.tex} にジャンプします。
   3.165  
   3.166 -  メインの .tex ファイルの @code{\include{chap1}} などにカーソルを合わせ、
   3.167 -@kbd{[prefix] g} を押すと、@file{chap1.tex} にジャンプします。また、
   3.168 +また、
   3.169 +
   3.170 +@table @kbd
   3.171 +@item [prefix] 4 g
   3.172 +        @dots{} 別ウィンドウで対応オブジェクトにジャンプ
   3.173 +@end table
   3.174 +
   3.175 +@noindent
   3.176 +を押すと、対応するオブジェクトへのジャンプを別ウィンドウで行います。ただし、
   3.177 +この機能は @code{begin/end}, @code{%#BEGIN/%#END} 間のジャンプに対しては
   3.178 +(意味がないと思われるので)機能しないので注意してください。
   3.179 +
   3.180 +@section メインファイルへのジャンプ
   3.181 +
   3.182  @file{chap1.tex}のようなサブファイルで、
   3.183  
   3.184  @table @kbd
   3.185 @@ -1045,7 +1116,11 @@
   3.186  @noindent 
   3.187  を押すと、メインファイルの編集バッファに切替えます。もし、メインファイルを
   3.188  オープンしていない場合は、カレントディレクトリから探して自動的にオープンし
   3.189 -ます。さらに現在の環境を単位として機能するコマンドに以下のものがあります。
   3.190 +ます。
   3.191 +
   3.192 +@section 環境を単位としたジャンプ
   3.193 +
   3.194 +さらに現在の環境を単位として機能するコマンドに以下のものがあります。
   3.195  
   3.196  @cindex 環境の先頭へ[かんきようのせんとうへ]
   3.197  @cindex 環境の末尾へ[かんきようのまつひへ]
   3.198 @@ -1067,7 +1142,7 @@
   3.199  
   3.200    
   3.201  
   3.202 -@node Modifying/Deleting, Filling item, Cursor jump, Top
   3.203 +@node Modifying/Deleting, Filling, Cursor jump, Top
   3.204  @comment  node-name,  next,  previous,  up
   3.205  @chapter 変更/削除
   3.206  @cindex 変更/削除[へんこう/さくしよ]
   3.207 @@ -1149,10 +1224,13 @@
   3.208                  ↑(カーソル位置)
   3.209  @end example
   3.210  
   3.211 -@node Filling item, Includeonly, Modifying/Deleting, Top
   3.212 +@node Filling, Includeonly, Modifying/Deleting, Top
   3.213  @comment  node-name,  next,  previous,  up
   3.214 -@chapter itemの桁揃え
   3.215 -@cindex itemの桁揃え[itemのけたそろえ]
   3.216 +@chapter 桁揃え
   3.217 +@cindex 桁揃え[けたそろえ]
   3.218 +
   3.219 +@section itemの桁揃え
   3.220 +@cindex itemなどの桁揃え[itemなとのけたそろえ]
   3.221  @cindex prefix i
   3.222  
   3.223    itemize 環境中にある@code{\item}の項目(文章)が複数行に渡る場合に、項
   3.224 @@ -1184,7 +1262,40 @@
   3.225  この変数の指定の仕方がよく分からない場合は、独自の項目列挙コマンドの名前を
   3.226  @code{@code{"\item"}で始まるものにして下さい(例えば"\itembf"})。
   3.227  
   3.228 -@node Includeonly, What column, Filling item, Top
   3.229 +  @kbd{[prefix] i} では@code{\item} を「ハングインデント」に整形します。も
   3.230 +し@code{\item}とその説明用パラグラフを切り離す時は通常の
   3.231 +@kbd{M-q}(他のモードではfill-paragraphが割り当てられている)を使ってくださ
   3.232 +い。(つまり以下のような場合:)
   3.233 +
   3.234 +@example
   3.235 +ハングインデント:
   3.236 +       >\item[ほげほげ] 英語では、特に意味のない単語を `foo' であらわしま
   3.237 +       >                すが、これの日本語版ともいえる単語が「ほげほげ」
   3.238 +       >                です。
   3.239 +通常インデント:
   3.240 +       > \item へろへろ
   3.241 +       >
   3.242 +       > 「ほげほげ」をでたらめが単語として使った時に、第2のでたらめな
   3.243 +       > 単語として「へろへろ」が使われることが多いようです。
   3.244 +@end example
   3.245 +
   3.246 +  上の通常インデントの場合、説明パラグラフのインデントは \item と同じ深さ
   3.247 +とする必要があります。ただし、@kbd{M-q}を行の最初の非空白文字の位置で押す
   3.248 +ことにより深さを変えることができます(後述)。
   3.249 +
   3.250 +@section パラグラフの桁揃え
   3.251 +@cindex パラグラフの桁揃え[はらくらふのけたそろえ]
   3.252 +@cindex M-q
   3.253 +
   3.254 +  パラグラフの桁揃え(fill)は、基本的に通常通り機能しますが、verbatim環境や、
   3.255 +tabular環境など桁揃えをすると悲惨な状況になるような環境中では機能しません。
   3.256 +また、\verb で括ってあるものは決して行分割されません(変数 
   3.257 +@code{YaTeX-verb-regexp} で制御) )。さらに、一時的にインデントの深さを変え
   3.258 +てある箇所では、そのインデントの先頭で@kbd{M-q}を押すことにより 
   3.259 +fill-prefix をいちいち変更しなくて桁揃えができます。
   3.260 +
   3.261 +
   3.262 +@node Includeonly, What column, Filling, Top
   3.263  @comment  node-name,  next,  previous,  up
   3.264  @chapter 勝手にincludeonly
   3.265  @cindex 勝手にincludeonly[かつてにincludeonly]
   3.266 @@ -1441,7 +1552,11 @@
   3.267  @end defvar
   3.268  
   3.269  @defvar YaTeX-item-regexp
   3.270 -itemの桁揃えの時に用いる、itemの正規表現(@code{"\\\\item"})
   3.271 +itemの桁揃えの時に用いる、itemの正規表現(@code{"\\\\(sub\\)*item"})
   3.272 +@end defvar
   3.273 +
   3.274 +@defvar YaTeX-verb-regexp
   3.275 +verbコマンドの正規表現。先頭の\\\\はつけない(@code{"verb\\*?\\|path"})
   3.276  @end defvar
   3.277  
   3.278  @defvar tex-command
   3.279 @@ -1534,7 +1649,13 @@
   3.280  @end defvar
   3.281  
   3.282  @defvar YaTeX-auto-math-mode
   3.283 -数式モードの切り替えを自動的に行う。(@code{nil})
   3.284 +数式モードの切り替えを自動的に行う。(@code{t})
   3.285 +@end defvar
   3.286 +
   3.287 +@defvar YaTeX-math-key-list-private
   3.288 +        数式イメージ補完で用いる (プリフィクスキー . 対応補完テーブル) の
   3.289 +        alist(@code{nil})。補完テーブルの書き方については
   3.290 +        @file{yatexmth.el}を参照。
   3.291  @end defvar
   3.292  
   3.293  @defvar YaTeX-default-pop-window-height
   3.294 @@ -1651,11 +1772,11 @@
   3.295    本プログラムはフリーソフトウェアです。本プログラムを使用して生じたいかな
   3.296  る結果に対しても作者は責任を負わないこととします。転載等に関しては制限いた
   3.297  しません。常識的に扱ってください。また、使用している旨をメイルでお知らせい
   3.298 -ただくと、作者は喜んでサポートに励むことでしょう(ほんとか)。
   3.299 +ただくと、作者は喜んでサポートに励むことでしょう。
   3.300  
   3.301    苦情、希望、バグ報告、感想等は歓迎いたします。
   3.302 -連絡は pcs39334@@asciinet.or.jp または、
   3.303 -yuuji@@ae.keio.ac.jpまで(1995年3月現在)。
   3.304 +連絡は yuuji@@ae.keio.ac.jp または、
   3.305 +pcs39334@@asciinet.or.jp まで(1995年3月現在)。
   3.306  
   3.307  仕様は、予告なく確実に(気分次第で)変更されます:-p。
   3.308  
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/help/YATEXHLP.eng	Tue Dec 20 21:00:21 1994 +0000
     4.3 @@ -0,0 +1,1360 @@
     4.4 +textfloatsep
     4.5 +\addtolength{\textfloatsep}{LENGTH}
     4.6 +Length between the text and, float of the top or bottom of page
     4.7 +
     4.8 +floatsep
     4.9 +\addtolength{\floatsep}{LENGTH}
    4.10 +Length between two floats
    4.11 +
    4.12 +oddsidemargin
    4.13 +\setlength{\oddsidemargin}{LENGTH}
    4.14 +右ページの左端から1インチ(2.54cm)の線と本文の距離
    4.15 +
    4.16 +pagestyle
    4.17 +\pagestyle{スタイル}
    4.18 +出力ページのヘッダとフッタのスタイルを決める。スタイルには以下のものがある:
    4.19 +plain		標準スタイル. フッタにページ番号だけつける.
    4.20 +empty		ヘッダにもフッタにも何も出力しない.
    4.21 +headings	ヘッダにセクションに応じた見出しとページ番号をつけ
    4.22 +		フッタには何も出力しない.
    4.23 +myheadings	headingsのスタイルで、ヘッダの情報を \markbpth と
    4.24 +		\markright で指定できる.
    4.25 +
    4.26 +thispagestyle
    4.27 +\thispagestyle{スタイル}
    4.28 +現在のページだけのスタイルを決定する。
    4.29 +
    4.30 +pagenumbering
    4.31 +\pagenumbering{スタイル}
    4.32 +ページ番号のスタイルを決める。スタイルには以下のものがある:
    4.33 +arabic		アラビア数字
    4.34 +alph		小文字の英字
    4.35 +Alph		大文字の英字
    4.36 +roman		小文字のローマ数字
    4.37 +Roman		大文字のローマ数字
    4.38 +
    4.39 +shortstack
    4.40 +\shortstack[場所]{重ねて\\表示する\\内容}
    4.41 +{}内の内容を\\で区切られた単位毎に積み重ねて表示する。
    4.42 +[場所]は、l(左寄せ)、c(センタリング)、r(右寄せ)のいずれか。
    4.43 +
    4.44 +newlength
    4.45 +\newlength{NAME}
    4.46 +NAMEという長さコマンドを新たに宣言する。
    4.47 +
    4.48 +addtolength
    4.49 +\addtolength{長さコマンド}{数値}
    4.50 +第1引数の長さを第2に引数の数値を足す。
    4.51 +代表的なスタイルパラメータについては \setlength の項を参照せよ。
    4.52 +
    4.53 +setlength
    4.54 +\setlength{長さコマンド}{数値}
    4.55 +第1引数の長さを第2に引数の数値に設定する。
    4.56 +代表的なスタイルパラメータは以下の通り:
    4.57 +(スタイルパラメータの変更はプリアンブルで行うこと)
    4.58 +\evensidemargin	\footheight	\footskip	\headheight
    4.59 +\headsep	\marginparsep	\marginparwidth	\oddsidemargin
    4.60 +\textheight	\textwidth	\topmargin	\topskip
    4.61 +\parindent	\baselineskip	\baselinestretch \parskip
    4.62 +\columnsep	\columnseprule	\mathindent
    4.63 +
    4.64 +settowidth{\NAME}{TEXT}
    4.65 +\hbox{TEXT}の出力結果と同じ幅に長さ\NAME をセットする。
    4.66 +
    4.67 +evensidemargin
    4.68 +\setlength{\evensidemargin}{LENGTH}
    4.69 +左ページの左端から1インチ(2.54cm)の線と本文の距離
    4.70 +
    4.71 +footheight
    4.72 +\setlength{\footheight}{LENGTH}
    4.73 +フッタの高さ
    4.74 +
    4.75 +footskip
    4.76 +\setlength{\footskip}{LENGTH}
    4.77 +本文の箱の下端とフッタの距離
    4.78 +
    4.79 +headheight
    4.80 +\addtolength{\headheight}{LENGTH}
    4.81 +ヘッダの高さ
    4.82 +
    4.83 +headsep
    4.84 +\setlength{\headsep}{LENGTH}
    4.85 +ヘッダと本文の間隔
    4.86 +
    4.87 +marginparsep
    4.88 +\addtolength{\marginparsep}{LENGTH}
    4.89 +傍注と本文の間隔
    4.90 +
    4.91 +marginparwidth
    4.92 +\addtolength{\marginparwidth}{LENGTH}
    4.93 +傍注の幅
    4.94 +
    4.95 +oddsidemargin
    4.96 +\addtolength{\oddsidemargin}{LENGTH}
    4.97 +右ページの左端から1インチ(2.54cm)の線と本文の距離
    4.98 +
    4.99 +textheight
   4.100 +\addtolength{\textheight}{LENGTH}
   4.101 +本文の高さ
   4.102 +
   4.103 +textwidth
   4.104 +\addtolength{\textwidth}{LENGTH}
   4.105 +本文の幅
   4.106 +
   4.107 +topmargin
   4.108 +\addtolength{\topmargin}{LENGTH}
   4.109 +ページ上端から1インチの線とヘッダの距離
   4.110 +
   4.111 +topskip
   4.112 +\addtolength{\topskip}{LENGTH}
   4.113 +本文の箱の上端と一行目のテキストとの間隔
   4.114 +
   4.115 +parindent
   4.116 +\setlength{\parindent}{LENGTH}
   4.117 +\parindent	段落の先頭の字下げ幅.
   4.118 +
   4.119 +linewidth
   4.120 +\addtolength{\linewidth}{LENGTH}
   4.121 +\linewidth	行の幅.
   4.122 +
   4.123 +baselineskip
   4.124 +\addtolength{baselineskip}{LENGTH}
   4.125 +\baselineskip	行のベースライン間の最低限の高さ.
   4.126 +
   4.127 +baselinestretch
   4.128 +\renewcommand{baselinestretch}{1.5}
   4.129 +\baselinestretch \baselineskip に乗ずる係数.		(default=1)
   4.130 +(* \setlengthなどではなく、\renewcommandで再定義する。)
   4.131 +
   4.132 +parskip
   4.133 +\addtolength{\parskip}{LENGTH}
   4.134 +\parskip	段落前の垂直スペース.
   4.135 +
   4.136 +columnsep
   4.137 +\addtolength{\columnsep}{LENGTH}
   4.138 +\columnsep	2段組みの時の段間の幅.
   4.139 +
   4.140 +columnseprule
   4.141 +\addtolength{\columnseprule}{LENGTH}
   4.142 +二段組の時の段間の罫線の太さ.
   4.143 +
   4.144 +columnwidth
   4.145 +\addtolength{\columnwidth}{LENGTH}
   4.146 +二段組の時には (\textwidth - \columnsep)/2
   4.147 +そうでない時は、\textwidth
   4.148 +
   4.149 +
   4.150 +columnseprule
   4.151 +\addtolength{columnseprule}{LENGTH}
   4.152 +\columnseprule	2段組みの時の段間の罫線の幅.		(default=0pt)
   4.153 +
   4.154 +mathindent
   4.155 +\addtolength{mathindent}{LENGTH}
   4.156 +\mathindent	スタイルオプションで fleqn を指定した場合の、
   4.157 +		左マージンからの数式の字下げ幅.
   4.158 +
   4.159 +LaTeX
   4.160 +\LaTeX
   4.161 +\LaTeX のロゴを表示。\LaTeX の定義は以下の通り。
   4.162 +\def\LaTeX{{\rm L\kern-.36em\raise.3ex\hbox{\sc a}\kern-.15em
   4.163 +    T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}
   4.164 +
   4.165 +fragile
   4.166 +** LaTeX用語 **
   4.167 +引数によって展開結果が変わるようなコマンドをいう。
   4.168 +その逆は robust なコマンド。
   4.169 +
   4.170 +robust
   4.171 +** LaTeX用語 **
   4.172 +展開結果が常に変わらないようなコマンドをいう。
   4.173 +フォント/サイズ指定子、長さコマンド、数式モード中に使う多くのコマンドは
   4.174 +robustなコマンド。
   4.175 +(maketitle型コマンドのうちオプション引数を全くとらないものと考えて良い)
   4.176 +
   4.177 +protect
   4.178 +\protect「fragileなコマンド」
   4.179 +引数によって結果が変わるようなコマンドを「fragileなコマンド」と言う。
   4.180 +一方、引数がいろいろな箇所で参照されるコマンドを「動く引数を取るコマンド
   4.181 +と言う。これは chapter や caption など目次などから参照される引数をとるも
   4.182 +のや、tabular/array 環境の @ 表現が該当する。
   4.183 +
   4.184 +さて、これらの「動く引数を取るコマンド」の引数に「fragileなコマンド」を
   4.185 +与える時に(fragileなコマンドの直前に)使うのが \protect である。以下は典
   4.186 +型的な利用例である。
   4.187 +
   4.188 +\newcommand{\thissystem}[1]{YaTeX version #1}
   4.189 +\chapter{\protect \thissystem{1.50}について}
   4.190 +
   4.191 +newcommand
   4.192 +\newcommand{\コマンド名}[引数の数]{定義}
   4.193 +「コマンド名」を「引数の数」個の引数を取る「定義」であるマクロとして定義
   4.194 +する。定義中でn番目の引数は #n として参照する。
   4.195 +	\newcommand{\foo}[1]{\underline{#1}}
   4.196 +とすると \foo{bar} は \underline{bar} と展開される。したがってフォント指
   4.197 +定子を含む場合newcommandの{}につられて、
   4.198 +	\newcommand{\foo}[1]{\bf #1}
   4.199 +とすると \foo{bar} がテキスト中で \bf bar と展開されてしまうので、
   4.200 +	\newcommand{\foo}[1]{{\bf #1}}
   4.201 +としなければならない。
   4.202 +
   4.203 +  「コマンド名」のマクロが既に定義されている場合はエラーとなる。再定義す
   4.204 +る場合は、\renewcommandを使う。
   4.205 +
   4.206 +renewcommand
   4.207 +\renewcommand{\コマンド名}[引数の数]{定義}
   4.208 +既に定義されているコマンドを別の内容で再定義する。
   4.209 +以下は \newcommand の説明。
   4.210 +<refer newcommand>
   4.211 +
   4.212 +newenvironment
   4.213 +\newenvironment{環境名}[引数の数]{定義1}{定義2}
   4.214 +新たな環境を定義する。
   4.215 +\begin{環境名}の時の展開内容を「定義1」に\end{環境名}の時の展開内容を
   4.216 +「定義2」に記述する。
   4.217 +	\newcommand{\環境名}{定義1} \def{\end環境名}{定義2}
   4.218 +と同値。
   4.219 +
   4.220 +renewenvironment
   4.221 +\renewenvironment{環境名}[引数の数]{定義1}{定義2}
   4.222 +既に定義されている「環境名」を別の内容で再定義する。
   4.223 +以下は、\newenvironmentの説明。
   4.224 +
   4.225 +<refer newenvironment>
   4.226 +
   4.227 +typeout
   4.228 +\typeout{メッセージ}
   4.229 +タイプセット中に「メッセージ」を端末に出力する。
   4.230 +
   4.231 +typein
   4.232 +\typein{メッセージ}	\typein[\マクロ]{メッセージ}
   4.233 +タイプセット中に「メッセージ」をプロンプトに出し、入力した結果を実行する。
   4.234 +第二の書式では、「\マクロ」を入力したものに定義する。
   4.235 +
   4.236 +par
   4.237 +\par
   4.238 +段落の区切りの役割をする。空行と同じ。
   4.239 +
   4.240 +everypar
   4.241 +\everypar
   4.242 +RTFM
   4.243 +
   4.244 +nopagebreak
   4.245 +\nopagebreak[i]		(i = 0,1,2,3,4)
   4.246 +改頁を強さiで抑制する([i]を省略すると4)。
   4.247 +
   4.248 +pagebreak
   4.249 +\pagebreak[i]		(i = 0,1,2,3,4)
   4.250 +改頁を強さiで促す([i]を省略すると4)。
   4.251 +
   4.252 +linebreak
   4.253 +\linebreak[i]		(i = 0,1,2,3,4)
   4.254 +改行を強さiで促す([i]を省略すると4)。
   4.255 +
   4.256 +nolinebreak
   4.257 +\nolinebreak[i]		(i = 0,1,2,3,4)
   4.258 +改行を強さiで抑制する([i]を省略すると4)。
   4.259 +
   4.260 +samepage
   4.261 +\samepage
   4.262 +改頁を禁止する。
   4.263 +RTFM
   4.264 +
   4.265 +obeycr
   4.266 +\obeycr
   4.267 +<CR> を \\. に定義する。→\restorecr
   4.268 +
   4.269 +restorecr
   4.270 +\restorecr
   4.271 +\obeycrで変更した<CR>の定義を元に戻す。
   4.272 +
   4.273 +\
   4.274 +\\		\\[長さ]
   4.275 +(任意の場所で)改行する。段落中では、\newline と同じ。
   4.276 +オプション引数の[長さ]を指定すると、次の行との間隔を
   4.277 +\vspace{LENGTH}によって確保する。
   4.278 +
   4.279 +addvspace
   4.280 +\addvspace{スキップ}
   4.281 +縦方向の間隔に「スキップ」の値を足す。ただし
   4.282 +\addvspace{S1} \addvspace{S2} と複数の値を同時に指定しても
   4.283 +\addvspace{S1,S2のうち大きいほう} と同値になる。
   4.284 +
   4.285 +vspace
   4.286 +\vspace{間隔}		\vspace*{間隔}
   4.287 +垂直方向に「間隔」ぶんのスペースを足す。
   4.288 +\vspace* はどんな場所でもスペースを足すが、\vspace はページの先頭や
   4.289 +末尾でははたらかない。
   4.290 +
   4.291 +vspace*
   4.292 +\vspace{間隔}		\vspace*{間隔}
   4.293 +垂直方向に「間隔」ぶんのスペースを足す。
   4.294 +\vspace* はどんな場所でもスペースを足すが、\vspace はページの先頭や
   4.295 +末尾でははたらかない。
   4.296 +
   4.297 +hspace
   4.298 +\hspace{間隔}		\hspace*{間隔}
   4.299 +水平方向に「間隔」ぶんのスペースを足す。
   4.300 +\hspace* はどんな場所でもスペースを足すが、\hspace は行の先頭や末尾では
   4.301 +はたらかない。
   4.302 +
   4.303 +hspace*
   4.304 +\hspace{間隔}		\hspace*{間隔}
   4.305 +水平方向に「間隔」ぶんのスペースを足す。
   4.306 +\hspace* はどんな場所でもスペースを足すが、\hspace は行の先頭や末尾では
   4.307 +はたらかない。
   4.308 +
   4.309 +smallskip
   4.310 +\smallskip
   4.311 +垂直方向に小さな間隔を空ける。
   4.312 +\def\smallskip{\vspace\smallskipamount}
   4.313 +
   4.314 +medskip
   4.315 +\medskip
   4.316 +垂直方向に中くらいの間隔を空ける。
   4.317 +\def\medskip{\vspace\medskipamount}
   4.318 +
   4.319 +bigskip
   4.320 +\bigskip
   4.321 +垂直方向に大きな間隔を空ける。
   4.322 +\def\bigskip{\vspace\bigskipamount}
   4.323 +
   4.324 +,
   4.325 +\,
   4.326 +狭いスペースを空ける。段落モード、LRモード、数式モードいずれでも利用可。
   4.327 +クォートの中にクォートを書くときなどに用いる。
   4.328 +例: ``\,`Foo', he said.''
   4.329 +数式モードで使えるスペースには以下のものがある:
   4.330 +	\:	少し広い
   4.331 +	\!	負で狭い
   4.332 +	\;	広い
   4.333 +
   4.334 +:
   4.335 +$\:$
   4.336 +少し広いスペース。数式モードのみ。
   4.337 +
   4.338 +!
   4.339 +$\!$
   4.340 +狭い負のスペース。数式モードのみ。
   4.341 +
   4.342 +;
   4.343 +$\;$
   4.344 +広いスペース。数式モードのみ。
   4.345 +
   4.346 +@whilenum
   4.347 +\@whilenum TEST \do {BODY}  
   4.348 +この辺あとで
   4.349 +
   4.350 +nofiles
   4.351 +\nofiles
   4.352 +プリアンブルで宣言すると、.aux, .idx, .lof, .lot, .toc ファイルの作成が
   4.353 +抑制される。
   4.354 +
   4.355 +includeonly
   4.356 +\includeonly{sub1}	\includeonly{sub1,sub3}
   4.357 +\include{}で読み込むファイルのうち、実際に読み込み処理するものを指定する。
   4.358 +(.texは省略可)
   4.359 +\includeonlyの引数リストにないファイルはまったく処理されない、または前回
   4.360 +以前に処理されている場合そこから全く変更がないものとして扱われる。
   4.361 +
   4.362 +include
   4.363 +\include{FILE}
   4.364 +\clearpage \input{FILE} \clearpage
   4.365 +と同じはたらきをする。
   4.366 +
   4.367 +input
   4.368 +\input{FILE}
   4.369 +FILE.tex がそこにあるかのように処理を続ける。
   4.370 +
   4.371 +setcounter
   4.372 +\setcounter{FOO}{VAL}
   4.373 +カウンタFOOの値をVALに設定する。
   4.374 +
   4.375 +addtocounter
   4.376 +\addtocounter{FOO}{VAL}
   4.377 +カウンタFOOの値にVALを加える。
   4.378 +
   4.379 +newcounter
   4.380 +\newcounter{COUNTER}[OLDCTR]
   4.381 +新しいカウンタCOUNTERを設定する。
   4.382 +オプション引数[OLDCTR]を指定すると、既存のカウンタOLDCTRの値が
   4.383 +\stepcounter もしくは \addtocounter で変更されるたびにCOUNTERの値もリセッ
   4.384 +トされる。
   4.385 +
   4.386 +value
   4.387 +\value{COUNTER}
   4.388 +COUNTERの値を返す。\protect を前置してはならない。
   4.389 +
   4.390 +stepcounter
   4.391 +\stepcounter{FOO}
   4.392 +カウンタFOOの値をインクリメントする。FOOに従うカウンタがあればそれらをリ
   4.393 +セットする。
   4.394 +
   4.395 +refstepcounter
   4.396 +\refstepcounter{FOO}
   4.397 +カウンタFOOの値をインクリメントする。FOOに従うカウンタがあればそれらをリ
   4.398 +セットする。\stepcounterとの違いは、\refstepcounter{FOO} の直後に 
   4.399 +\label{hoge} があった場合に、\ref{hoge} の値が \value{FOO} を持つように
   4.400 +「\ref値」を設定することである。
   4.401 +
   4.402 +arabic
   4.403 +\arabic{COUNTER}
   4.404 +アラビア数字でCOUNTERの値を出力。
   4.405 +
   4.406 +roman
   4.407 +\roman{COUNTER}
   4.408 +小文字のローマ数字でCOUNTERの値を出力。
   4.409 +
   4.410 +Roman
   4.411 +\Roman{COUNTER}
   4.412 +大文字のローマ数字でCOUNTERの値を出力。
   4.413 +
   4.414 +alph
   4.415 +\alph{COUNTER}
   4.416 +小文字の英字でCOUNTERの値を出力。
   4.417 +
   4.418 +Alph
   4.419 +\Alph{COUNTER}
   4.420 +大文字の英字でCOUNTERの値を出力。
   4.421 +
   4.422 +fnsymbol
   4.423 +\fnsymbol{COUNTER}
   4.424 +脚注シンボル(1 = *, 2 = \dagger, ...) でCOUNTERの値を出力。数式モードのみ。
   4.425 +
   4.426 +label
   4.427 +\label{LABEL}
   4.428 +ラベルLABELの値をその時の「\ref値」に設定する。
   4.429 +この値は、\ref{LABEL}によって参照される。また\pageref{LABEL}により
   4.430 +\label{LABEL}の存在するページ番号が参照される。
   4.431 +「\ref値」とは \section などのセクションコマンド、enumerate環境での
   4.432 +\item コマンド、theorem環境などによって設定される値である。例えば、
   4.433 +enumerate環境中の \item の直後ではそのitemの番号が「\ref値」となり、
   4.434 +そこにある \label{LABEL} はitemの番号をLABELにセットする。
   4.435 +
   4.436 +ref
   4.437 +\ref{LABEL}
   4.438 +\label{LABEL}で設定したLABELの値を参照する。
   4.439 +本文中で設定されたラベルにたいしてはページ番号が、
   4.440 +図表中で設定されたラベルは図表番号が、
   4.441 +enumerateされたitemで設定されたラベルにたいしては、item番号が返される。
   4.442 +
   4.443 +pageref
   4.444 +pageref{LABEL}
   4.445 +\label{LABEL}の存在するページ番号を参照する。
   4.446 +
   4.447 +(
   4.448 +\( 数式 \)
   4.449 +文中数式を組む。
   4.450 +\begin{math} 数式 \end{math}
   4.451 +と同値。\( および \)は fragile.
   4.452 +
   4.453 +)
   4.454 +\( x^2 = 4 \)
   4.455 +文中数式を組む。
   4.456 +\begin{math} 数式 \end{math}
   4.457 +と同値。\( および \)は fragile.
   4.458 +
   4.459 +[
   4.460 +ディスプレイ数式を組む。
   4.461 +\[ 数式 \]
   4.462 +\begin{displaymath} 数式 \end{displaymath}
   4.463 +と同値。\[ および \]は fragile.
   4.464 +
   4.465 +)
   4.466 +\[ 数式 \]
   4.467 +ディスプレイ数式を組む。
   4.468 +\begin{displaymath} 数式 \end{displaymath}
   4.469 +と同値。\[ および \]は fragile.
   4.470 +
   4.471 +equation
   4.472 +\begin{equation} 数式 \end{equation}
   4.473 +番号つきの数式をdisplaymath環境で組む。
   4.474 +
   4.475 +eqnarray
   4.476 +\begin{eqnarray} 方程式の並び \end{eqnarray}
   4.477 +方程式の並びを3つの桁に整理して出力する。3つの桁は&記号によって、
   4.478 +「左辺 & 等不等号 & 右辺」のように区切られる。例えば以下のようにする。
   4.479 +\begin{eqnarray}
   4.480 + 3x + 2y & = & 4 \\
   4.481 +  x - 4y & = & -5
   4.482 +\end{eqnarray}
   4.483 +eqnarray* 環境は数式番号を出力しないほかはeqnarray環境と同じである。
   4.484 +
   4.485 +eqnarray*
   4.486 +\begin{eqnarray*} 方程式の並び \end{eqnarray*}
   4.487 +数式番号を出力しないほかはeqnarray環境と同じである。
   4.488 +
   4.489 +frac
   4.490 +\frac{分子}{分母}
   4.491 + 分子
   4.492 +------   のような分数形式を組む。{分子 \over 分母} と同じ。
   4.493 + 分母
   4.494 +
   4.495 +sqrt
   4.496 +\sqrt[N]{式}
   4.497 +「式」のN乗根をあらわす数式。[N]を省略すると平方根。
   4.498 +
   4.499 +lefteqn
   4.500 +\lefteqn{式}
   4.501 +ディスプレイ数式モードにおいて、「式」が幅ゼロであるとみなして、左寄せす
   4.502 +る。たとえばeqnarray環境において、左辺が長くなってしまう場合に、行を
   4.503 +折り畳むために利用する。
   4.504 +\begin{eqnarray}
   4.505 + \lefteqn{a_1 + a_2 + \cdots + a_n =} \\
   4.506 + 	&	&	a_1 + b_1 + \cdots + z_1 + \\
   4.507 + 	&	&	b_2 + c+2 + \cdost + z_2
   4.508 +\end{eqnarray}
   4.509 +
   4.510 +center
   4.511 +\begin{center} 内容 \end{center}
   4.512 +「内容」を中央寄せする。各行は\\によって改行位置を指定する。
   4.513 +→ \centering
   4.514 +
   4.515 +flushright
   4.516 +\begin{flushright} 内容 \end{flushright}
   4.517 +「内容」を右寄せする。各行は\\によって改行位置を指定する。
   4.518 +→ \raggedright
   4.519 +
   4.520 +flushleft
   4.521 +\begin{flushleft} 内容 \end{flushleft}
   4.522 +「内容」を左寄せする。各行を\\によって改行位置を指定するとその位置で改行
   4.523 +するが、指定しないと適当な行長のところで改行してくれる。
   4.524 +→ \raggedleft
   4.525 +
   4.526 +centering
   4.527 +\centering 
   4.528 +段落をセンタリングして組版する。
   4.529 +たとえば table環境、figura環境の先頭で宣言すると環境の終りまでをセンタリ
   4.530 +ングして組む。
   4.531 +
   4.532 +raggedright
   4.533 +\raggedright
   4.534 +段落を右寄せして組版する。
   4.535 +
   4.536 +raggedleft
   4.537 +\raggedleft
   4.538 +段落を左寄せして組版する。
   4.539 +
   4.540 +raggedbottom
   4.541 +\raggedbottom
   4.542 +組版する時に各ページの高さに多少のずれがあっても許容する。
   4.543 +プリアンブルで指定する。
   4.544 +→\flushbottom
   4.545 +
   4.546 +flushbottom
   4.547 +\flushbottom
   4.548 +組版する時に各ページの高さを正確にそろえる。
   4.549 +プリアンブルで指定する。
   4.550 +→\raggedbottom
   4.551 +
   4.552 +sloppy
   4.553 +\sloppy
   4.554 +\sloppy を指定すると、各行を必ず右マージンで折り返す代わりに、
   4.555 +単語間の空白を大目に見る。
   4.556 +→\fussy
   4.557 +
   4.558 +fussy
   4.559 +\fussy
   4.560 +通常の組版規則に戻る。
   4.561 +→\sloppy
   4.562 +
   4.563 +sloppypar
   4.564 +\begin{sloppypar} 段落 \end{sloppypar}
   4.565 +段落を \sloppy で組む。
   4.566 +→\sloppy
   4.567 +
   4.568 +verbatim
   4.569 +\begin{verbatim} ... \end{verbatim}
   4.570 +The verbatim environment uses the fixed-width \tt font, turns blanks into 
   4.571 +spaces, starts a new line for each carrige return (or sequence of 
   4.572 +consecutive carriage returns), and interprets EVERY character literally.
   4.573 +I.e., all special characters \, {, $, etc. are \catcode'd to 'other'.
   4.574 +
   4.575 +verbatim*
   4.576 +\begin{verbatim*} ... \end{verbatim*}
   4.577 +<refer verbatim>
   4.578 +
   4.579 +The verbatim* environment is the same, except that spaces
   4.580 +print as the TeXbook's space character instead of as blank spaces.
   4.581 +
   4.582 +list
   4.583 +\begin{list}{デフォルトラベル}{整形パラメータ} ... \end{list}
   4.584 +リスト環境に入る。リスト環境では \item で指定された各項目を一定の字下げ
   4.585 +で列挙する。第1引数には \item のオプション引数のラベルが省略された時のデ
   4.586 +フォルトラベルを指定し、第2引数には各itemを置く時に処理されるパラメータ
   4.587 +を指定する。
   4.588 +例:
   4.589 +\begin{list}%
   4.590 + {$\diamond$}
   4.591 + {\addtolength{\leftmargin}{4em}}
   4.592 + \item 第1引数には\verb|\item| にオプション引数をつけなかった時にふる、
   4.593 +       デフォルトのラベルを与える。
   4.594 + \item 第2引数には各itemを置く時に処理されるパラメータを与える。
   4.595 + \item[*] のようにオプション引数をつけるとそれがラベルとなる。
   4.596 +\end{list}
   4.597 +
   4.598 +  list環境の体裁を制御する変数には以下のものがある(括弧内は既定値)。
   4.599 +水平方向:
   4.600 +<refer list環境の体裁を制御する変数>
   4.601 +
   4.602 +list環境の体裁を制御する変数
   4.603 +\labelwidth	itemのラベルの幅
   4.604 +\labelsep	ラベルの右端と最初のアイテムのテキストとの間隔
   4.605 +\leftmargin	list環境内での左マージン
   4.606 +\rightmargin	同右マージン (0pt)
   4.607 +\itemindent	itemの直前に加えられるインデント幅 (0pt)
   4.608 +\linewidth	一行の幅
   4.609 +\listparindent	各パラグラフの先頭のインデント(ただし\itemの付いている先
   4.610 +		頭のパラグラフを除く)(0pt)
   4.611 +
   4.612 +垂直方向:
   4.613 +\topsep		list環境に入る前のパラグラフと最初のitemとの間隔
   4.614 +\partopsep	list環境で新しいパラグラフをはじめる時に\topsepに加えら
   4.615 +		れる付加的な間隔
   4.616 +\itemsep	連続するitemどうしの間隔
   4.617 +\parsep		一つのitem内でのパラグラフどうしの間隔
   4.618 +
   4.619 +
   4.620 +itemize
   4.621 +\begin{itemize} \item アイテム1 ... \item アイテムn \end{itemize}
   4.622 +項目を列挙するための環境。
   4.623 +最大4つまでネストできる。
   4.624 +各レベルのitemの頭につく記号は、\labelitemi, \labelitemii,
   4.625 +\labelitemiii, \labelitemiv で制御される。
   4.626 +
   4.627 +itemize環境の体裁を制御する変数には以下のものがある。
   4.628 +<refer list環境の体裁を制御する変数>
   4.629 +
   4.630 +
   4.631 +enumerate
   4.632 +\begin{enumerate} \item アイテム1 ... \item アイテムn \end{enumerate}
   4.633 +項目を番号つきで列挙するための環境。
   4.634 +最大4つまでネストできる。
   4.635 +各レベルのitemの頭につく番号は、enumi, enumii, enumiii, enumiv
   4.636 +が保持していて、各itemのラベルは、\labelenumi, ..., \labelenumiv
   4.637 +で生成される。また、\p@enumN\theenumN は \ref値を設定する。
   4.638 +(Nはレベルの深さ。\ref値については\refの説明を参照せよ)
   4.639 +たとえば
   4.640 +\def\theenumii{\alph{enumii}}
   4.641 +\def\p@enumii{\theenumi\theenumii}
   4.642 +\def\labelenumii{(\theenumii)}
   4.643 +とすると \ref値が 3a などのように設定される。
   4.644 +
   4.645 +enumerate環境の体裁を制御する変数には以下のものがある。
   4.646 +<refer list環境の体裁を制御する変数>
   4.647 +
   4.648 +item
   4.649 +\item			\item[LABEL]
   4.650 +itemize, enumerate, description 環境などで項目を開始する。
   4.651 +[LABEL]を指定するとラベルとしてLABELを出力する。
   4.652 +
   4.653 +description
   4.654 +\begin{description} \item[見出し単語] 説明 ... \end{description}
   4.655 +[見出し単語]を見出しとする
   4.656 +
   4.657 +subitem
   4.658 +\subitem 項目
   4.659 +サブアイテムを定義。
   4.660 +
   4.661 +subsubitem
   4.662 +\subsubitem 項目
   4.663 +サブサブアイテムを定義。
   4.664 +
   4.665 +makebox
   4.666 +\makebox[WID][POS]{オブジェクト}	\makebox(X,Y)[POS]{オブジェクト}
   4.667 +第1の書式では、オブジェクトをWIDで指定した幅として、\hbox 内の
   4.668 +POSで指定した場所に配置する。POSにlを指定すると左寄せ、rを指定すると右寄せ、
   4.669 +何も指定しないとセンタリングされる。
   4.670 +第2の書式では、picuture環境で大きさ(X,Y)の(\unitlengthを基準とする)
   4.671 +\hbox にオブジェクトを配置する。配置位置POSは第1の書式と同様。
   4.672 +
   4.673 +mbox
   4.674 +\mbox{オブジェクト}
   4.675 +\makebox{オブジェクト}と同じ。
   4.676 +
   4.677 +newsavebox
   4.678 +\newsavebox{\CMD}
   4.679 +新規のボックス保存用コマンドを定義する。\CMDは \savebox コマンドで
   4.680 +ボックスを保存するために使う。\newsaveboxで宣言したコマンド名は
   4.681 +常にグローバルとなる。
   4.682 +
   4.683 +savebox
   4.684 +\savebox{\CMD}{テキスト}
   4.685 +ボックスを組む内容である「テキスト」の結果を\CMDに保存する。
   4.686 +「テキスト」は \makebox への引数と全く同じであるが、「テキスト」を
   4.687 +処理した結果はその場に表示はしない。\usebox{\CMD}により処理したボックス
   4.688 +が置かれる。
   4.689 +
   4.690 +sbox
   4.691 +\sbox{\CMD}{テキスト}
   4.692 +\saveboxと同じ。sboxはrobust, saveboxはfragile
   4.693 +
   4.694 +framebox
   4.695 +\framebox{オブジェクト}
   4.696 +「オブジェクト」に枠をつけて\makeboxと同様の処理をする。
   4.697 +枠の線の太さは \framerule、オブジェクトとの間隔は \framesep で決まる。た
   4.698 +だしpicture環境で \framebox(X,Y){オブジェクト}とした場合は、picture環境
   4.699 +用の線の太さに従い、外枠とオブジェクトとの間隔は空けられない。
   4.700 +
   4.701 +fbox
   4.702 +\fbox{オブジェクト}
   4.703 +\framebox{オブジェクト}と同じ。
   4.704 +\fboxはrobust, \frameboxはfragile
   4.705 +
   4.706 +parbox
   4.707 +\parbox[POS]{WIDTH}{TEXT}
   4.708 +TEXTをWIDThの幅で組んでボックスを作成する。ボックスの位置はPOSによって
   4.709 +c : センタリング(デフォルト)
   4.710 +b : ボックスの一番下の線が現テキストのラインに合う
   4.711 +t : ボックスの一番上の線が現テキストのラインに合う
   4.712 +のように決められる。\parboxではパラメータが以下のようにリセットされる。
   4.713 +
   4.714 +\parskip          = 0pt
   4.715 +\linewidth        = \hsize
   4.716 +\@totalleftmargin = 0pt
   4.717 +\leftskip         = 0pt
   4.718 +\rightskip        = 0pt
   4.719 +\@rightskip       = 0pt
   4.720 +\parfillskip      = 0pt plus 1fil
   4.721 +\lineskip         = \normallineskip
   4.722 +\baselineskip     = \normalbaselineskip
   4.723 +
   4.724 +minipage
   4.725 +\begin{minipage}[pos]{WIDTH}  TEXT   \end{minipage}
   4.726 +\parbox とほぼ同様WIDTHの幅のTEXTをボックスとして組む。ボックスの位置は
   4.727 +POSによって
   4.728 +c : センタリング(デフォルト)
   4.729 +b : ボックスの一番下の線が現テキストのラインに合う
   4.730 +t : ボックスの一番上の線が現テキストのラインに合う
   4.731 +のように決められる。
   4.732 +parboxと違い、TEXTは通常のパラグラフとして組まれる。
   4.733 +
   4.734 +rule
   4.735 +\rule[RAISED]{WIDTH}{HEIGHT}
   4.736 +幅 WIDTH x 高さ HEIGHT の罫線を作る。RAISEDが指定された場合、その分だけ
   4.737 +上に上げられる。
   4.738 +
   4.739 +underline
   4.740 +\underline{TEXT}
   4.741 +TEXTに下線をつけて表示。
   4.742 +
   4.743 +raisebox
   4.744 +\raisebox{DISTANCE}[HEIGHT][DEPTH]{BOX}
   4.745 +BOXをDISTANCEだけ上げて組む。
   4.746 +HEIGHT, DEPTH を指定すると、TeXから見たBOXの「高さ」と「深さ」
   4.747 +(註:これらの用語についてはTeXBookなどを参照のこと)
   4.748 +を HEIGHT, DEPTH に指定する。
   4.749 +
   4.750 +tabbing
   4.751 +\begin{tabbing} \= text1.1 \= text1.2 \\ \> text2.1 \> text2.2 \end{tabbing}
   4.752 +桁揃えを行う環境を作る(入れ子不可)。例えば、
   4.753 +\begin{tabbing}
   4.754 + \= 項目1 \hspace*{2em} \= 項目2 \hspace*{3em}	\= 項目3 \\
   4.755 + \> いろは		\> にほへ		\> とちり \+ \\
   4.756 + 			\> ぬるを		\> わかよ \\
   4.757 +			\> たれそ \- \\
   4.758 + \> つねな		\> らむう		\> ゐのお
   4.759 +\end{tabbing}
   4.760 +上のtabbing環境は以下のように3つのタブ位置で組まれる。
   4.761 +  (1番目)   (2番目)     (3番目)
   4.762 +   いろは    にほへ      とちり
   4.763 +             ぬるを      をかよ
   4.764 +             たれそ
   4.765 +   つねな    らむう      ゐのお
   4.766 +        \2em/      \3em/
   4.767 +tabbing環境におけるタブ位置操作コマンドは以下の通り(nは1から):
   4.768 +\=	n番目のタブ位置を現在位置に設定しタブカウンタ(n)を1進める
   4.769 +\\	改行してタブカウンタをリセットする(n=1)
   4.770 +\>	位置をn番目のタブ位置に設定し、カウンタを1進める
   4.771 +\+	次の行のタブカウンタの初期値に1加える \+ \\ とすると次の行の最初
   4.772 +	の \> は2番目のタブ位置を示す. \+ を複数書くとその数だけタブカウ
   4.773 +	ンタの初期値が増える
   4.774 +\-	\+とは逆に、次の行のタブカウンタの初期値から1引く
   4.775 +\<	一つ前のタブカウンタに戻ってそのタブ位置をセット. 行頭のみ
   4.776 +\'	\'以降を通常のタブ位置より \tabbingsep 分だけ右寄せして出力
   4.777 +\`	\`以降のテキストをすべて右寄せして出力
   4.778 +\pushtabs それまで用いていたタブストップ位置を全てpush
   4.779 +\poptabs  それまで用いていたタブストップ位置を全てpop. \pushtabs と 
   4.780 +	\poptabs は必ず対になっていなければならない. 入れ子可
   4.781 +\aX	Xは = か ' か `   tabbing環境でない通常のアクセントは
   4.782 +	\a= \a' \a` で表わす
   4.783 +\kill	現在行のテキストは出力せずタブ設定だけ解釈する
   4.784 +
   4.785 +array
   4.786 +\begin{array}{PREAMBLE} C1 & C2 & .. & Cn \\ D1 ... \end{array}
   4.787 +Make a mathematical array.  Useful to make matrix.
   4.788 +See the help of `tabular' for detailed description.
   4.789 +
   4.790 +tabular
   4.791 +\begin{tabular}[OPT]{PREAMBLE} C1 & C2 & .. & Cn \\ D1 ... \end{tabular}
   4.792 +Make tabular.
   4.793 +[[OPT]]
   4.794 +[t]		Align the top of tabular to the line.
   4.795 +[b]		Align the bottom of tabular to the line.
   4.796 +[[PREAMBLE]]
   4.797 +  l,r,c  : indicate where entry is to be placed.
   4.798 +  |      : for vertical rule
   4.799 +  @{EXP} : inserts the text EXP in every column.  \arraycolsep or \tabcolsep
   4.800 +           spacing is suppressed.
   4.801 +  *{N}{PRE} : equivalent to writing N copies of PRE in the preamble.  PRE
   4.802 +              may contain *{N'}{EXP'} expressions.
   4.803 +  p{LEN} : makes entry in parbox of width LEN.
   4.804 +
   4.805 +[[Usable commands in array, tabular environment]]
   4.806 +\multicolumn
   4.807 +<refer multicolumn>
   4.808 +\vline
   4.809 +<refer vline>
   4.810 +\hline
   4.811 +<refer hline>
   4.812 +\cline{i-j}
   4.813 +<refer cline>
   4.814 +\extracolsep{W}
   4.815 +<refer extracolsep>
   4.816 +
   4.817 +
   4.818 +See below as sample.
   4.819 +
   4.820 +\LaTeX Expression				Printed image
   4.821 +\begin{array}{ccr}
   4.822 + x+y+z	& a_1	&  1 \\				x+y+z  a1    1
   4.823 + x+z	& a_2	&  21 \\			 x+z   a2   21
   4.824 + y	& a_3	&  321				  y    a3  321
   4.825 +\end{array}
   4.826 +
   4.827 +\[ \left(
   4.828 + \begin{array}{cccc}
   4.829 +  a_{11}  & a_{12}  & \dots & a_{1n} \\		/ a11 a12 ... a1n \
   4.830 +  a_{21}  & a_{22}  & \dots & a_{2n} \\		| a21 a22 ... a2n |
   4.831 +  \vdots  & \vdots  & \ddots& \vdots \\		|  :   :  \.   :  |
   4.832 +  a_{n1}  & a_{n2}  & \dots & a_{nn}		\ an1 an2 ..: ann /
   4.833 + \end{array} 
   4.834 +\right)\]
   4.835 +
   4.836 +\right(, \left) or \right{, left} or \right[, \left] or \right|, \left|
   4.837 +can enclose whole of array environment by parentheses, braces, brackets,
   4.838 +norm respectively.  The number of `\right's and `\left's should be the
   4.839 +same, but the type of parentheses don't have to match like
   4.840 +\right( \left].  `\right.' produces the invisible parenthesis.
   4.841 +
   4.842 +\[ Ans. \cdots \left\{					 /
   4.843 +	  \begin{array}{ccc}				 |  x = 5
   4.844 +	   x & = & 5 \\				Ans. ...<
   4.845 +   	   y & = & 3					 |  y = 3
   4.846 +	  \end{array} \right. \]			 \
   4.847 +
   4.848 +Here are the style parameters for the tabular environment.
   4.849 +\arraycolsep    : half the width separating columns in an array environment
   4.850 +\tabcolsep      : half the width separating columns in a tabular environment
   4.851 +\arrayrulewidth : width of rules
   4.852 +\doublerulesep  : space between adjacent rules in array or tabular
   4.853 +\arraystretch   : line spacing in array and tabular environments is done by
   4.854 +                  placing a strut in every row of height and depth 
   4.855 +                  \arraystretch times the height and depth of the strut
   4.856 +                  produced by an ordinary \strut commmand.
   4.857 +
   4.858 +Tabular environment cannot spread across pages.  `supertabular.sty'
   4.859 +allow this.
   4.860 +
   4.861 +tabular*
   4.862 +\begin{tabular*}{幅}{プリアンブル} ... \end{tabular*}
   4.863 +Make tabular environment with specifying its width.
   4.864 +To fill this width, use \extracolsep{} of preamble as below:
   4.865 +\begin{tabular*}{10em}[b]{|c@{\extracolsep{\fill}}|c|c|}
   4.866 + \hline
   4.867 + a & b & c \\ \hline
   4.868 + 1 & 2 & 3
   4.869 +\end{tabular*}
   4.870 +See also tabular.
   4.871 +
   4.872 +multicolumn
   4.873 +\multicolumn{N}{FORMAT}{ITEM}
   4.874 +In tabular environment,
   4.875 +replaces the next N column items by
   4.876 +ITEM, formatted according to FORMAT.  FORMAT should contain at most
   4.877 +one l,r or c.  If it contains none, then ITEM is ignored.
   4.878 +
   4.879 +vline
   4.880 +\vline
   4.881 +In tabular environment,
   4.882 +draws a vertical line the height of the current row.  May
   4.883 +appear in an array element entry.
   4.884 +
   4.885 +
   4.886 +hline
   4.887 +\hline
   4.888 +In tabular environment draws a horizontal line between rows.  Must
   4.889 +appear either before the first entry (to appear above the first row) or
   4.890 +right after a \\ command.  If followed by another \hline, then adds a
   4.891 +\vskip of \doublerulesep.
   4.892 +
   4.893 +cline
   4.894 +\cline{i-j}
   4.895 +In tabular environment,
   4.896 +draws horizontal lines between rows covering columns
   4.897 +i through j, inclusive.  Multiple commands may follow
   4.898 +one another to provide lines covering several disjoint
   4.899 +columns
   4.900 +
   4.901 +extracolsep
   4.902 +\extracolsep{W}
   4.903 +for use inside an @ in the preamble.  Causes a WIDTH
   4.904 +space to be added between columns for the rest of the 
   4.905 +columns.  This is in addition to the ordinary intercolumn 
   4.906 +space.
   4.907 +
   4.908 +picture
   4.909 +\begin{picture}(WIDTH,HEIGHT)(X,Y) ..contents.. \end{picture}
   4.910 +The picture  environment  allows you to create  just about any kind of
   4.911 +picture you want containing text, lines, arrows and circles.  You tell
   4.912 +LaTeX  where  to  put  things  in  the  picture  by  specifying  their
   4.913 +coordinates.   A coordinate  is a number that may have a decimal point
   4.914 +and a minus  sign  - a number  like  5, 2.3 or -3.1416.   A coordinate
   4.915 +specifies a length in multiples of the unit length \unitlength,  so if
   4.916 +\unitlength  has been set to 1cm, then the coordinate 2.54 specifies a
   4.917 +length of 2.54 centimeters.   You can change  the value of \unitlength
   4.918 +anywhere  you want, using the \setlength  command,  but strange things
   4.919 +will happen if you try changing it inside the picture environment.
   4.920 +
   4.921 +A position is a pair of coordinates,  such as (2.4,-5), specifying the
   4.922 +point  with x-coordinate  2.4 and y-coordinate  -5.   Coordinates  are
   4.923 +specified  in the  usual  way  with  respect  to an origin,  which  is
   4.924 +normally  at the lower-left  corner of the picture.   Note that when a
   4.925 +position  appears as an argument,  it is not enclosed  in braces;  the
   4.926 +parentheses serve to delimit the argument.
   4.927 +
   4.928 +The  picture  environment  has  one  mandatory  argument,  which  is a
   4.929 +position.   It specifies  the size  of the picture.   The  environment
   4.930 +produces  a rectangular  box with width and height determined  by this
   4.931 +argument's x- and y-coordinates.
   4.932 +
   4.933 +The  picture  environment  also  has  an optional  position  argument,
   4.934 +following  the size argument,  that  can change  the origin.   (Unlike
   4.935 +ordinary optional arguments,  this argument is not contained in square
   4.936 +brackets.) The optional argument gives the coordinates of the point at
   4.937 +the lower-left corner of the picture (thereby determining the origin). 
   4.938 +For example, if \unitlength has been set to 1mm, the command
   4.939 +
   4.940 +\begin{picture}(100,200)(10,20)
   4.941 +
   4.942 +produces   a  picture   of  width  100  millimeters   and  height  200
   4.943 +millimeters,  whose lower-left  corner is the point (10,20)  and whose
   4.944 +upper-right  corner is therefore the point (110,220).   When you first
   4.945 +draw a picture,  you will  omit  the optional  argument,  leaving  the
   4.946 +origin  at the lower-left  corner.   If you then want  to modify  your
   4.947 +picture by shifting everything, you just add the appropriate  optional
   4.948 +argument.
   4.949 +
   4.950 +The environment's  mandatory  argument determines  the nominal size of
   4.951 +the picture.   This need  bear  no relation  to how large  the picture
   4.952 +really  is; LaTeX will happily  allow  you to put things  outside  the
   4.953 +picture, or even off the page.  The picture's  nominal size is used by
   4.954 +TeX in determining how much room to leave for it.
   4.955 +
   4.956 +Everything that appears in a picture is drawn by the \put command. The
   4.957 +command
   4.958 +
   4.959 +\put (11.3,-.3){...}
   4.960 +
   4.961 +puts the object specified  by "..." in the picture, with its reference
   4.962 +point at coordinates  (11.3,-.3).   The reference  points  for various
   4.963 +objects will be described below.
   4.964 +
   4.965 +The \put command creates an LR box.  You can put anything  in the text
   4.966 +argument  of the \put command  that you'd put into the argument  of an
   4.967 +\mbox and related  commands.   When you do this,  the reference  point
   4.968 +will be the lower left corner of the box.
   4.969 +
   4.970 +Picture environment is obsolete I thinks, so show only commands.
   4.971 +
   4.972 +[[COMMANDS]]
   4.973 +\put(X,Y){OBJECT}
   4.974 +\multiput(X,Y)(dX,dY){REPEAT}{OBJECT}
   4.975 +[[OBJECTS]]
   4.976 +\makebox(X,Y)[POS]{TEXT}
   4.977 +\framebox(X,Y)[POS]{TEXT}
   4.978 +\dashbox(X,Y)[POS]{TEXT}
   4.979 +(POS = l, r, b, t)
   4.980 +\line(dX,dY){HorizontalLength}
   4.981 +\vector(dX,dY){HorizontalLength}		(arrow)
   4.982 +(dX,dY = +-1, +-2, ..., +-6)
   4.983 +\shortstack[POS]{FIRST\\SECOND\\THIRD...}
   4.984 +\circle{DIAMETER}
   4.985 +\circle*{DIAMETER}				(Filled circle)
   4.986 +(Maximum diameters are 40pt, 15pt)
   4.987 +\oval(Dia-X,DiaY)[POS]				(Oval POS = l, r, t, b)
   4.988 +\frame{OBJECT}
   4.989 +\thinlines, \thicklines				(choose line thickness)
   4.990 +\linethickness{THICKNESS}
   4.991 +
   4.992 +newtheorem
   4.993 +\newtheorem{NAME}{TEXT}[COUNTER]	\newtheorem{NAME}[OLDNAME]{TEXT} 
   4.994 +This defines the environment NAME to be just as one would expect a 
   4.995 +theorem environment to be, except that it prints ``TEXT'' instead of 
   4.996 +``Theorem''.  
   4.997 +
   4.998 +If OLDNAME is given, then environments NAME and OLDNAME use the same 
   4.999 +counter, so using a NAME environment advances the number of the next 
  4.1000 +NAME environment, and vice-versa.
  4.1001 +
  4.1002 +If COUNTER is given, then environment NAME is numbered within COUNTER.
  4.1003 +E.g., if COUNTER = subsection, then the first NAME in subsection 7.2
  4.1004 +is numbered TEXT 7.2.1.
  4.1005 +
  4.1006 +The way NAME environments are numbered can be changed by redefining
  4.1007 +\theNAME.
  4.1008 +
  4.1009 +title
  4.1010 +\title{TITLE}
  4.1011 +Define the title of the document.
  4.1012 +
  4.1013 +author
  4.1014 +\author{AUTHOR}
  4.1015 +Declare the author of the document.
  4.1016 +
  4.1017 +date
  4.1018 +\date{DATE}
  4.1019 +Define the date of document which is used by \maketitle.
  4.1020 +Omitting DATE produces current date.
  4.1021 +
  4.1022 +thanks
  4.1023 +\thanks{FOOTNOTE}
  4.1024 +Output a footnote in title page.
  4.1025 +
  4.1026 +maketitle
  4.1027 +\maketitle
  4.1028 +Output a title.  Should be written in document environment.
  4.1029 +Here are the constituents of title page.
  4.1030 +\title{TITLE}
  4.1031 +\author{AUTHOR}
  4.1032 +\date{DATE}		(If DATE omitted, output the date of typesetting)
  4.1033 +\thanks{NOTE}		(Output a thanks message or the post of the author)
  4.1034 +
  4.1035 +part
  4.1036 +\part{TITLE}
  4.1037 +Start a new part whose title is TITLE.
  4.1038 +<refer chapter>
  4.1039 +
  4.1040 +chapter
  4.1041 +\chapter{TITLE}
  4.1042 +Start a chapter whose title is TITLE.
  4.1043 +Sectioning commands:
  4.1044 +\part			Part ?
  4.1045 +\chapter		Chapter ?	(not available in `article.sty')
  4.1046 +\section		?
  4.1047 +\subsection		?.?
  4.1048 +\subsubsection		?.?.?
  4.1049 +\paragraph		***
  4.1050 +\subparagraph		===
  4.1051 +
  4.1052 +section
  4.1053 +\section{TITLE}
  4.1054 +Start a section whose title is TITLE.
  4.1055 +<refer chapter>
  4.1056 +
  4.1057 +subsection
  4.1058 +\subsection{TITLE}
  4.1059 +Start a subsection whose title is TITLE.
  4.1060 +<refer chapter>
  4.1061 +
  4.1062 +subsubsection
  4.1063 +\subsubsection{TITLE}
  4.1064 +Start a paragraph whose title is TITLE.
  4.1065 +<refer chapter>
  4.1066 +
  4.1067 +paragraph
  4.1068 +\paragraph{TITLE}
  4.1069 +Start a paragraph whose title is TITLE.
  4.1070 +<refer chapter
  4.1071 +
  4.1072 +subparagraph
  4.1073 +\subparagraph{TITLE}
  4.1074 +Start a subparagraph whose title is TITLE.
  4.1075 +<refer chapter>
  4.1076 +
  4.1077 +appendix
  4.1078 +\appendix
  4.1079 +Declare the beginning of appendix.
  4.1080 +Change the numbering fashion to appendix oriented.
  4.1081 +
  4.1082 +contentsline
  4.1083 +\contentsline{TYPE}{ENTRY}{PAGE}
  4.1084 +\contentsline{subsection}{\makebox{30pt}[r]{1.4.3} Gnats and Gnus}{22}
  4.1085 +Macro to produce a TYPE entry in a table of contents, etc.
  4.1086 +It will appear in the .TOC or other file.  For example,
  4.1087 +The entry for subsection 1.4.3 in the table of contents might
  4.1088 +be produced by:
  4.1089 +\contentsline{subsection}{\makebox{30pt}[r]{1.4.3} Gnats and Gnus}{22}
  4.1090 +The \protect command causes command sequences to be written
  4.1091 +without expanding them.
  4.1092 +
  4.1093 +addcontentsline
  4.1094 +\addcontentsline{TABLE}{TYPE}{ENTRY}
  4.1095 +User command for adding his own entry to a table of contents, etc.
  4.1096 +It adds the entry
  4.1097 +   \contentsline{TYPE}{ENTRY}{page}
  4.1098 +to the .TABLE file.
  4.1099 +
  4.1100 +addtocontents
  4.1101 +\addtocontents{TABLE}{TEXT}
  4.1102 +Adds TEXT to the .TABLE file, with no page number.
  4.1103 +
  4.1104 +index
  4.1105 +\index{INDEX}
  4.1106 +Create an entry of index.
  4.1107 +
  4.1108 +
  4.1109 +glossary
  4.1110 +\glossary{STRING}
  4.1111 +Create an entry of glossary.
  4.1112 +
  4.1113 +makeindex
  4.1114 +\makeindex
  4.1115 +Writes \indexentry to .idx file.
  4.1116 +Should be in preamble.
  4.1117 +
  4.1118 +makeglossary
  4.1119 +\makeglossary
  4.1120 +Writes \glossaryentry to .glo file.
  4.1121 +Should be in preamble.
  4.1122 +
  4.1123 +bibliography
  4.1124 +\bibliography{FILE1,FILE2, ... ,FILEn}
  4.1125 +Specifies the bibdata files.
  4.1126 +
  4.1127 +bibliographystyle
  4.1128 +\bibliographystyle{STYLE}
  4.1129 +Style of numbering of bibliographies.
  4.1130 +plain	nomal
  4.1131 +unsrt	without sortingg
  4.1132 +alpha	gives tag like "Foo94"
  4.1133 +abbrv	omit the first name of author, publishing month, book title
  4.1134 +
  4.1135 +thebibliography
  4.1136 +\begin{thebibliography} \bibitem{ITEM},... \end{thebibliography}
  4.1137 +The thebibliography environment is a list environment.  To save the
  4.1138 +use of an extra counter, it should use  enumiv  as the item counter.
  4.1139 +Instead of using \item, items in the bibliography are produced by the 
  4.1140 +\bibitem command.
  4.1141 +---
  4.1142 +<refer bibitem>
  4.1143 +
  4.1144 +bibitem
  4.1145 +\bibitem{NAME}			\bibitem[LABEL]{NAME}
  4.1146 +Produces a numbered (as [1], [2],...) entry cited as NAME.
  4.1147 +Second form produces an entry labeled by LABEL and cited as NAME.
  4.1148 +
  4.1149 +thefootnote
  4.1150 +In usual LaTeX style, produces the footnote number.
  4.1151 +If footnotes are to be numbered within pages, then the 
  4.1152 +document style file must include an \@addtoreset command 
  4.1153 +to cause the footnote counter to be reset when the page 
  4.1154 +counter is stepped.  This is not a good idea, though,
  4.1155 +because the counter will not always be reset in time
  4.1156 +to ensure that the first footnote on a page is footnote
  4.1157 +number one.  
  4.1158 +
  4.1159 +footnote
  4.1160 +\footnote{NOTE}   or   \footnote[NUM]{NOTE}
  4.1161 +User command to insert a footnote.
  4.1162 +In second form, insert a footnote numbered
  4.1163 +NUM, where NUM is a number -- 1, 2,
  4.1164 +etc.  For example, if footnotes are numbered
  4.1165 +*, **, etc. within pages, then \footnote[2]{...}
  4.1166 +produces footnote '**'.  This command does not
  4.1167 +step the footnote counter.
  4.1168 +(fragile)
  4.1169 +
  4.1170 +footnotemark
  4.1171 +\footnotemark[NUM]
  4.1172 +Command to produce just the footnote mark in
  4.1173 +the text, but no footnote.  With no argument,
  4.1174 +it steps the footnote counter before generating
  4.1175 +the mark.
  4.1176 +
  4.1177 +footnotetext
  4.1178 +\footnotetext[NUM]{TEXT}
  4.1179 +Command to produce the footnote but no  mark.
  4.1180 +\footnote is equivalent to \footnotemark \footnotetext .
  4.1181 +
  4.1182 +footnotesize
  4.1183 +{\footnotesize ...}
  4.1184 +Size-changing command for footnotes.
  4.1185 +
  4.1186 +footnotesep
  4.1187 +\footnotesep
  4.1188 +The height of a strut placed at the beginning of every footnote.
  4.1189 +
  4.1190 +footnoterule
  4.1191 +\footnoterule
  4.1192 +Macro to draw the rule separating footnotes from text.
  4.1193 +It is executed right after a \vspace of \skip\footins.
  4.1194 +It should take zero vertical space--i.e., it should to
  4.1195 +a negative skip to compensate for any positive space
  4.1196 +it occupies.  (See PLAIN.TEX.)
  4.1197 +
  4.1198 +documentstyle
  4.1199 +\documentstyle[OPTION1,OPTION2, ... ,OPTIONn]{STYLE}
  4.1200 +The user starts his file with the command as above
  4.1201 +which saves the OPTION's and \input's the file STYLE.STY.
  4.1202 +
  4.1203 +verb
  4.1204 +\verb#CONTENTS#
  4.1205 +The command \verb produces in-line verbatim text, where the argument
  4.1206 +is delimited by any pair of characters.  E.g., \verb #...# takes
  4.1207 +'...' as its argument, and sets it verbatim in \tt font.
  4.1208 +
  4.1209 +The *-variants of these commands is the same, except that spaces
  4.1210 +print as the TeXbook's space character instead of as blank spaces.
  4.1211 +
  4.1212 +styleparameter
  4.1213 +まだ訳していないスタイルパラメータ。
  4.1214 +
  4.1215 +topfigrule
  4.1216 +\topfigrule
  4.1217 +Command to place rule (or whatever) between floats
  4.1218 +at top of page and text.  Executed in inner vertical
  4.1219 +mode right before the \textfloatsep skip separating
  4.1220 +the floats from the text.  Must occupy zero vertical
  4.1221 +space.  (See \footnoterule.)
  4.1222 +
  4.1223 +botfigrule
  4.1224 +\setlength{\botfigrule}{LENGTH}
  4.1225 +Same as \topfigrule, but put after the \textfloatsep
  4.1226 +skip separating text from the floats at bottom of page.
  4.1227 +
  4.1228 +intextsep
  4.1229 +\setlength{\intextsep}{LENGTH}
  4.1230 +Space left on top and bottom of an in-text float.
  4.1231 +
  4.1232 +newpage
  4.1233 +\newpage
  4.1234 +Advance to a new page.
  4.1235 +\clearpage 		Output the unfinished table of images, if any,
  4.1236 +			and clear page.
  4.1237 +\cleardoublepage 	Same as \clearpage except that when spread style
  4.1238 +			(such as book), start a new page with odd page.
  4.1239 +\newpage		Finish current column when twocolumn.
  4.1240 +
  4.1241 +clearpage
  4.1242 +\clearpage 
  4.1243 +<refer newpage>
  4.1244 +
  4.1245 +cleardoublepage
  4.1246 +\cleardoublepage 
  4.1247 +<refer newpage>
  4.1248 +
  4.1249 +length
  4.1250 +
  4.1251 +Here are the available units of length in TeX.
  4.1252 +cm		centi meter
  4.1253 +em		width of `M'
  4.1254 +ex		height of `x'
  4.1255 +in		inch (=2.54cm)
  4.1256 +mm		mi.li meter
  4.1257 +pc		pica(=12pt)
  4.1258 +pt		point (72.27pt=1 inch)
  4.1259 +\fill		Freely extendable length whose normal length is 0
  4.1260 +\stretch{X}	X-times as long as \fill
  4.1261 +
  4.1262 +stretch
  4.1263 +\stretch{X}
  4.1264 +<refer length>
  4.1265 +
  4.1266 +twocolumn
  4.1267 +\twocolumn[STRING]
  4.1268 +Clear page and start two-column typesetting.
  4.1269 +Optional argument [STRING] specifies the page-acrossing title.
  4.1270 +->onecolumn
  4.1271 +
  4.1272 +onecolumn
  4.1273 +\onecolumn
  4.1274 +Clear page and start one-column typesetting.
  4.1275 +->twocolumn
  4.1276 +
  4.1277 +topnewpage
  4.1278 +\topnewpage{BOX}
  4.1279 +Begin a new page and create the parbox-ed BOX whose width is \textwidth.
  4.1280 +This is useful to make a page-acrossing title in a twocolumn page.
  4.1281 +
  4.1282 +YaTeX
  4.1283 +(setq auto-mode-alist (cons '("\\.tex$" . yatex-mode) auto-mode-alist))
  4.1284 +おそらくあなたが今使っているこのモード。
  4.1285 +LaTeXを効率的に使うための多くの機能を盛り込んでいます。
  4.1286 +
  4.1287 +【発音について】
  4.1288 +yatex.elなどプログラムを指す時は「やてっく」、システムを指す時は「やちょ
  4.1289 +う」と読みます。
  4.1290 +
  4.1291 +【謝辞】
  4.1292 +以下の方々の御協力を頂きました。ここに感謝申し上げます。
  4.1293 +
  4.1294 +(順不同)
  4.1295 +峯恒憲さん(九州大)
  4.1296 +	Bibtex起動、typeset process の kill、エラー箇所の正しい判定
  4.1297 +	の要望その他を頂きました。
  4.1298 +
  4.1299 +森中秀明さん(アンリツ)
  4.1300 +	タイプセットバッファでの実行継続、lpq, bibtex起動、領域指定タイ
  4.1301 +	プセット後のプレビュー対象ファイルのデフォルト値の変更、
  4.1302 +	describe-mode、\verb の補完の要望、verbatim環境や\verbの中にある
  4.1303 +	\begin{}, \end{} を数えないようにする要望、などを頂きました。
  4.1304 +
  4.1305 +石坂裕毅さん(富士通)
  4.1306 +	YaTeX-get-error-file のバグレポートなどを頂きました。
  4.1307 +
  4.1308 +Bayardさん(asciinet)
  4.1309 +	min-outとの連係の不具合の報告を頂きました。
  4.1310 +
  4.1311 +Kけんさん(asciinet)
  4.1312 +	ms-dos固有の設定に関するバグレポートを頂きました。
  4.1313 +
  4.1314 +sa2cさん(asciinet)
  4.1315 +	Mule用のパッチを頂きました。
  4.1316 +
  4.1317 +桂川直己さん(筑波大)
  4.1318 +	数え切れないバグレポートと要望を頂きました。またVzへの移植版であ
  4.1319 +	る laitex(雷鳥) を作成されました。
  4.1320 +
  4.1321 +三平善郎さん(慶応大)
  4.1322 +	開き括弧の入力時の処理のモード分けのアイデアを頂きました。
  4.1323 +
  4.1324 +萩庭崇さん(慶応大)
  4.1325 +	begin型補完の内側に文字があった場合それらをインデントしてほしい
  4.1326 +	という要望を頂きました。
  4.1327 +
  4.1328 +田中健次郎さん(慶応大)
  4.1329 +	タイプセット時に未セーブ状態の関連ファイルをセーブして欲しいとい
  4.1330 +	う要望を頂きました。
  4.1331 +
  4.1332 +bauerさん(asciinet)
  4.1333 +	アクセント補完の要望とアクセント記号の規則の情報等を頂きました。
  4.1334 +
  4.1335 +佐々木たろうさん(asciinet)
  4.1336 +	数式環境の処理に関する多様なアイデア、ウィンドウ選択処理に関する
  4.1337 +	ユーザインタフェースの繊細な改善案などを頂きました。
  4.1338 +
  4.1339 +Deslarさん(asciinet)
  4.1340 +	byte-compile関係のバグ報告などを頂きました。
  4.1341 +
  4.1342 +tadfさん(asciinet)
  4.1343 +	Demacsでのプロセス起動時のインタフェースの不具合の報告などを頂き
  4.1344 +	ました。
  4.1345 +
  4.1346 +ほんまたけるさん(asciinet)
  4.1347 +	パラグラフ境界をLaTeX用に設定しなおす要望などを頂きました。
  4.1348 +
  4.1349 +TUSKさん(asciinet)
  4.1350 +	Texinfoドキュメント(初版)を作成して頂きました。
  4.1351 +
  4.1352 +横田和也さん(asciinet)
  4.1353 +	dviout起動時の工夫の案、ミニバッファで読み込むもののヒストリを分
  4.1354 +	けるアイデアのきっかけをいただき、ヘルプファイルの項目の提供をし
  4.1355 +	て頂きました。
  4.1356 +
  4.1357 +kanbai-anさん(asciinet)
  4.1358 +	日本語入力モード判定関数のバグを直すパッチなどを頂きました。
  4.1359 +
  4.1360 +
  4.1361 +yatex
  4.1362 +<refer YaTeX>
  4.1363 +
     5.1 --- a/help/YATEXHLP.jp	Fri Nov 25 08:26:13 1994 +0000
     5.2 +++ b/help/YATEXHLP.jp	Tue Dec 20 21:00:21 1994 +0000
     5.3 @@ -1023,15 +1023,40 @@
     5.4  
     5.5  index
     5.6  \index{INDEX}
     5.7 -まだ書いてない。
     5.8 +索引のエントリを定義する。
     5.9 +
    5.10 +--------------------------------------------------------------------
    5.11 +<refer 索引の作り方>
    5.12  
    5.13  glossary
    5.14  \glossary{STRING}
    5.15 -まだ書いてない。
    5.16 +用語集のエントリを定義する。
    5.17  
    5.18  makeindex
    5.19  \makeindex
    5.20  \indexentryで登録されている項目を .idx ファイルに書き込む。
    5.21 +プリアンブルで指定する。
    5.22 +
    5.23 +--------------------------------------------------------------------
    5.24 +<refer 索引の作り方>
    5.25 +
    5.26 +makeglossary
    5.27 +\makeglossary
    5.28 +\glossaryentryで登録されている項目を .glo ファイルに書き込む。
    5.29 +プリアンブルで指定する。
    5.30 +
    5.31 +索引の作り方
    5.32 +
    5.33 +(1)\documentstyleにmakeidxオプションを与え、プリアンブルに \makeindex
    5.34 +   を書き、索引を生成する場所に \printindex を書く。
    5.35 +(2)本文に \index{索引となる単語} を埋め込む。
    5.36 +(3)一度(または二度)タイプセットする。
    5.37 +(4).idxファイルができるのでそのファイルを makeindex にかける。
    5.38 +(5).indファイルができるのでもう一度タイプセットして出来上がり。
    5.39 +
    5.40 +** \indexの記法 **
    5.41 +日本語をそのまま \index{漢字} と入れたのではあいうえお順にソートされない。
    5.42 +そこで、読みを@で区切って \index{かんじ@漢字} のように入れる。
    5.43  
    5.44  bibliography
    5.45  \bibliography{FILE1,FILE2, ... ,FILEn}
    5.46 @@ -1106,9 +1131,14 @@
    5.47  %                     mode right before the \textfloatsep skip separating
    5.48  %                     the floats from the text.  Must occupy zero vertical
    5.49  %                     space.  (See \footnoterule.)
    5.50 -%   \botfigrule     : Same as \topfigrule, but put after the \textfloatsep
    5.51 -%                     skip separating text from the floats at bottom of page.
    5.52 -%   \intextsep      : Space left on top and bottom of an in-text float.
    5.53 +botfigrule
    5.54 +\setlength{\botfigrule}{長さ}
    5.55 +Same as \topfigrule, but put after the \textfloatsep
    5.56 +skip separating text from the floats at bottom of page.
    5.57 +
    5.58 +intextsep
    5.59 +\setlength{\intextsep}{長さ}
    5.60 +文書中フロートの上下に残された空白の長さ
    5.61  
    5.62  
    5.63  newpage
     6.1 Binary file yatex.el has changed
     7.1 --- a/yatex.new	Fri Nov 25 08:26:13 1994 +0000
     7.2 +++ b/yatex.new	Tue Dec 20 21:00:21 1994 +0000
     7.3 @@ -1,11 +1,32 @@
     7.4  	What's new in YaTeX
     7.5  	yatex.el 各バージョンの変更点について
     7.6  
     7.7 +1.55	{}の上で [prefix] k した時に直前のコマンドが maketitle 型辞書に
     7.8 +	属していれば {} のみ(フォント指定子があればそれも)を消すようにした。
     7.9 +	新単語入力時に、N)one を選ぶと、そのEmacsでのみ有効にするように
    7.10 +	し、補完テーブルも辞書ファイルも更新しない D)iscard を新設。
    7.11 +	?プロンプトを出しているタイプセッタをkillする時は x コマンドを送っ
    7.12 +	て終了させ .aux ファイルの破損を防ぐようにした。
    7.13 +	Emacs19でタイプセット時親ファイルを聞いた時にカレントバッファが
    7.14 +	親ファイルになってしまうのを回避した。
    7.15 +	親子ファイル間ジャンプで別 frame へのジャンプをサポート(Emacs19)。
    7.16 +	\include{child} 上で [prefix] g して child.tex に飛び child.tex
    7.17 +	に親ファイル指定(%#!jlatex parent)がない時はジャンプ元ファイルを
    7.18 +	親ファイルとみなすようにした。
    7.19 +	\input{} にフルパスが書いてある時も [prefix] g を可能にした。
    7.20 +	同時編集するファイルの名前の重複を許した。
    7.21 +	[prefix] i の \item fill の修正。
    7.22 +	エラージャンプで dired が起動する事があるバグを修正。
    7.23 +	Emacs-19でもミニバッファから読み込むものの種別毎にヒストリを分け
    7.24 +	て持つようにした(今までは Emacs18+gmhist のみ有効)。
    7.25 +	maketitle 型コマンド入力直後のスペースは入れないようにした。
    7.26 +	itemize 環境中のTABで \subitem のインデントの深さを変えた。
    7.27 +
    7.28  1.54	section 型コマンドの引数のデフォルトの入力には通常の文字列入力を
    7.29  	行うようにし、変数 user-article-table を廃止した。これにより
    7.30 +	~/.yatexrc に任意の elisp を入れておいても消えないようになった。
    7.31  	Emacs-19(Mule2) でのデフォルトのヘルプファイルの格納場所をetcディ
    7.32  	レクトリから、site-lisp ディレクトリに変更した(注意!!)。
    7.33 -	~/.yatexrc に任意の elisp を入れておいても消えないようになった。
    7.34  	documentstyle のアドイン関数を充実させ、スタイルオプションやスタ
    7.35  	イルの学習を行うようにした。
    7.36  	ユーザ辞書も新単語の入力と同時に更新するようにし、kill-emacs を
     8.1 --- a/yatex19.el	Fri Nov 25 08:26:13 1994 +0000
     8.2 +++ b/yatex19.el	Tue Dec 20 21:00:21 1994 +0000
     8.3 @@ -1,7 +1,7 @@
     8.4  ;;; -*- Emacs-Lisp -*-
     8.5  ;;; YaTeX facilities for Emacs 19
     8.6  ;;; (c )1994 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp]
     8.7 -;;; Last modified Mon Nov 21 21:52:16 1994 on figaro
     8.8 +;;; Last modified Mon Dec 19 02:55:36 1994 on VFR
     8.9  ;;; $Id$
    8.10  
    8.11  ;;; とりあえず hilit19 を使っている時に色が付くようにして
    8.12 @@ -205,7 +205,10 @@
    8.13  ;; Highlightening
    8.14  ;; ローカルなマクロを読み込んだ後 redraw すると
    8.15  ;; ローカルマクロを keyword として光らせる(keywordじゃまずいかな…)。
    8.16 -(defvar YaTeX-hilit-pattern-adjustment
    8.17 +(defvar YaTeX-hilit-patterns-alist nil
    8.18 +  "*Hiliting pattern alist for LaTeX text.
    8.19 +Default value is equal to latex-mode's one.")
    8.20 +(defvar YaTeX-hilit-pattern-adjustment-default
    8.21    (list
    8.22     ;;\def が define なんだから new* も define でしょう。
    8.23     '("\\\\\\(re\\)?new\\(environment\\|command\\){" "}" define)
    8.24 @@ -215,17 +218,26 @@
    8.25      (concat "\\\\\\(" YaTeX-sectioning-regexp "\\){") "}"
    8.26      'sectioning)
    8.27     ;;eqnarray などの数式環境が入ってないみたい…
    8.28 -   '("\\\\begin{\\(eqnarray\\*?\\)\\|\\(equation\\*?\\)}"
    8.29 -     "\\\\end{\\(eqnarray\\*?\\)\\|\\(equation\\*?\\)}"
    8.30 +   '("\\\\begin{\\(eqnarray\\*?\\|equation\\*?\\)}"
    8.31 +     "\\\\end{\\(eqnarray\\*?\\|equation\\*?\\)}"
    8.32       formula))
    8.33    "Adjustment for hilit19's LaTeX hilit pattern.")
    8.34 +(defvar YaTeX-hilit-pattern-adjustment-private nil
    8.35 +  "*Private variable, same purpose as YaTeX-hilit-pattern-adjustment-default.")
    8.36  (defvar YaTeX-hilit-sectioning-face
    8.37 -  '(yellow/dodgerblue yellow/cornflowerblue))
    8.38 +  '(yellow/dodgerblue yellow/cornflowerblue)
    8.39 +  "*Hilightening face for sectioning unit.  '(FaceForLight FaceForDark)")
    8.40  (defvar YaTeX-hilit-singlecmd-face
    8.41 -  '(slateblue2 aquamarine))
    8.42 +  '(slateblue2 aquamarine)
    8.43 +  "*Hilightening face for maketitle type.  '(FaceForLight FaceForDark)")
    8.44  (defun YaTeX-19-collect-macro ()
    8.45    (cond
    8.46     ((and (featurep 'hilit19) (fboundp 'hilit-translate))
    8.47 +    (or YaTeX-hilit-patterns-alist
    8.48 +	(let ((alist (cdr (assq 'latex-mode hilit-patterns-alist))))
    8.49 +	  (setcar (assoc "\\\\item\\(\\[[^]]*\\]\\)?" alist)
    8.50 +		  (concat YaTeX-item-regexp "\\b\\(\\[[^]]*\\]\\)?"))
    8.51 +	  (setq YaTeX-hilit-patterns-alist alist)))
    8.52      (let ((get-face
    8.53  	   (function
    8.54  	    (lambda (table)
    8.55 @@ -242,8 +254,9 @@
    8.56  	  (cons
    8.57  	   (cons 'yatex-mode
    8.58  		 (append
    8.59 -		  YaTeX-hilit-pattern-adjustment
    8.60 -		  (cdr (assq 'latex-mode hilit-patterns-alist))
    8.61 +		  YaTeX-hilit-pattern-adjustment-private
    8.62 +		  YaTeX-hilit-pattern-adjustment-default
    8.63 +		  YaTeX-hilit-patterns-alist
    8.64  		  (list
    8.65  		   (list
    8.66  		    (concat "\\\\\\("
    8.67 @@ -259,7 +272,7 @@
    8.68  			     (function (lambda (s) (regexp-quote (car s))))
    8.69  			     (append user-singlecmd-table tmp-singlecmd-table)
    8.70  			     "\\|")
    8.71 -			    "\\)")
    8.72 +			    "\\)\\b")
    8.73  		    0 'macro))))
    8.74  	   hilit-patterns-alist)))))
    8.75  (YaTeX-19-collect-macro)
     9.1 --- a/yatexadd.el	Fri Nov 25 08:26:13 1994 +0000
     9.2 +++ b/yatexadd.el	Tue Dec 20 21:00:21 1994 +0000
     9.3 @@ -1,8 +1,8 @@
     9.4  ;;; -*- Emacs-Lisp -*-
     9.5  ;;; YaTeX add-in functions.
     9.6 -;;; yatexadd.el rev.9
     9.7 +;;; yatexadd.el rev.11
     9.8  ;;; (c )1991-1994 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp]
     9.9 -;;; Last modified Sat Nov 12 07:03:15 1994 on VFR
    9.10 +;;; Last modified Mon Dec 19 03:07:01 1994 on landcruiser
    9.11  ;;; $Id$
    9.12  
    9.13  ;;;
    9.14 @@ -176,19 +176,47 @@
    9.15  	  (YaTeX:read-coordinates "Dimension"))
    9.16  )
    9.17  
    9.18 +(defvar YaTeX-minibuffer-quick-map nil)
    9.19 +(if YaTeX-minibuffer-quick-map nil
    9.20 +  (setq YaTeX-minibuffer-quick-map
    9.21 +	(copy-keymap minibuffer-local-completion-map))
    9.22 +  (let ((ch (1+ ? )))
    9.23 +    (while (< ch 127)
    9.24 +      (define-key YaTeX-minibuffer-quick-map (char-to-string ch)
    9.25 +	'YaTeX-minibuffer-quick-complete)
    9.26 +      (setq ch (1+ ch)))))
    9.27 +
    9.28 +(defvar YaTeX:left-right-delimiters
    9.29 +   '(("(" . ")") (")" . "(") ("[" . "]") ("]" . "[")
    9.30 +     ("\\{" . "\\}") ("\\}" . "\\{") ("|") ("\\|")
    9.31 +     ("\\lfloor" . "\\rfloor") ("\\lceil" . "\\rceil")
    9.32 +     ("\\langle" . "\\rangle") ("/") (".")
    9.33 +     ("\\rfloor" . "\\rfloor") ("\\rceil" . "\\lceil")
    9.34 +     ("\\rangle" . "\\langle") ("\\backslash")
    9.35 +     ("\\uparrow") ("\\downarrow") ("\\updownarrow") ("\\Updownarrow"))
    9.36 +   "TeX math delimiter, which can be completed after \\right or \\left.")
    9.37 +
    9.38 +(defvar YaTeX:left-right-default nil "Default string of YaTeX:right.")
    9.39 +
    9.40  (defun YaTeX:left ()
    9.41 -  (let (c)
    9.42 -    (while (not (string-match
    9.43 -		 (progn (message "Which parenthesis? One of [{(|)}]: ")
    9.44 -			(setq c (regexp-quote (char-to-string (read-char)))))
    9.45 -		 "[{(|)}]")))
    9.46 -    (setq single-command "right")
    9.47 -    (cond
    9.48 -     ((string-match c "[(|)]") c)
    9.49 -     (t (concat "\\" c))))
    9.50 -)
    9.51 +  (let ((minibuffer-completion-table YaTeX:left-right-delimiters)
    9.52 +	delimiter (leftp (string= single-command "left")))
    9.53 +    (setq delimiter
    9.54 +	  (read-from-minibuffer
    9.55 +	   (format "Delimiter%s: "
    9.56 +		   (if YaTeX:left-right-default
    9.57 +		       (format "(default=`%s')" YaTeX:left-right-default)
    9.58 +		     "(SPC for menu)"))
    9.59 +	   nil YaTeX-minibuffer-quick-map))
    9.60 +    (if (string= "" delimiter) (setq delimiter YaTeX:left-right-default))
    9.61 +    (setq single-command (if leftp "right" "left")
    9.62 +	  YaTeX:left-right-default
    9.63 +	  (or (cdr (assoc delimiter YaTeX:left-right-delimiters)) delimiter))
    9.64 +    delimiter))
    9.65 +
    9.66  (fset 'YaTeX:right 'YaTeX:left)
    9.67  
    9.68 +
    9.69  (defun YaTeX:read-coordinates (&optional mes varX varY)
    9.70    (concat
    9.71     "("
    9.72 @@ -487,7 +515,7 @@
    9.73        (if (> argc 0) (insert (format "[%d]" argc)))
    9.74        (if (and (stringp command)
    9.75  	       (string< "" command)
    9.76 -	       (y-or-n-p "Update user completion table?"))
    9.77 +	       (y-or-n-p "Update dictionary?"))
    9.78  	  (cond
    9.79  	   ((= argc 0)
    9.80  	    (YaTeX-update-table
    9.81 @@ -515,6 +543,8 @@
    9.82     "Page style: "
    9.83     '(("plain") ("empty") ("headings") ("myheadings") ("normal") nil))
    9.84  )
    9.85 +(fset 'YaTeX::thispagestyle 'YaTeX::pagestyle)
    9.86 +
    9.87  ;;
    9.88  ; completion for the arguments of \pagenumbering
    9.89  ;;
    9.90 @@ -570,6 +600,7 @@
    9.91    "*User definable alist of local style parameters.")
    9.92  
    9.93  (defvar YaTeX:length-history nil "Holds history of length.")
    9.94 +(put 'YaTeX:length-history 'no-default t)
    9.95  (defun YaTeX::setlength (&optional argp)
    9.96    "YaTeX add-in function for arguments of \\setlength."
    9.97    (cond
    9.98 @@ -583,8 +614,7 @@
    9.99       nil nil "\\")
   9.100      )
   9.101     ((equal 2 argp)
   9.102 -    (let ((minibuffer-history-symbol 'YaTeX:length-history))
   9.103 -      (read-string "Length: "))))
   9.104 +    (read-string-with-history "Length: " nil 'YaTeX:length-history)))
   9.105  )
   9.106  (fset 'YaTeX::addtolength 'YaTeX::setlength)
   9.107  
   9.108 @@ -670,7 +700,7 @@
   9.109  	(minibuffer-completion-table dt)
   9.110  	(opt (read-from-minibuffer
   9.111  	      "Style options ([opt1,opt2,...]): "
   9.112 -	      nil YaTeX-minibuffer-completion-map))
   9.113 +	      nil YaTeX-minibuffer-completion-map nil))
   9.114  	(substr opt) o)
   9.115      (if (string< "" opt)
   9.116  	(progn
   9.117 @@ -689,9 +719,10 @@
   9.118        "")))
   9.119  
   9.120  (defun YaTeX::documentstyle (&optional argp)
   9.121 -  "YaTeX add-in function for arguments of \\socumentstyle."
   9.122 +  "YaTeX add-in function for arguments of \\documentstyle."
   9.123    (cond
   9.124     ((equal argp 1)
   9.125 +    (setq env-name "document")
   9.126      (let ((sname
   9.127  	   (YaTeX-cplread-with-learning
   9.128  	    (format "Documentstyle (default %s): "
    10.1 --- a/yatexgen.el	Fri Nov 25 08:26:13 1994 +0000
    10.2 +++ b/yatexgen.el	Tue Dec 20 21:00:21 1994 +0000
    10.3 @@ -1,8 +1,8 @@
    10.4  ;;; -*- Emacs-Lisp -*-
    10.5  ;;; YaTeX add-in function generator.
    10.6 -;;; yatexgen.el rev.3
    10.7 +;;; yatexgen.el rev.4
    10.8  ;;; (c )1991-1994 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp]
    10.9 -;;; Last modified Thu Nov 17 03:54:56 1994 on VFR
   10.10 +;;; Last modified Sun Dec 11 05:38:35 1994 on VFR
   10.11  ;;; $Id$
   10.12  
   10.13  (require 'yatex)
   10.14 @@ -469,7 +469,7 @@
   10.15    (concat
   10.16     "(read-file-name \""
   10.17     (read-string (if nth (format "Prompt for argument#%d: " nth) "Prompt: "))
   10.18 -   ": \" nil nil t \"\")\n")
   10.19 +   ": \" "" nil t \"\")\n")
   10.20  )
   10.21  (defun YaTeX-generate-create-read-oneof (&optional nth readpos)
   10.22    (concat
    11.1 --- a/yatexlib.el	Fri Nov 25 08:26:13 1994 +0000
    11.2 +++ b/yatexlib.el	Tue Dec 20 21:00:21 1994 +0000
    11.3 @@ -2,7 +2,7 @@
    11.4  ;;; YaTeX library of general functions.
    11.5  ;;; yatexlib.el
    11.6  ;;; (c )1994 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp]
    11.7 -;;; Last modified Thu Nov 24 02:20:45 1994 on VFR
    11.8 +;;; Last modified Wed Dec 21 05:58:06 1994 on landcruiser
    11.9  ;;; $Id$
   11.10  
   11.11  ;;;###autoload
   11.12 @@ -47,15 +47,15 @@
   11.13  Optional second arg SETBUF t make use set-buffer instead of switch-to-buffer."
   11.14    (interactive "Fswitch to file: ")
   11.15    (let (buf)
   11.16 -    (if (setq buf (get-buffer (file-name-nondirectory file)))
   11.17 +    (if (setq buf (get-file-buffer file))
   11.18  	(progn
   11.19  	  (funcall (if setbuf 'set-buffer 'switch-to-buffer)
   11.20 -		   (file-name-nondirectory file))
   11.21 +		   (get-file-buffer file))
   11.22  	  buf)
   11.23        (if (file-exists-p file)
   11.24 -	  (funcall
   11.25 -	   (if setbuf 'find-file-noselect 'find-file)
   11.26 -	   file)
   11.27 +	  (or ;find-file returns nil but set current-buffer...
   11.28 +	   (funcall (if setbuf 'find-file-noselect 'find-file) file)
   11.29 +	   (current-buffer))
   11.30  	(message "%s was not found in this directory." file)
   11.31  	nil)))
   11.32  )
   11.33 @@ -64,8 +64,8 @@
   11.34  (defun YaTeX-switch-to-buffer-other-window (file)
   11.35    "Switch to buffer if buffer exists, find file if not."
   11.36    (interactive "Fswitch to file: ")
   11.37 -  (if (get-buffer (file-name-nondirectory file))
   11.38 -      (progn (switch-to-buffer-other-window file) t)
   11.39 +  (if (get-file-buffer file)
   11.40 +      (progn (switch-to-buffer-other-window (get-file-buffer file)) t)
   11.41      (if (file-exists-p file)
   11.42  	(progn (find-file-other-window file) t)
   11.43        (message "%s was not found in this directory." file)
   11.44 @@ -128,19 +128,7 @@
   11.45  	     (get-buffer-window buffer))
   11.46  	   (progn
   11.47  	     (if select
   11.48 -		 (cond
   11.49 -		  (YaTeX-emacs-19
   11.50 -		   (let ((frame (window-frame (get-buffer-window buffer t))))
   11.51 -		     (select-frame frame)
   11.52 -		     (focus-frame frame)
   11.53 -		     (set-mouse-position frame 0 0)
   11.54 -		     (raise-frame frame)
   11.55 -		     (select-window (get-buffer-window buffer))
   11.56 -		     (if (and (featurep 'windows)
   11.57 -			      (win:frame-window frame))
   11.58 -			 (win:adjust-window))))
   11.59 -		  (t
   11.60 -		   (select-window (get-buffer-window buffer)))))
   11.61 +		 (goto-buffer-window buffer))
   11.62  	     t))
   11.63        (let ((window (selected-window))
   11.64  	    (wlist (YaTeX-window-list)) win w (x 0))
   11.65 @@ -167,18 +155,7 @@
   11.66  	   ((and YaTeX-emacs-19 (get-buffer-window buffer t))
   11.67  	    nil)			;if found in other frame
   11.68  	   (YaTeX-default-pop-window-height
   11.69 -	    (split-window
   11.70 -	     (selected-window)
   11.71 -	     (max
   11.72 -	      (min
   11.73 -	       (- (screen-height)
   11.74 -		  (if (numberp YaTeX-default-pop-window-height)
   11.75 -		      (+ YaTeX-default-pop-window-height 2)
   11.76 -		    (/ (* (screen-height)
   11.77 -			  (string-to-int YaTeX-default-pop-window-height))
   11.78 -		       100)))
   11.79 -	       (- (screen-height) window-min-height 1))
   11.80 -	      window-min-height))
   11.81 +	    (split-window-calculate-height YaTeX-default-pop-window-height)
   11.82  	    (pop-to-buffer buffer)
   11.83  	    (or select (select-window window)))
   11.84  	   (t nil)))
   11.85 @@ -186,6 +163,27 @@
   11.86  )
   11.87  
   11.88  ;;;###autoload
   11.89 +(defun split-window-calculate-height (height)
   11.90 +  "Split current window wight specified HEIGHT.
   11.91 +If HEIGHT is number, make new window that has HEIGHT lines.
   11.92 +If HEIGHT is string, make new window that occupy HEIGT % of screen height.
   11.93 +Otherwise split window conventionally."
   11.94 +  (if (one-window-p)
   11.95 +      (split-window
   11.96 +       (selected-window)
   11.97 +       (max
   11.98 +	(min
   11.99 +	 (- (screen-height)
  11.100 +	    (if (numberp YaTeX-default-pop-window-height)
  11.101 +		(+ YaTeX-default-pop-window-height 2)
  11.102 +	      (/ (* (screen-height)
  11.103 +		    (string-to-int YaTeX-default-pop-window-height))
  11.104 +		 100)))
  11.105 +	 (- (screen-height) window-min-height 1))
  11.106 +	window-min-height)))
  11.107 +)
  11.108 +
  11.109 +;;;###autoload
  11.110  (defun YaTeX-window-list ()
  11.111    (let*((curw (selected-window)) (win curw) (wlist (list curw)))
  11.112      (while (not (eq curw (setq win (next-window win))))
  11.113 @@ -215,11 +213,20 @@
  11.114  ;;;###autoload
  11.115  (defun YaTeX-minibuffer-complete ()
  11.116    "Complete in minibuffer.
  11.117 -If the symbol 'delim is bound and is string, its value is assumed to be
  11.118 +  If the symbol 'delim is bound and is string, its value is assumed to be
  11.119  the character class of delimiters.  Completion will be performed on
  11.120 -the last field separated by those delimiters."
  11.121 +the last field separated by those delimiters.
  11.122 +  If the symbol 'quick is bound and is 't, when the try-completion results
  11.123 +in t, exit minibuffer immediately."
  11.124    (interactive)
  11.125 -  (let (beg word compl (md (match-data)))
  11.126 +  (let ((md (match-data)) beg word compl
  11.127 +	(quick (and (boundp 'quick) (eq quick t)))
  11.128 +	(displist			;function to display completion-list
  11.129 +	 (function
  11.130 +	  (lambda ()
  11.131 +	    (with-output-to-temp-buffer "*Completions*"
  11.132 +	      (display-completion-list
  11.133 +	       (all-completions word minibuffer-completion-table)))))))
  11.134      (setq beg (if (and (boundp 'delim) (stringp delim))
  11.135  		  (save-excursion
  11.136  		    (skip-chars-backward (concat "^" delim))
  11.137 @@ -229,31 +236,117 @@
  11.138  	  compl (try-completion word minibuffer-completion-table))
  11.139      (cond
  11.140       ((eq compl t)
  11.141 -      (let ((p (point)) (max (point-max)))
  11.142 -	(goto-char max)
  11.143 -	(insert " [Sole completion]")
  11.144 -	(goto-char p)
  11.145 -	(sit-for 1)
  11.146 -	(delete-region max (point-max))
  11.147 -	(goto-char p)))
  11.148 +      (if quick (exit-minibuffer)
  11.149 +	(let ((p (point)) (max (point-max)))
  11.150 +	  (unwind-protect
  11.151 +	      (progn
  11.152 +		(goto-char max)
  11.153 +		(insert " [Sole completion]")
  11.154 +		(goto-char p)
  11.155 +		(sit-for 1))
  11.156 +	    (delete-region max (point-max))
  11.157 +	    (goto-char p)))))
  11.158       ((eq compl nil)
  11.159        (ding)
  11.160        (save-excursion
  11.161  	(let (p)
  11.162 -	  (goto-char (setq p (point-max)))
  11.163 -	  (insert " [No match]")
  11.164 -	  (goto-char p)
  11.165 -	  (sit-for 2)
  11.166 -	  (delete-region p (point-max)))))
  11.167 +	  (unwind-protect
  11.168 +	      (progn
  11.169 +		(goto-char (setq p (point-max)))
  11.170 +		(insert " [No match]")
  11.171 +		(goto-char p)
  11.172 +		(sit-for 2))
  11.173 +	    (delete-region p (point-max))))))
  11.174       ((string= compl word)
  11.175 -      (with-output-to-temp-buffer "*Completions*"
  11.176 -	(display-completion-list
  11.177 -	 (all-completions word minibuffer-completion-table))))
  11.178 +      (funcall displist))
  11.179       (t (delete-region beg (point-max))
  11.180 -	(insert compl))
  11.181 -     )
  11.182 +	(insert compl)
  11.183 +	(if quick
  11.184 +	    (if (eq (try-completion compl minibuffer-completion-table) t)
  11.185 +		(exit-minibuffer)
  11.186 +	      (funcall displist)))))
  11.187      (store-match-data md))
  11.188  )
  11.189  
  11.190 +(defun YaTeX-minibuffer-quick-complete ()
  11.191 +  "Set 'quick to 't and call YaTeX-minibuffer-complete.
  11.192 +See documentation of YaTeX-minibuffer-complete."
  11.193 +  (interactive)
  11.194 +  (let ((quick t))
  11.195 +    (self-insert-command 1)
  11.196 +    (YaTeX-minibuffer-complete)))
  11.197 +
  11.198 +(defun foreach-buffers (pattern job)
  11.199 +  "For each buffer which matches with PATTERN, do JOB."
  11.200 +  (let ((list (buffer-list)))
  11.201 +    (save-excursion
  11.202 +      (while list
  11.203 +	(set-buffer (car list))
  11.204 +	(if (or (and (stringp pattern)
  11.205 +		     (buffer-file-name)
  11.206 +		     (string-match pattern (buffer-file-name)))
  11.207 +		(and (symbolp pattern) major-mode (eq major-mode pattern)))
  11.208 +	    (eval job))
  11.209 +	(setq list (cdr list)))))
  11.210 +)
  11.211 +
  11.212 +(defun goto-buffer-window (buffer)
  11.213 +  "Select window which is bound to BUFFER.
  11.214 +If no such window exist, switch to buffer BUFFER."
  11.215 +  (if (stringp buffer)
  11.216 +      (setq buffer (or (get-file-buffer buffer) (get-buffer buffer))))
  11.217 +  (if (get-buffer buffer)
  11.218 +      (cond
  11.219 +       ((get-buffer-window buffer)
  11.220 +	(select-window (get-buffer-window buffer)))
  11.221 +       ((and YaTeX-emacs-19 (get-buffer-window buffer t))
  11.222 +	(let*((win (get-buffer-window buffer t))
  11.223 +	      (frame (window-frame win)))
  11.224 +	  (select-frame frame)
  11.225 +	  (raise-frame frame)
  11.226 +	  (focus-frame frame)
  11.227 +	  (select-window win)
  11.228 +	  (set-mouse-position frame 0 0)
  11.229 +	  (and (featurep 'windows) (fboundp 'win:adjust-window)
  11.230 +	       (win:adjust-window))))
  11.231 +       (t (switch-to-buffer buffer))))
  11.232 +)
  11.233 +
  11.234 +;; Here starts the functions which support gmhist-vs-Emacs19 compatible
  11.235 +;; reading with history.
  11.236 +;;;###autoload
  11.237 +(defun completing-read-with-history
  11.238 +  (prompt table &optional predicate must-match initial hsym)
  11.239 +  "Completing read with general history: gmhist, Emacs-19."
  11.240 +  (let ((minibuffer-history
  11.241 +	 (or (symbol-value hsym)
  11.242 +	     (and (boundp 'minibuffer-history) minibuffer-history)))
  11.243 +	(minibuffer-history-symbol (or hsym 'minibuffer-history)))
  11.244 +    (prog1
  11.245 +	(if (fboundp 'completing-read-with-history-in)
  11.246 +	    (completing-read-with-history-in
  11.247 +	     minibuffer-history-symbol prompt table predicate must-match initial)
  11.248 +	  (completing-read prompt table predicate must-match initial))
  11.249 +      (if (and YaTeX-emacs-19 hsym) (set hsym minibuffer-history)))))
  11.250 +
  11.251 +;;;###autoload
  11.252 +(defun read-from-minibuffer-with-history (prompt &optional init map read hsym)
  11.253 +  "Read from minibuffer with general history: gmhist, Emacs-19."
  11.254 +  (cond
  11.255 +   (YaTeX-emacs-19
  11.256 +    (read-from-minibuffer prompt init map read hsym))
  11.257 +   (t
  11.258 +    (let ((minibuffer-history-symbol hsym))
  11.259 +      (read-from-minibuffer prompt init map read)))))
  11.260 +
  11.261 +;;;###autoload
  11.262 +(defun read-string-with-history (prompt &optional init hsym)
  11.263 +  "Read string with history: gmhist(Emacs-18) and Emacs-19."
  11.264 +  (cond
  11.265 +   (YaTeX-emacs-19
  11.266 +    (read-from-minibuffer prompt init minibuffer-local-map nil hsym))
  11.267 +   ((featurep 'gmhist-mh)
  11.268 +    (read-with-history-in hsym prompt init))
  11.269 +   (t (read-string prompt init))))
  11.270  
  11.271  (provide 'yatexlib)
    12.1 --- a/yatexmth.el	Fri Nov 25 08:26:13 1994 +0000
    12.2 +++ b/yatexmth.el	Tue Dec 20 21:00:21 1994 +0000
    12.3 @@ -2,7 +2,7 @@
    12.4  ;;; YaTeX math-mode-specific functions.
    12.5  ;;; yatexmth.el rev.2
    12.6  ;;; (c )1993-1994 by HIROSE Yuuji [yuuji@ae.keio.ac.jp]
    12.7 -;;; Last modified Tue Oct 11 22:57:43 1994 on figaro
    12.8 +;;; Last modified Fri Dec  2 17:03:30 1994 on VFR
    12.9  ;;; $Id$
   12.10  
   12.11  ;;; [Customization guide]
   12.12 @@ -42,7 +42,7 @@
   12.13  ;;;			("'" . Other-List-if-any)))
   12.14  ;;;
   12.15  ;;;	  Put these expressions into your ~/.emacs, and you can use this
   12.16 -;;;	completion in the YaTeX-math-mode.
   12.17 +;;;	completion in the math-mode.
   12.18  ;;;
   12.19  ;;;	  And you can add your favorite completion sequences to the
   12.20  ;;;	default completion list invoked with `;', by defining those lists
   12.21 @@ -81,8 +81,8 @@
   12.22  ;;;		      '(("," . YaTeX-math-funcs-list)
   12.23  ;;;			("'" . ほかに定義したいシリーズがあれば…)))
   12.24  ;;;
   12.25 -;;;	これらを ~/.emacs に書いておけば、野鳥の math-mode で自分専用の
   12.26 -;;;	イメージ補完が利用できます。
   12.27 +;;;	これらを ~/.emacs に書いておけば、math-mode で自分専用のイメージ
   12.28 +;;;	補完が利用できます。
   12.29  
   12.30  (defvar YaTeX-jisold
   12.31    (and (boundp 'dos-machine-type)
   12.32 @@ -378,6 +378,10 @@
   12.33    (list 'nth 1 list))
   12.34  
   12.35  (defvar YaTeX-math-cmd-regexp (concat (regexp-quote YaTeX-ec) "[A-z]"))
   12.36 +(defvar YaTeX-math-verbatim-environments
   12.37 +  '("alltt")
   12.38 +  "*List of environments in which LaTeX math mode is disabled.
   12.39 +This value is appended with YaTeX-verbatim-environments.")
   12.40  
   12.41  ;;;
   12.42  ;;YaTeX math-mode functions
   12.43 @@ -438,12 +442,14 @@
   12.44    "If current position is supposed to be in LaTeX-math-mode, return t."
   12.45    (or (YaTeX-quick-in-environment-p
   12.46         '("math" "eqnarray" "equation" "eqnarray*" "displaymath"))
   12.47 -      (let ((p (point)) (nest 0) me0
   12.48 +      (let*((p (point)) (nest 0) me0
   12.49 +	    (delim (concat YaTeX-sectioning-regexp
   12.50 +			   "\\|^%\\|^$\\|^\C-l"))
   12.51  	    (boundary
   12.52  	     (save-excursion
   12.53 -	       (if (looking-at YaTeX-paragraph-delimiter)
   12.54 +	       (if (looking-at delim)
   12.55  		   (goto-char (max (point-min) (1- (point)))))
   12.56 -	       (re-search-backward YaTeX-paragraph-delimiter nil 1)
   12.57 +	       (re-search-backward delim nil 1)
   12.58  	       (point))))
   12.59  	(save-excursion
   12.60  	  (cond
   12.61 @@ -455,7 +461,7 @@
   12.62  				     "\\([()]\\|[][]\\)") boundary t))
   12.63  		  (setq me0 (match-end 0))
   12.64  		  (if (or (YaTeX-on-comment-p)
   12.65 -			  (YaTeX-quick-in-environment-p "verbatim")) nil
   12.66 +			  (YaTeX-literal-p)) nil
   12.67  		    (if (or (= (char-after (1- me0)) ?\))
   12.68  			    (= (char-after (1- me0)) ?\]))
   12.69  			(setq nest (1+ nest))
   12.70 @@ -464,11 +470,18 @@
   12.71  		(if (< nest 0) (throw 'open t))))
   12.72  	    t)
   12.73  	   (t (catch 'dollar
   12.74 -		(while (search-backward "$" boundary t)
   12.75 +		(while ;(search-backward "$" boundary t);little bit fast.
   12.76 +		    (YaTeX-re-search-active-backward ;;;;;; Too slow???
   12.77 +		     "\\$" YaTeX-comment-prefix boundary t)
   12.78  		  (cond
   12.79  		   ((equal (char-after (1- (point))) ?$) ; $$ equation $$
   12.80  		    (backward-char 1)
   12.81  		    (setq nest (1+ nest)))
   12.82 +		   ((let ((YaTeX-verbatim-environments
   12.83 +			   (append YaTeX-math-verbatim-environments
   12.84 +				   YaTeX-verbatim-environments)))
   12.85 +		      (YaTeX-literal-p))
   12.86 +		    nil)
   12.87  		   ((and (equal (char-after (1- (point))) ?\\ )
   12.88  			 (not (equal (char-after (- (point) 3)) ?\\ )))
   12.89  		    nil)		;\$
   12.90 @@ -583,8 +596,9 @@
   12.91      (setq result
   12.92  	  (catch 'complete
   12.93  	    (if (and (not force)
   12.94 -		     (or (and (not YaTeX-auto-math-mode) (not YaTeX-math-mode))
   12.95 -			 (not (YaTeX-in-math-mode-p))))
   12.96 +		     (if YaTeX-auto-math-mode
   12.97 +			 (not (YaTeX-in-math-mode-p))
   12.98 +		       (not YaTeX-math-mode)))
   12.99  		(throw 'complete 'escape));this tag should be exit, but...
  12.100  	    (while t
  12.101  	      (message "Sequence(TAB for menu): %s" key)
    13.1 --- a/yatexprc.el	Fri Nov 25 08:26:13 1994 +0000
    13.2 +++ b/yatexprc.el	Tue Dec 20 21:00:21 1994 +0000
    13.3 @@ -1,709 +1,727 @@
    13.4 -;;; -*- Emacs-Lisp -*-
    13.5 -;;; YaTeX process handler.
    13.6 -;;; yatexprc.el
    13.7 -;;; (c )1993-1994 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp]
    13.8 -;;; Last modified Fri Nov 25 03:31:46 1994 on VFR
    13.9 -;;; $Id$
   13.10 -
   13.11 -(require 'yatex)
   13.12 -
   13.13 -(defvar YaTeX-typeset-process nil
   13.14 -  "Process identifier for jlatex"
   13.15 -)
   13.16 -(defvar YaTeX-typeset-buffer "*YaTeX-typesetting*"
   13.17 -  "Process buffer for jlatex")
   13.18 -
   13.19 -(defvar YaTeX-typeset-buffer-syntax nil
   13.20 -  "*Syntax table for typesetting buffer")
   13.21 -
   13.22 -(defvar YaTeX-current-TeX-buffer nil
   13.23 -  "Keeps the buffer on which recently typeset run.")
   13.24 -
   13.25 -(defvar YaTeX-shell-command-option
   13.26 -  (or (and (boundp 'shell-command-option) shell-command-option)
   13.27 -      (if YaTeX-dos "/c" "-c"))
   13.28 -  "Shell option for command execution.")
   13.29 -
   13.30 -(if YaTeX-typeset-buffer-syntax nil
   13.31 -  (setq YaTeX-typeset-buffer-syntax
   13.32 -	(make-syntax-table (standard-syntax-table)))
   13.33 -  (modify-syntax-entry ?\{ "w" YaTeX-typeset-buffer-syntax)
   13.34 -  (modify-syntax-entry ?\} "w" YaTeX-typeset-buffer-syntax)
   13.35 -  (modify-syntax-entry ?\[ "w" YaTeX-typeset-buffer-syntax)
   13.36 -  (modify-syntax-entry ?\] "w" YaTeX-typeset-buffer-syntax)
   13.37 -)
   13.38 -
   13.39 -(defun YaTeX-typeset (command buffer)
   13.40 -  "Execute jlatex (or other) to LaTeX typeset."
   13.41 -  (interactive)
   13.42 -  (save-excursion
   13.43 -    (let ((p (point)) (window (selected-window)) execdir)
   13.44 -      (if (and YaTeX-typeset-process
   13.45 -	       (eq (process-status YaTeX-typeset-process) 'run))
   13.46 -	  ;; if tex command is halting.
   13.47 -	  (YaTeX-kill-typeset-process YaTeX-typeset-process))
   13.48 -      (YaTeX-visit-main t);;execution directory
   13.49 -      (setq execdir default-directory)
   13.50 -      ;;Select lower-most window if there are more than 2 windows and
   13.51 -      ;;typeset buffer not seen.
   13.52 -      (YaTeX-showup-buffer
   13.53 -       buffer (function (lambda (x) (nth 3 (window-edges x)))))
   13.54 -      (set-buffer (get-buffer-create buffer))
   13.55 -      (setq default-directory execdir)
   13.56 -      (cd execdir)
   13.57 -      (erase-buffer)
   13.58 -      (cond
   13.59 -       (YaTeX-dos			;if MS-DOS
   13.60 -	(YaTeX-put-nonstopmode)
   13.61 -	(call-process
   13.62 -	 shell-file-name nil buffer nil YaTeX-shell-command-option command)
   13.63 -	(YaTeX-remove-nonstopmode))
   13.64 -       (t				;if UNIX
   13.65 -	(set-process-buffer
   13.66 -	 (setq YaTeX-typeset-process
   13.67 -	       (start-process "LaTeX" buffer shell-file-name
   13.68 -			      YaTeX-shell-command-option command))
   13.69 -	 (get-buffer buffer))
   13.70 -	(set-process-sentinel YaTeX-typeset-process 'YaTeX-typeset-sentinel)))
   13.71 -      (message (format "Calling `%s'..." command))
   13.72 -      (setq YaTeX-current-TeX-buffer (buffer-name))
   13.73 -      (use-local-map YaTeX-typesetting-mode-map)
   13.74 -      (set-syntax-table YaTeX-typeset-buffer-syntax)
   13.75 -      (setq mode-name "typeset")
   13.76 -      (if YaTeX-typeset-process		; if process is running (maybe on UNIX)
   13.77 -	  (cond ((boundp 'MULE)
   13.78 -		 (set-current-process-coding-system
   13.79 -		  YaTeX-latex-message-code YaTeX-coding-system))
   13.80 -		((boundp 'NEMACS)
   13.81 -		 (set-kanji-process-code YaTeX-latex-message-code))))
   13.82 -      (if YaTeX-dos (message "Done.")
   13.83 -	(insert " ")
   13.84 -	(set-marker (process-mark YaTeX-typeset-process) (1- (point))))
   13.85 -      (if (bolp) (forward-line -1))	;what for?
   13.86 -      (if YaTeX-emacs-19
   13.87 -	  (let ((win (get-buffer-window buffer t)) owin)
   13.88 -	    (select-frame (window-frame win))
   13.89 -	    (setq owin (selected-window))
   13.90 -	    (select-window win)
   13.91 -	    (goto-char (point-max))
   13.92 -	    (recenter -1)
   13.93 -	    (select-window owin))
   13.94 -	(select-window (get-buffer-window buffer))
   13.95 -	(goto-char (point-max))
   13.96 -	(recenter -1))
   13.97 -      (select-window window)))
   13.98 -)
   13.99 -
  13.100 -(defun YaTeX-typeset-sentinel (proc mes)
  13.101 -  (cond ((null (buffer-name (process-buffer proc)))
  13.102 -         ;; buffer killed
  13.103 -         (set-process-buffer proc nil))
  13.104 -        ((memq (process-status proc) '(signal exit))
  13.105 -         (let* ((obuf (current-buffer)) (pbuf (process-buffer proc))
  13.106 -		(pwin (get-buffer-window pbuf))
  13.107 -		(owin (selected-window)) win)
  13.108 -           ;; save-excursion isn't the right thing if
  13.109 -           ;;  process-buffer is current-buffer
  13.110 -           (unwind-protect
  13.111 -               (progn
  13.112 -                 ;; Write something in *typesetting* and hack its mode line
  13.113 -		 (if pwin
  13.114 -		     (select-window pwin)
  13.115 -		   (set-buffer pbuf))
  13.116 -		 ;;(YaTeX-showup-buffer pbuf nil t)
  13.117 -                 (goto-char (point-max))
  13.118 -		 (if pwin (recenter -3))
  13.119 -                 (insert ?\n "latex typesetting " mes)
  13.120 -                 (forward-char -1)
  13.121 -                 (insert " at " (substring (current-time-string) 0 -5) "\n")
  13.122 -                 (forward-char 1)
  13.123 -                 (setq mode-line-process
  13.124 -                       (concat ": "
  13.125 -                               (symbol-name (process-status proc))))
  13.126 -		 (message "latex typesetting %s."
  13.127 -			  (if (eq (process-status proc) 'exit)
  13.128 -			      "done" "ceased"))
  13.129 -                 ;; If buffer and mode line shows that the process
  13.130 -                 ;; is dead, we can delete it now.  Otherwise it
  13.131 -                 ;; will stay around until M-x list-processes.
  13.132 -                 (delete-process proc)
  13.133 -		 )
  13.134 -             (setq YaTeX-typesetting-process nil)
  13.135 -             ;; Force mode line redisplay soon
  13.136 -             (set-buffer-modified-p (buffer-modified-p))
  13.137 -	     )
  13.138 -	   (select-window owin)
  13.139 -	   (set-buffer obuf))))
  13.140 -)
  13.141 -
  13.142 -(defvar YaTeX-texput-file "texput.tex"
  13.143 -  "*File name for temporary file of typeset-region."
  13.144 -)
  13.145 -
  13.146 -(defun YaTeX-typeset-region ()
  13.147 -  "Paste the region to the file `texput.tex' and execute jlatex (or other)
  13.148 -to LaTeX typeset.  The region is specified by the rule:
  13.149 -	(1)If keyword `%#BEGIN' is found in the upper direction from (point).
  13.150 -	  (1-1)if the keyword `%#END' is found after `%#BEGIN',
  13.151 -		->Assume the text between `%#BEGIN' and `%#END' as region.
  13.152 -	  (1-2)if the keyword `%#END' is not found anywhere after `%#BEGIN',
  13.153 -		->Assume the text after `%#BEGIN' as region.
  13.154 -	(2)If no `%#BEGIN' usage is found before the (point),
  13.155 -		->Assume the text between current (point) and (mark) as region.
  13.156 -DON'T forget to eliminate the `%#BEGIN/%#END' notation after editing
  13.157 -operation to the region."
  13.158 -  (interactive)
  13.159 -  (save-excursion
  13.160 -    (let*
  13.161 -	((end "") typeout ;Type out message that tells the method of cutting.
  13.162 -	 (cmd (concat (YaTeX-get-latex-command nil) " " YaTeX-texput-file))
  13.163 -	 (buffer (current-buffer)) opoint preamble (subpreamble "") main
  13.164 -	 (hilit-auto-highlight nil)	;for Emacs19 with hilit19
  13.165 -	 reg-begin reg-end)
  13.166 -
  13.167 -      (save-excursion
  13.168 -	(if (search-backward "%#BEGIN" nil t)
  13.169 -	    (progn
  13.170 -	      (setq typeout "--- Region from BEGIN to "
  13.171 -		    end "the end of the buffer ---"
  13.172 -		    reg-begin (match-end 0))
  13.173 -	      (if (search-forward "%#END" nil t)
  13.174 -		  (setq reg-end (match-beginning 0)
  13.175 -			end "END ---")
  13.176 -		(setq reg-end (point-max))))
  13.177 -	  (setq typeout "=== Region from (point) to (mark) ===")
  13.178 -	  (setq reg-begin (point) reg-end (mark)))
  13.179 -	(goto-char (point-min))
  13.180 -	(while (search-forward "%#REQUIRE" nil t)
  13.181 -	  (setq subpreamble
  13.182 -		(concat subpreamble
  13.183 -			(cond
  13.184 -			 ((eolp)
  13.185 -			  (buffer-substring
  13.186 -			   (match-beginning 0)
  13.187 -			   (point-beginning-of-line)))
  13.188 -			 (t (buffer-substring
  13.189 -			     (match-end 0)
  13.190 -			     (point-end-of-line))))
  13.191 -			"\n"))
  13.192 -	  (goto-char (match-end 0))))
  13.193 -      (YaTeX-visit-main t)
  13.194 -      (setq main (current-buffer))
  13.195 -      (setq opoint (point))
  13.196 -      (goto-char (point-min))
  13.197 -      (setq
  13.198 -       preamble
  13.199 -       (if (re-search-forward "^[ 	]*\\\\begin.*{document}" nil t)
  13.200 -	   (buffer-substring (point-min) (match-end 0))
  13.201 -	 (concat "\\documentstyle{" YaTeX-default-document-style "}\n"
  13.202 -		 "\\begin{document}")))
  13.203 -      (goto-char opoint)
  13.204 -      ;;(set-buffer buffer)		;for clarity
  13.205 -      (set-buffer (find-file-noselect YaTeX-texput-file))
  13.206 -      ;;(find-file YaTeX-texput-file)
  13.207 -      (erase-buffer)
  13.208 -      (if YaTeX-need-nonstop
  13.209 -	  (insert "\\nonstopmode{}\n"))
  13.210 -      (insert preamble "\n" subpreamble "\n")
  13.211 -      (insert-buffer-substring buffer reg-begin reg-end)
  13.212 -      (insert "\\typeout{" typeout end "}\n") ;Notice the selected method.
  13.213 -      (insert "\n\\end{document}\n")
  13.214 -      (basic-save-buffer)
  13.215 -      (kill-buffer (current-buffer))
  13.216 -      (set-buffer main)		;return to parent file or itself.
  13.217 -      (YaTeX-typeset cmd YaTeX-typeset-buffer)
  13.218 -      (switch-to-buffer buffer)		;for Emacs-19
  13.219 -      (put 'dvi2-command 'region t)))
  13.220 -)
  13.221 -
  13.222 -(defun YaTeX-typeset-buffer ()
  13.223 -  "Typeset whole buffer.  If %#! usage says other buffer is main text,
  13.224 -visit main buffer to confirm if its includeonly list contains current
  13.225 -buffer's file.  And if it doesn't contain editing text, ask user which
  13.226 -action wants to be done, A:Add list, R:Replace list, %:comment-out list."
  13.227 -  (interactive)
  13.228 -  (YaTeX-save-buffers)
  13.229 -  (let*((me (substring (buffer-name) 0 (rindex (buffer-name) ?.)))
  13.230 -	(mydir (file-name-directory (buffer-file-name)))
  13.231 -	(cmd (YaTeX-get-latex-command t)))
  13.232 -    (if (YaTeX-main-file-p) nil
  13.233 -      (save-excursion
  13.234 -	(YaTeX-visit-main t)	;search into main buffer
  13.235 -	(save-excursion
  13.236 -	  (push-mark (point) t)
  13.237 -	  (goto-char (point-min))
  13.238 -	  (if (and (re-search-forward "^[ 	]*\\\\begin{document}" nil t)
  13.239 -		   (re-search-backward "^[ 	]*\\\\includeonly{" nil t))
  13.240 -	      (let*
  13.241 -		  ((b (progn (skip-chars-forward "^{") (point)))
  13.242 -		   (e (progn (skip-chars-forward "^}") (1+ (point))))
  13.243 -		   (s (buffer-substring b e)) c
  13.244 -		   (pardir (file-name-directory (buffer-file-name))))
  13.245 -		(if (string-match (concat "[{,/]" me "[,}]") s)
  13.246 -		    nil ; Nothing to do when it's already in includeonly.
  13.247 -		  (ding)
  13.248 -		  (switch-to-buffer (current-buffer));Display this buffer.
  13.249 -		  (setq
  13.250 -		   me	  ;;Rewrite my name(me) to contain sub directory name.
  13.251 -		   (concat
  13.252 -		    (if (string-match pardir mydir) ;if mydir is child of main
  13.253 -			(substring mydir (length pardir)) ;cut absolute path
  13.254 -		      mydir) ;else concat absolute path name.
  13.255 -		    me))
  13.256 -		  (message
  13.257 -		   "`%s' is not in \\includeonly. A)dd R)eplace %%)comment? "
  13.258 -		   me)
  13.259 -		  (setq c (read-char))
  13.260 -		  (cond
  13.261 -		   ((= c ?a)
  13.262 -		    (goto-char (1+ b))
  13.263 -		    (insert me (if (string= s "{}") "" ",")))
  13.264 -		   ((= c ?r)
  13.265 -		    (delete-region (1+ b) (1- e)) (insert me))
  13.266 -		   ((= c ?%)
  13.267 -		    (beginning-of-line) (insert "%"))
  13.268 -		   (t nil))
  13.269 -		  (basic-save-buffer))))
  13.270 -	  (exchange-point-and-mark))
  13.271 -	))
  13.272 -    (YaTeX-typeset cmd YaTeX-typeset-buffer)
  13.273 -    (put 'dvi2-command 'region nil))
  13.274 -)
  13.275 -
  13.276 -(defvar YaTeX-call-command-history nil
  13.277 -  "Holds history list of YaTeX-call-command-on-file.")
  13.278 -(put 'YaTeX-call-command-history 'no-default t)
  13.279 -(defun YaTeX-call-command-on-file (base-cmd buffer)
  13.280 -  (YaTeX-save-buffers)
  13.281 -  (YaTeX-typeset
  13.282 -   (let ((minibufer-history-symbol 'YaTeX-call-command-history))
  13.283 -     (read-string "Call command: "
  13.284 -		  (concat base-cmd " " (YaTeX-get-preview-file-name))))
  13.285 -   buffer)
  13.286 -)
  13.287 -
  13.288 -(defun YaTeX-bibtex-buffer (cmd)
  13.289 -  "Pass the bibliography data of editing file to bibtex."
  13.290 -  (interactive)
  13.291 -  (YaTeX-save-buffers)
  13.292 -  (YaTeX-call-command-on-file cmd "*YaTeX-bibtex*" )
  13.293 -)
  13.294 -
  13.295 -(defun YaTeX-kill-typeset-process (proc)
  13.296 -  "Kill process PROC after sending signal to PROC.
  13.297 -PROC should be process identifier."
  13.298 -  (cond
  13.299 -   (YaTeX-dos
  13.300 -    (error "MS-DOS can't have concurrent process."))
  13.301 -   ((or (null proc) (not (eq (process-status proc) 'run)))
  13.302 -    (error "No typesetting process."))
  13.303 -   (t (interrupt-process proc)
  13.304 -      (delete-process proc)))
  13.305 -)
  13.306 -
  13.307 -(defun YaTeX-system (command buffer)
  13.308 -  "Execute some command on buffer.  Not a official function."
  13.309 -  (save-excursion
  13.310 -    (YaTeX-showup-buffer
  13.311 -     buffer (function (lambda (x) (nth 3 (window-edges x)))))
  13.312 -    (set-buffer (get-buffer-create buffer))
  13.313 -    (erase-buffer)
  13.314 -    (if YaTeX-dos
  13.315 -	(call-process
  13.316 -	 shell-file-name nil buffer nil YaTeX-shell-command-option command)
  13.317 -      (set-process-buffer
  13.318 -       (start-process
  13.319 -	"system" buffer shell-file-name YaTeX-shell-command-option command)
  13.320 -       (get-buffer buffer))))
  13.321 -)
  13.322 -
  13.323 -(defvar YaTeX-preview-command-history nil
  13.324 -  "Holds minibuffer history of preview command.")
  13.325 -(put 'YaTeX-preview-command-history 'no-default t)
  13.326 -(defvar YaTeX-preview-file-history nil
  13.327 -  "Holds minibuffer history of file to preview.")
  13.328 -(put 'YaTeX-preview-file-history 'no-default t)
  13.329 -(defun YaTeX-preview (preview-command preview-file)
  13.330 -  "Execute xdvi (or other) to tex-preview."
  13.331 -  (interactive
  13.332 -   (list
  13.333 -    (let ((minibuffer-history-symbol 'YaTeX-preview-command-history))
  13.334 -      (read-string "Preview command: " dvi2-command))
  13.335 -    (let ((minibuffer-history-symbol 'YaTeX-preview-file-history))
  13.336 -      (read-string "Preview file[.dvi]: "
  13.337 -		   (if (get 'dvi2-command 'region)
  13.338 -		       (substring YaTeX-texput-file
  13.339 -				  0 (rindex YaTeX-texput-file ?.))
  13.340 -		     (YaTeX-get-preview-file-name))
  13.341 -		   ))))
  13.342 -  (setq dvi2-command preview-command)	;`dvi2command' is buffer local
  13.343 -  (save-excursion
  13.344 -    (YaTeX-visit-main t)
  13.345 -    (let ((pbuffer "*dvi-preview*") (dir default-directory))
  13.346 -      (YaTeX-showup-buffer
  13.347 -       pbuffer (function (lambda (x) (nth 3 (window-edges x)))))
  13.348 -      (set-buffer (get-buffer-create pbuffer))
  13.349 -      (erase-buffer)
  13.350 -      (setq default-directory dir)	;for 18
  13.351 -      (cd dir)				;for 19
  13.352 -      (cond
  13.353 -       (YaTeX-dos			;if MS-DOS
  13.354 -	(send-string-to-terminal "\e[2J\e[>5h") ;CLS & hide cursor
  13.355 -	(call-process shell-file-name "con" "*dvi-preview*" nil
  13.356 -		      YaTeX-shell-command-option preview-command preview-file)
  13.357 -	(send-string-to-terminal "\e[>5l") ;show cursor
  13.358 -	(redraw-display))
  13.359 -       (t				;if UNIX
  13.360 -	(set-process-buffer
  13.361 -	 (start-process "preview" "*dvi-preview*" shell-file-name
  13.362 -			YaTeX-shell-command-option
  13.363 -			(concat preview-command " " preview-file))
  13.364 -	 (get-buffer pbuffer))
  13.365 -	(message
  13.366 -	 (concat "Starting " preview-command
  13.367 -		 " to preview " preview-file))))))
  13.368 -)
  13.369 -
  13.370 -(defun YaTeX-prev-error ()
  13.371 -  "Visit previous typeset error.
  13.372 -  To avoid making confliction of line numbers by editing, jump to
  13.373 -error or warning lines in reverse order."
  13.374 -  (interactive)
  13.375 -  (let ((cur-buf (buffer-name)) (cur-win (selected-window))
  13.376 -	error-line typeset-win error-buffer error-win)
  13.377 -    (if (null (get-buffer YaTeX-typeset-buffer))
  13.378 -	(error "There is no typesetting buffer."))
  13.379 -    (YaTeX-showup-buffer YaTeX-typeset-buffer nil t)
  13.380 -    (setq typeset-win (selected-window))
  13.381 -    (if (re-search-backward
  13.382 -	 (concat "\\(" latex-error-regexp "\\)\\|\\("
  13.383 -		 latex-warning-regexp "\\)")
  13.384 -	 nil t)
  13.385 -	nil
  13.386 -      (select-window cur-win)
  13.387 -      (error "No more erros on %s" cur-buf))
  13.388 -    (goto-char (match-beginning 0))
  13.389 -    (skip-chars-forward "^0-9" (match-end 0))
  13.390 -    (setq error-line
  13.391 -	  (string-to-int
  13.392 -	   (buffer-substring
  13.393 -	    (point)
  13.394 -	    (progn (skip-chars-forward "0-9" (match-end 0)) (point))))
  13.395 -	  error-buffer (YaTeX-get-error-file cur-buf)
  13.396 -	  error-win (get-buffer-window error-buffer))
  13.397 -    (if (or (null error-line) (equal 0 error-line))
  13.398 -	(error "Can't detect error position."))
  13.399 -    (select-window cur-win)
  13.400 -    (cond
  13.401 -     (error-win (select-window error-win))
  13.402 -     ((eq (get-lru-window) typeset-win)
  13.403 -      (YaTeX-switch-to-buffer error-buffer))
  13.404 -     (t (select-window (get-lru-window))
  13.405 -	(YaTeX-switch-to-buffer error-buffer)))
  13.406 -    (setq error-win (selected-window))
  13.407 -    (goto-line error-line)
  13.408 -    (message "LaTeX %s in `%s' on line: %d."
  13.409 -	     (if (match-beginning 1) "error" "warning")
  13.410 -	     error-buffer error-line)
  13.411 -    (select-window typeset-win)
  13.412 -    (skip-chars-backward "0-9")
  13.413 -    (recenter (/ (window-height) 2))
  13.414 -    (sit-for 3)
  13.415 -    (goto-char (match-beginning 0))
  13.416 -    (select-window error-win))
  13.417 -)
  13.418 -
  13.419 -(defun YaTeX-jump-error-line ()
  13.420 -  "Jump to corresponding line on latex command's error message."
  13.421 -  (interactive)
  13.422 -  (let (error-line error-file error-buf)
  13.423 -    (save-excursion
  13.424 -      (beginning-of-line)
  13.425 -      (setq error-line (re-search-forward "l[ ines]*\\.?\\([1-9][0-9]*\\)"
  13.426 -					  (point-end-of-line) t)))
  13.427 -    (if (null error-line)
  13.428 -	(if (eobp) (insert (this-command-keys))
  13.429 -	  (error "No line number expression."))
  13.430 -      (goto-char (match-beginning 0))
  13.431 -      (setq error-line (string-to-int
  13.432 -			(buffer-substring (match-beginning 1) (match-end 1)))
  13.433 -	    error-file (YaTeX-get-error-file YaTeX-current-TeX-buffer)
  13.434 -	    error-buf (YaTeX-switch-to-buffer error-file t))
  13.435 -      (if (null error-buf)
  13.436 -	  (error "`%s' is not found in this directory." error-file))
  13.437 -      (YaTeX-showup-buffer error-buf nil t)
  13.438 -      (goto-line error-line)))
  13.439 -)
  13.440 -
  13.441 -(defun YaTeX-send-string ()
  13.442 -  "Send string to current typeset process."
  13.443 -  (interactive)
  13.444 -  (if (and (eq (process-status YaTeX-typeset-process) 'run)
  13.445 -	   (>= (point) (process-mark YaTeX-typeset-process)))
  13.446 -      (let ((b (process-mark YaTeX-typeset-process))
  13.447 -	    (e (point-end-of-line)))
  13.448 -	(goto-char b)
  13.449 -	(skip-chars-forward " \t" e)
  13.450 -	(setq b (point))
  13.451 -	(process-send-string
  13.452 -	 YaTeX-typeset-process (concat (buffer-substring b e) "\n"))
  13.453 -	(goto-char e)
  13.454 -	(insert "\n")
  13.455 -	(set-marker (process-mark YaTeX-typeset-process) (point))
  13.456 -	(insert " "))
  13.457 -    (ding))
  13.458 -)
  13.459 -
  13.460 -(defun YaTeX-view-error ()
  13.461 -  (interactive)
  13.462 -  (if (null (get-buffer YaTeX-typeset-buffer))
  13.463 -      (message "No typeset buffer found.")
  13.464 -    (let ((win (selected-window)))
  13.465 -      (YaTeX-showup-buffer YaTeX-typeset-buffer nil t)
  13.466 -      ;; Next 3 lines are obsolete because YaTeX-typesetting-buffer is
  13.467 -      ;; automatically scrolled up at typesetting.
  13.468 -      ;;(goto-char (point-max))
  13.469 -      ;;(forward-line -1)
  13.470 -      ;;(recenter -1)
  13.471 -      (select-window win)))
  13.472 -)
  13.473 -
  13.474 -(defun YaTeX-get-error-file (default)
  13.475 -  "Get current processing file from typesetting log."
  13.476 -  (save-excursion
  13.477 -    (let(s)
  13.478 -      (condition-case () (up-list -1)
  13.479 -	(error
  13.480 -	 (let ((list 0) found)
  13.481 -	   (while
  13.482 -	       (and (<= list 0) (not found)
  13.483 -		    (re-search-backward "\\((\\)\\|\\()\\)" nil t))
  13.484 -	     (if (equal (match-beginning 0) (match-beginning 2)) ;close paren.
  13.485 -		 (setq list (1- list)) ;open paren
  13.486 -	       (setq list (1+ list))
  13.487 -	       (if (= list 1)
  13.488 -		   (if (looking-at "\\([^,{}%]+\.\\)tex\\|sty")
  13.489 -		       (setq found t)
  13.490 -		     (setq list (1- list)))))))))
  13.491 -      (setq s
  13.492 -	    (buffer-substring
  13.493 -	     (progn (forward-char 1) (point))
  13.494 -	     (progn (skip-chars-forward "-A-Za-z0-9_/\.\\" (point-end-of-line))
  13.495 -		    (point))))
  13.496 -      (if (string= "" s) default s)))
  13.497 -)
  13.498 -      
  13.499 -(defun YaTeX-put-nonstopmode ()
  13.500 -  (if YaTeX-need-nonstop
  13.501 -      (if (re-search-backward "\\\\nonstopmode{}" (point-min) t)
  13.502 -	  nil                    ;if already written in text then do nothing
  13.503 -	(save-excursion
  13.504 -	  (YaTeX-visit-main t)
  13.505 -	  (goto-char (point-min))
  13.506 -	  (insert "\\nonstopmode{}%_YaTeX_%\n")))
  13.507 -    )
  13.508 -)
  13.509 -
  13.510 -(defun YaTeX-remove-nonstopmode ()
  13.511 -  (if YaTeX-need-nonstop ;for speed
  13.512 -      (save-excursion
  13.513 -	(YaTeX-visit-main t)
  13.514 -	(goto-char (point-min))
  13.515 -	(forward-line 1)
  13.516 -	(narrow-to-region (point-min) (point))
  13.517 -	(goto-char (point-min))
  13.518 -	(delete-matching-lines "^\\\\nonstopmode\\{\\}%_YaTeX_%$")
  13.519 -	(widen)))
  13.520 -)
  13.521 -
  13.522 -(defun YaTeX-get-preview-file-name ()
  13.523 -  "Get file name to preview by inquiring YaTeX-get-latex-command"
  13.524 -  (let* ((latex-cmd (YaTeX-get-latex-command t))
  13.525 -	 (rin (rindex latex-cmd ? ))
  13.526 -	 (fname (if (> rin -1) (substring latex-cmd (1+ rin)) ""))
  13.527 -	 (period))
  13.528 -    (if (string= fname "")
  13.529 -	(setq fname (substring (file-name-nondirectory
  13.530 -				(buffer-file-name))
  13.531 -			       0 -4))
  13.532 -      (setq period (rindex fname ?.))
  13.533 -      (setq fname (substring fname 0 (if (eq -1 period) nil period)))
  13.534 -      ))
  13.535 -)
  13.536 -
  13.537 -(defun YaTeX-get-latex-command (&optional switch)
  13.538 -  "Specify the latex-command name and its argument.
  13.539 -If there is a line which begins with string: \"%#!\", the following
  13.540 -strings are assumed to be the latex-command and arguments.  The
  13.541 -default value of latex-command is:
  13.542 -	tex-command FileName
  13.543 -and if you write \"%#!jlatex\" in the beginning of certain line.
  13.544 -	\"jlatex \" FileName
  13.545 -will be the latex-command,
  13.546 -and you write \"%#!jlatex main.tex\" on some line and argument SWITCH
  13.547 -is non-nil, then
  13.548 -	\"jlatex main.tex\"
  13.549 -
  13.550 -will be given to the shell."
  13.551 -  (let (magic command target)
  13.552 -    (setq parent
  13.553 -	  (cond
  13.554 -	   (YaTeX-parent-file YaTeX-parent-file)
  13.555 -	   (t (save-excursion
  13.556 -		(YaTeX-visit-main t)
  13.557 -		(file-name-nondirectory (buffer-file-name)))))
  13.558 -	  magic (YaTeX-get-builtin "!"))
  13.559 -    (cond
  13.560 -     (magic
  13.561 -      (cond
  13.562 -       (switch (if (string-match "\\s " magic) magic
  13.563 -		 (concat magic " " parent)))
  13.564 -       (t (concat (substring magic 0 (string-match "\\s " magic)) " "))))
  13.565 -     (t (concat tex-command " " (if switch parent)))))
  13.566 -)
  13.567 -
  13.568 -(defvar YaTeX-lpr-command-history nil
  13.569 -  "Holds command line history of YaTeX-lpr.")
  13.570 -(put 'YaTeX-lpr-command-history 'no-default t)
  13.571 -(defun YaTeX-lpr (arg)
  13.572 -  "Print out.  If prefix arg ARG is non nil, call print driver without
  13.573 -page range description."
  13.574 -  (interactive "P")
  13.575 -  (let*((cmd (or (YaTeX-get-builtin "LPR") dviprint-command-format))
  13.576 -	from to (lbuffer "*dvi-printing*"))
  13.577 -    (setq
  13.578 -     cmd 
  13.579 -     (YaTeX-replace-format
  13.580 -      cmd "f"
  13.581 -      (if (or arg (not (string-match "%f" cmd)))
  13.582 -	      ""
  13.583 -	    (YaTeX-replace-format
  13.584 -	     dviprint-from-format
  13.585 -	     "b"
  13.586 -	     (if (string=
  13.587 -		  (setq from (read-string "From page(default 1): ")) "")
  13.588 -		 "1" from))))
  13.589 -       )
  13.590 -    (setq
  13.591 -     cmd
  13.592 -     (YaTeX-replace-format
  13.593 -      cmd "t"
  13.594 -      (if (or arg (not (string-match "%t" cmd))
  13.595 -	      (string= 
  13.596 -	       (setq to (read-string "To page(default none): ")) ""))
  13.597 -	  ""
  13.598 -	(YaTeX-replace-format dviprint-to-format "e" to)))
  13.599 -     )
  13.600 -    (setq cmd
  13.601 -	  (let ((minibuffer-history-symbol 'YaTeX-lpr-command-history))
  13.602 -	    (read-string "Edit command line: "
  13.603 -			 (format cmd (YaTeX-get-preview-file-name)))))
  13.604 -    (save-excursion
  13.605 -      (YaTeX-visit-main t) ;;change execution directory
  13.606 -      (YaTeX-showup-buffer
  13.607 -       lbuffer (function (lambda (x) (nth 3 (window-edges x)))))
  13.608 -      (set-buffer (get-buffer-create lbuffer))
  13.609 -      (erase-buffer)
  13.610 -      (cond
  13.611 -       (YaTeX-dos
  13.612 -	(call-process shell-file-name "con" "*dvi-printing*" nil
  13.613 -		      YaTeX-shell-command-option cmd))
  13.614 -       (t
  13.615 -	(set-process-buffer
  13.616 -	 (start-process "print" "*dvi-printing*" shell-file-name
  13.617 -			YaTeX-shell-command-option cmd)
  13.618 -	 (get-buffer lbuffer))
  13.619 -	(message "Starting printing command: %s..." cmd)))
  13.620 -      ))
  13.621 -)
  13.622 -
  13.623 -(defun YaTeX-main-file-p ()
  13.624 -  "Return if current buffer is main LaTeX source."
  13.625 -  (cond
  13.626 -   ((YaTeX-get-builtin "!")
  13.627 -    (string-match (YaTeX-guess-parent (YaTeX-get-builtin "!")) (buffer-name)))
  13.628 -   (t
  13.629 -    (save-excursion
  13.630 -      (let ((latex-main-id (concat "^\\s *" YaTeX-ec-regexp "documentstyle")))
  13.631 -	(or (re-search-backward latex-main-id nil t)
  13.632 -	    (re-search-forward latex-main-id nil t))))))
  13.633 -)
  13.634 -
  13.635 -(defun YaTeX-visit-main (&optional setbuf)
  13.636 -  "Switch buffer to main LaTeX source.
  13.637 -Use set-buffer instead of switch-to-buffer if the optional second argument
  13.638 -SETBUF is t(Use it only from Emacs-Lisp program)."
  13.639 -  (interactive)
  13.640 -  (let (b-in main-file)
  13.641 -    (if (setq b-in (YaTeX-get-builtin "!"))
  13.642 -	(setq main-file (YaTeX-guess-parent b-in)))
  13.643 -    (if YaTeX-parent-file
  13.644 -	(setq main-file ;;(get-file-buffer YaTeX-parent-file)
  13.645 -	      YaTeX-parent-file))
  13.646 -    (if (YaTeX-main-file-p)
  13.647 -	(if (interactive-p) (message "I think this is main LaTeX source.") nil)
  13.648 -      (cond
  13.649 -       ((and (interactive-p) main-file (get-buffer-window main-file))
  13.650 -	(select-window (get-buffer-window main-file)))
  13.651 -       ((and main-file (YaTeX-switch-to-buffer main-file setbuf)))
  13.652 -       ((and main-file
  13.653 -	     (file-exists-p (setq main-file (concat "../" main-file)))
  13.654 -	     (y-or-n-p (concat (expand-file-name main-file)
  13.655 -			       " is main file?:")))
  13.656 -	(YaTeX-switch-to-buffer main-file setbuf))
  13.657 -       (t (setq main-file (read-file-name "Enter your main text: " nil nil 1))
  13.658 -	  (setq YaTeX-parent-file main-file)
  13.659 -	  (find-file main-file))
  13.660 -       )))
  13.661 -  nil
  13.662 -)
  13.663 -
  13.664 -
  13.665 -(defun YaTeX-guess-parent (command-line)
  13.666 -  (setq command-line
  13.667 -	(if (string-match ".*\\s " command-line)
  13.668 -	    (substring command-line (match-end 0))
  13.669 -	  (file-name-nondirectory (buffer-file-name)))
  13.670 -	command-line
  13.671 -	(concat (if (string-match "\\(.*\\)\\." command-line)
  13.672 -		    (substring command-line (match-beginning 1) (match-end 1))
  13.673 -		  command-line)
  13.674 -		".tex"))
  13.675 -)
  13.676 -
  13.677 -(defun YaTeX-visit-main-other-window ()
  13.678 -  "Switch to buffer main LaTeX source in other window."
  13.679 -  (interactive)
  13.680 -  (if (YaTeX-main-file-p) (message "I think this is main LaTeX source.")
  13.681 -      (YaTeX-switch-to-buffer-other-window
  13.682 -       (concat (YaTeX-get-preview-file-name) ".tex")))
  13.683 -)
  13.684 -
  13.685 -(defun YaTeX-get-builtin (key)
  13.686 -  "Read source built-in command of %# usage."
  13.687 -  (save-excursion
  13.688 -    (goto-char (point-min))
  13.689 -    (if (and (re-search-forward
  13.690 -	      (concat "^" (regexp-quote (concat "%#" key))) nil t)
  13.691 -	     (not (eolp)))
  13.692 -	(buffer-substring
  13.693 -	 (progn (skip-chars-forward " 	" (point-end-of-line))(point))
  13.694 -	 (point-end-of-line))
  13.695 -      nil))
  13.696 -)
  13.697 -
  13.698 -(defun YaTeX-save-buffers ()
  13.699 -  "Save buffers which is in yatex-mode."
  13.700 -  (basic-save-buffer)
  13.701 -  (save-excursion
  13.702 -    (mapcar '(lambda (buf)
  13.703 -	       (set-buffer buf)
  13.704 -	       (if (and (buffer-file-name buf)
  13.705 -			(eq major-mode 'yatex-mode)
  13.706 -			(buffer-modified-p buf)
  13.707 -			(y-or-n-p (format "Save %s" (buffer-name buf))))
  13.708 -		   (save-buffer buf)))
  13.709 -	    (buffer-list)))
  13.710 -)
  13.711 -
  13.712 -(provide 'yatexprc)
  13.713 +;;; -*- Emacs-Lisp -*-
  13.714 +;;; YaTeX process handler.
  13.715 +;;; yatexprc.el
  13.716 +;;; (c )1993-1994 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp]
  13.717 +;;; Last modified Wed Dec 14 16:58:15 1994 on 98fa
  13.718 +;;; $Id$
  13.719 +
  13.720 +(require 'yatex)
  13.721 +
  13.722 +(defvar YaTeX-typeset-process nil
  13.723 +  "Process identifier for jlatex"
  13.724 +)
  13.725 +(defvar YaTeX-typeset-buffer "*YaTeX-typesetting*"
  13.726 +  "Process buffer for jlatex")
  13.727 +
  13.728 +(defvar YaTeX-typeset-buffer-syntax nil
  13.729 +  "*Syntax table for typesetting buffer")
  13.730 +
  13.731 +(defvar YaTeX-current-TeX-buffer nil
  13.732 +  "Keeps the buffer on which recently typeset run.")
  13.733 +
  13.734 +(defvar YaTeX-shell-command-option
  13.735 +  (or (and (boundp 'shell-command-option) shell-command-option)
  13.736 +      (if YaTeX-dos "/c" "-c"))
  13.737 +  "Shell option for command execution.")
  13.738 +
  13.739 +(if YaTeX-typeset-buffer-syntax nil
  13.740 +  (setq YaTeX-typeset-buffer-syntax
  13.741 +	(make-syntax-table (standard-syntax-table)))
  13.742 +  (modify-syntax-entry ?\{ "w" YaTeX-typeset-buffer-syntax)
  13.743 +  (modify-syntax-entry ?\} "w" YaTeX-typeset-buffer-syntax)
  13.744 +  (modify-syntax-entry ?\[ "w" YaTeX-typeset-buffer-syntax)
  13.745 +  (modify-syntax-entry ?\] "w" YaTeX-typeset-buffer-syntax)
  13.746 +)
  13.747 +
  13.748 +(defun YaTeX-typeset (command buffer)
  13.749 +  "Execute jlatex (or other) to LaTeX typeset."
  13.750 +  (interactive)
  13.751 +  (save-excursion
  13.752 +    (let ((p (point)) (window (selected-window)) execdir (cb (current-buffer)))
  13.753 +      (if (and YaTeX-typeset-process
  13.754 +	       (eq (process-status YaTeX-typeset-process) 'run))
  13.755 +	  ;; if tex command is halting.
  13.756 +	  (YaTeX-kill-typeset-process YaTeX-typeset-process))
  13.757 +      (YaTeX-visit-main t) ;;execution directory
  13.758 +      (setq execdir default-directory)
  13.759 +      ;;Select lower-most window if there are more than 2 windows and
  13.760 +      ;;typeset buffer not seen.
  13.761 +      (YaTeX-showup-buffer
  13.762 +       buffer (function (lambda (x) (nth 3 (window-edges x)))))
  13.763 +      (set-buffer (get-buffer-create buffer))
  13.764 +      (setq default-directory execdir)
  13.765 +      (cd execdir)
  13.766 +      (erase-buffer)
  13.767 +      (cond
  13.768 +       (YaTeX-dos			;if MS-DOS
  13.769 +	(YaTeX-put-nonstopmode)
  13.770 +	(call-process
  13.771 +	 shell-file-name nil buffer nil YaTeX-shell-command-option command)
  13.772 +	(YaTeX-remove-nonstopmode))
  13.773 +       (t				;if UNIX
  13.774 +	(set-process-buffer
  13.775 +	 (setq YaTeX-typeset-process
  13.776 +	       (start-process "LaTeX" buffer shell-file-name
  13.777 +			      YaTeX-shell-command-option command))
  13.778 +	 (get-buffer buffer))
  13.779 +	(set-process-sentinel YaTeX-typeset-process 'YaTeX-typeset-sentinel)))
  13.780 +      (message (format "Calling `%s'..." command))
  13.781 +      (setq YaTeX-current-TeX-buffer (buffer-name))
  13.782 +      (use-local-map YaTeX-typesetting-mode-map)
  13.783 +      (set-syntax-table YaTeX-typeset-buffer-syntax)
  13.784 +      (setq mode-name "typeset")
  13.785 +      (if YaTeX-typeset-process		; if process is running (maybe on UNIX)
  13.786 +	  (cond ((boundp 'MULE)
  13.787 +		 (set-current-process-coding-system
  13.788 +		  YaTeX-latex-message-code YaTeX-coding-system))
  13.789 +		((boundp 'NEMACS)
  13.790 +		 (set-kanji-process-code YaTeX-latex-message-code))))
  13.791 +      (if YaTeX-dos (message "Done.")
  13.792 +	(insert " ")
  13.793 +	(set-marker (process-mark YaTeX-typeset-process) (1- (point))))
  13.794 +      (if (bolp) (forward-line -1))	;what for?
  13.795 +      (if (and YaTeX-emacs-19 window-system)
  13.796 +	  (let ((win (get-buffer-window buffer t)) owin)
  13.797 +	    (select-frame (window-frame win))
  13.798 +	    (setq owin (selected-window))
  13.799 +	    (select-window win)
  13.800 +	    (goto-char (point-max))
  13.801 +	    (recenter -1)
  13.802 +	    (select-window owin))
  13.803 +	(select-window (get-buffer-window buffer))
  13.804 +	(goto-char (point-max))
  13.805 +	(recenter -1))
  13.806 +      (select-window window)
  13.807 +      (switch-to-buffer cb)))
  13.808 +)
  13.809 +
  13.810 +(defun YaTeX-typeset-sentinel (proc mes)
  13.811 +  (cond ((null (buffer-name (process-buffer proc)))
  13.812 +         ;; buffer killed
  13.813 +         (set-process-buffer proc nil))
  13.814 +        ((memq (process-status proc) '(signal exit))
  13.815 +         (let* ((obuf (current-buffer)) (pbuf (process-buffer proc))
  13.816 +		(pwin (get-buffer-window pbuf))
  13.817 +		(owin (selected-window)) win)
  13.818 +           ;; save-excursion isn't the right thing if
  13.819 +           ;;  process-buffer is current-buffer
  13.820 +           (unwind-protect
  13.821 +               (progn
  13.822 +                 ;; Write something in *typesetting* and hack its mode line
  13.823 +		 (if pwin
  13.824 +		     (select-window pwin)
  13.825 +		   (set-buffer pbuf))
  13.826 +		 ;;(YaTeX-showup-buffer pbuf nil t)
  13.827 +                 (goto-char (point-max))
  13.828 +		 (if pwin (recenter -3))
  13.829 +                 (insert ?\n "latex typesetting " mes)
  13.830 +                 (forward-char -1)
  13.831 +                 (insert " at " (substring (current-time-string) 0 -5) "\n")
  13.832 +                 (forward-char 1)
  13.833 +                 (setq mode-line-process
  13.834 +                       (concat ": "
  13.835 +                               (symbol-name (process-status proc))))
  13.836 +		 (message "latex typesetting %s."
  13.837 +			  (if (eq (process-status proc) 'exit)
  13.838 +			      "done" "ceased"))
  13.839 +                 ;; If buffer and mode line shows that the process
  13.840 +                 ;; is dead, we can delete it now.  Otherwise it
  13.841 +                 ;; will stay around until M-x list-processes.
  13.842 +                 (delete-process proc)
  13.843 +		 )
  13.844 +             (setq YaTeX-typeset-process nil)
  13.845 +             ;; Force mode line redisplay soon
  13.846 +             (set-buffer-modified-p (buffer-modified-p))
  13.847 +	     )
  13.848 +	   (select-window owin)
  13.849 +	   (set-buffer obuf))))
  13.850 +)
  13.851 +
  13.852 +(defvar YaTeX-texput-file "texput.tex"
  13.853 +  "*File name for temporary file of typeset-region."
  13.854 +)
  13.855 +
  13.856 +(defun YaTeX-typeset-region ()
  13.857 +  "Paste the region to the file `texput.tex' and execute jlatex (or other)
  13.858 +to LaTeX typeset.  The region is specified by the rule:
  13.859 +	(1)If keyword `%#BEGIN' is found in the upper direction from (point).
  13.860 +	  (1-1)if the keyword `%#END' is found after `%#BEGIN',
  13.861 +		->Assume the text between `%#BEGIN' and `%#END' as region.
  13.862 +	  (1-2)if the keyword `%#END' is not found anywhere after `%#BEGIN',
  13.863 +		->Assume the text after `%#BEGIN' as region.
  13.864 +	(2)If no `%#BEGIN' usage is found before the (point),
  13.865 +		->Assume the text between current (point) and (mark) as region.
  13.866 +DON'T forget to eliminate the `%#BEGIN/%#END' notation after editing
  13.867 +operation to the region."
  13.868 +  (interactive)
  13.869 +  (save-excursion
  13.870 +    (let*
  13.871 +	((end "") typeout ;Type out message that tells the method of cutting.
  13.872 +	 (texput YaTeX-texput-file)
  13.873 +	 (cmd (concat (YaTeX-get-latex-command nil) " " texput))
  13.874 +	 (buffer (current-buffer)) opoint preamble (subpreamble "") main
  13.875 +	 (hilit-auto-highlight nil)	;for Emacs19 with hilit19
  13.876 +	 reg-begin reg-end)
  13.877 +
  13.878 +      (save-excursion
  13.879 +	(if (search-backward "%#BEGIN" nil t)
  13.880 +	    (progn
  13.881 +	      (setq typeout "--- Region from BEGIN to "
  13.882 +		    end "the end of the buffer ---"
  13.883 +		    reg-begin (match-end 0))
  13.884 +	      (if (search-forward "%#END" nil t)
  13.885 +		  (setq reg-end (match-beginning 0)
  13.886 +			end "END ---")
  13.887 +		(setq reg-end (point-max))))
  13.888 +	  (setq typeout "=== Region from (point) to (mark) ===")
  13.889 +	  (setq reg-begin (point) reg-end (mark)))
  13.890 +	(goto-char (point-min))
  13.891 +	(while (search-forward "%#REQUIRE" nil t)
  13.892 +	  (setq subpreamble
  13.893 +		(concat subpreamble
  13.894 +			(cond
  13.895 +			 ((eolp)
  13.896 +			  (buffer-substring
  13.897 +			   (match-beginning 0)
  13.898 +			   (point-beginning-of-line)))
  13.899 +			 (t (buffer-substring
  13.900 +			     (match-end 0)
  13.901 +			     (point-end-of-line))))
  13.902 +			"\n"))
  13.903 +	  (goto-char (match-end 0))))
  13.904 +      (YaTeX-visit-main t)
  13.905 +      (setq main (current-buffer))
  13.906 +      (setq opoint (point))
  13.907 +      (goto-char (point-min))
  13.908 +      (setq
  13.909 +       preamble
  13.910 +       (if (re-search-forward "^[ 	]*\\\\begin.*{document}" nil t)
  13.911 +	   (buffer-substring (point-min) (match-end 0))
  13.912 +	 (concat "\\documentstyle{" YaTeX-default-document-style "}\n"
  13.913 +		 "\\begin{document}")))
  13.914 +      (goto-char opoint)
  13.915 +      ;;(set-buffer buffer)		;for clarity
  13.916 +      (set-buffer (find-file-noselect texput))
  13.917 +      ;;(find-file YaTeX-texput-file)
  13.918 +      (erase-buffer)
  13.919 +      (if YaTeX-need-nonstop
  13.920 +	  (insert "\\nonstopmode{}\n"))
  13.921 +      (insert preamble "\n" subpreamble "\n")
  13.922 +      (insert-buffer-substring buffer reg-begin reg-end)
  13.923 +      (insert "\\typeout{" typeout end "}\n") ;Notice the selected method.
  13.924 +      (insert "\n\\end{document}\n")
  13.925 +      (basic-save-buffer)
  13.926 +      (kill-buffer (current-buffer))
  13.927 +      (set-buffer main)		;return to parent file or itself.
  13.928 +      (YaTeX-typeset cmd YaTeX-typeset-buffer)
  13.929 +      (switch-to-buffer buffer)		;for Emacs-19
  13.930 +      (put 'dvi2-command 'region t)))
  13.931 +)
  13.932 +
  13.933 +(defun YaTeX-typeset-buffer ()
  13.934 +  "Typeset whole buffer.  If %#! usage says other buffer is main text,
  13.935 +visit main buffer to confirm if its includeonly list contains current
  13.936 +buffer's file.  And if it doesn't contain editing text, ask user which
  13.937 +action wants to be done, A:Add list, R:Replace list, %:comment-out list."
  13.938 +  (interactive)
  13.939 +  (YaTeX-save-buffers)
  13.940 +  (let*((me (substring (buffer-name) 0 (rindex (buffer-name) ?.)))
  13.941 +	(mydir (file-name-directory (buffer-file-name)))
  13.942 +	(cmd (YaTeX-get-latex-command t)) (cb (current-buffer)))
  13.943 +    (if (YaTeX-main-file-p) nil
  13.944 +      (save-excursion
  13.945 +	(YaTeX-visit-main t)	;search into main buffer
  13.946 +	(save-excursion
  13.947 +	  (push-mark (point) t)
  13.948 +	  (goto-char (point-min))
  13.949 +	  (if (and (re-search-forward "^[ 	]*\\\\begin{document}" nil t)
  13.950 +		   (re-search-backward "^[ 	]*\\\\includeonly{" nil t))
  13.951 +	      (let*
  13.952 +		  ((b (progn (skip-chars-forward "^{") (point)))
  13.953 +		   (e (progn (skip-chars-forward "^}") (1+ (point))))
  13.954 +		   (s (buffer-substring b e)) c
  13.955 +		   (pardir (file-name-directory (buffer-file-name))))
  13.956 +		(if (string-match (concat "[{,/]" me "[,}]") s)
  13.957 +		    nil ; Nothing to do when it's already in includeonly.
  13.958 +		  (ding)
  13.959 +		  (switch-to-buffer (current-buffer));Display this buffer.
  13.960 +		  (setq
  13.961 +		   me	  ;;Rewrite my name(me) to contain sub directory name.
  13.962 +		   (concat
  13.963 +		    (if (string-match pardir mydir) ;if mydir is child of main
  13.964 +			(substring mydir (length pardir)) ;cut absolute path
  13.965 +		      mydir) ;else concat absolute path name.
  13.966 +		    me))
  13.967 +		  (message
  13.968 +		   "`%s' is not in \\includeonly. A)dd R)eplace %%)comment? "
  13.969 +		   me)
  13.970 +		  (setq c (read-char))
  13.971 +		  (cond
  13.972 +		   ((= c ?a)
  13.973 +		    (goto-char (1+ b))
  13.974 +		    (insert me (if (string= s "{}") "" ",")))
  13.975 +		   ((= c ?r)
  13.976 +		    (delete-region (1+ b) (1- e)) (insert me))
  13.977 +		   ((= c ?%)
  13.978 +		    (beginning-of-line) (insert "%"))
  13.979 +		   (t nil))
  13.980 +		  (basic-save-buffer))))
  13.981 +	  (exchange-point-and-mark)))
  13.982 +      (switch-to-buffer cb))		;for 19
  13.983 +    (YaTeX-typeset cmd YaTeX-typeset-buffer)
  13.984 +    (put 'dvi2-command 'region nil))
  13.985 +)
  13.986 +
  13.987 +(defvar YaTeX-call-command-history nil
  13.988 +  "Holds history list of YaTeX-call-command-on-file.")
  13.989 +(put 'YaTeX-call-command-history 'no-default t)
  13.990 +(defun YaTeX-call-command-on-file (base-cmd buffer)
  13.991 +  (YaTeX-save-buffers)
  13.992 +  (YaTeX-typeset
  13.993 +   (read-string-with-history
  13.994 +    "Call command: "
  13.995 +    (concat base-cmd " " (YaTeX-get-preview-file-name))
  13.996 +    'YaTeX-call-command-history)
  13.997 +   buffer)
  13.998 +)
  13.999 +
 13.1000 +(defun YaTeX-bibtex-buffer (cmd)
 13.1001 +  "Pass the bibliography data of editing file to bibtex."
 13.1002 +  (interactive)
 13.1003 +  (YaTeX-save-buffers)
 13.1004 +  (YaTeX-call-command-on-file cmd "*YaTeX-bibtex*" )
 13.1005 +)
 13.1006 +
 13.1007 +(defun YaTeX-kill-typeset-process (proc)
 13.1008 +  "Kill process PROC after sending signal to PROC.
 13.1009 +PROC should be process identifier."
 13.1010 +  (cond
 13.1011 +   (YaTeX-dos
 13.1012 +    (error "MS-DOS can't have concurrent process."))
 13.1013 +   ((or (null proc) (not (eq (process-status proc) 'run)))
 13.1014 +    (message "Typesetting process is not running."))
 13.1015 +   (t
 13.1016 +    (save-excursion
 13.1017 +      (set-buffer (process-buffer proc))
 13.1018 +      (save-excursion
 13.1019 +	(goto-char (point-max))
 13.1020 +	(beginning-of-line)
 13.1021 +	(if (looking-at "\\? +$")
 13.1022 +	    (let ((mp (point-max)))
 13.1023 +	      (process-send-string proc "x\n")
 13.1024 +	      (while (= mp (point-max)) (sit-for 1))))))
 13.1025 +    (if (eq (process-status proc) 'run)
 13.1026 +	(progn
 13.1027 +	  (interrupt-process proc)
 13.1028 +	  (delete-process proc)))))
 13.1029 +)
 13.1030 +
 13.1031 +(defun YaTeX-system (command buffer)
 13.1032 +  "Execute some command on buffer.  Not a official function."
 13.1033 +  (save-excursion
 13.1034 +    (YaTeX-showup-buffer
 13.1035 +     buffer (function (lambda (x) (nth 3 (window-edges x)))))
 13.1036 +    (set-buffer (get-buffer-create buffer))
 13.1037 +    (erase-buffer)
 13.1038 +    (if YaTeX-dos
 13.1039 +	(call-process
 13.1040 +	 shell-file-name nil buffer nil YaTeX-shell-command-option command)
 13.1041 +      (set-process-buffer
 13.1042 +       (start-process
 13.1043 +	"system" buffer shell-file-name YaTeX-shell-command-option command)
 13.1044 +       (get-buffer buffer))))
 13.1045 +)
 13.1046 +
 13.1047 +(defvar YaTeX-preview-command-history nil
 13.1048 +  "Holds minibuffer history of preview command.")
 13.1049 +(put 'YaTeX-preview-command-history 'no-default t)
 13.1050 +(defvar YaTeX-preview-file-history nil
 13.1051 +  "Holds minibuffer history of file to preview.")
 13.1052 +(put 'YaTeX-preview-file-history 'no-default t)
 13.1053 +(defun YaTeX-preview (preview-command preview-file)
 13.1054 +  "Execute xdvi (or other) to tex-preview."
 13.1055 +  (interactive
 13.1056 +   (list
 13.1057 +    (read-string-with-history
 13.1058 +     "Preview command: " dvi2-command 'YaTeX-preview-command-history)
 13.1059 +    (read-string-with-history
 13.1060 +     "Preview file[.dvi]: "
 13.1061 +     (if (get 'dvi2-command 'region)
 13.1062 +	 (substring YaTeX-texput-file
 13.1063 +		    0 (rindex YaTeX-texput-file ?.))
 13.1064 +       (YaTeX-get-preview-file-name))
 13.1065 +     'YaTeX-preview-file-history)))
 13.1066 +  (setq dvi2-command preview-command)	;`dvi2command' is buffer local
 13.1067 +  (save-excursion
 13.1068 +    (YaTeX-visit-main t)
 13.1069 +    (let ((pbuffer "*dvi-preview*") (dir default-directory))
 13.1070 +      (YaTeX-showup-buffer
 13.1071 +       pbuffer (function (lambda (x) (nth 3 (window-edges x)))))
 13.1072 +      (set-buffer (get-buffer-create pbuffer))
 13.1073 +      (erase-buffer)
 13.1074 +      (setq default-directory dir)	;for 18
 13.1075 +      (cd dir)				;for 19
 13.1076 +      (cond
 13.1077 +       (YaTeX-dos			;if MS-DOS
 13.1078 +	(send-string-to-terminal "\e[2J\e[>5h") ;CLS & hide cursor
 13.1079 +	(call-process shell-file-name "con" "*dvi-preview*" nil
 13.1080 +		      YaTeX-shell-command-option preview-command preview-file)
 13.1081 +	(send-string-to-terminal "\e[>5l") ;show cursor
 13.1082 +	(redraw-display))
 13.1083 +       (t				;if UNIX
 13.1084 +	(set-process-buffer
 13.1085 +	 (start-process "preview" "*dvi-preview*" shell-file-name
 13.1086 +			YaTeX-shell-command-option
 13.1087 +			(concat preview-command " " preview-file))
 13.1088 +	 (get-buffer pbuffer))
 13.1089 +	(message
 13.1090 +	 (concat "Starting " preview-command
 13.1091 +		 " to preview " preview-file))))))
 13.1092 +)
 13.1093 +
 13.1094 +(defun YaTeX-prev-error ()
 13.1095 +  "Visit previous typeset error.
 13.1096 +  To avoid making confliction of line numbers by editing, jump to
 13.1097 +error or warning lines in reverse order."
 13.1098 +  (interactive)
 13.1099 +  (let ((cur-buf (buffer-name)) (cur-win (selected-window))
 13.1100 +	error-line typeset-win error-buffer error-win)
 13.1101 +    (if (null (get-buffer YaTeX-typeset-buffer))
 13.1102 +	(error "There is no typesetting buffer."))
 13.1103 +    (YaTeX-showup-buffer YaTeX-typeset-buffer nil t)
 13.1104 +    (setq typeset-win (selected-window))
 13.1105 +    (if (re-search-backward
 13.1106 +	 (concat "\\(" latex-error-regexp "\\)\\|\\("
 13.1107 +		 latex-warning-regexp "\\)")
 13.1108 +	 nil t)
 13.1109 +	nil
 13.1110 +      (select-window cur-win)
 13.1111 +      (error "No more erros on %s" cur-buf))
 13.1112 +    (goto-char (match-beginning 0))
 13.1113 +    (skip-chars-forward "^0-9" (match-end 0))
 13.1114 +    (setq error-line
 13.1115 +	  (string-to-int
 13.1116 +	   (buffer-substring
 13.1117 +	    (point)
 13.1118 +	    (progn (skip-chars-forward "0-9" (match-end 0)) (point))))
 13.1119 +	  error-buffer (YaTeX-get-error-file cur-buf)
 13.1120 +	  error-win (get-buffer-window error-buffer))
 13.1121 +    (if (or (null error-line) (equal 0 error-line))
 13.1122 +	(error "Can't detect error position."))
 13.1123 +    (select-window cur-win)
 13.1124 +    (cond
 13.1125 +     (error-win (select-window error-win))
 13.1126 +     ((eq (get-lru-window) typeset-win)
 13.1127 +      (YaTeX-switch-to-buffer error-buffer))
 13.1128 +     (t (select-window (get-lru-window))
 13.1129 +	(YaTeX-switch-to-buffer error-buffer)))
 13.1130 +    (setq error-win (selected-window))
 13.1131 +    (goto-line error-line)
 13.1132 +    (message "LaTeX %s in `%s' on line: %d."
 13.1133 +	     (if (match-beginning 1) "error" "warning")
 13.1134 +	     error-buffer error-line)
 13.1135 +    (select-window typeset-win)
 13.1136 +    (skip-chars-backward "0-9")
 13.1137 +    (recenter (/ (window-height) 2))
 13.1138 +    (sit-for 3)
 13.1139 +    (goto-char (match-beginning 0))
 13.1140 +    (select-window error-win))
 13.1141 +)
 13.1142 +
 13.1143 +(defun YaTeX-jump-error-line ()
 13.1144 +  "Jump to corresponding line on latex command's error message."
 13.1145 +  (interactive)
 13.1146 +  (let (error-line error-file error-buf)
 13.1147 +    (save-excursion
 13.1148 +      (beginning-of-line)
 13.1149 +      (setq error-line (re-search-forward "l[ ines]*\\.?\\([1-9][0-9]*\\)"
 13.1150 +					  (point-end-of-line) t)))
 13.1151 +    (if (null error-line)
 13.1152 +	(if (eobp) (insert (this-command-keys))
 13.1153 +	  (error "No line number expression."))
 13.1154 +      (goto-char (match-beginning 0))
 13.1155 +      (setq error-line (string-to-int
 13.1156 +			(buffer-substring (match-beginning 1) (match-end 1)))
 13.1157 +	    error-file (YaTeX-get-error-file YaTeX-current-TeX-buffer)
 13.1158 +	    error-buf (YaTeX-switch-to-buffer error-file t))
 13.1159 +      (if (null error-buf)
 13.1160 +	  (error "`%s' is not found in this directory." error-file))
 13.1161 +      (YaTeX-showup-buffer error-buf nil t)
 13.1162 +      (goto-line error-line)))
 13.1163 +)
 13.1164 +
 13.1165 +(defun YaTeX-send-string ()
 13.1166 +  "Send string to current typeset process."
 13.1167 +  (interactive)
 13.1168 +  (if (and (eq (process-status YaTeX-typeset-process) 'run)
 13.1169 +	   (>= (point) (process-mark YaTeX-typeset-process)))
 13.1170 +      (let ((b (process-mark YaTeX-typeset-process))
 13.1171 +	    (e (point-end-of-line)))
 13.1172 +	(goto-char b)
 13.1173 +	(skip-chars-forward " \t" e)
 13.1174 +	(setq b (point))
 13.1175 +	(process-send-string
 13.1176 +	 YaTeX-typeset-process (concat (buffer-substring b e) "\n"))
 13.1177 +	(goto-char e)
 13.1178 +	(insert "\n")
 13.1179 +	(set-marker (process-mark YaTeX-typeset-process) (point))
 13.1180 +	(insert " "))
 13.1181 +    (ding))
 13.1182 +)
 13.1183 +
 13.1184 +(defun YaTeX-view-error ()
 13.1185 +  (interactive)
 13.1186 +  (if (null (get-buffer YaTeX-typeset-buffer))
 13.1187 +      (message "No typeset buffer found.")
 13.1188 +    (let ((win (selected-window)))
 13.1189 +      (YaTeX-showup-buffer YaTeX-typeset-buffer nil t)
 13.1190 +      ;; Next 3 lines are obsolete because YaTeX-typesetting-buffer is
 13.1191 +      ;; automatically scrolled up at typesetting.
 13.1192 +      ;;(goto-char (point-max))
 13.1193 +      ;;(forward-line -1)
 13.1194 +      ;;(recenter -1)
 13.1195 +      (select-window win)))
 13.1196 +)
 13.1197 +
 13.1198 +(defun YaTeX-get-error-file (default)
 13.1199 +  "Get current processing file from typesetting log."
 13.1200 +  (save-excursion
 13.1201 +    (let(s)
 13.1202 +      (condition-case () (up-list -1)
 13.1203 +	(error
 13.1204 +	 (let ((list 0) found)
 13.1205 +	   (while
 13.1206 +	       (and (<= list 0) (not found)
 13.1207 +		    (re-search-backward "\\((\\)\\|\\()\\)" nil t))
 13.1208 +	     (if (equal (match-beginning 0) (match-beginning 2)) ;close paren.
 13.1209 +		 (setq list (1- list)) ;open paren
 13.1210 +	       (setq list (1+ list))
 13.1211 +	       (if (= list 1)
 13.1212 +		   (if (looking-at "\\([^,{}%]+\.\\)tex\\|sty")
 13.1213 +		       (setq found t)
 13.1214 +		     (setq list (1- list)))))))))
 13.1215 +      (setq s
 13.1216 +	    (buffer-substring
 13.1217 +	     (progn (forward-char 1) (point))
 13.1218 +	     (progn (skip-chars-forward "^ \n" (point-end-of-line))
 13.1219 +		    (point))))
 13.1220 +      (if (string= "" s) default s)))
 13.1221 +)
 13.1222 +      
 13.1223 +(defun YaTeX-put-nonstopmode ()
 13.1224 +  (if YaTeX-need-nonstop
 13.1225 +      (if (re-search-backward "\\\\nonstopmode{}" (point-min) t)
 13.1226 +	  nil                    ;if already written in text then do nothing
 13.1227 +	(save-excursion
 13.1228 +	  (YaTeX-visit-main t)
 13.1229 +	  (goto-char (point-min))
 13.1230 +	  (insert "\\nonstopmode{}%_YaTeX_%\n")))
 13.1231 +    )
 13.1232 +)
 13.1233 +
 13.1234 +(defun YaTeX-remove-nonstopmode ()
 13.1235 +  (if YaTeX-need-nonstop ;for speed
 13.1236 +      (save-excursion
 13.1237 +	(YaTeX-visit-main t)
 13.1238 +	(goto-char (point-min))
 13.1239 +	(forward-line 1)
 13.1240 +	(narrow-to-region (point-min) (point))
 13.1241 +	(goto-char (point-min))
 13.1242 +	(delete-matching-lines "^\\\\nonstopmode\\{\\}%_YaTeX_%$")
 13.1243 +	(widen)))
 13.1244 +)
 13.1245 +
 13.1246 +(defun YaTeX-get-preview-file-name ()
 13.1247 +  "Get file name to preview by inquiring YaTeX-get-latex-command"
 13.1248 +  (let* ((latex-cmd (YaTeX-get-latex-command t))
 13.1249 +	 (rin (rindex latex-cmd ? ))
 13.1250 +	 (fname (if (> rin -1) (substring latex-cmd (1+ rin)) ""))
 13.1251 +	 (period))
 13.1252 +    (if (string= fname "")
 13.1253 +	(setq fname (substring (file-name-nondirectory
 13.1254 +				(buffer-file-name))
 13.1255 +			       0 -4))
 13.1256 +      (setq period (rindex fname ?.))
 13.1257 +      (setq fname (substring fname 0 (if (eq -1 period) nil period)))
 13.1258 +      ))
 13.1259 +)
 13.1260 +
 13.1261 +(defun YaTeX-get-latex-command (&optional switch)
 13.1262 +  "Specify the latex-command name and its argument.
 13.1263 +If there is a line which begins with string: \"%#!\", the following
 13.1264 +strings are assumed to be the latex-command and arguments.  The
 13.1265 +default value of latex-command is:
 13.1266 +	tex-command FileName
 13.1267 +and if you write \"%#!jlatex\" in the beginning of certain line.
 13.1268 +	\"jlatex \" FileName
 13.1269 +will be the latex-command,
 13.1270 +and you write \"%#!jlatex main.tex\" on some line and argument SWITCH
 13.1271 +is non-nil, then
 13.1272 +	\"jlatex main.tex\"
 13.1273 +
 13.1274 +will be given to the shell."
 13.1275 +  (let (magic command target)
 13.1276 +    (setq parent
 13.1277 +	  (cond
 13.1278 +	   (YaTeX-parent-file YaTeX-parent-file)
 13.1279 +	   (t (save-excursion
 13.1280 +		(YaTeX-visit-main t)
 13.1281 +		(file-name-nondirectory (buffer-file-name)))))
 13.1282 +	  magic (YaTeX-get-builtin "!"))
 13.1283 +    (cond
 13.1284 +     (magic
 13.1285 +      (cond
 13.1286 +       (switch (if (string-match "\\s " magic) magic
 13.1287 +		 (concat magic " " parent)))
 13.1288 +       (t (concat (substring magic 0 (string-match "\\s " magic)) " "))))
 13.1289 +     (t (concat tex-command " " (if switch parent)))))
 13.1290 +)
 13.1291 +
 13.1292 +(defvar YaTeX-lpr-command-history nil
 13.1293 +  "Holds command line history of YaTeX-lpr.")
 13.1294 +(put 'YaTeX-lpr-command-history 'no-default t)
 13.1295 +(defun YaTeX-lpr (arg)
 13.1296 +  "Print out.  If prefix arg ARG is non nil, call print driver without
 13.1297 +page range description."
 13.1298 +  (interactive "P")
 13.1299 +  (let*((cmd (or (YaTeX-get-builtin "LPR") dviprint-command-format))
 13.1300 +	from to (lbuffer "*dvi-printing*"))
 13.1301 +    (setq
 13.1302 +     cmd 
 13.1303 +     (YaTeX-replace-format
 13.1304 +      cmd "f"
 13.1305 +      (if (or arg (not (string-match "%f" cmd)))
 13.1306 +	      ""
 13.1307 +	    (YaTeX-replace-format
 13.1308 +	     dviprint-from-format
 13.1309 +	     "b"
 13.1310 +	     (if (string=
 13.1311 +		  (setq from (read-string "From page(default 1): ")) "")
 13.1312 +		 "1" from))))
 13.1313 +       )
 13.1314 +    (setq
 13.1315 +     cmd
 13.1316 +     (YaTeX-replace-format
 13.1317 +      cmd "t"
 13.1318 +      (if (or arg (not (string-match "%t" cmd))
 13.1319 +	      (string= 
 13.1320 +	       (setq to (read-string "To page(default none): ")) ""))
 13.1321 +	  ""
 13.1322 +	(YaTeX-replace-format dviprint-to-format "e" to)))
 13.1323 +     )
 13.1324 +    (setq cmd
 13.1325 +	  (read-string-with-history
 13.1326 +	   "Edit command line: "
 13.1327 +	   (format cmd (YaTeX-get-preview-file-name))
 13.1328 +	   'YaTeX-lpr-command-history))
 13.1329 +    (save-excursion
 13.1330 +      (YaTeX-visit-main t) ;;change execution directory
 13.1331 +      (YaTeX-showup-buffer
 13.1332 +       lbuffer (function (lambda (x) (nth 3 (window-edges x)))))
 13.1333 +      (set-buffer (get-buffer-create lbuffer))
 13.1334 +      (erase-buffer)
 13.1335 +      (cond
 13.1336 +       (YaTeX-dos
 13.1337 +	(call-process shell-file-name "con" "*dvi-printing*" nil
 13.1338 +		      YaTeX-shell-command-option cmd))
 13.1339 +       (t
 13.1340 +	(set-process-buffer
 13.1341 +	 (start-process "print" "*dvi-printing*" shell-file-name
 13.1342 +			YaTeX-shell-command-option cmd)
 13.1343 +	 (get-buffer lbuffer))
 13.1344 +	(message "Starting printing command: %s..." cmd)))
 13.1345 +      ))
 13.1346 +)
 13.1347 +
 13.1348 +(defun YaTeX-main-file-p ()
 13.1349 +  "Return if current buffer is main LaTeX source."
 13.1350 +  (cond
 13.1351 +   ((YaTeX-get-builtin "!")
 13.1352 +    (string-match (YaTeX-guess-parent (YaTeX-get-builtin "!")) (buffer-name)))
 13.1353 +   (t
 13.1354 +    (save-excursion
 13.1355 +      (let ((latex-main-id (concat "^\\s *" YaTeX-ec-regexp "documentstyle")))
 13.1356 +	(or (re-search-backward latex-main-id nil t)
 13.1357 +	    (re-search-forward latex-main-id nil t))))))
 13.1358 +)
 13.1359 +
 13.1360 +(defun YaTeX-visit-main (&optional setbuf)
 13.1361 +  "Switch buffer to main LaTeX source.
 13.1362 +Use set-buffer instead of switch-to-buffer if the optional second argument
 13.1363 +SETBUF is t(Use it only from Emacs-Lisp program)."
 13.1364 +  (interactive "P")
 13.1365 +  (if (and (interactive-p) setbuf) (setq YaTeX-parent-file nil))
 13.1366 +  (let (b-in main-file)
 13.1367 +    (if (setq b-in (YaTeX-get-builtin "!"))
 13.1368 +	(setq main-file (YaTeX-guess-parent b-in)))
 13.1369 +    (if YaTeX-parent-file
 13.1370 +	(setq main-file ;;(get-file-buffer YaTeX-parent-file)
 13.1371 +	      YaTeX-parent-file))
 13.1372 +    (if (YaTeX-main-file-p)
 13.1373 +	(if (interactive-p) (message "I think this is main LaTeX source.") nil)
 13.1374 +      (cond
 13.1375 +       ((and (interactive-p) main-file (get-file-buffer main-file))
 13.1376 +	(goto-buffer-window main-file))
 13.1377 +       ((and main-file (YaTeX-switch-to-buffer main-file setbuf)))
 13.1378 +       ((and main-file
 13.1379 +	     (file-exists-p (setq main-file (concat "../" main-file)))
 13.1380 +	     (y-or-n-p (concat (expand-file-name main-file)
 13.1381 +			       " is main file?:")))
 13.1382 +	(setq YaTeX-parent-file main-file)
 13.1383 +	(YaTeX-switch-to-buffer main-file setbuf))
 13.1384 +       (t (setq main-file (read-file-name "Enter your main text: " nil nil 1))
 13.1385 +	  (setq YaTeX-parent-file main-file)
 13.1386 +	  (YaTeX-switch-to-buffer main-file setbuf))
 13.1387 +       )))
 13.1388 +  nil
 13.1389 +)
 13.1390 +
 13.1391 +
 13.1392 +(defun YaTeX-guess-parent (command-line)
 13.1393 +  (setq command-line
 13.1394 +	(if (string-match ".*\\s " command-line)
 13.1395 +	    (substring command-line (match-end 0))
 13.1396 +	  (file-name-nondirectory (buffer-file-name)))
 13.1397 +	command-line
 13.1398 +	(concat (if (string-match "\\(.*\\)\\." command-line)
 13.1399 +		    (substring command-line (match-beginning 1) (match-end 1))
 13.1400 +		  command-line)
 13.1401 +		".tex"))
 13.1402 +)
 13.1403 +
 13.1404 +(defun YaTeX-visit-main-other-window ()
 13.1405 +  "Switch to buffer main LaTeX source in other window."
 13.1406 +  (interactive)
 13.1407 +  (if (YaTeX-main-file-p) (message "I think this is main LaTeX source.")
 13.1408 +      (YaTeX-switch-to-buffer-other-window
 13.1409 +       (concat (YaTeX-get-preview-file-name) ".tex")))
 13.1410 +)
 13.1411 +
 13.1412 +(defun YaTeX-get-builtin (key)
 13.1413 +  "Read source built-in command of %# usage."
 13.1414 +  (save-excursion
 13.1415 +    (goto-char (point-min))
 13.1416 +    (if (and (re-search-forward
 13.1417 +	      (concat "^" (regexp-quote (concat "%#" key))) nil t)
 13.1418 +	     (not (eolp)))
 13.1419 +	(buffer-substring
 13.1420 +	 (progn (skip-chars-forward " 	" (point-end-of-line))(point))
 13.1421 +	 (point-end-of-line))
 13.1422 +      nil))
 13.1423 +)
 13.1424 +
 13.1425 +(defun YaTeX-save-buffers ()
 13.1426 +  "Save buffers which is in yatex-mode."
 13.1427 +  (basic-save-buffer)
 13.1428 +  (save-excursion
 13.1429 +    (mapcar '(lambda (buf)
 13.1430 +	       (set-buffer buf)
 13.1431 +	       (if (and (buffer-file-name buf)
 13.1432 +			(eq major-mode 'yatex-mode)
 13.1433 +			(buffer-modified-p buf)
 13.1434 +			(y-or-n-p (format "Save %s" (buffer-name buf))))
 13.1435 +		   (save-buffer buf)))
 13.1436 +	    (buffer-list)))
 13.1437 +)
 13.1438 +
 13.1439 +(provide 'yatexprc)