# HG changeset patch # User yuuji # Date 1072325432 0 # Node ID 0734be649cb83885e829198ebebf2a55f09584de # Parent 5b19f901fa1605309fa50608abc5a1b5627b1a47 Do not care file-coding-system when YaTeX-kanji-code is nil. New completion yatexpkg.el is introduced. diff -r 5b19f901fa16 -r 0734be649cb8 docs/yatexadd.doc --- a/docs/yatexadd.doc Fri May 02 11:23:59 2003 +0000 +++ b/docs/yatexadd.doc Thu Dec 25 04:10:32 2003 +0000 @@ -38,13 +38,19 @@ 【関数定義】 付加関数には、各LaTeXコマンドのオプション引数を返す形式のもの、 - section型補完の引数を返すもの、の二種類があります。 + section型補完の引数を返すもの、リジョン括りsection型補完の引数該当 + 部を処理するためのもの、三種類があります。ここでは便宜上その三つを、 - 前者は、以下の例のように、begin型補完では\begin{環境名}の直後に - 付加する文字列、section型補完では LaTeX コマンド名と第一引数の間に - 位置する文字列、maketitle型補完では LaTeX コマンド名の直後に位置す - る文字列を返すような関数です。便宜上この形の付加関数を、追加型付加 - 関数と呼ぶことにします。 + a. 追加型付加関数 + b. 引数型付加関数 + c. 括り補完時付加関数 + + と呼ぶことにします。 + + a は、以下の例のように、begin型補完では\begin{環境名}の直後に付 + 加する文字列、section型補完では LaTeX コマンド名と第一引数の間に位 + 置する文字列、maketitle型補完では LaTeX コマンド名の直後に位置する + 文字列を返すような関数です。 (例) \begin{table}[ht] (付加関数名 YaTeX:table) ~~~~ @@ -56,8 +62,8 @@ 追加型付加関数は『LaTeXコマンド名の前に YaTeX: をつけた名前』で定 義します。 - 後者は、以下のようにsection型コマンドの引数となる文字列を返す - 関数です。この形の付加関数を引数型付加関数と呼ぶことにします。 + b は、以下のようにsection型コマンドの引数となる文字列を返す関数 + です。 (例) \newcommand{\foo}{bar} (付加関数名 YaTeX::newcommand) ~~~~ ~~~ @@ -68,6 +74,21 @@ て、引数型付加関数は整数の引数を一つ取るものとして定義し、その引数 の値により処理を決定することになります。 + (yatex.1.72の新機能) + c は、既存テキストの一部をsection型コマンドの引数として括るとき + に、指定したりジョンの先頭と末尾の各ポイントを引数として呼ばれます。 + たとえば、 + + 5/3 + + というテキストをリジョン指定して [prefix] S でセクション型コマンド + で括りたいときに、括られるテキストに対してなんらかの処理をほどこし + たいときに呼ばれます。 + + (例) 5/3 ←5/3をリジョン指定し \frac で括る + \frac{5/3} ←5/3のポイント位置を引数に呼ばれる + ~~~ (付加関数 YaTeX::frac-region) + 【定義例】 @@ -110,6 +131,30 @@ なお、引数型付加関数が nil を返した場合は、通常の引数入力関数が呼 ばれます。 + 最後に括り補完時付加関数の例として、既存テキストを \frac で括 + る場合の例を示します。\frac は2つの引数を取り、\frac{a}{b} のよ + うにして、分数を表すときに利用するコマンドです。数学的には + + a + a/b ⇔ ---- + b + + と置き換え可能な記法です。LaTeXソースにa/bと書いたものを野鳥の括 + り補完で\fracに括ると、以下のようになります。 + + \frac{a/b} + + /の部分を }{ に置き換えれば正しい書き換えになります。このような + ことを対話的に半自動で行なうアドイン関数は以下のようにします。 + + (defun YaTeX::frac-region (beg end) ;リジョンの先頭と末尾 + (catch 'done + (while (search-forward "/" end t) ;/がある間繰り返す + (goto-char (match-beginning 0)) ;/の位置に移動 + (if (y-or-n-p "Replace this slash(/) to `}{'") + (throw 'done (replace-match "}{"))) ;置き換えて終了 + (goto-char (match-end 0))))) + 【呼ばれ方】 @@ -118,7 +163,8 @@ \begin{環境名} が自動入力された直後に呼び出されます。section型補完 では第一引数の補完の直前、maketitle型補完の場合は、コマンド名の直 後(一つのスペースを挿入する直前)に呼び出されます。引数型付加関数は、 - section型コマンドの引数の入力時にその都度呼ばれます。 + section型コマンドの引数の入力時にその都度呼ばれます。括り補完時付 + 加関数は、LaTeXコマンドと{}がテキストに挿入された直後に呼ばれます。 【参考】 diff -r 5b19f901fa16 -r 0734be649cb8 docs/yatexe.tex --- a/docs/yatexe.tex Fri May 02 11:23:59 2003 +0000 +++ b/docs/yatexe.tex Thu Dec 25 04:10:32 2003 +0000 @@ -5,7 +5,7 @@ @iftex @c @syncodeindex fn cp -@c Last modified Fri Feb 2 12:39:12 2001 on firestorm +@c Last modified Fri Sep 12 12:04:11 2003 on firestorm @syncodeindex vr cp @end iftex @@ -15,7 +15,7 @@ @subtitle Yet Another tex-mode for emacs @title Wild Bird @subtitle // YaTeX // -@author @copyright{} 1991-1996 by HIROSE, Yuuji [yuuji@@yatex.org] +@author @copyright{} 1991-2003 by HIROSE, Yuuji [yuuji@@yatex.org] @end titlepage @node Top, What is YaTeX?, (dir), (dir) @@ -30,7 +30,7 @@ * Main features:: What YaTeX can do * Installation:: Guide to install * Typesetting:: Call typesetting processes -* %#notation:: +* %#notation:: Meta-keyword `%#' * Completion:: Input LaTeX commands with completion * Local dictionaries:: Directory dependent completion * Commenting out:: Commenting/uncommenting text @@ -40,6 +40,7 @@ * Updation of includeonly:: Free from maintaining includeonly * What column:: Check what table-column the cursor belong * Intelligent newline:: Guess requisites of new line +* Usepackage checker:: Selecting correct \usepackage is YaTeX's job * Online help:: On-line documentation of LaTeX * Browsing file hierarchy:: Walking through file hierarchy * Cooperation with other packages:: Work well with gmhist, min-out @@ -47,75 +48,6 @@ * Etcetera:: YaTeX is acquisitive. * Copying:: Redistribution - --- The Detailed Node Listing --- - -Typesetting - -* Calling typesetter:: -* Calling previewer:: -* Printing out:: - -%# notation - -* Changing typesetter:: -* Static region for typesetting:: -* Lpr format:: -* Editing %# notation:: - -Completion - -* Begin-type completion:: -* Section-type completion:: -* Large-type completion:: -* Maketitle-type completion:: -* Arbitrary completion:: -* End completion:: -* Accent completion:: -* Image completion:: -* Greek letters completion:: - -Section-type completion - -* view-sectioning:: - -Cursor jump - -* Jump to corresponding object:: -* Invoking image processor:: -* Jump to main file:: -* Jumping around the environment:: -* Jumping to last completion position:: - -Changing and Deleting - -* Changing LaTeX commands:: -* Killing LaTeX commands:: - -Customizations - -* Lisp variables:: -* Add-in functions:: -* Add-in generator:: - -Lisp variables - -* All customizable variables:: -* Sample definitions:: -* Hook variables:: -* Hook file:: - -Procedure - -* How the add-in function works:: -* How the function is called:: -* Useful functions for creating add-in:: -* Contribution:: - -How the add-in function works - -* Defining option-add-in:: -* Defining argument-add-in:: -@end menu @node What is YaTeX?, Main features, Top, Top @comment node-name, next, previous, up @@ -1348,7 +1280,7 @@ in the minibuffer. Type @kbd{a} if you want to add the current file name to @code{\includeonly} list, @kbd{r} to replace \@code{includeonly} list -by the current file, and type @kbd{%} to comment out the +with the current file, and type @kbd{%} to comment out the @code{\includeonly} line. @node What column, Intelligent newline, Updation of includeonly, Top @@ -1389,7 +1321,7 @@ virtual column headers by putting them in the first line and commenting that line with @code{%}. -@node Intelligent newline, Online help, What column, Top +@node Intelligent newline, Usepackage checker, What column, Top @comment node-name, next, previous, up @chapter Intelligent newline @cindex Intelligent newline @@ -1440,7 +1372,22 @@ useful. See the definition of the function @code{YaTeX-intelligent-newline-itemize} as an example. -@node Online help, Browsing file hierarchy, Intelligent newline, Top +@node Usepackage checker, Online help, Intelligent newline, Top +@comment node-name, next, previous, up +@chapter Usepackage checker +@cindex usepackage + +When you input begint-type, section-type, maketitle-type macros with +completion, and it requires some LaTeX2e package, YaTeX examines +the existence of correct @code{\usepackage}. If not, YaTeX inserts +the @code{\usepackage@{@}} declaration corresponding to input macro. + +To activate the package completion for your favarite package, +set the variable @code{YaTeX-package-alist-private} correctly. +Please refere the value of @code{YaTeX-package-alist-default} as an +example. + +@node Online help, Browsing file hierarchy, Usepackage checker, Top @comment node-name, next, previous, up @chapter Online help @cindex online help @@ -1631,6 +1578,17 @@ are to change some of these variables, see more detailed documentation of the variable by @kbd{M-x describe-variable}. +@defvar YaTeX-japan +Set this nil to produce all messages in English +(@code{Depends on Japanese feature of Emacs}) +@end defvar + +@defvar YaTeX-kanji-code +Default buffer-file-coding-system for YaTeX modes' buffer. +Set this 0 to no language conversion. Nil to preserve original +coding-system. (@code{1 or 2}) +@end defvar + @defvar YaTeX-prefix Prefix key stroke (@kbd{C-c}) @end defvar @@ -1831,6 +1789,28 @@ (@code{(featurep 'hilit19)} @end defvar +@defvar YaTeX-singlecmd-suffix +Suffix which is always inserted after maketitle-type macros. +@code{"{}"} is recommended. +@end defvar + +@defvar YaTeX-package-alist-private +Alist of LaTeX2e-package name vs. lists of macros in it. +Set this alist properly and YaTeX automatically check the declaratiion of +`usepackage' for corresponding macro, when you input that macro with +completion. If required `usepackage' is not found, YaTeX also +automatically inserts `\usepackage'. Alist is as follows; +@lisp + '((PackageName1 + (completionType ListOfMacro) + (completionType ListOfMacro)) + (PackageName2 + (completionType ListOfMacro) + (completionType ListOfMacro...))....) +@end lisp +completionType is one of @code{env, section, maketitle}. +Consult the value of @code{YaTeX-package-alist-default} as an example. +@end defvar @node Sample definitions, Hook variables, All customizable variables, Lisp variables @comment node-name, next, previous, up @@ -1919,7 +1899,18 @@ @comment node-name, next, previous, up @subsection How the add-in function works - There are two kinds of add-in. @dfn{Option add-in} returns the +There are three types of add-in. + +@enumerate +@item +Option add-in +@item +argument add-in +@item +enclosing add-in +@end enumerate + +@dfn{Option add-in} returns the La@TeX{}'s optional parameters such as optional strings after @code{\begin@{ENV@}}, optional strings between a section-type command and its first argument, and optional strings just after type @@ -1952,9 +1943,33 @@ command is being read. Thus the add-in should determine the job referring the value of its argument. + @dfn{enclosing add-in} is for modifying and/or checking the region that +will be enclosed by section-type commands via @kbd{[prefix] S}. An +enclosing add-in function will be called with two arguments, beginning of +the enclosed region and end of the region. Suppose you want to enclose +the existing text @code{(a+b)/c} by @code{\frac{}}. + +@display +a/c +| | +A B +@end display + +You do set-mark-command at point A and then move to point B. Typing +@kbd{[prefix] S} and input @code{frac} enclose the region like this; + +@display +\frac{a/c} +@end display + +Normally, the expression @code{a/c} is translated to +@code{\frac@{a@}@{c@}}. An enclosing add-in is useful for modifying +@code{/} to @code{@}@{}. + @menu * Defining option-add-in:: * Defining argument-add-in:: +* Defining enclosing-add-in:: @end menu @node Defining option-add-in, Defining argument-add-in, How the add-in function works, How the add-in function works @@ -1984,7 +1999,7 @@ (concat "@{" (read-string "Rule: ") "@}")) @end lisp -@node Defining argument-add-in, , Defining option-add-in, How the add-in function works +@node Defining argument-add-in, Defining enclosing-add-in, Defining option-add-in, How the add-in function works @comment node-name, next, previous, up @subsubsection Defining `argument add-in' @@ -2007,6 +2022,29 @@ Note that when the `argument add-in' function return `nil', normal argument reader will be called. +@node Defining enclosing-add-in, , Defining argument-add-in, How the add-in function works +@comment node-name, next, previous, up +@subsubsection Defining `enclosing add-in' + + This section describes how to define the add-in function for +text enclosed by @code{\frac@{@}}. + + When enclosing the text @code{5/3} by @code{\frac@{@}}, you might want to +replace @code{/} with @code{@}@{}. Enclosing function +@code{YaTeX::frac-region} is called with two arguments, beginning of +enclosed text and end of enclosed text. The function is expected to +replace @code{/} with @code{@}@{}. Here is an example expression. + +@lisp +(defun YaTeX::frac-region (beg end) + (catch 'done + (while (search-forward "/" end t) + (goto-char (match-beginning 0)) + (if (y-or-n-p "Replace this slash(/) with `}{'") + (throw 'done (replace-match "}{"))) + (goto-char (match-end 0))))) +@end lisp + @node How the function is called, Useful functions for creating add-in, How the add-in function works, Add-in functions @comment node-name, next, previous, up @subsection How the function is called @@ -2282,7 +2320,7 @@ as a result of using this software. However, any reports and suggestions are welcome as long as I feel interests in this software. My possible e-mail address is `yuuji@@yatex.org'. -(up to Dec.2000 at least) And there is mailing list for YaTeX. +(up to Sep.2003 at least) And there is mailing list for YaTeX. Although the common language is Japanese, questions in English will be welcome. To join the ML, send the mail whose subject is `append' to the address `yatex@@yatex.org. If you have some diff -r 5b19f901fa16 -r 0734be649cb8 docs/yatexj.tex --- a/docs/yatexj.tex Fri May 02 11:23:59 2003 +0000 +++ b/docs/yatexj.tex Thu Dec 25 04:10:32 2003 +0000 @@ -10,7 +10,7 @@ @c ノードいじったら C-l C-u C-n 全部のノード更新 C-l C-u C-e @c メニュー増やしたら C-l C-u C-m 全部のメニュー更新 C-l C-u C-a @c フォーマットするときは C-l C-e C-b -@c Last modified Fri Feb 2 10:03:49 2001 on firestorm +@c Last modified Fri Aug 29 01:55:00 2003 on firestorm @syncodeindex vr cp @end iftex @@ -20,7 +20,7 @@ @subtitle Yet Another tex-mode for emacs @title 『野鳥』 @subtitle // YaTeX // -@author @copyright{} 1991-2000 by HIROSE, Yuuji [yuuji@@yatex.org] +@author @copyright{} 1991-2003 by HIROSE, Yuuji [yuuji@@yatex.org] @end titlepage @node Top, Intro, (dir), (dir) @@ -42,6 +42,7 @@ * Includeonly:: 勝手に includeonly * What column:: カラム位置ガイド * Intelligent newline:: おまかせ改行 +* Usepackage cheker:: 先回りusepackage * Changing mode of YaTeX:: 野鳥動作モード変更 * Online help:: LaTeXオンラインヘルプ * Inclusion hierarchy browser:: ファイル分割階層構造の表示 @@ -51,65 +52,6 @@ * Copying:: 取り扱い * Concept Index:: 索引 - --- The Detailed Node Listing --- - -latexコマンド起動 - -* Calling typesetter:: タイプセッタ起動 -* Calling previewer:: プレヴューア起動 -* Print out:: プリントアウト用コマンドの起動 - -%#記法 - -* Changing typesetter:: タイプセット用コマンドの変更 -* Splitting input files:: 入力ファイル分割 -* Fix region for typesetting:: 領域の固定 -* lpr format:: プリントアウトコマンド用フォーマット -* Editing %# notation:: %#記法の編集 - -補完入力 - -* begin型補完:: -* section型補完:: -* large型補完:: -* maketitle型補完:: -* Arbitrary completion:: 随時補完 -* end補完:: -* Accent mark completion:: アクセント記号補完 -* Image completion:: 数式記号イメージ補完 -* Greek letter completion:: ギリシャ文字補完 - -section型補完 - -* 2個以上の引数をとる section型コマンド:: -* Enclose section-type command:: 括り補完 -* Recursive completion:: 再帰補完 -* view-sectioning:: セクション区切りのアウトライン表示 - -カーソルジャンプ - -* 対応オブジェクトへのジャンプ:: -* お絵描きツール起動:: -* メインファイルへのジャンプ:: -* 環境を単位としたジャンプ:: -* 最後の補完位置へのジャンプ:: - -変更/削除 - -* Changing LaTeX command:: La@TeX{} コマンドの変更 -* Killing LaTeX command:: La@TeX{} コマンドの削除 - -カスタマイズ - -* Lisp variables:: lisp 変数 -* Add-in functions:: 付加関数(アドイン関数) - -lisp 変数 - -* All customizable variables:: カスタマイズ変数一覧 -* Sample definitions:: カスタマイズ変数設定例 -* Hook variables:: hook変数 -* Hook file:: hook用ファイル @end menu @node Intro, Terminology, Top, Top @@ -1566,7 +1508,7 @@ す。もし項目名として別のものを表示して欲しい場合は、行頭を@code{%}にしてダ ミーの項目並びを作っておくと良いでしょう。 -@node Intelligent newline, Changing mode of YaTeX, What column, Top +@node Intelligent newline, Usepackage cheker, What column, Top @comment node-name, next, previous, up @chapter おまかせ改行 @cindex おまかせ改行[おまかせかいきよう] @@ -1612,7 +1554,22 @@ いでしょう。@file{yatexenv.el}内の関数 @code{YaTeX-intelligent-newline-itemize} の定義などを参考にしてください。 -@node Changing mode of YaTeX, Online help, Intelligent newline, Top +@node Usepackage cheker, Changing mode of YaTeX, Intelligent newline, Top +@comment node-name, next, previous, up +@chapter 先回りusepackage +@cindex 先回りusepackage[さきまわり] + + begin型、section型、maketitle型、いずれかのLaTeX2eマクロを補完入力すると、 +そのマクロの利用に外部パッケージを必要とする場合、そのパッケージを +本文中で @code{\usepackage@{@}} しているかどうかを調査し、もししていなければ +プリアンブルに対応するパッケージを引数にした @code{\usepackage} 文を +(確認後に)挿入します。 + + ただしこの機能が働くためには、パッケージ名とその中で定義されているマクロ +群をalistの形式で変数 @code{YaTeX-package-alist-private} に設定しておく必 +要があります。 + +@node Changing mode of YaTeX, Online help, Usepackage cheker, Top @comment node-name, next, previous, up @chapter 野鳥の動作モード切り替え @cindex モード切り替え[もうときりかえ] @@ -1841,7 +1798,9 @@ @end defvar @defvar YaTeX-kanji-code -文書を作成する時の漢字コード 1=Shift JIS, 2=JIS, 3=EUC (2 (MS-DOSでは1)) +文書を作成する時の漢字コード +nil=既存のコードのまま 0=no-conversion1=Shift JIS, +2=JIS, 3=EUC (2 (MS-DOSでは1)) @end defvar @defvar tex-command @@ -2034,6 +1993,30 @@ (@code{(featurep 'hilit19)} @end defvar +@defvar YaTeX-singlecmd-suffix +全てのmaketitle型コマンドの補完入力直後に挿入する文字列。 +@code{"{}"} などがお勧め。 +@end defvar + +@defvar YaTeX-package-alist-private +LaTeX2eのパッケージ名とその中に含まれるマクロのリスト。 +適切に設定しておくと本文入力時にマクロを補完入力すると +そのマクロに必要なパッケージを usepackage するか自動的に検査してくれる。 +していなければ \usepackage を自動追加することもできる。 +リストは +@lisp + '((パッケージ名1 + (補完タイプ マクロのリスト……) + (補完タイプ マクロのリスト……)) + (パッケージ名2 + (補完タイプ マクロのリスト……) + (補完タイプ マクロのリスト……))………) +@end lisp +という形式にする。補完タイプは @code{env, section, maketitle} のどれか。 +具体例は変数 @code{YaTeX-package-alist-default} +の値参照。 +@end defvar + @node Sample definitions, Hook variables, All customizable variables, Lisp variables @comment node-name, next, previous, up @subsection カスタマイズ変数設定例 @@ -2125,7 +2108,7 @@ ただくと、作者は喜んでサポートに励むことでしょう。 苦情、希望、バグ報告、感想等は歓迎いたします。 -連絡は yuuji@@yatex.org まで(2000年12月現在)。 +連絡は yuuji@@yatex.org まで(2003年9月現在)。 継続的に使用してくださる方はメイリングリスト「fj野鳥の会」に 是非加入してください。加入方法については本パッケージの @file{docs/qanda} ファイルの「その他」の章を御覧ください。 diff -r 5b19f901fa16 -r 0734be649cb8 help/YATEXHLP.eng --- a/help/YATEXHLP.eng Fri May 02 11:23:59 2003 +0000 +++ b/help/YATEXHLP.eng Thu Dec 25 04:10:32 2003 +0000 @@ -1299,6 +1299,166 @@ Begin a new page and create the parbox-ed BOX whose width is \textwidth. This is useful to make a page-acrossing title in a twocolumn page. +breakbox +\begin{breakbox} ... \end{breakbox} +Make a surrounding frame extended across pages. +Useful for cite a long program list. +Requires `\usepackage{eclbkbox}' + +verbfile +\verbfile{FILE} +Include a FILE in verbatim format. +Requires `\usepackage{misc}' +See also \listing + +listing +\listing{FILE} +Include a FILE in verbatim format with line number. +Requires `\usepackage{misc}' +See also \verbfile + +ascmac +\usepackage{ascmac} +The `ascmac' package provides +* \boxnote environment notebook-like box +* \screen environment corner-rounded box suitable for screen output +* \itembox environment itemizing box +* \shadebox environment shaded box +* \keytop macro keytop +* \yen Yen mark +* \return-key +* \mask, \maskbox + +boxnote +\begin{boxnote} ... \end{boxnote} +Enclose with notebook-like square. +Defined in ascmac.sty. + + + +screen +\begin{screen} ... \end{screen} +Enclose with corner-rounded square which stands for screen output. +Requires `\usepackage{ascmac}' + + + +itembox +\begin{itembox}{ITEMSTRING} ... \end{itembox} +Enclose box with ITEMSTRING header. +Requires `\usepackage{ascmac}' + + +shadebox +\begin{shadebox} ... \end{shadebox} +Enclose shaded box. +Requires `\usepackage{ascmac}' + + +keytop +\keytop{KEY} +Output a keytop designed character. +Requires `\usepackage{ascmac}' + + +mask +\mask{STRING}{MASKTYPE} +Make a masked STRING. MASKTYPE is one of character A through K. + +eg.) \mask{This is a pen!}{C} + +Mask types are viewed at +http://www.yatex.org/help/ascmac-mask.jpg + +Defined in `\usepackage{ascmac}' + + + +maskbox +\maskbox{WIDTH}{HEIGHT}{MASKTYPE}{POS}{STRING} +Make a masked box of WIDTH x HEIGHT which contains STRING located in POS. +Masking type MASKTYPE is one of character A through K. + +eg.) \maskbox{5cm}{2.5em}{G}{c}{Year!} + +Mask types are viewed at +http://www.yatex.org/help/ascmac-mask.jpg + +Requires `\usepackage{ascmac}' + + +alltt +\begin{alltt} ... \end{alltt} +An environment like verbatim except in which TeX macro can be used. + +comment +\begin{comment} ... \end{comment} +Comment out enclosed environment. +But if \includeversion{comment} appears, enclosed part activated. +Putting \excludeversion{ENV} defines new environment ENV which +works equivalently to comment environment. + +Requires `\usepackage{version}' + +bou +\bou{STRING} +Put the emphasizing dot on each characters in STRING. + +Requires `\usepackage{plext}' + +url +\url{URL_STRING} +Put URL string with reasonable folding. + +Requires `\usepackage{url}' + +longtable +\begin{longtable}{POSSTRING} ... \end{longtable} +Same as table, but can be spreaded across pages. + +Requires `\usepackage{longtable}' + +fancybox +\usepackage{fancybox} +Provides some fancy boxes. +* \shadowbox{} +* \ovalbox{} +* \doublebox{} + +shadowbox +\shadowbox{STRING} +Surround a STRING by shadow box. + +Require `\usepackage{fancybox}` + + + +ovalbox +\ovalbox{STRING} +Surround a STRING by oval box + +Require `\usepackage{fancybox}` + + + +Ovalbox +\Ovalbox{STRING} +Surround a STRING by thick oval box. + +Require `\usepackage{fancybox}` + + + +doublebox +\doublebox{STRING} +Surround a STRING by double frame. + +Require `\usepackage{fancybox}` + + + + + YaTeX (setq auto-mode-alist (cons '("\\.tex$" . yatex-mode) auto-mode-alist)) The mode you are probably using now. diff -r 5b19f901fa16 -r 0734be649cb8 help/YATEXHLP.jp --- a/help/YATEXHLP.jp Fri May 02 11:23:59 2003 +0000 +++ b/help/YATEXHLP.jp Thu Dec 25 04:10:32 2003 +0000 @@ -1,7 +1,11 @@ %%% %%% 野鳥-LaTeXヘルプファイル(c)HIROSE Yuuji [yuuji@yatex.org] -%%% 機械的に変換して野鳥以外のデバイスで利用することを許可します。 -%%% その際にコピーライト表示と含まれている項目を削除しないでください。 +%%% このヘルプファイルを野鳥以外のデバイスで利用することを許可します。 +%%% 項目の修正や追加は自由に行なって構いませんが、そのことを +%%% 知らせて頂けるとありがたいです。 +%%% 他のデバイスで利用する場合でも先頭のコピーライト表示と、末尾に含まれる +%%% LaiTeX, laitex, YaTeX, yatex の各項目は(このヘルプファイルについての +%%% 著作権表記と謝辞が含まれているので)削除しないでください。 %%% textfloatsep @@ -1234,6 +1238,169 @@ 新しいページを開始し、\textwidthのBOXをparboxで作成する。 二段組みページでぶち抜きタイトルを作成する時に用いるとよい。 +breakbox +\begin{breakbox} ... \end{breakbox} +ページをまたがる枠で囲む +要 `\usepackage{eclbkbox}' + +verbfile +\verbfile{FILE} +FILE を verbatim 環境的に取り込む。 +要 `\usepackage{misc}' +cf) \listing + +listing +\listing{FILE} +FILE を verbatim 環境的に取り込む(行番号つき)。 +要 `\usepackage{misc}' +cf) \verbfile + +ascmac +\usepackage{ascmac} +`ascmac' パッケージで定義されている代表的なマクロ +* \boxnote 環境 帳面風のボックス +* \screen 環境 スクリーン出力風の枠 +* \itembox 環境 目立つ枠 +* \shadebox 環境 影つきボックス +* \keytop{} キートップ +* \yen 円記号 +* \return-key リターンキー +* \mask, \maskbox 網掛け文字 + +boxnote +\begin{boxnote} ... \end{boxnote} +帳面風の枠で囲む +要 ascmac.sty + + + +screen +\begin{screen} ... \end{screen} +スクリーン出力風の枠で囲む +要 `\usepackage{ascmac}' + + + +itembox +\begin{itembox}{ITEMSTRING} ... \end{itembox} +見出し(ITEMSTRING)つきの枠で囲む +要 `\usepackage{ascmac}' + + +shadebox +\begin{shadebox} ... \end{shadebox} +行幅いっぱいの影つきの枠で囲む +要 `\usepackage{ascmac}' + + +keytop +\keytop{KEY} +キートップ風に KEY を出力 +要 `\usepackage{ascmac}' + + +mask +\mask{文字列}{網掛けタイプ} +「文字列」を指定した網掛けタイプで装飾する。 +網掛けタイプは A〜K のどれか。 + +例) \mask{御食事券発覚!}{C} + +どんな見映えかは以下を見よ。 +http://www.yatex.org/help/ascmac-mask.jpg + +要 `\usepackage{ascmac}' + + + +maskbox +\maskbox{WIDTH}{HEIGHT}{MASKTYPE}{POS}{STRING} +指定した幅(WIDTH)と高さ(HEIGHT)で指定した網掛けタイプ(MASKTYPE) +のボックスを作り、その中の指定した位置(POS)にSTRINGを配置する。 +POSは l c rのどれかで、それぞれ、左寄せ、中央寄せ、右寄せ。 + +網掛けタイプは A〜K のどれか。 + +例) \maskbox{0.7\columnwidth}{6em}{A}{c}{\shortstack{これは\\大事件だ!}} + +マスクタイプA〜Kがどんな見映えかは以下を見よ。 +http://www.yatex.org/help/ascmac-mask.jpg + +要 `\usepackage{ascmac}' + + +alltt +\begin{alltt} ... \end{alltt} +TeXマクロの使えるverbitam環境。 + +comment +\begin{comment} ... \end{comment} +環境内の全てを出力しないようにする。 +ただし、 \includeversion{comment} と書くと環境を出力するようになる。 +また \excludeversion{ENV} とすると新しい環境 ENV が +comment 環境 と同じ機能を持つものとして使えるようになる。 + +要 `\usepackage{version}' + +bou +\bou{STRING} +横書き環境で STRING に傍点を付ける。 + +要 `\usepackage{plext}' + +url +\url{URL_STRING} +overfullしがちなURLを頑張って折り返してくれる。 + +要 `\usepackage{url}' + +longtable +\begin{longtable}{POSSTRING} ... \end{longtable} +ページをまたぐ表が作れる。 + +table環境も参照せよ。 + +fancybox +\usepackage{fancybox} +各種の見栄えの良いボックスが定義されている。 + +* \shadowbox{} +* \ovalbox{} +* \doublebox{} + +shadowbox +\shadowbox{STRING} +STRINGをその幅で影つきボックスで囲む。 + +要 `\usepackage{fancybox}` + + + +ovalbox +\ovalbox{STRING} +角の丸い四角枠で STRING を囲む。 + +要 `\usepackage{fancybox}` + + + +Ovalbox +\Ovalbox{STRING} +角の丸い四角枠で STRING を囲む。ovalboxより線が太い。 + +要 `\usepackage{fancybox}` + + + +doublebox +\doublebox{STRING} +二重四角枠で STRING を囲む。 + +要 `\usepackage{fancybox}` + + + + LaiTeX a Little Assistant Interface for TeX on Vz おそらくあなたが今 Vz 上で使っているこのモード。 @@ -1320,8 +1487,8 @@ たれました。享年二十六歳。彼には、野鳥だけでなく私が手掛けた数多 くのソフトウェアを作る動機、センスあふれるコメントなどを頂きまし た。現在の野鳥が皆様に支持されるように健やかに育ったのは彼のおか - げと言っても過言ではありません。野鳥/雷鳥/白鳥/飛鳥を使うときに - 彼の安らかな眠りを私と共に祈って下さい。 + げと言っても過言ではありません。野鳥/雷鳥/白鳥/飛鳥/花鳥を使うと + きに彼の安らかな眠りを私と共に祈って下さい。 るねきちさん(asciinet) 占い師だそうです。 diff -r 5b19f901fa16 -r 0734be649cb8 yahtml.el --- a/yahtml.el Fri May 02 11:23:59 2003 +0000 +++ b/yahtml.el Thu Dec 25 04:10:32 2003 +0000 @@ -1,6 +1,6 @@ ;;; -*- Emacs-Lisp -*- -;;; (c ) 1994-2002 by HIROSE Yuuji [yuuji@yatex.org] -;;; Last modified Thu Nov 21 17:55:40 2002 on firestorm +;;; (c) 1994-2003 by HIROSE Yuuji [yuuji@yatex.org] +;;; Last modified Mon Nov 17 18:28:50 2003 on firestorm ;;; $Id$ (defconst yahtml-revision-number "1.70" @@ -202,9 +202,7 @@ (defvar yahtml-environment-indent 1 "*Indentation depth of HTML's listing environment") -(defvar YaTeX-japan (or (boundp 'NEMACS) (boundp 'MULE) YaTeX-emacs-20) - "Whether yatex mode is running on Japanese environment or not.") - +;; YaTeX-japan is defined in yatexlib.el (defvar yahtml-lint-program (if YaTeX-japan "jweblint" "weblint") "*Program name to lint HTML file") (defvar yahtml-hate-too-deep-indentation nil @@ -345,6 +343,9 @@ (yahtml-define-begend-key "ba" "a" map) (yahtml-define-begend-key "bf" "form" map) (yahtml-define-begend-key "bs" "select" map) + (yahtml-define-begend-key "bv" "div" map) + (yahtml-define-begend-key "bS" "div" map) + (yahtml-define-begend-key "bp" "pre" map) (YaTeX-define-key "b " 'yahtml-insert-begend map) (YaTeX-define-key "B " 'yahtml-insert-begend-region map) ) @@ -571,6 +572,7 @@ (set (make-local-variable 'yahtml-mode-old-mode) old-mm))) (let ((coding (or (yahtml-dir-default-charset) yahtml-kanji-code))) (cond + ((null coding) nil) ((and YaTeX-emacs-20 (boundp 'buffer-file-coding-system)) (setq buffer-file-coding-system (or (and (fboundp 'set-auto-coding) buffer-file-name diff -r 5b19f901fa16 -r 0734be649cb8 yatex.el --- a/yatex.el Fri May 02 11:23:59 2003 +0000 +++ b/yatex.el Thu Dec 25 04:10:32 2003 +0000 @@ -1,30 +1,15 @@ ;;; -*- Emacs-Lisp -*- ;;; Yet Another tex-mode for emacs - //野鳥// -;;; yatex.el rev. 1.71 -;;; (c )1991-2003 by HIROSE Yuuji.[yuuji@yatex.org] -;;; Last modified Thu May 1 22:36:40 2003 on firestorm +;;; yatex.el rev. 1.72 +;;; (c)1991-2003 by HIROSE Yuuji.[yuuji@yatex.org] +;;; Last modified Thu Dec 25 13:10:42 2003 on firestorm ;;; $Id$ ;;; The latest version of this software is always available at; ;;; http://www.yatex.org/ -;; This program is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) -;; any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program; see the file COPYING. If not, write to the -;; Software Foundation Inc., 59 Temple Place - Suite 330, Boston, MA -;; 02111-1307, USA. - (require 'comment) (require 'yatexlib) -(defconst YaTeX-revision-number "1.71" +(defconst YaTeX-revision-number "1.72" "Revision number of running yatex.el") ;---------- Local variables ---------- @@ -276,6 +261,7 @@ ("widetilde") ("widehat") ("overline") ("overrightarrow") ;; section types in mathmode ("frac" 2) ("sqrt") ("mathrm") ("mathbf") ("mathit") + ) (if YaTeX-use-LaTeX2e '(("documentclass") ("usepackage") @@ -287,6 +273,13 @@ ("rotatebox" 2) ("resizebox" 2) ("reflectbox") ("colorbox" 2) ("fcolorbox" 3) ("textcolor" 2) ("color") ("includegraphics") ("includegraphics*") + ("bou") ;defined in plext + ("url") ;defined in url + ("shadowbox") ("doublebox") ("ovalbox") ("Ovalbox") + ("fancyoval") ;defined in fancybox + ("keytop") ("mask" 2) ("maskbox" 5) ;defined in ascmac + ("bm") ;deined in bm + ("verbfile") ("listing") ;defined in misc ))) "Default completion table for section-type completion.") @@ -295,14 +288,21 @@ ; Set tex-environment possible completion (defvar env-table - '(("quote") ("quotation") ("center") ("verse") ("document") - ("verbatim") ("itemize") ("enumerate") ("description") - ("list") ("tabular") ("tabular*") ("table") ("tabbing") ("titlepage") - ("sloppypar") ("picture") ("displaymath") - ("eqnarray") ("figure") ("equation") ("abstract") ("array") - ("thebibliography") ("theindex") ("flushleft") ("flushright") - ("minipage") - ) + (append + '(("quote") ("quotation") ("center") ("verse") ("document") + ("verbatim") ("itemize") ("enumerate") ("description") + ("list") ("tabular") ("tabular*") ("table") ("tabbing") ("titlepage") + ("sloppypar") ("picture") ("displaymath") + ("eqnarray") ("figure") ("equation") ("abstract") ("array") + ("thebibliography") ("theindex") ("flushleft") ("flushright") + ("minipage") + ) + (if YaTeX-use-LaTeX2e + '(("comment") ;defined in version + ("longtable") ;defined in longtable + ("screen") ("boxnote") ("shadebox") ("itembox") ;in ascmac + ("alltt") ;defined in alltt + ("breakbox")))) ;defined in eclbkbox "Default completion table for begin-type completion.") (defvar user-env-table nil) @@ -352,7 +352,9 @@ ("varpi") ("rho") ("varrho") ("sigma") ("varsigma") ("tau") ("upsilon") ("phi") ("varphi") ("chi") ("psi") ("omega") ("Gamma") ("Delta") ("Theta") ("Lambda")("Xi") ("Pi") - ("Sigma") ("Upsilon") ("Phi") ("Psi") ("Omega")))) + ("Sigma") ("Upsilon") ("Phi") ("Psi") ("Omega"))) + (if YaTeX-use-LaTeX2e + '(("return") ("Return") ("yen")))) ;defined in ascmac "Default completion table for maketitle-type completion.") (defvar user-singlecmd-table nil) @@ -506,7 +508,12 @@ (defvar YaTeX-fontsize-name "large" "*Initial fontsize completion") (defvar YaTeX-single-command "maketitle" "*Initial LaTeX single command") (defvar YaTeX-kanji-code (if YaTeX-dos 1 2) - "*File kanji code used by Japanese TeX.") + "*File kanji code used by Japanese TeX. +nil: Do not care (Preserve coding-system) +0: no-converion (mule) +1: Shift JIS +2: JIS +3: EUC") (defvar YaTeX-coding-system nil "File coding system used by Japanese TeX.") (cond @@ -515,9 +522,7 @@ (cdr (assoc YaTeX-kanji-code YaTeX-kanji-code-alist)))) ((boundp 'MULE) (setq YaTeX-coding-system - (symbol-value (cdr (assoc YaTeX-kanji-code YaTeX-kanji-code-alist))))) - ((boundp 'NEMACS) - (setq YaTeX-latex-message-code latex-message-kanji-code))) + (symbol-value (cdr (assoc YaTeX-kanji-code YaTeX-kanji-code-alist)))))) (defvar YaTeX-mode-syntax-table nil "*Syntax table for yatex-mode") @@ -610,7 +615,9 @@ YaTeX-math-mode indent-line-function comment-line-break-function comment-start comment-start-skip )) - (cond ((boundp 'MULE) + (cond ((null YaTeX-kanji-code) + nil) + ((boundp 'MULE) (set-file-coding-system YaTeX-coding-system)) ((and YaTeX-emacs-20 (boundp 'buffer-file-coding-system)) (setq buffer-file-coding-system @@ -729,6 +736,8 @@ (autoload 'YaTeX-display-hierarchy-directly "yatexhie" "Same as YaTeX-display-hierarchy. Call from mouse." t) +;;autoload from yatexpkg.el +(autoload 'YaTeX-package-auto-usepackage "yatexpkg" "Auto \\usepackage" t) ;;; ;; YaTeX-mode functions @@ -780,6 +789,7 @@ (goto-char beg2) (YaTeX-intelligent-newline nil) (YaTeX-indent-line)) + (YaTeX-package-auto-usepackage env 'env) (if YaTeX-current-position-register (point-to-register YaTeX-current-position-register)))) @@ -813,7 +823,9 @@ (cond ((save-excursion (not (search-backward YaTeX-ec nil t))) (if YaTeX-use-LaTeX2e "documentclass" "documentstyle")) - ((progn (forward-char -1) (looking-at "表\\|図\\|式")) + ((progn + (if (= (char-after (1- (point))) ?~) (forward-char -1)) + (forward-char -1) (looking-at "表\\|図\\|式")) "ref") ((and (looking-at "[a-z \t]") (progn (skip-chars-backward "a-z \t") @@ -886,12 +898,15 @@ (enable-recursive-minibuffers t));;let (setq YaTeX-section-name section) (if beg - (let ((e (make-marker))) + (let*((e (make-marker)) + (ar2 (intern-soft (concat "YaTeX::" section "-region"))) + (arp (and ar2 (fboundp ar2)))) (goto-char end) (insert "}") (set-marker e (point)) (goto-char beg) (insert YaTeX-ec YaTeX-section-name "{") + (if arp (funcall ar2 (point) e)) (goto-char e) (set-marker e nil)) (use-global-map YaTeX-recursive-map) @@ -918,7 +933,8 @@ (if (string= (buffer-substring (- (point) 2) (point)) "{}") (forward-char -1)) (while (string= (buffer-substring (- (point) 3) (1- (point))) "{}") - (forward-char -2))) + (forward-char -2)) + (YaTeX-package-auto-usepackage section 'section)) (if (<= (minibuffer-depth) 0) (use-global-map global-map)) (insert ""))) ;insert dummy string to fontify(Emacs20) @@ -967,7 +983,8 @@ (if YaTeX-current-position-register (point-to-register YaTeX-current-position-register)) (save-excursion - (insert (YaTeX-addin YaTeX-fontsize-name)))))) + (insert (YaTeX-addin YaTeX-fontsize-name))) + (YaTeX-package-auto-usepackage YaTeX-fontsize-name 'large)))) (defun YaTeX-make-fontsize-region () "Call function:YaTeX-make-fontsize with ARG to specify region mode." @@ -1003,6 +1020,7 @@ (goto-char p) (forward-char -2) (if (looking-at "\\[\\]") (forward-char 1) (goto-char q))) + (YaTeX-package-auto-usepackage YaTeX-single-command 'maketitle) (if YaTeX-current-position-register (point-to-register YaTeX-current-position-register))) @@ -2019,26 +2037,42 @@ (defun YaTeX-kill-paren (kill-contents) "Kill parentheses leaving its contents. But kill its contents if the argument KILL-CONTENTS is non-nil." - (save-excursion - (let (p) - (if (looking-at "\\s(\\|\\(\\s)\\)") - (progn - (if (match-beginning 1) - (up-list -1)) - (setq p (point)) - (forward-list 1) - (if kill-contents (delete-region p (point)) - (backward-delete-char 1) - (goto-char p) - (if (looking-at - (concat "{" YaTeX-ec-regexp - YaTeX-command-token-regexp "+" - "\\s +")) - (delete-region - (point) - (progn (re-search-forward "\\s +" nil t) (point))) - (delete-char 1))) - t))))) + (interactive "P") + (let (p bsl (backslash-syntax (char-to-string (char-syntax ?\\))) + (md (match-data))) + (unwind-protect + (save-excursion + (modify-syntax-entry ?\\ " ") + (if (looking-at "\\s(\\|\\(\\s)\\)") + (progn + (if (match-beginning 1) + (up-list -1)) + (if (and (> (point) (point-min)) + (= (char-after (1- (point))) ?\\ )) + (setq p (1- (point)) bsl t) + (setq p (point))) + (forward-list 1) + ;(YaTeX-goto-open-paren t) + (if kill-contents (delete-region p (point)) + (backward-delete-char 1) + (cond + ((save-excursion + (forward-char -2) + (looking-at (concat YaTeX-ec-regexp "/"))) + (backward-delete-char 2)) + ((= (char-after (1- (point))) ?\\) + (backward-delete-char 1))) + (goto-char p) + (if (looking-at + (concat "{" YaTeX-ec-regexp + YaTeX-command-token-regexp "+" + "\\s +")) + (delete-region (point) (match-end 0)) + (delete-char 1) + (if bsl (delete-char 1)))) + t))) + (modify-syntax-entry ?\\ backslash-syntax) + (store-match-data md)))) (defvar YaTeX-read-environment-history nil "Holds history of environments.") (put 'YaTeX-read-environment-history 'no-default t) diff -r 5b19f901fa16 -r 0734be649cb8 yatex.new --- a/yatex.new Fri May 02 11:23:59 2003 +0000 +++ b/yatex.new Thu Dec 25 04:10:32 2003 +0000 @@ -1,6 +1,14 @@ What's new in YaTeX/yahtml 野鳥/yahtml - 各バージョンの変更点について +1.72 === yatex === + YaTeX-kanji-code が nil なら coding-system に感知しない + 補完したマクロがLaTeX2eの特定のpackageに依存している場合 + そのpackageを半自動で \usepackage する(yatexpkg.el新設) + {} の末尾がイタリック補正 \/ ならそれを消す + === yahtml == + yahtml-kanji-code が nil なら coding-system に感知しない + 1.71 === yatex === fill-prefix を指定している場合、Emacs21で \item の auto-fill が \item の深さにかかわらず fill-prefix になってしまうのを回避 diff -r 5b19f901fa16 -r 0734be649cb8 yatex19.el --- a/yatex19.el Fri May 02 11:23:59 2003 +0000 +++ b/yatex19.el Thu Dec 25 04:10:32 2003 +0000 @@ -1,7 +1,7 @@ ;;; -*- Emacs-Lisp -*- ;;; YaTeX facilities for Emacs 19 -;;; (c )1994-2003 by HIROSE Yuuji.[yuuji@yatex.org] -;;; Last modified Fri Feb 21 01:35:19 2003 on firestorm +;;; (c)1994-2003 by HIROSE Yuuji.[yuuji@yatex.org] +;;; Last modified Fri Jun 27 12:07:46 2003 on firestorm ;;; $Id$ ;(require 'yatex) diff -r 5b19f901fa16 -r 0734be649cb8 yatexadd.el --- a/yatexadd.el Fri May 02 11:23:59 2003 +0000 +++ b/yatexadd.el Thu Dec 25 04:10:32 2003 +0000 @@ -1,8 +1,8 @@ ;;; -*- Emacs-Lisp -*- ;;; YaTeX add-in functions. -;;; yatexadd.el rev.15 -;;; (c )1991-2003 by HIROSE Yuuji.[yuuji@yatex.org] -;;; Last modified Mon Mar 17 16:46:01 2003 on serow +;;; yatexadd.el rev.17 +;;; (c)1991-2003 by HIROSE Yuuji.[yuuji@yatex.org] +;;; Last modified Thu Nov 27 11:11:30 2003 on firestorm ;;; $Id$ ;;; @@ -60,26 +60,28 @@ (concat (YaTeX:read-position "tb") "{" (read-string "Column format: ") "}")) -(defun YaTeX:read-oneof (oneof) +(defun YaTeX:read-oneof (oneof &optional quick allow-dup) (let ((pos "") loc (guide "")) (and (boundp 'name) name (setq guide (format "%s " name))) - (while (not (string-match - (setq loc (read-key-sequence - (format "%s position (`%s') [%s]: " - guide oneof pos));name is in YaTeX-addin - loc (if (fboundp 'events-to-keys) - (events-to-keys loc) loc)) - "\r\^g\n")) - (cond - ((string-match loc oneof) - (if (not (string-match loc pos)) - (setq pos (concat pos loc)))) - ((and (string-match loc "\C-h\C-?") (> (length pos) 0)) - (setq pos (substring pos 0 (1- (length pos))))) - (t - (ding) - (message "Please input one of `%s'." oneof) - (sit-for 3)))) + (catch 'quick + (while (not (string-match + (setq loc (read-key-sequence + (format "%s position (`%s') [%s]: " + guide oneof pos));name is in YaTeX-addin + loc (if (fboundp 'events-to-keys) + (events-to-keys loc) loc)) + "\r\^g\n")) + (cond + ((string-match loc oneof) + (if (or allow-dup (not (string-match loc pos))) + (setq pos (concat pos loc))) + (if quick (throw 'quick t))) + ((and (string-match loc "\C-h\C-?") (> (length pos) 0)) + (setq pos (substring pos 0 (1- (length pos))))) + (t + (ding) + (message "Please input one of `%s'." oneof) + (sit-for 3))))) (message "") pos)) @@ -218,7 +220,6 @@ (fset 'YaTeX:right 'YaTeX:left) - (defun YaTeX:read-coordinates (&optional mes varX varY) (concat "(" @@ -227,6 +228,9 @@ (read-string (format "%s %s: " (or mes "Dimension") (or varY "Y"))) ")")) +(defun YaTeX:itembox () + (concat "{" (read-string "Item heading string: ") "}")) + ;;; ;;Sample functions for maketitle-type command. ;;; @@ -1132,12 +1136,7 @@ ((equal 1 argp) (read-string "Number of columns: ")) ((equal 2 argp) - (let (c) - (while (not (string-match - (progn (message "Format(one of l,r,c): ") - (setq c (char-to-string (read-char)))) - "lrc"))) - c)) + (YaTeX:read-oneof "|lrc" nil t)) ((equal 3 argp) (read-string "Item: ")))) @@ -1373,6 +1372,59 @@ (setq YaTeX-section-name "label") nil) +(defvar YaTeX::usepackage-alist-default + '(("version") ("plext") ("url") ("fancybox") ("pifont") ("longtable") + ("ascmac") ("bm") ("graphics") ("graphicx") ("alltt") ("misc") ("eclbkbox") + ("amsmath") ("amssymb") ("xymtex") ("chemist") + ("a4j") ("array") ("epsf") ("color") ("epsfig") ("floatfig") + ("landscape") ("path") ("supertabular") ("twocolumn")) + "Default completion table for arguments of \usepackage") + +(defvar YaTeX::usepackage-alist-private nil + "*Private completion list of the argument for usepackage") + +(defvar YaTeX::usepackage-alist-local nil + "Directory local completion list of the argument for usepackage") + +(defun YaTeX::usepackage (&optional argp) + (cond + ((equal argp 1) + (setq YaTeX-env-name "document") + (YaTeX-cplread-with-learning + "Use package: " + 'YaTeX::usepackage-alist-default + 'YaTeX::usepackage-alist-private + 'YaTeX::usepackage-alist-local)))) + +(defun YaTeX::mask (argp) + (cond + ((equal argp 1) + (read-string "String: ")) + ((equal argp 2) + (let (c) + (while (not (memq c '(?A ?B ?C ?D ?E ?F ?G ?H ?I ?J ?K))) + (message "Mask type(A..K): ") + (setq c (upcase (read-char)))) + (format "%c" c))))) + +(defun YaTeX::maskbox (argp) + (cond + ((equal argp 1) + (read-string "Width: ")) + ((equal argp 2) + (read-string "Height: ")) + ((equal argp 3) + (let (c) + (while (not (memq c '(?A ?B ?C ?D ?E ?F ?G ?H ?I ?J ?K))) + (message "Mask type(A..K): ") + (setq c (upcase (read-char)))) + (format "%c" c))) + ((equal argp 4) + (YaTeX:read-oneof "lcr" 'quick)) + ((equal argp 5) + (read-string "String: ")) +)) + ;;; -------------------- math-mode stuff -------------------- (defun YaTeX::tilde (&optional pos) "For accent macros in mathmode" @@ -1418,6 +1470,44 @@ (fset 'YaTeX::overline 'YaTeX::widetilde) (fset 'YaTeX::overrightarrow 'YaTeX::widetilde) +; +; for \frac{}{} region +(defun YaTeX::frac-region (beg end) + (if (catch 'done + (while (re-search-forward "\\s *\\(\\\\over\\|/\\)\\s *" end t) + (goto-char (match-beginning 0)) + (if (y-or-n-p + (format "Replace this `%s' with `}{'" (YaTeX-match-string 0))) + (throw 'done t)) + (goto-char (match-end 0)))) + (let (p (b0 (match-beginning 0)) e0) + (replace-match "}{") + (setq e0 (point)) + (save-restriction + (narrow-to-region beg end) + (goto-char e0) + (skip-chars-forward " \t") + (setq p (point)) + (YaTeX-goto-corresponding-paren) + (forward-char 1) + (skip-chars-forward " \t\r\n") + (if (= end (1+ (point))) + (progn + (goto-char p) + (if (looking-at "\\\\") (forward-char 1)) + (YaTeX-kill-paren nil))) + (goto-char beg) + (skip-chars-forward " \t") + (setq p (point)) + (YaTeX-goto-corresponding-paren) + (forward-char 1) + (skip-chars-forward " \t\r\n") + (if (>= (point) b0) + (progn + (goto-char p) + (if (looking-at "\\\\") (forward-char 1)) + (YaTeX-kill-paren nil)))))) + (message "")) ;;; ;; Add-in functions for large-type command. diff -r 5b19f901fa16 -r 0734be649cb8 yatexenv.el --- a/yatexenv.el Fri May 02 11:23:59 2003 +0000 +++ b/yatexenv.el Thu Dec 25 04:10:32 2003 +0000 @@ -1,8 +1,8 @@ ;;; -*- Emacs-Lisp -*- ;;; YaTeX environment-specific functions. ;;; yatexenv.el -;;; (c ) 1994-2003 by HIROSE Yuuji.[yuuji@yatex.org] -;;; Last modified Sun Mar 30 19:25:47 2003 on firestorm +;;; (c) 1994-2003 by HIROSE Yuuji.[yuuji@yatex.org] +;;; Last modified Fri Jun 27 12:09:30 2003 on firestorm ;;; $Id$ ;;; diff -r 5b19f901fa16 -r 0734be649cb8 yatexgen.el --- a/yatexgen.el Fri May 02 11:23:59 2003 +0000 +++ b/yatexgen.el Thu Dec 25 04:10:32 2003 +0000 @@ -1,8 +1,8 @@ ;;; -*- Emacs-Lisp -*- ;;; YaTeX add-in function generator. ;;; yatexgen.el rev.5 -;;; (c )1991-1995,1999,2000 by HIROSE Yuuji.[yuuji@yatex.org] -;;; Last modified Mon Dec 25 19:17:30 2000 on firestorm +;;; (c)1991-1995,1999,2000 by HIROSE Yuuji.[yuuji@yatex.org] +;;; Last modified Fri Jun 27 12:09:37 2003 on firestorm ;;; $Id$ (require 'yatex) diff -r 5b19f901fa16 -r 0734be649cb8 yatexhie.el --- a/yatexhie.el Fri May 02 11:23:59 2003 +0000 +++ b/yatexhie.el Thu Dec 25 04:10:32 2003 +0000 @@ -1,8 +1,8 @@ ;;; -*- Emacs-Lisp -*- ;;; YaTeX hierarchy browser. ;;; yatexhie.el -;;; (c )1995 by HIROSE Yuuji [yuuji@yatex.org] -;;; Last modified Wed Dec 1 23:41:01 1999 on firestorm +;;; (c)1995 by HIROSE Yuuji [yuuji@yatex.org] +;;; Last modified Fri Jun 27 12:09:49 2003 on firestorm ;;; $Id$ ;; ----- Customizable variables ----- diff -r 5b19f901fa16 -r 0734be649cb8 yatexhlp.el --- a/yatexhlp.el Fri May 02 11:23:59 2003 +0000 +++ b/yatexhlp.el Thu Dec 25 04:10:32 2003 +0000 @@ -1,8 +1,8 @@ ;;; -*- Emacs-Lisp -*- ;;; YaTeX helper with LaTeX commands and macros. ;;; yatexhlp.el -;;; (c )1994,1998 by HIROSE Yuuji.[yuuji@yatex.org] -;;; Last modified Thu Aug 26 18:15:39 1999 on firestorm +;;; (c)1994,1998 by HIROSE Yuuji.[yuuji@yatex.org] +;;; Last modified Fri Jun 27 12:09:58 2003 on firestorm ;;; $Id$ (let ((help-file (concat "YATEXHLP." diff -r 5b19f901fa16 -r 0734be649cb8 yatexlib.el --- a/yatexlib.el Fri May 02 11:23:59 2003 +0000 +++ b/yatexlib.el Thu Dec 25 04:10:32 2003 +0000 @@ -1,12 +1,13 @@ ;;; -*- Emacs-Lisp -*- ;;; YaTeX and yahtml common libraries, general functions and definitions ;;; yatexlib.el -;;; (c )1994-2002 by HIROSE Yuuji.[yuuji@yatex.org] -;;; Last modified Wed Oct 2 23:35:33 2002 on firestorm +;;; (c)1994-2002 by HIROSE Yuuji.[yuuji@yatex.org] +;;; Last modified Tue Aug 19 22:20:40 2003 on firestorm ;;; $Id$ ;; General variables (defvar YaTeX-dos (memq system-type '(ms-dos windows-nt OS/2))) +(defvar YaTeX-macos (memq system-type '(darwin))) (defvar YaTeX-emacs-19 (>= (string-to-int emacs-version) 19)) (defvar YaTeX-emacs-20 (>= (string-to-int emacs-version) 20)) (defvar YaTeX-emacs-21 (>= (string-to-int emacs-version) 21)) @@ -21,7 +22,11 @@ window-system) ; falls down lazy check.. "Current display's capability of expressing colors.") -(defvar YaTeX-japan (or (boundp 'NEMACS) (boundp 'MULE) YaTeX-emacs-20) +(defvar YaTeX-japan + (or (boundp 'NEMACS) + (boundp 'MULE) + (and (boundp 'current-language-environment) + (string-match "[Jj]apanese" current-language-environment))) "Whether yatex mode is running on Japanese environment or not.") ;; autoload from yahtml.el @@ -33,14 +38,17 @@ (list '(0 . *noconv*) (cons 1 - (if YaTeX-dos (if (boundp '*sjis-dos*) *sjis-dos* *sjis*dos) - *sjis*)) + (cond + (YaTeX-dos (if (boundp '*sjis-dos*) *sjis-dos* *sjis*dos)) + (YaTeX-macos (if (boundp '*sjis-mac*) *sjis-mac* *sjis*mac)) + (t *sjis*))) '(2 . *junet*) '(3 . *euc-japan*))) (YaTeX-emacs-20 ;;(cdr-safe(assq 'coding-system (assoc "Japanese" language-info-alist))) (list '(0 . no-conversion) (cons 1 (cond (YaTeX-dos 'shift_jis-dos) + (YaTeX-macos 'shift_jis-mac) ((member 'shift_jis (coding-system-list)) 'shift_jis-unix) (t 'sjis))) '(2 . iso-2022-jp-unix) diff -r 5b19f901fa16 -r 0734be649cb8 yatexm-o.el --- a/yatexm-o.el Fri May 02 11:23:59 2003 +0000 +++ b/yatexm-o.el Thu Dec 25 04:10:32 2003 +0000 @@ -1,7 +1,7 @@ ;;; -*- Emacs-Lisp -*- ;;; Sample startup file to invoke yatex-mode with outline-minor mode. -;;; (c )1993 by HIROSE Yuuji [yuuji@yatex.org] -;;; Last modified Thu Aug 26 18:16:00 1999 on firestorm +;;; (c)1993 by HIROSE Yuuji [yuuji@yatex.org] +;;; Last modified Fri Jun 27 12:10:15 2003 on firestorm ;;; ;; outline-minor-mode(使用しない場合は不要です) diff -r 5b19f901fa16 -r 0734be649cb8 yatexpkg.el --- a/yatexpkg.el Fri May 02 11:23:59 2003 +0000 +++ b/yatexpkg.el Thu Dec 25 04:10:32 2003 +0000 @@ -1,12 +1,13 @@ ;;; -*- Emacs-Lisp -*- ;;; YaTeX package manager ;;; yatexpkg.el -;;; (c )2003 by HIROSE, Yuuji [yuuji@yatex.org] -;;; Last modified Fri May 2 20:13:49 2003 on firestorm +;;; (c)2003 by HIROSE, Yuuji [yuuji@yatex.org] +;;; Last modified Thu Aug 28 18:24:33 2003 on firestorm ;;; $Id$ (defvar YaTeX-package-alist-default - '(("version" (env "comment")) ;by tsuchiya@pine.kuee.kyoto-u.ac.jp + '(("version" (env "comment") ;by tsuchiya@pine.kuee.kyoto-u.ac.jp + (section "includeversion" "excludeversion")) ("plext" (section "bou")) ;by yas.axis@ma.mni.ne.jp @@ -17,14 +18,21 @@ ("longtable" (env "longtable")) ("ascmac" (env "screen" "boxnote" "shadebox" "itembox") (maketitle "return" "Return" "yen") - (section "keytop")) + (section "keytop") ("mask") ("maskbox")) ("bm" (section "bm")) ;by aoyama@le.chiba-u.ac.jp ("graphicx" (section "includegraphics")) ("alltt" (env "alltt")) ("misc" (section "verbfile" "listing")) ("eclbkbox" (env "breakbox"))) - "Default package vs. macro list") + "Default package vs. macro list. +Alists contains '(PACKAGENAME . MACROLIST) +PACKAGENAME Basename of package(String). +MACROLIST List of '(TYPE . MACROS) +TYPE One of 'env, 'section or 'maketitle according to completion-type +MACROS List of macros + +An good example is the value of YaTeX-package-alist-default.") (defvar YaTeX-package-alist-private nil "*User defined package vs. macro list. See also YaTeX-package-alist-default") @@ -85,6 +93,7 @@ usepkgrx YaTeX-comment-prefix nil t) (setq mb0 (match-beginning 0)) (skip-chars-forward "^{") + (forward-char 1) (let ((pl pkglist)) (while pl ;(car pl)'s car is package, cdr is type (if (looking-at (regexp-quote (car (car pl)))) @@ -100,7 +109,11 @@ (setq pkg (completing-read "Load which package?(TAB for list): " - pkglist)) + pkglist nil nil + ;;initial input + (if (= (length pkglist) 1) + (let ((w (car (car pkglist)))) + (if YaTeX-emacs-19 (cons w 0) w))))) (set-buffer pb) (goto-char (point-min)) (if (YaTeX-re-search-active-forward diff -r 5b19f901fa16 -r 0734be649cb8 yatexprc.el --- a/yatexprc.el Fri May 02 11:23:59 2003 +0000 +++ b/yatexprc.el Thu Dec 25 04:10:32 2003 +0000 @@ -1,8 +1,8 @@ ;;; -*- Emacs-Lisp -*- ;;; YaTeX process handler. ;;; yatexprc.el -;;; (c )1993-2003 by HIROSE Yuuji.[yuuji@yatex.org] -;;; Last modified Thu May 1 22:37:31 2003 on firestorm +;;; (c)1993-2003 by HIROSE Yuuji.[yuuji@yatex.org] +;;; Last modified Sun Nov 2 08:09:44 2003 on firestorm ;;; $Id$ ;(require 'yatex) @@ -27,15 +27,23 @@ "Shell option for command execution.") (defvar YaTeX-latex-message-code +;; (cond +;; (YaTeX-dos (cdr (assq 1 YaTeX-kanji-code-alist))) +;; ((and YaTeX-emacs-20 (member 'undecided (coding-system-list)) +;; 'undecided)) +;; ((featurep 'mule) +;; (or (and (boundp '*autoconv*) *autoconv*) +;; (and (fboundp 'coding-system-list) 'automatic-conversion))) +;; ((boundp 'NEMACS) +;; (cdr (assq (if YaTeX-dos 1 2) YaTeX-kanji-code-alist)))) (cond - (YaTeX-dos (cdr (assq 1 YaTeX-kanji-code-alist))) - ((and YaTeX-emacs-20 (member 'undecided (coding-system-list)) - 'undecided)) - ((featurep 'mule) - (or (and (boundp '*autoconv*) *autoconv*) - (and (fboundp 'coding-system-list) 'automatic-conversion))) + (YaTeX-emacs-20 + (cdr (assoc latex-message-kanji-code YaTeX-kanji-code-alist))) + ((boundp 'MULE) + (symbol-value + (cdr (assoc latex-message-kanji-code YaTeX-kanji-code-alist)))) ((boundp 'NEMACS) - (cdr (assq (if YaTeX-dos 1 2) YaTeX-kanji-code-alist)))) + latex-message-kanji-code)) "Process coding system for LaTeX.") (if YaTeX-typeset-buffer-syntax nil @@ -395,11 +403,11 @@ (concat (catch 'found-paper (mapcar (lambda (pair) - (if (member (car pair) opts) + (if (YaTeX-member (car pair) opts) (throw 'found-paper (cdr pair)))) YaTeX-paper-type-alist) YaTeX-default-paper-type) - (if (member "landscape" opts) "r" ""))))) + (if (YaTeX-member "landscape" opts) (if YaTeX-dos "L" "r") ""))))) (defvar YaTeX-preview-command-history nil "Holds minibuffer history of preview command.") @@ -415,7 +423,10 @@ "Preview command: " (YaTeX-replace-format (or (YaTeX-get-builtin "PREVIEW") dvi2-command) - "p" (concat "-paper " (YaTeX-get-paper-type))) + "p" (format (cond + (YaTeX-dos "-y:%s") + (t "-paper %s")) + (YaTeX-get-paper-type))) 'YaTeX-preview-command-history) (read-string-with-history "Preview file[.dvi]: " @@ -688,10 +699,13 @@ (defvar YaTeX-lpr-command-history nil "Holds command line history of YaTeX-lpr.") (put 'YaTeX-lpr-command-history 'no-default t) +(defvar YaTeX-lpr-ask-page-range-default t) (defun YaTeX-lpr (arg) - "Print out. If prefix arg ARG is non nil, call print driver without + "Print out. +If prefix arg ARG is non nil, call print driver without page range description." (interactive "P") + (or YaTeX-lpr-ask-page-range-default (setq arg (not arg))) (let*((cmd (or (YaTeX-get-builtin "LPR") dviprint-command-format)) from to (lbuffer "*dvi-printing*") dir) (setq diff -r 5b19f901fa16 -r 0734be649cb8 yatexsec.el --- a/yatexsec.el Fri May 02 11:23:59 2003 +0000 +++ b/yatexsec.el Thu Dec 25 04:10:32 2003 +0000 @@ -1,8 +1,8 @@ ;;; -*- Emacs-Lisp -*- ;;; YaTeX sectioning browser. ;;; yatexsec.el -;;; (c ) 1994,1998,1999,2003 by HIROSE Yuuji [yuuji@yatex.org] -;;; Last modified Wed Mar 5 13:19:11 2003 on firestorm +;;; (c) 1994,1998,1999,2003 by HIROSE Yuuji [yuuji@yatex.org] +;;; Last modified Fri Jun 27 12:10:34 2003 on firestorm ;;; $Id$ (defvar YaTeX-sectioning-level