Mercurial > hgrepos > hgweb.cgi > yatex
changeset 497:c0827f80b18e dev
Merged with old orphaned branch for clarity
author | HIROSE Yuuji <yuuji@gentei.org> |
---|---|
date | Sun, 17 Sep 2017 10:25:38 +0859 |
parents | 9c857ce72a03 (diff) 77a2fd4fd634 (current diff) |
children | ca7cf34e959c 16763e5b7481 |
files | yatex.el yatex19.el yatex23.el yatexadd.el yatexenv.el yatexhlp.el yatexlib.el yatexmth.el yatexpkg.el yatexprc.el |
diffstat | 32 files changed, 4029 insertions(+), 3322 deletions(-) [+] |
line wrap: on
line diff
--- a/.hgignore Fri Dec 26 01:06:32 2014 +0900 +++ b/.hgignore Sun Sep 17 10:25:38 2017 +0859 @@ -5,6 +5,7 @@ .cvsignore [._]win* __emacs +*.gz *.swp trashbox *.aux
--- a/.hgtags Fri Dec 26 01:06:32 2014 +0900 +++ b/.hgtags Sun Sep 17 10:25:38 2017 +0859 @@ -10,3 +10,12 @@ 0000000000000000000000000000000000000000 yatex-1.77 0000000000000000000000000000000000000000 yatex-1.77 d0c09133ced7fffa1eb5fa4d114fb12580f812ff yatex-1.77 +d69fd7b1ac4d06d7f8633e892dc24eab2bfc23db yatex-1.78 +a3ba09c1e8e907578f679fceb99264ce2d4eb777 yatex-1.79 +129b9f9b6d34048f0fb657034dd2f1c50dabfa9c yatex-1.80 +129b9f9b6d34048f0fb657034dd2f1c50dabfa9c yatex-1.80 +0000000000000000000000000000000000000000 yatex-1.80 +0000000000000000000000000000000000000000 yatex-1.80 +0e37ced833ef9388295be594da9bc91ff6eae037 yatex-1.80 +0e37ced833ef9388295be594da9bc91ff6eae037 yatex-1.80 +a2bb2426a15410438d5e5917ce939bd4bbbe8194 yatex-1.80
--- a/00readme Fri Dec 26 01:06:32 2014 +0900 +++ b/00readme Sun Sep 17 10:25:38 2017 +0859 @@ -1,5 +1,5 @@ ・Mercurialリポジトリでも公開しています(1.74以降)。 - % hg clone http://www.yatex.org/hgrepos/yatex yatex + % hg clone https://www.yatex.org/hgrepos/yatex yatex でコピーし、その後は yatex/ ディレクトリ内で hg pull -u して下さい。 ・yatex-1.69 よりバイトコンパイルしないのをデフォルトとしました。 @@ -19,5 +19,5 @@ 鳥」、Hidemaruへの移植版である「飛鳥」、xyzzyへの移植版である「花鳥」 に関する情報交換のためのメイリングリスト「fj野鳥の会」に是非御参加ください。 詳しくは docs/qanda ファイル、または - http://www.yatex.org/ + https://www.yatex.org/ を御覧ください。
--- a/comment.el Fri Dec 26 01:06:32 2014 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,86 +0,0 @@ -;;; -*- Emacs-Lisp -*- -;;; comment/uncomment region for emacs. -;;; comment.el rev.0.1 -;;; (c) 1992, 2002 by HIROSE Yuuji.(yuuji@yatex.org) -;;; Last modified Mon Nov 25 18:33:23 2002 on firestorm - -;;; Rename `comment-region' to `comment-out-region' for standard -;;; Emacs-19 function. - -(provide 'comment) - -(defvar current-comment-prefix "> " "*Default prefix string") - -(defun cite-region (beg end) - (save-excursion - (goto-char (max beg end)) - (if (bolp) - (forward-line -1)) - (if (string= string "") (setq string current-comment-prefix) - (setq current-comment-prefix string)) - (save-restriction - (narrow-to-region (min beg end) (point)) - (goto-char (point-min)) - (message "%s" string) - (while (re-search-forward "^" nil t) - (replace-match string)) - )) -) - -(defun comment-out-region (string &optional beg end once) - "Inserts STRING at the beginning of every line in the region specified -BEG and END. -Called interactively, STRING defaults to comment-start (or '> ' if -none is defined) unless a prefix argument is given, in which case it -prompts for a string. Optional second argument ONCE is only for -compatibility for uncomment-region. It has no means now." - (interactive - (list (if current-prefix-arg - (read-string - (concat "String to insert" - (format "(default \"%s\")" current-comment-prefix - " ") - ": ")) - current-comment-prefix))) - (if (not (stringp string)) (setq string current-comment-prefix)) - (cite-region (or beg (region-beginning)) (or end (region-end))) -) - - -(defun uncomment-out-region (string &optional beg end once) - "Deletes STRING from the beginning of every line in the region. -Called interactively, STRING defaults to comment-start (or '> ' if -none is defined) unless a prefix argument is given, in which case it -prompts for a string. Optional second argument ONCE restricts -deletion to first occurance of STRING on each line." - (interactive - (list (if current-prefix-arg - (read-string - (concat "String to delete" - (format "(default \"%s\")" current-comment-prefix - " ") - ": ")) - current-comment-prefix))) - (if (not (stringp string)) (setq string current-comment-prefix)) - (save-excursion - (save-restriction - (narrow-to-region (or beg (region-beginning)) (or end (region-end))) - (goto-char (point-min)) - (while (re-search-forward (concat "^" string) nil t) - (replace-match "") - (if once (end-of-line))) - )) -) - -(defun cite-file (filename) - "insert the file with citation string." - (interactive "FCite-file: ") - (let* - ((string - (read-string - (format "Citation string (default \"%s\"): " current-comment-prefix) - )) - (ins-tail (car (cdr (insert-file-contents filename))))) - (save-excursion - (cite-region (point) (+ (point) ins-tail)))) -)
--- a/docs/htmlqa Fri Dec 26 01:06:32 2014 +0900 +++ b/docs/htmlqa Sun Sep 17 10:25:38 2017 +0859 @@ -52,6 +52,9 @@ ・<META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=x-sjis">を 認識して漢字コードを設定して欲しいなー。 + HTML5 で書くのであればこの構文を使うのはやめ、文字集合はUTF-8に + 絞り <meta charset="utf--8"> と記しましょう。 + 文書の中にファイルのエンコード法を書いてもそもそもそのMETAなんちゃ らを読めない可能性があるので charset をMETAで指定するのは本当に 期待した通りには機能しません。たとえば、多国語文書を書く必要が出 @@ -185,5 +188,4 @@ mode: indented-text fill-column: 72 fill-prefix: " " -buffer-file-coding-system: shift_jis-dos End:
--- a/docs/qanda Fri Dec 26 01:06:32 2014 +0900 +++ b/docs/qanda Sun Sep 17 10:25:38 2017 +0859 @@ -5,9 +5,8 @@ %% (新項目:・RefTeXは使えますか? + ・bibtexとlatexとかを交互にかけるのが面倒なんですけど ・自分で定義したカウンタを\ref補完でのラベル候補対象として認識させたい - ・font-lock はどうやって使えばいいんでしょ? - ・XEmacsでも色は着きますか? ・{\it }内部では斜体に {\bf }では太字になるという噂を聞いたんですが…) ■インストール関連 @@ -36,38 +35,18 @@ ・まだしたっぱなので Info ディレクトリに書き込む権利がないっすう… - rootにしてもらいましょう。それがだめなときは Mule2 をインストー - ルしてもらいましょう。してくれない時は、ホームディレクトリにイン - ストールして、ほーらディスクの無駄遣いだよ〜んといって脅せば入れ - てくれるはずです。Mule2 なら、~/.emacs に + rootにしてもらいましょう。それがだめなときは以下のようにして個人 + 所有の Info ディレクトリをEmacsに認識させましょう。 (setq Info-default-directory-list (cons "自分のInfoディレクトリ" Info-default-directory-list)) - と書くことで、info を起動した時に個人用のファイルもメニューに加 - わります。それでもMule2をなかなか入れてくれない時は、新しいinfo - ファイルを拾って来るたびに管理者に「入れてくださーい。あ、すみま - せーん毎度。でもMule2なら自分のディレクトリを追加できるんですけ - どねぇ…」を繰り返しましょう。 - ・LaTeXのヘルプファイルがないといわれる。 - Nemacs, Mule1 では $EMACS/etc/, Mule2 では $EMACS/site-lisp/ に - 置かれているとみなすようになっています。もし公共の場所に置く権限 - がない時は、ホームディレクトリの下のどこかに置いて、変数 - YaTeX-help-file にそのファイル名を設定して下さい。 - -・Nemacsで info が読めない。 - - Muleでformatしているので、内部日本語処理の異なるNemacs(または - NemacsベースのDemacs)では(バイト数がずれるため)正しく読むことが - できません。Muleで御覧ください。なお、Texinfoファイルのフォーマッ - トには texinfo-3.1.tar.gz にある Emacs-Lisp ファイルを用いてくだ - さい。 - - また、九州大学の井上さんによると、Info の dir 画面で,M-x - Info-tagify とやると info ファイルのコンバートができるそうです。 + もし公共の場所に置く権限がない時は、ホームディレクトリの下のどこ + かに置いて、変数 YaTeX-help-file にそのファイル名を設定して下さ + い。 ■操作関連 ・間違って変なLaTeXコマンドを学習させてしまった。 @@ -174,20 +153,12 @@ ・直前に入れた \foo{引数だよ} の「引数だよ」をもう一回使いたい。 - gmhist というパッケージを導入しましょう。野鳥は gmhist に対応し - ています。ミニバッファで \foo{???}: と聞かれた時に M-p (ESC p)を + ミニバッファで \foo{???}: と聞かれた時に M-p (ESC p)を 押すと今まで入力した文字の履歴を逆方向にたどって表示します。M-n と押すと順方向にたどります。これらの入力履歴は begin 型補完、 section 型補完、プレヴューア起動、プリントアウトコマンド起動それ ぞれに対し独立に設定されます。 - gmhist は多くの Emacs-Lisp アーカイブサイトに置いてあります。 - ftp.ae.keio.ac.jp:pub/emacs-lisp/util/gmhist.tar.gz - にもあります。 - - ただし、Mule2 以降を用いている場合は、gmhistを用いなくてもミニバッ - ファでのヒストリが使えます。 - ・ref←→label間ジャンプで存在するはずのref/labelにジャンプしない。 C-c g とだけ打つと対応するref/labelの前方検索から始めます。 @@ -216,24 +187,30 @@ ・いつも雛型として使っている template.tex を簡単に入れたい - autoinsert.el (Emacs19/Mule2付属)を使いましょう。もしくは、それ - の機能強化版 auto-insert-tkld を使いましょう。後者は、 - ftp://ftp.ae.keio.ac.jp/pub/emacs-lisp/util/auto-inset-tkld.tar.Z - で入手できます。 + ~/work/template.tex に置きましょう。置き場所を変えたい場合は + (setq YaTeX-template-file "~/hogehoge/fugafuga.tex") + のようにして変更できます。 ・bibtexとlatexとかを交互にかけるのが面倒なんですけど - latexmk というスグレもののツールがあります。これは、.tex, - .bib, .idx などのファイル間の依存関係をドキュメントを走査して調 - べ、自動的に bibtex, makeindex, jlatex などを必要な順序で必要な - 回数起動してくれます。これをインストールし、各ドキュメントの先頭 - に - %#!latexmk + yatex1.76からラベルやbibtexでの文献番号不整合を自動的に検知して、 + 再処理が必要なときは自動的に再起動するようになりました(auto rerun)。 + ほとんどの場合、野鳥の auto rerun で対処できるはずです。ただし、 + 以下で述べるlatexmkを利用する場合は重複処理になるため野鳥の + auto rerun を無効化してください。無効化は + (setq YaTeX-typeset-auto-rerun nil) + します。 - などと書いてタイプセッタとして latexmk を指定すれば複雑な依存関 - 係に悩んだ日々とはおさらばです。なお、latexmk は CTAN サイトの - support/latexmk/ ディレクトリに置いてあります。 - (例えば ftp.kdd.lab.kdd.co.jp:/CTAN/) + 同じ目的のツールに latexmk というツールがあります。これは、.tex, + .bib, .idx などのファイル間の依存関係を調べ、自動的に bibtex, + makeindex, platex などを必要な順序で必要な回数起動してくれます。 + これをインストールし、各ドキュメントの先頭に + + %#!latexmk + + などと書いてタイプセッタとして latexmk を指定することで利用でき + ます。なお、latexmk は CTAN サイトにあります。 + (http://www.ctan.org/pkg/latexmk/) ・タイプセットとプレヴューでキーが違うのが面倒ですね? @@ -413,13 +390,6 @@ ん。光らないだけで実害はないので、気にしないか、あるいは次の Meadow が登場するまで hilit19 を利用して下さい。 -・メニューバーの YaTeX をクリックした時にハングしたかと思うほど遅い。 - - わかりません、Emacs のせいです。我慢してください。二回目からは遅 - くありません。ふつ〜メニューなんか使わないでしょ? サルのようにメ - ニューバーを使う友達に野鳥を勧めてはいけません。言いすぎでした、 - ごめんなさいごめんなさい。 - ・\it をイタリック表示できませんか?(Mule2) まず、普段使用しているサイズの斜体フォントを探します。 @@ -611,7 +581,7 @@ 境に括り入れます。 「じゃあpreviewしてみよっか、でもこの部分だけでいいやね」と いってもっぺんcenter環境全体をマーク(ESC C-@)して - [prefix] % b してcenter環境を %#BEGIN〜%#ENDで括ってから + [prefix] % B してcenter環境を %#BEGIN〜%#ENDで括ってから 領域タイプセットします。[prefix] t r。 「さてpreviewじゃ」 といいつつ [prefix] t p します。 @@ -622,22 +592,23 @@ めます。 「はい、次の行」 と言いながら ESC RET します。また適当に埋めて - 領域タイプセットして xdvi をraiseします。muleに戻りcenter環境 - の外に『この表は重要ネ〜』と書きます。 + 今度は [prefix] t e で隣のバッファに on-the-fly preview を出し、 + 表の中味を書き換えては自動的に隣のpreview画像が書き変わる様を + 眺めます。 + 続いて、center環境の外に『この表は重要ネ〜』と書きます。 「うむ、『重要』にはアンダーラインを引こう」 といって『重要』をリジョン指定して [prefix] S(大文字) で - underline を補完入力し、またpreviewします。 + underline を補完入力し、悩んだふりをして 「やっぱアンダーラインはやめ」と言いながら \underline または { か } にカーソルを合わせて [prefix] k して - \underline{} を消します。またpreviewして、 + \underline{} を消します。さらに悩むふりをして 「やっぱセンタリングは要らんかもしれんなあ…」と言いつつ \end{center} にカーソルを合わせて [prefix] . を押します。 - すると \begin{center}, \end{center} に % がつくのでまた - previewします。 + すると \begin{center}, \end{center} に % がつきます。 「うむ、やっぱりセンタリングはぽいっ」と言って \end{center}の行で [prefix] k をおして begin/end 対を消します。 「さて、ファイルがでかくなって来たので分割するか」と言って - \include{foo} などを補完入力します。 + \include{foo} などを [prefix] s で補完入力します。 「じゃあ foo.tex を作らなきゃ…」と言って [prefix] g します。 foo.tex が勝手に作られるので適当にごちゃごちゃ書いて [prefix] t j でタイプセットします。 @@ -649,7 +620,7 @@ こんな感じですかね。 あとは、イメージ補完、数式モード自動判定、先回りusepackageなんて - のもAUCにはありません。 + のもアドバンテージでしょう。 ・なんで構成ファイルがいまさらSJISなの? だっせー。 @@ -701,7 +672,7 @@ に更新を行なって下さい。Mercurialをインストール後、以下のように して開発版に追随します。 - hg clone http://www.yatex.org:/hgrepos/yatex + hg clone https://www.yatex.org:/hgrepos/yatex で、リポジトリ全体を取得します。開発ブランチは dev なので @@ -738,5 +709,4 @@ mode: indented-text fill-column: 72 fill-prefix: " " -buffer-file-coding-system: shift_jis-dos End:
--- a/docs/qanda.eng Fri Dec 26 01:06:32 2014 +0900 +++ b/docs/qanda.eng Sun Sep 17 10:25:38 2017 +0859 @@ -32,39 +32,25 @@ *I ain't got the privilege to write in the Info directory... - Get yourself made root. If you can't, have them install Mule2 - and add + Get yourself made root. If you can't, write this: (setq Info-default-directory-list (cons "YOUR INFO DIRECTORY" Info-default-directory-list)) to your ~/.emacs. Now your personal files will be added to the - menu when you invoke info. By the way, Mule1 will not release - memories, so processes will pile up and be heavier on the system - compared to Mule2. Nemacs has already become obsolete by the - developers, so no further comments for usage of Nemacs. Get - yourself Mule2 with flying colors :-) + menu when you invoke info. *Emacs can't find the help file. - - The help file is set to be placed in $EMACS/etc/ for Nemacs, - Mule1 and $EMACS/site-lisp/ for Mule2. If you don't have the - privilege to put them in a public location, copy it to your home - directory and set YaTeX-help-file to that file name. -*I can't read info on Nemacs + If you don't have the privilege to put them in a public + location, copy it to your home directory and set YaTeX-help-file + to that file name. - The info file was formatted on Mule, so it can't be read - correctly on Nemacs (or Demacs based on Nemacs) because the - internal Japanese processing is different. Read it on Mule. - Use the Emacs-Lisp package in texinfo-3.1.tar.gz to format the - Texinfo file. - [Operations] ============ -*I accidentally learned in a wrong LaTeX command. +*I accidentally learned in a wrong LaTeX macro in my dictionary. There should be a line with the wrong command in the .yatexrc file in your home or current directory. Erase or fix that line, @@ -209,19 +195,24 @@ *Is it possible to include personal template file template.tex handily? - Try Emacs-19's standard package `autoinsert.el' please. Or its - upper compatible package auto-insert-tkld might also be good. - You can get auto-insert-tkld via anonymous ftp - ftp://ftp.ae.keio.ac.jp/pub/emacs-lisp/util/ - ftp://archive.cis.ohio-state.edu/pub/gnu/elisp-archive/ + Put your template.tex into your ~/work directory where YaTeX + seeks by default. If you change the location to another place, + set the lisp-variable as below. + (setq YaTeX-template-file "~/other/location/template.tex") *It is bothering for me to determine I should call bibtex or latex... - Why don't you try `latexmk' perl script, which is a TeX specific - tool as `make'? It detects the dependency among the TeX-related - files such as .tex, .bib, and so on, and will execute suitable - commands in a suitable sequence. You can find `latexmk' script - in a directory of supports/latexmk in some CTAN ftp directory. + Since version 1.76, YaTeX automatically call bibtex/latex twice + if needed. In most case, you don't have to repeat to call + typesetter or bibtex. If you use `latexmk' described below, + YaTeX's auto rerun functionality should be disabled by setting + like this: + (setq YaTeX-typeset-auto-rerun nil) + + The `latexmk' perl script, which is a TeX specific tool to + automate generation of LaTeX document. You can find `latexmk' + some CTAN ftp directory. + (eg. http://www.ctan.org/pkg/latexmk/) *Can I inhibit auto-filling against very long <a href="..."> line? @@ -276,12 +267,6 @@ you are thinking of graduating from hilit19, it might be better to keep old setting about it... -*It's sooo slow when I click YaTeX on the menu bar. - - I don't know why. Probably a problem with Emacs-19. You'll - just have to bear with it. It won't be so slow the second time. - Anyway, you probably won't use the menu at all, do you? - *Is there any way of displaying `\it' strings in the italic font? First, you should find the available italic font on your @@ -396,7 +381,7 @@ If you want to catch up to latest version, using yatex-current is inefficient. Use yatex's mercurial repository instead. - hg clone http://www.yatex.org:/hgrepos/yatex + hg clone https://www.yatex.org:/hgrepos/yatex cd yatex hg up -C dev
--- a/docs/yahtmle Fri Dec 26 01:06:32 2014 +0900 +++ b/docs/yahtmle Sun Sep 17 10:25:38 2017 +0859 @@ -1,7 +1,7 @@ Info file: yahtmle, -*-Text-*- produced by `texinfo-format-buffer' from file `yahtmle.tex' -using `texinfmt.el' version 2.38 of 3 July 1998. +using `texinfmt.el' version 2.42 of 7 Jul 2006. START-INFO-DIR-ENTRY * yahtml-e: (yahtmle). Yet Another html-mode for Emacs (English). @@ -49,9 +49,9 @@ ***************** * Menu: -* Setting up yahtml:: -* Setting environments for weblint browsers and image viewers:: -* Setting environment variables for WWW pages:: +* Setting up yahtml:: +* Setting environments for weblint browsers and image viewers:: +* Setting environment variables for WWW pages:: @@ -110,7 +110,8 @@ ... list of matching path name on file system and URLs `yahtml-directory-index' ... index file displayed when none is given in URL. Usually - `index.html' on NCSA type httpd and `Welcome.html' on CERN types. + `index.html' on NCSA type httpd and `Welcome.html' on CERN + types. Examples for `yahtml-path-url-alist'. If `/home/yuuji/http/' is `http://localhost/~yuuji' at home and `/usr/home/yuuji/www/' is @@ -213,10 +214,10 @@ * Menu: -* Changing tags in pairs:: -* Changing entities:: -* URLencoding of strings within region:: -* td-enclosure/tr-enclosure:: +* Changing tags in pairs:: +* Changing entities:: +* URLencoding of strings within region:: +* td-enclosure/tr-enclosure:: @@ -252,7 +253,7 @@ ... convert char to special entity in marked region `[prefix] :' ... convert special entity to original char in marked region - (reverse of [prefix] ;) + (reverse of [prefix] ;) @@ -263,7 +264,7 @@ ==================================== `[prefix] #' - ... encode chars that needs to be URLencoded within region + ... encode chars that needs to be URLencoded within region @@ -275,15 +276,16 @@ table element, td-enclosure or tr-enclosure is convenient. `[prefix] }' - - ... Enclose each field in a region into <td>...</td>'s. + + ... Enclose each field in a region into <td>...</td>'s. `[prefix] ]' - - ... Enclose each line in a region into <tr>...</tr>'s, with every -line converted to <td>...</td> repetition. They presume white space as -field separator by default. To change this, enter other delimiting -character for a query. You can convert CSV, for example, into table by -specifying comma(,) as a delimiter. + + ... Enclose each line in a region into <tr>...</tr>'s, with every + line converted to <td>...</td> repetition. They presume + white space as field separator by default. To change this, + enter other delimiting character for a query. You can + convert CSV, for example, into table by specifying comma(,) + as a delimiter. If you want to enclose fields with th, call with universal-argument (`C-u'). Enter `th' to enclose fields with <th>...</th>. The special @@ -299,8 +301,8 @@ * Menu: -* CSS-class completion:: -* Reread CSS definition:: +* CSS-class completion:: +* Reread CSS definition:: @@ -322,8 +324,8 @@ .caution { font-size: 120%; background-color: 0xc00000;} when you input any tags via completing-read, yahtml prompts you to input -class name. If this is bothering, typing `C-j' instead of `RET' (or -`C-m') cancels the next prompt to class name completion. +class name. If this is bothering, typing `C-j' instead of +`RET' (or `C-m') cancels the next prompt to class name completion. @@ -366,8 +368,8 @@ -- Variable: yahtml-kanji-code Default kanji code. 1=sjis, 2=jis, 3=euc, 4=utf-8 (2) If AddType - "text/html; charset=xxx" .html is written in .htaccess, this will - override yahtml-kanji-code. + "text/html; charset=xxx" .html is written in .htaccess, this + will override yahtml-kanji-code. -- Variable: yahtml-fill-column Columns to auto-fill (72) @@ -498,39 +500,35 @@ * Menu: -* Customize: Customizations. 4. -* Demacs: Intro. 4. -* Key Assign: Customizations. 4. -* LaTeX: Intro. 4. -* Mule: Intro. 4. -* yahtml: Intro. 4. - - - - +* Customize: Customizations. (line 5) +* Demacs: Intro. (line 5) +* Key Assign: Customizations. (line 5) +* LaTeX: Intro. (line 5) +* Mule: Intro. (line 5) +* yahtml: Intro. (line 5) Tag table: -Node: Top256 -Node: Intro833 -Node: Installation1231 -Node: Setting up yahtml1512 -Node: Setting environments for weblint browsers and image viewers2303 -Node: Setting environment variables for WWW pages2999 -Node: Command Invocation3970 -Node: Completion4398 -Node: Jump5914 -Node: Changing and Deleting6394 -Node: Changing tags in pairs6678 -Node: Changing entities7173 -Node: URLencoding of strings within region7709 -Node: td-enclosure/tr-enclosure8010 -Node: CSS Support8976 -Node: CSS-class completion9202 -Node: Reread CSS definition10055 -Node: Customizations10330 -Node: All customizable variables10606 -Node: Hook variables14374 -Node: Copying14500 -Node: Concept Index15291 +Node: Top259 +Node: Intro836 +Node: Installation1234 +Node: Setting up yahtml1500 +Node: Setting environments for weblint browsers and image viewers2291 +Node: Setting environment variables for WWW pages2987 +Node: Command Invocation3979 +Node: Completion4407 +Node: Jump5923 +Node: Changing and Deleting6403 +Node: Changing tags in pairs6665 +Node: Changing entities7160 +Node: URLencoding of strings within region7704 +Node: td-enclosure/tr-enclosure8007 +Node: CSS Support9032 +Node: CSS-class completion9243 +Node: Reread CSS definition10096 +Node: Customizations10371 +Node: All customizable variables10647 +Node: Hook variables14427 +Node: Copying14553 +Node: Concept Index15344 End tag table
--- a/docs/yahtmlj Fri Dec 26 01:06:32 2014 +0900 +++ b/docs/yahtmlj Sun Sep 17 10:25:38 2017 +0859 @@ -1,7 +1,7 @@ Info file: yahtmlj, -*-Text-*- produced by `texinfo-format-buffer' from file `yahtmlj.tex' -using `texinfmt.el' version 2.38 of 3 July 1998. +using `texinfmt.el' version 2.42 of 7 Jul 2006. START-INFO-DIR-ENTRY * yahtml: (yahtmlj). Yet Another html-mode for Emacs (Japanese). @@ -35,10 +35,11 @@ はじめに ******** -yahtmlは GNU Emacs 上で HTML文書を作成する時に、繁雑なHTMLタグの入力を補完 -機能によってスムーズに行えるようにするだけでなく、weblintなどの構文チェッ -クプログラム、カーソル位置のURLやファイル名に依存したブラウザ/イメージヴュー -アの起動などを Emacs 編集画面中から行えるようにするパッケージです。 +yahtmlは GNU Emacs 上で HTML文書を作成する時に、繁雑なHTMLタグの入力を +補完機能によってスムーズに行えるようにするだけでなく、weblintなどの構 +文チェックプログラム、カーソル位置のURLやファイル名に依存したブラウザ/ +イメージヴューアの起動などを Emacs 編集画面中から行えるようにするパッ +ケージです。 (このInfoは未完成です(__)…) @@ -68,17 +69,17 @@ (cons (cons "\\.html$" 'yahtml-mode) auto-mode-alist)) (autoload 'yahtml-mode "yahtml" "Yet Another HTML mode" t) -次にyahtmlに必要なファイル(`yahtml.el', `yatexlib.el', `yatexprc.el') を置 -くディレクトリを load-path に加えます。たとえば、 `~/src/emacs/yahtml'に置 -くのであれば、 +次にyahtmlに必要なファイル(`yahtml.el', `yatexlib.el', +`yatexprc.el') を置くディレクトリを load-path に加えます。たとえば、 +`~/src/emacs/yahtml'に置くのであれば、 (setq load-path (cons (expand-file-name "~/src/emacs/yahtml") load-path)) などとします。 以上の設定により、拡張子が .html であるファイルを編集すると自動的に -yahtml がロードされます。yahtmlが正常に起動できたときはモードラインの表示 -が「yahtml」に変わります。 +yahtml がロードされます。yahtmlが正常に起動できたときはモードラインの +表示が「yahtml」に変わります。 @@ -87,8 +88,8 @@ lintプログラム/ブラウザ/イメージヴューア環境等の設定 ==================================================== -利用する外部プログラムなどに関する以下の変数を確認し、必要なら正しい値に変 -更します(括弧内はデフォルト値)。 +利用する外部プログラムなどに関する以下の変数を確認し、必要なら正しい値 +に変更します(括弧内はデフォルト値)。 `yahtml-www-browser' ... 起動するブラウザのコマンド名(netscape) `yahtml-image-viewer' @@ -110,13 +111,13 @@ ... ファイルシステム上のPATH名と、URLの対応表 `yahtml-directory-index' ... URL指定でファイル名を省略したときに表示されるインデックス - ファイル名(NCSA系httpdなら `index.html', CERN系なら`Welcome.html'が一 - 般的) + ファイル名(NCSA系httpdなら `index.html', CERN系なら + `Welcome.html'が一般的) 変数 `yahtml-path-url-alist' の設定例を示します。例えば、自宅では、 -`/home/yuuji/http/' が `http://localhost/~yuuji' で参照でき、職場では -`/usr/home/yuuji/www/' が`http://www.keio.ac.jp/~yuuji/' で参照できるよう -になっている場合は以下のように設定します。 +`/home/yuuji/http/' が `http://localhost/~yuuji' で参照でき、職場では +`/usr/home/yuuji/www/' が`http://www.keio.ac.jp/~yuuji/' で参照できる +ようになっている場合は以下のように設定します。 (setq yahtml-path-url-alist '(("/home/yuuj/http" . "http://localhost/~yuuji") @@ -146,26 +147,27 @@ 補完入力 ******** -「野鳥」で利用できる、「begin型補完」、「section型補完」、「large型補完」、 -「maketitle型補完」、「アクセント補完」と全く同じキー操作で対応するHTMLタ -グの補完入力ができます。それぞれの型の補完は順に、「複数行に渡るタグ入力」、 -「空要素タグ(imgなど)の補完」、「一行内での開始/終了タグの入力」、「空要素 -空属性タグの入力」、「文字参照入力」に対応しています。具体的には +「野鳥」で利用できる、「begin型補完」、「section型補完」、「large型補 +完」、「maketitle型補完」、「アクセント補完」と全く同じキー操作で対応 +するHTMLタグの補完入力ができます。それぞれの型の補完は順に、「複数行に +渡るタグ入力」、「空要素タグ(imgなど)の補完」、「一行内での開始/終了タ +グの入力」、「空要素空属性タグの入力」、「文字参照入力」に対応していま +す。具体的には `[prefix] b (野鳥のbegin補完に対応)' ... <ul> </ul> - のように開始タグと終了タグを二行に渡って書きたい場合の補完を指します。 - おもにブロック型タグが補完候補に含まれます。 + のように開始タグと終了タグを二行に渡って書きたい場合の補完を指し + ます。おもにブロック型タグが補完候補に含まれます。 `[prefix] s (野鳥のsection型補完に対応)' ... <img src="foo.gif" alt="photo"> - のように終了タグを持たず、かつ属性値のみで機能を指定するタグを補完し - ます。補完候補としては、img, input が存在します。 + のように終了タグを持たず、かつ属性値のみで機能を指定するタグを補 + 完します。補完候補としては、img, input が存在します。 `[prefix] l (野鳥のlarge型補完に対応)' ... begin型補完とほぼ同じですが、 @@ -175,13 +177,13 @@ のように一行内に開始/終了タグを入れたいときに利用します。 `[prefix] m (野鳥のmaketitle型補完に対応)' - ... 要素も属性値も持たないタグを補完入力します。<br> + ... 要素も属性値も持たないタグを補完入力します。<br> などが補完候補に相当します。 `[prefix] a (野鳥のアクセント補完に対応)' ... エンティティ参照による文字表記を入力するときに用います。 - デフォルトでは < (<), > (>), & (&), " ("), ' ('), - ブランク ( ) の補完入力が行えます。 + デフォルトでは < (<), > (>), & (&), " ("), ' + ('),ブランク ( ) の補完入力が行えます。 @@ -194,8 +196,8 @@ `[prefix] g' ... 対応するオブジェクトにジャンプ -を押すことにより、カーソル位置のHTML構文に対応する場所にジャンプします。対 -応関係が存在すると解釈されるコマンドには以下のものがあります。 +を押すことにより、カーソル位置のHTML構文に対応する場所にジャンプします。 +対応関係が存在すると解釈されるコマンドには以下のものがあります。 * `<TAG>' ←→ `</TAG>' * `<img src="画像ファイル">' → 対応するviewer起動 @@ -227,8 +229,8 @@ `[prefix] c' ... 対応するタグ等を変更 -を押すことにより、カーソル位置のHTML構文に応じた記述内容の変更を行います。 -カーソル位置と変更する内容の対応は以下の通りです。 +を押すことにより、カーソル位置のHTML構文に応じた記述内容の変更を行いま +す。カーソル位置と変更する内容の対応は以下の通りです。 * `<TAG>'〜`</TAG>' ... `TAG' の変更 @@ -241,15 +243,16 @@ 文字参照への変更 ================ -文字としての < や > を表現するときは、文字参照を用いて< や > と表記 -する必要がありますが、HTML以外のファイルからこれらの文字を含むテキストを張 -り込んだ場合などに、これらの文字を一括して文字参照形式に変換できます。 +文字としての < や > を表現するときは、文字参照を用いて< や > と +表記する必要がありますが、HTML以外のファイルからこれらの文字を含むテキ +ストを張り込んだ場合などに、これらの文字を一括して文字参照形式に変換で +きます。 `[prefix] ;' ... 指定した領域の文字参照に置き換えるべき文字の置換 `[prefix] :' - ... 指定した領域の文字参照を参照文字そのものに置換([prefix] ; - の逆変換) + ... 指定した領域の文字参照を参照文字そのものに置換 + ([prefix] ; の逆変換) @@ -259,9 +262,9 @@ リジョン内文字のURLencode ========================= `[prefix] #' - - ... 指定した領域内に URLencode すべき文字があればそれらをエン - コード表記に置換。 + + ... 指定した領域内に URLencode すべき文字があればそれらを + エンコード表記に置換。 @@ -269,23 +272,25 @@ td括り/tr括り ============= -空白区切りで書いた表形式の行レコードを <td> 括りの並び,あるいはそれらをさ -らに <tr> で括った行並びに変換できます。 +空白区切りで書いた表形式の行レコードを <td> 括りの並び,あるいはそれら +をさらに <tr> で括った行並びに変換できます。 `[prefix] }' - - ... 現在のリジョンにあるデータを空白区切りごとに + + ... 現在のリジョンにあるデータを空白区切りごとに <td>...</td> で括る `[prefix] ]' - - ... 現在のリジョンにある行を上記td括りをほどこしてからさらに行ごと -に <tr>...</tr> で括るデフォルトでは空白区切りですが,これを変えるときは -Delimiter: の問い合わせに区切り文字を指定します。たとえばカンマ(,) を指定 -するとCSVから表を作ることができます。 -td以外の要素,具体的には th で括りたい場合は universal-argument (`C-u') を -つけて上記2つのコマンドを呼びます。どの要素で括るかの質問が増えるのでそれ -に th と入れれば,各フィールドを <th>...</th> で括ります。もし,第1フィー -ルドのみ th で,残りを全部 td 括りにしたいときは thd と入力して下さい。 + ... 現在のリジョンにある行を上記td括りをほどこしてからさらに行 + ごとに <tr>...</tr> で括るデフォルトでは空白区切りですが, + これを変えるときはDelimiter: の問い合わせに区切り文字を指 + 定します。たとえばカンマ(,)を指定するとCSVから表を作るこ + とができます。 + +td以外の要素,具体的には th で括りたい場合は universal-argument +(`C-u') をつけて上記2つのコマンドを呼びます。どの要素で括るかの質問が +増えるのでそれに th と入れれば,各フィールドを <th>...</th>で括ります。 +もし,第1フィールドのみ th で,残りを全部 td 括りにしたいときは thd と +入力して下さい。 @@ -305,34 +310,34 @@ CSSクラス名補完 =============== -HTML屋はCSS(Cascading Style Sheets)のクラス名を補完入力することができます。 -スタイル定義として +HTML屋はCSS(Cascading Style Sheets)のクラス名を補完入力することができ +ます。スタイル定義として h1.foo, h2.foo { background-color: 0xffffff; } h1.bar, h2.bar { font-size: 120%; } -のようなものがあった場合に、h1またはh2タグを [prefix] b や [prefix] l で補 -完入力した場合に、それらに有効な class 名である foo, bar を候補として補完 -入力することが可能です。また +のようなものがあった場合に、h1またはh2タグを [prefix] b や [prefix] l +で補完入力した場合に、それらに有効な class 名である foo, bar を候補と +して補完入力することが可能です。また .caution { font-size: 120%; background-color: 0xc00000;} -のような全てのエレメントに働くclassが定義されていた場合は、全てのタグの補 -完入力時にclass参照入力を求められます。これが煩わしい場合はエレメント名入 -力確定のときにリターンキー(またはC-m)ではなく、C-jを押せばclass補完入力を -キャンセルできます。たとえば +のような全てのエレメントに働くclassが定義されていた場合は、全てのタグ +の補完入力時にclass参照入力を求められます。これが煩わしい場合はエレメ +ント名入力確定のときにリターンキー(またはC-m)ではなく、C-jを押せば +class補完入力をキャンセルできます。たとえば - `[prefix] l' 行内タグ補完を起動 - (または`[prefix] l SPC') + [prefix] l 行内タグ補完を起動 + (または[prefix] l SPC) tt <tt></tt>をいれたいのでttと入力 - `C-m' + C-m とした場合は続いて class= と補完プロンプトが出ますが、 - `[prefix] l' 行内タグ補完を起動 - (または`[prefix] l SPC') + [prefix] l 行内タグ補完を起動 + (または[prefix] l SPC) tt <tt></tt>をいれたいのでttと入力 - `C-j' + C-j と最後を `C-j' で入力した場合は class 補完プロンプトは出ません。 @@ -342,9 +347,9 @@ CSS定義ファイルの読み直し ========================= -htmlファイルを編集中にCSS定義ファイルを修正し、追加したclassを補完候補とし -て直ちに読み込ませたい場合は、`M-x yahtml-mode' として再起動を行ってくださ -い。 +htmlファイルを編集中にCSS定義ファイルを修正し、追加した +classを補完候補として直ちに読み込ませたい場合は、 +`M-x yahtml-mode' として再起動を行ってください。 @@ -371,7 +376,8 @@ yahtml-mode 中のプリフィクスキー (`\C-c') -- Variable: yahtml-image-viewer - imgで参照している画像ファイルを表示するときに起動するコマンド (xv) + imgで参照している画像ファイルを表示するときに起動するコマンド + (xv) -- Variable: yahtml-www-browser `[prefix]g' で外部ページを表示するときに起動するブラウザ (netscape) @@ -379,8 +385,8 @@ -- Variable: yahtml-kanji-code デフォルトの漢字コード。1=sjis, 2=jis, 3=euc, 4=utf-8 (2) .htaccess ファイルに - AddType "text/html; charset=xxx" .html の記述があった場合はそれ - に従う + AddType "text/html; charset=xxx" .htmlの記述があった場合は + それに従う -- Variable: yahtml-fill-column auto-fillするときのカラム数 (72) @@ -389,17 +395,19 @@ yahtml-mode 固有のfill-prefix (`nil') -- Variable: yahtml-path-url-alist - OSのファイルシステム上でのフルパス名と、その外部公開時のURLの対応表。 + OSのファイルシステム上でのフルパス名と、その外部公開時のURLの対応 + 表。 -- Variable: yahtml-directory-index - サーバアクセス時ファイル名を省略したときにデフォルトで開かれるインデッ - クスファイルの名前。多くの場合 index.html。(`"index.html"') + サーバアクセス時ファイル名を省略したときにデフォルトで開かれるイ + ンデックスファイルの名前。多くの場合 index.html。(`"index.html"') -- Variable: yahtml-lint-program HTML構文チェックプログラム。(`"jweblint"') -- Variable: yahtml-hate-too-deep-indentation - ネストした列挙系環境でのインデントが深すぎるときにtにする。(`nil') + ネストした列挙系環境でのインデントが深すぎるときにtにする。 + (`nil') -- Variable: yahtml-always-/p `<p>' をいれたら必ず `</p>' したい人向け。`nil' @@ -423,26 +431,27 @@ ./.htaccess を参照するかどうかを決定する。`'apache' -- Variable: yahtml-apache-access-file - `yahtml-server-type' が `'apache' のときにアクセス制限ファイル名を指 - 定。`".htaccess"' + `yahtml-server-type' が `'apache' のときにアクセス制限ファイル名 + を指定。`".htaccess"' -- Variable: yahtml-shell-command-option シェルで別コマンドを起動するときのオプション。 -- Variable: yahtml-translate-hyphens-when-comment-region - 領域コメントアウトをするときに既に存在するハイフンを `-' に変更す - るかどうか。(`t') + 領域コメントアウトをするときに既に存在するハイフンを `-' に変 + 更するかどうか。(`t') -- Variable: yahtml-entity-reference-chars-alist - エンティティ参照(Entity Reference)で記述すべき文字群を`'(?文字 . "エ - ンティティ表記")' という形式を列挙したalistで並べる。デフォルトで - `<', `>', `&', `'', `"' に対するalistが設定されているので、追加したい - 分だけを記述すれば良い。cdr部 `"エンティティ表記"' は、先頭の `&' と - 末尾の`;' は含めずに書く。 + エンティティ参照(Entity Reference)で記述すべき文字群を`'(?文 + 字 . "エンティティ表記")' という形式を列挙したalistで並べる。デ + フォルトで `<', `>', `&', `'', `"' に対するalistが設定されている + ので、追加したい分だけを記述すれば良い。cdr部 `"エンティティ表記 + "' は、先頭の `&' と 末尾の`;'は含めずに書く。 -- Variable: yahtml-faithful-to-htmllint - 構文チェッカとして htmllint を利用する場合ちょっとした余計な空白など - に対しても警告を示すので、これを回避するときにはこの変数を`t'にする。 + 構文チェッカとして htmllint を利用する場合ちょっとした余計な空白 + などに対しても警告を示すので、これを回避するときにはこの変数を`t' + にする。 -- Variable: yahtml-use-css CSSの補完機能を使うかどうか (`t') @@ -451,12 +460,12 @@ 画像ファイルのサイズを調べるときに読み込むバイト数 (`10000') -- Variable: yahtml:img-default-alt-format - <img src...>のALT属性のデフォルト文字列の書式。%xは画像の幅、%yは画像 - の高さ、%sはファイルサイズに置換される (`"%xx%y(%sbytes)"') + <img src...>のALT属性のデフォルト文字列の書式。%xは画像の幅、%yは + 画像の高さ、%sはファイルサイズに置換される (`"%xx%y(%sbytes)"') -- Variable: yahtml-escape-chars - href補完などのときに予約文字をURLエンコードするか; 'askのときは確認し - てから置換する (`'ask') + href補完などのときに予約文字をURLエンコードするか; 'askのときは確 + 認してから置換する (`'ask') -- Variable: yahtml-use-font-lock ソースの色づけパッケージとして font-lock を利用するか(`(featurep @@ -467,7 +476,8 @@ 'hilit19)') -- Variable: yahtml-indentation-boundary - インデント計算を打ち切ってよい境界となる正規表現(`"^\\s *<h[1-3]>"') + インデント計算を打ち切ってよい境界となる正規表現(`"^\\s + *<h[1-3]>"') @@ -484,19 +494,19 @@ 取り扱い ******** - 本プログラムはフリーソフトウェアです。本プログラムを使用して生じたいかな -る結果に対しても作者は責任を負わないこととします。転載等に関しては制限いた -しません。常識的に扱ってください。また、使用している旨をメイルでお知らせい -ただくと、作者は喜んでサポートに励むことでしょう。 + 本プログラムはフリーソフトウェアです。本プログラムを使用して生じたい +かなる結果に対しても作者は責任を負わないこととします。転載等に関しては +制限いたしません。常識的に扱ってください。また、使用している旨をメイル +でお知らせいただくと、作者は喜んでサポートに励むことでしょう。 - 苦情、希望、バグ報告、感想等は歓迎いたします。連絡は yuuji@yatex.org ま -で(2000年12月現在)。継続的に使用してくださる方はメイリングリスト「fj野鳥の -会」に是非加入してください。加入方法については本パッケージの `docs/htmlqa' -ファイルの「その他」の章を御覧ください。 + 苦情、希望、バグ報告、感想等は歓迎いたします。連絡は yuuji@yatex.org +まで(2000年12月現在)。継続的に使用してくださる方はメイリングリスト「fj +野鳥の会」に是非加入してください。加入方法については本パッケージの +`docs/htmlqa'ファイルの「その他」の章を御覧ください。 仕様は、予告なく確実に(気分次第で)変更されます:-p。 - 広瀬雄二 + 広瀬雄二 @@ -508,39 +518,35 @@ * Menu: -* カスタマイズ[かすたまいす]: Customizations. 4. -* キーアサイン[きいあさいん]: Customizations. 4. -* Demacs: Intro. 4. -* HTMLョ[HTMLや]: Intro. 4. -* LaTeX: Intro. 4. -* Mule: Intro. 4. - - - - +* キーアサイン[きいあさいん]: Customizations. (line 5) +* カスタマイズ[かすたまいす]: Customizations. (line 5) +* Demacs: Intro. (line 5) +* HTML屋[HTMLや]: Intro. (line 5) +* LaTeX: Intro. (line 5) +* Mule: Intro. (line 5) Tag table: -Node: Top257 -Node: Intro726 -Node: Installation1005 -Node: yahtml起動のための設定1193 -Node: lintプログラム/ブラウザ/イメージヴューア環境等の設定1847 -Node: WWWページ環境用変数の設定2347 -Node: Command Invocation3118 -Node: Completion3445 -Node: Jump4429 -Node: Changing and Deleting4828 -Node: 対タグの変更5002 -Node: 文字参照への変更5352 -Node: リジョン内文字のURLencode5735 -Node: td括り/tr括り5969 -Node: CSS Support6598 -Node: CSS-class completion6796 -Node: Reread CSS file7792 -Node: Customizations8014 -Node: All customizable variables8238 -Node: Hook variables11236 -Node: Copying11348 -Node: Concept Index11851 +Node: Top260 +Node: Intro729 +Node: Installation1009 +Node: yahtml起動のための設定1197 +Node: lintプログラム/ブラウザ/イメージヴューア環境等の設定1849 +Node: WWWページ環境用変数の設定2349 +Node: Command Invocation3151 +Node: Completion3478 +Node: Jump4460 +Node: Changing and Deleting4859 +Node: 対タグの変更5033 +Node: 文字参照への変更5383 +Node: リジョン内文字のURLencode5775 +Node: td括り/tr括り6014 +Node: CSS Support6688 +Node: CSS-class completion6886 +Node: Reread CSS file7869 +Node: Customizations8091 +Node: All customizable variables8315 +Node: Hook variables11343 +Node: Copying11455 +Node: Concept Index11951 End tag table
--- a/docs/yatex.ref Fri Dec 26 01:06:32 2014 +0900 +++ b/docs/yatex.ref Sun Sep 17 10:25:38 2017 +0859 @@ -44,16 +44,18 @@ 【プロセス起動】 + ◆latex起動 [prefix] tj + ◆latex+dvipdfmx起動 [prefix] td + ◆環境の即時プレビュー [prefix] te + ◆latex起動(領域指定) [prefix] tr ◆jbibtex起動 [prefix] tb - ◆jlatex起動 [prefix] tj ◆makeindex起動 [prefix] ti - ◆jlatexのkill [prefix] tk ※ + ◆latexプロセスのkill [prefix] tk ※ ◆プリントアウト [prefix] tl ◆プリントアウト(全ページ) C-u [prefix] tl ◆プレビューア起動 [prefix] tp ◆xdvi上で文字列サーチ [prefix] ts ※※ ◆lpq起動 [prefix] tq - ◆jlatex起動(領域指定) [prefix] tr [prefix] t を押せばメニューが出るので、[prefix] t の次に押すキー は覚えなくて構いません。 @@ -72,7 +74,7 @@ ◆タイプセットエラー箇所へ [prefix] ' タイプセットエラー発生箇所へ(末尾から)遡って順次ジャンプします。 - もちろん jlatex でエラーが生じた場合のみ有効です。 + タイプセット時にエラーが生じた場合のみ有効です。 ◆対応するオブジェクトジャンプ [prefix] g ◆別ウィンドウで 〃 [prefix] 4g @@ -85,6 +87,7 @@ ・\include(only), \input の上 対応するファイルへ ・\ref, \label の上 対応する \label, \ref へ ・\cite, \bibitem の上 対応する \bibitem, \cite へ + ・その他 対応するプレヴューア位置へ ◆メインファイルへジャンプ [prefix] ^ ◆別ウィンドウで 〃 [prefix] 4^
--- a/docs/yatexe Fri Dec 26 01:06:32 2014 +0900 +++ b/docs/yatexe Sun Sep 17 10:25:38 2017 +0859 @@ -1,7 +1,7 @@ Info file: yatexe, -*-Text-*- produced by `texinfo-format-buffer' from file `yatexe.tex' -using `texinfmt.el' version 2.38 of 3 July 1998. +using `texinfmt.el' version 2.42 of 7 Jul 2006. START-INFO-DIR-ENTRY * YaTeX-e: (yatexe). Yet Another tex-mode for Emacs (English). @@ -16,7 +16,7 @@ * Menu: -* What is YaTeX?:: +* What is YaTeX?:: * Main features:: What YaTeX can do * Installation:: Guide to install * Typesetting:: Call typesetting processes @@ -47,7 +47,8 @@ ************** YaTeX automates typesetting and previewing of LaTeX and enables -completing input of LaTeX mark-up command such as `\begin{}'..`\end{}'. +completing input of LaTeX mark-up command such as +`\begin{}'..`\end{}'. YaTeX also supports Demacs which runs on MS-DOS(386), Mule (Multi Language Enhancement to GNU Emacs), and latex on DOS. @@ -64,9 +65,9 @@ * Semiautomatic replacing of `\includeonly' * Jumping to error line(`C-c '') * Completing-read of LaTeX commands such as `\begin{}', `\section' etc. - (`C-c b', `C-c s', `C-c l', `C-c m') - * Enclosing text into LaTeX environments or commands (`C-u' - ABOVEKEYSTROKES) + (`C-c b', `C-c s', `C-c l', `C-c m') + * Enclosing text into LaTeX environments or commands (ABOVEKEYSTROKES + after region setting) * Displaying the structure of text at entering sectioning commands * Lump shifting of sectioning commands (*Note view-sectioning::) * Learning unknown/new LaTeX commands for the next completion @@ -75,15 +76,16 @@ * Quick changing or deleting of LaTeX commands(`C-c c', `C-c k') * Jumping from and to inter-file, begin<->end, ref<->label(`C-c g') * Blanket commenting out or uncommenting (`C-c >', `C-c <', `C-c ,', - `C-c .') + `C-c .') * Easy input of accent mark, math-mode's commands and Greek letters - (`C-c a', `;', `:') + (`C-c a', `;', `:') * Online help for the popular LaTeX commands (`C-c ?', `C-c /') * Document files hierarchy browser (`C-c d') * Adding automatically \usepackage corresponding to inputting LaTeX - macro with completion + macro with completion * Allow you to forget creating \label{}s, \ref{} or \cite{} completion - automatically generate labels. + automatically generate labels. + * \includegraphics by Drag&Drop of image file @@ -124,14 +126,14 @@ execute typeset or preview command. `[prefix] t j' - ... invoke latex + ... invoke typesetter `[prefix] t r' - ... invoke latex on region + ... invoke typesetter on region `[prefix] t e' - ... invoke latex on current environment or whole portion of - current formulas in math-mode. + ... `on-the-fly preview' on current environment or whole + portion of current formulas in math-mode `[prefix] t d' - ... invoke dvipdfmx after successful typesetting + ... invoke dvipdfmx after successful typesetting `[prefix] t k' ... kill current typesetting process `[prefix] t b' @@ -149,9 +151,9 @@ * Menu: -* Calling typesetter:: -* Calling previewer:: -* Printing out:: +* Calling typesetter:: +* Calling previewer:: +* Printing out:: @@ -192,14 +194,20 @@ files. The `[prefix] te' key automatically marks current inner environment or -inner math mode and then call typeset-region with marked region. This is -convenient to quick view of current tabular environment or current editing -formulas. Keeping previewer window for `texput.dvi' is handy for -debugging. Since `[prefix] te' selects the inner-most environment as -region, it is not suitable for partial typesetting of doubly or more -composed environment. If you want to do partial typesetting for a nested -environment, use `[prefix] tr' for static-region, which is described in -the section *Note %#notation::. +inner math mode or paragraph, and then call typeset-region with marked +region. This is convenient to quick view of current tabular environment +or current editing formulas. If running Emacs has the ability of +displaying images, typeset image will be shown in the next window. +Further more, if you modify the content within that environment, YaTeX +performs `on-the-fly' preview that automatically update preview image as +you typed. + +If your Emacs does not supply on-the-fly preview, keeping previewer window +for `texput.dvi' is handy for debugging. Since `[prefix] te' selects the +inner-most environment as region, it is not suitable for partial +typesetting of doubly or more composed environment. If you want to do +partial typesetting for a nested environment, use `[prefix] tr' for +static-region, which is described in the section *Note %#notation::. @@ -238,12 +246,12 @@ * Menu: -* Changing typesetter:: -* Splitting input files:: -* Static region for typesetting:: -* Lpr format:: -* Controlling which command to invoke:: -* Editing %# notation:: +* Changing typesetter:: +* Splitting input files:: +* Static region for typesetting:: +* Lpr format:: +* Controlling which command to invoke:: +* Editing %# notation:: @@ -286,12 +294,12 @@ (see *Note Cursor jump::), take described below into consideration. * You can put split texts in sub directory, but not in sub directory of - sub directory. + sub directory. * In the main text, specify the child file name with relative path name - such as \include{chap1/sub}, when you include the file in a - sub-directory. + such as \include{chap1/sub}, when you include the file in a + sub-directory. * In a sub-text, write `%#!latex main.tex' even if `main.tex' is in the - parent directory(not %#!latex ../main.tex). + parent directory(not %#!latex ../main.tex). @@ -370,15 +378,27 @@ These %# notation below can control which command to invoke for LaTeX related process. - `%#BIBTEX' - - ... Command line for makeindex ([prefix] t i) + `%#PREVIEW' + + ... Command line for DVI viewing ([prefix] t p) `%#MAKEINDEX' - - ... Command line for bibtex ([prefix] t b) + + ... Command line for makeindex ([prefix] t i) + `%#BIBTEX' + + ... Command line for bibtex ([prefix] t b) `%#DVIPDF' - - ... Command line for dvipdf(mx) ([prefix] t b) + + ... Command line for dvipdf(mx) ([prefix] t b) + `%#LPR' + + ... Command line for printing out([prefix] t l) + `%#PDFVIEW' + + ... Command line for PDF viewing + `%#IMAGEDPI' + + ... DPI value for converting to on-the-fly prewview image If you want to invoke "makeidx hogehoge" to update index, put the next line some upper place in the source, for example. @@ -418,15 +438,17 @@ * Menu: -* Begin-type completion:: -* Section-type completion:: -* Large-type completion:: -* Maketitle-type completion:: -* Arbitrary completion:: -* End completion:: -* Accent completion:: -* Image completion:: -* Greek letters completion:: +* Begin-type completion:: +* Section-type completion:: +* Label Generation:: +* Large-type completion:: +* Maketitle-type completion:: +* Arbitrary completion:: +* End completion:: +* Accent completion:: +* Image completion:: +* Greek letters completion:: +* Inserting parentheses:: @@ -488,7 +510,7 @@ The next message will show up in the minibuffer - Begin environment(default document): + Begin environment(default document): by typing `[prefix] b'. Put the wishing environment with completion in the minibuffer, and `\begin{env}'...\`\end{env}' will be inserted in the @@ -501,25 +523,19 @@ automatically inserted such as `\item' for `itemize' environment. If you don't want the entry, it can be removed by undoing. - If you want to enclose some paragraphs which have already been written, -invoke the begin-type completion with changing the case of `b' of key -sequence upper(or invoke it with universal argument by `C-u' prefix). - - The following example encloses a region with `description' environment. - -`[prefix] B D' -`(or ESC 1 [prefix] b D)' -`(or C-u [prefix] b D)' - - ... begin-type completion for region - - This enclosing holds good for the completing input by `[prefix] b SPC'. -`[prefix] B SPC' enclose a region with the environment selected by -completing-read. + If you want to enclose some paragraphs which have already been written +into environment, invoke the begin-type completion right after region +marking. + +If you set `transient-mark-mode' to `nil' in your `~/.emacs', typing +`C-space' (`set-mark-command') twice turns `transient-mark-mode' on +temporarily. Then, type call begin-type completion to enclose text into a +environment. + -File: yatexe, Node: Section-type completion, Next: Large-type completion, Prev: Begin-type completion, Up: Completion +File: yatexe, Node: Section-type completion, Prev: Begin-type completion, Up: Completion Section-type completion ======================= @@ -556,7 +572,7 @@ in your LaTeX source. When you neglect argument such as (C-v for view) \???{} (default section): vspace* - \vspace*{???}: + \vspace*{???}: YaTeX puts @@ -595,7 +611,7 @@ * Menu: -* view-sectioning:: +* view-sectioning:: @@ -618,12 +634,12 @@ `M-x YaTeX-section-overview' ... Generate *Sectioning Lines* buffer -from the LaTeX source buffer. In this listing buffer, typing `u' on the -sectioning command shifts up the corresponding sectioning command in +from the LaTeX source buffer. In this listing buffer, typing `u' on +the sectioning command shifts up the corresponding sectioning command in source text and `d' shifts down. After marking lines in the listing -buffer, typing `U' shifts up all sectioning commands in the region, and -`U' shifts down. Here are all the key bindings of `*Sectioning Lines*' -buffer. +buffer, typing `U' shifts up all sectioning commands in the region, +and `U' shifts down. Here are all the key bindings of +`*Sectioning Lines*' buffer. `SPC' ... Jump to corresponding source line @@ -641,9 +657,44 @@ ... Hide sectioning commands whose level is lower than n + +File: yatexe, Node: Label Generation, Next: Large-type completion, Prev: Section-type completion, Up: Completion + +Label Generation +================ + +When you want to type-in references of `\ref' or `\cite', all you have to +do is type `[prefix] s ref' without adding labels beforehand. You will +see possible LaTeX-counters in the next window even if some counter does +not have `\label'. Selecting the counter will automatically set the label +to that counter. + +All possible counter list in the buffer tends to be large. You can reduce +the number of list by filtering type of counters by key-commands as +follows. + `M-a' + + ... Show all(disable filtering) + `M-c' + + ... Captions only + `M-e' + + ... equations (with counters) only + `M-i' + + ... numbers items only + `M-s' + + ... sections only + `M-m' + + ... other counters only + + -File: yatexe, Node: Large-type completion, Next: Maketitle-type completion, Prev: Section-type completion, Up: Completion +File: yatexe, Node: Large-type completion, Next: Maketitle-type completion, Prev: Label Generation, Up: Completion Large-type completion ===================== @@ -656,15 +707,14 @@ the message in the minibuffer - {\??? } (default large): + {\??? } (default large): prompts prompts you large-type command with completing-read. There are TeX commands to change fonts or sizes, `it', `huge' and so on, in the completion table. - Region-based completion is also invoked by changing the letter after -prefix key stroke as `[prefix] L'. It encloses the region by braces with -large-type command. + Region-based completion is also invoked by calling completion after +region activated. @@ -758,10 +808,11 @@ or not, and change the behavior of key strokes `;' and `:'. By the way, we often express the leftarrow mark by `<-' for example. -Considering such image, you can write `\leftarrow' by typing `<-' after -`;' (semicolon) as a prefix. In the same way, `\longleftarrow' (`<--') is -completed by typing `;<--', infinity mark which is imitated by `oo' is -completed by typing `;oo'. +Considering such image, you can write `\leftarrow' by typing `<-' +after `;' (semicolon) as a prefix. In the same way, +`\longleftarrow' (`<--') is completed by typing `;<--', +infinity mark which is imitated by `oo' is completed by typing +`;oo'. Here are the sample operations in YaTeX math-mode. @@ -775,11 +826,11 @@ In any case, you can quit from image completion and can move to the next editing operation if the LaTeX command you want is shown in the buffer. - `;' itself in math-environment is inserted by `;;'. Typing `TAB' in the -midst of image completion shows all of the LaTeX commands that start with -the same name as string you previously typed in. In this menu buffer, -press `RET' after moving the cursor (by `n', `p', `b', `f') to insert the -LaTeX command. + `;' itself in math-environment is inserted by `;;'. Typing +`TAB' in the midst of image completion shows all of the LaTeX +commands that start with the same name as string you previously typed in. +In this menu buffer, press `RET' after moving the cursor (by `n', +`p', `b', `f') to insert the LaTeX command. To know all of the completion table, type `TAB' just after `;'. And here is the sample menu by `TAB' after `;<'. @@ -787,7 +838,7 @@ KEY LaTeX sequence sign < \leq < ~ - << \ll << + << \ll << <- \leftarrow <- <= \Leftarrow <= @@ -797,7 +848,7 @@ -File: yatexe, Node: Greek letters completion, Prev: Image completion, Up: Completion +File: yatexe, Node: Greek letters completion, Next: Inserting parentheses, Prev: Image completion, Up: Completion Greek letters completion ======================== @@ -807,11 +858,23 @@ `\alpha', `b' makes `\beta' and `g' makes `\gamma' and so on. First, type `:TAB' to know all the correspondence of alphabets vs. Greek letters. - If you will find `;' or `:' doesn't work in correct position of math -environment, it may be a bug of YaTeX. Please send me a bug report with -the configuration of your text, and avoid it temporarily by typing `;' or -`:' after universal-argument(`C-u') which forces `;' and `:' to work as -math-prefix. + If you will find `;' or `:' doesn't work in correct position of +math environment, it may be a bug of YaTeX. Please send me a bug report +with the configuration of your text, and avoid it temporarily by typing +`;' or `:' after universal-argument(`C-u') which forces +`;' and `:' to work as math-prefix. + + + +File: yatexe, Node: Inserting parentheses, Prev: Greek letters completion, Up: Completion + +Inserting parentheses +===================== + + Typing opening parenthesis, one of `(', `{ and `['', automatically +inserts the closing one. If a opening bracket is typed after `\', `\]' is +automatically inserted with computed indentation. If you stop automatic +insertion, type `C-q' before opening parenthesis. @@ -865,9 +928,10 @@ to `ESC h' by default. It is NOT predictable what will happen when you continuously comment out some paragraph many times. - You can also comment out an environment between `\begin' and `\end', or -a `\begin'-\`\end' pair themselves, by making the following key strokes on -the line where `\begin{}' or `\end{}' exists. + You can also comment out an environment between `\begin' and +`\end', or a `\begin'-\`\end' pair themselves, by making the +following key strokes on the line where `\begin{}' or +`\end{}' exists. `[prefix] >' ... comment out from \begin to \`end' @@ -897,11 +961,11 @@ * Menu: -* Jump to corresponding object:: -* Invoking image processor:: -* Jump to main file:: -* Jumping around the environment:: -* Jumping to last completion position:: +* Jump to corresponding object:: +* Invoking image processor:: +* Jump to main file:: +* Jumping around the environment:: +* Jumping to last completion position:: @@ -939,9 +1003,9 @@ `[prefix] 4 g' ... go to corresponding object in other window -do the same job as `[prefix] g' except it's done in other window. Note -that this function doesn't work on `begin/end', `%#BEGIN/%#END' pairs -because it is meaningless. +do the same job as `[prefix] g' except it's done in other window. +Note that this function doesn't work on `begin/end', +`%#BEGIN/%#END' pairs because it is meaningless. @@ -985,8 +1049,8 @@ `[prefix] 4^' ... visit main file in other buffer -in a sub text switch the buffer to the main text specified by `%#!' -notation. +in a sub text switch the buffer to the main text specified by +`%#!' notation. @@ -1034,8 +1098,8 @@ * Menu: -* Changing LaTeX commands:: -* Killing LaTeX commands:: +* Changing LaTeX commands:: +* Killing LaTeX commands:: @@ -1118,9 +1182,9 @@ (setq YaTeX-item-regexp "\\(\\\\\\(sub\\)*item\\)\\|\\(\\\\underlineitem\\)") -in your `~/.emacs'. If you are not familiar with regular expression for -Emacs-Lisp, name a newcommand for `itemize' beginning with `\item' such as -`\itembf', not `\bfitem'. +in your `~/.emacs'. If you are not familiar with regular expression +for Emacs-Lisp, name a newcommand for `itemize' beginning with +`\item' such as `\itembf', not `\bfitem'. This function reformats the `\item' into `hang-indented' style. For example: @@ -1170,9 +1234,10 @@ A)dd R)eplace %)comment? -in the minibuffer. Type `a' if you want to add the current file name to -`\includeonly' list, `r' to replace \`includeonly' list with the current -file, and type `%' to comment out the `\includeonly' line. +in the minibuffer. Type `a' if you want to add the current file name +to `\includeonly' list, `r' to replace \`includeonly' list +with the current file, and type `%' to comment out the +`\includeonly' line. @@ -1228,7 +1293,7 @@ * `tabular', `tabular*', `array' Corresponding number of `&' and `\\'. And `\hline' if - needed. + needed. * `tabbing' @@ -1243,8 +1308,8 @@ If you want to apply these trick to other environments, `foo' environment for example, define the function named -`YaTeX-intelligent-newline-foo' to insert corresponding contents. That -function will be called at the beginning of the next line after the +`YaTeX-intelligent-newline-foo' to insert corresponding contents. +That function will be called at the beginning of the next line after the newline is inserted to the current line. Since the function `YaTeX-indent-line' is designed to indent the current line properly, calling this function before your code to insert certain contents must be @@ -1417,9 +1482,9 @@ * Menu: -* Lisp variables:: -* Add-in functions:: -* Add-in generator:: +* Lisp variables:: +* Add-in functions:: +* Add-in generator:: @@ -1443,10 +1508,10 @@ * Menu: -* All customizable variables:: -* Sample definitions:: -* Hook variables:: -* Hook file:: +* All customizable variables:: +* Sample definitions:: +* Hook variables:: +* Hook file:: @@ -1504,6 +1569,20 @@ -- Variable: YaTeX-dvipdf-command Default command name to convert .dvi to PDF (`"dvipdfmx"') + -- Variable: YaTeX-on-the-fly-preview-interval + Interval time in seconds of idle to trigger on-the-fly preview of + environment by `[prefix] t e'(0.9). + `Nil' disables on-the-fly preview. + + -- Variable: YaTeX-on-the-fly-math-preview-engine + Function symbol to use on-the-fly preview of MATH environment started + by `[prefix] t e' (`'YaTeX-typeset-environment-by-lmp' which calls + latex-math-preview-expression function if latex-math-preview is + available, otherwise `'YaTeX-typeset-environment-by-builtin' which + alls built-in function). + + `Nil' disables on-the-fly preview. + -- Variable: YaTeX-cmd-gimp Command name of GIMP (code{"gimp"}) -- Variable: YaTeX-cmd-tgif @@ -1611,7 +1690,7 @@ `YaTeX-display-hierarchy' searches for sectioning command first, and comment line secondary as a file headings. In latter case, ignore lines that match with regular expression of this variable. Default value of - this variable is RCS header expressions and mode specifying line `-*- xxxx + this variable is RCS header expressions and mode specifying line `-*- xxxx -*'. -- Variable: YaTeX-skip-default-reader @@ -1665,8 +1744,8 @@ (`(featurep 'hilit19)' -- Variable: YaTeX-singlecmd-suffix - Suffix which is always inserted after maketitle-type macros. `"{}"' - is recommended. + Suffix which is always inserted after maketitle-type macros. + `"{}"' is recommended. -- Variable: YaTeX-package-alist-private Alist of LaTeX2e-package name vs. lists of macros in it. Set this @@ -1690,6 +1769,12 @@ Regexp of environment names that should begin with no indentation. All verbatime-like environment name should match with. + -- Variable: YaTeX-electric-indent-mode + Emacs 24.4 introduces automatic indentation of current and new lines. + This might be annoying for some people. Pass this value to the + function 'electric-indent-local-mode. If you prefer to stop + electric-indent-mode in yatex-mode, set `-1' to this variable. + -- Variable: YaTeX-ref-default-label-string Default \\ref time string format. This format is like strftime(3) but allowed conversion char are as follows; %y -> Last 2 digit of @@ -1795,10 +1880,10 @@ * Menu: -* How the add-in function works:: -* How the function is called:: -* Useful functions for creating add-in:: -* Contribution:: +* How the add-in function works:: +* How the function is called:: +* Useful functions for creating add-in:: +* Contribution:: @@ -1856,14 +1941,15 @@ \frac{a/c} -Normally, the expression `a/c' is translated to `\frac{a}{c}'. An -enclosing add-in is useful for modifying `/' to `}{'. +Normally, the expression `a/c' is translated to +`\frac{a}{c}'. An enclosing add-in is useful for modifying +`/' to `}{'. * Menu: -* Defining option-add-in:: -* Defining argument-add-in:: -* Defining enclosing-add-in:: +* Defining option-add-in:: +* Defining argument-add-in:: +* Defining enclosing-add-in:: @@ -1904,7 +1990,7 @@ (defun YaTeX::newcommand (n) ;n is argument position (cond ((= n 1) ;1st argument is macro name - (read-string "Command: " "\\")) ;initial input `\' + (read-string "Command: " "\\")) ;initial input `\' ((= n 2) "") ;do nothing when reading arg#2 (t nil))) @@ -1932,7 +2018,7 @@ (while (search-forward "/" end t) (goto-char (match-beginning 0)) (if (y-or-n-p "Replace this slash(/) with `}{'") - (throw 'done (replace-match "}{"))) + (throw 'done (replace-match "}{"))) (goto-char (match-end 0))))) @@ -1967,9 +2053,10 @@ `[A]' Character list which can show up in the brackets `[D]' - Return the location specifier such as `[htb]'. When nothing is - entered, omit [] itself. If the possible characters are "htbp", call - this function as `(YaTeX:read-position "htbp")' + Return the location specifier such as `[htb]'. When + nothing is entered, omit [] itself. If the possible characters + are "htbp", call this function as + `(YaTeX:read-position "htbp")' `[F]' YaTeX:read-coordinates @@ -1977,9 +2064,9 @@ Base prompt, X-axis prompt, Y-axis prompt (each optional) `[D]' Read the coordinates with the prompt "BasePrompt X-axisPrompt:" for - X-axis, "BasePrompt Y-axisPrompt:" for Y-axis, and return it in the - form of "(X,Y)". The default prompts are `Dimension', `X', `Y' - respectively. + X-axis, "BasePrompt Y-axisPrompt:" for Y-axis, and return it in the form + of "(X,Y)". The default prompts are `Dimension', `X', + `Y' respectively. `[F]' YaTeX:check-completion-type @@ -2032,25 +2119,26 @@ ---------------- The latter generator is invoked by the next sequence. `M-x -YaTeX-generate-simple' This generator can make both "option add-in" and -"argument add-in" (*refer the section add-in functions* *Note How the -add-in function works::), whereas `YaTeX-generate' cannot make "argument -addin". + YaTeX-generate-simple' This generator can make both + "option add-in" and "argument add-in" (*refer the + section add-in functions* *Note How the add-in + function works::), whereas `YaTeX-generate' cannot + make "argument addin". For example, assume you have the LaTeX command as follows. - \epsinput[t](250,50){hoge.eps}{plain}{Picture of foo} - (A) (B) (1) (2) (3) - (A)Optional parameter to specify the position - One of t(top), b(bottom), l(left), r(right) - (B)Maximum size of frame - (1)1st argument is filename of EPS file - (2)2nd argument indicates - plain do nothing - frame make frame around image - dframe make double-frame around image - for included EPS file. - (3)Caption for the picture + \epsinput[t](250,50){hoge.eps}{plain}{Picture of foo} + (A) (B) (1) (2) (3) + (A)Optional parameter to specify the position + One of t(top), b(bottom), l(left), r(right) + (B)Maximum size of frame + (1)1st argument is filename of EPS file + (2)2nd argument indicates + plain do nothing + frame make frame around image + dframe make double-frame around image + for included EPS file. + (3)Caption for the picture Now get start with generation. Typing `M-x YaTeX-generate-simple' brings the prompt: @@ -2095,7 +2183,7 @@ are t, b, l, and r. To tell these information to generator, operate as follows. - Read type(1).... p + Read type(1).... p Acceptable characters: tblr RET (B) is coordinate. So its completion style is coOrd. We want a prompt @@ -2142,10 +2230,10 @@ Then all the candidates ready to be read. Type single RET after entering all. - Item[1](RET to exit): plain RET - Item[2](RET to exit): frame RET - Item[3](RET to exit): dframe RET - Item[4](RET to exit): RET + Item[1](RET to exit): plain RET + Item[2](RET to exit): frame RET + Item[3](RET to exit): dframe RET + Item[4](RET to exit): RET The following prompt asks whether the entered string must belong to candidates or not. In this case, since the argument must be one of @@ -2199,9 +2287,12 @@ anything as a result of using this software. Adopting code from this program is also free. But I would not do contract act. + This software can be treated with: "The 2-Clause BSD License" (since +2017-09-09, yatex 1.80). + Any reports and suggestions are welcome as long as I feel interests in this software. My possible e-mail address is `yuuji@yatex.org'. (as of -Jan.2004) And there is mailing list for YaTeX. Although the common +Sep.2017) 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 question, please ask to @@ -2212,70 +2303,71 @@ HIROSE Yuuji - Tag table: -Node: Top253 -Node: What is YaTeX?1594 -Node: Main features1967 -Node: Installation3496 -Node: Typesetting4273 -Node: Calling typesetter5403 -Node: Calling previewer7607 -Node: Printing out7968 -Node: %#notation8260 -Node: Changing typesetter8678 -Node: Splitting input files9042 -Node: Static region for typesetting10467 -Node: Lpr format11596 -Node: Controlling which command to invoke12669 -Node: Editing %# notation13339 -Node: Completion13883 -Node: Begin-type completion14443 -Node: Section-type completion17486 -Node: view-sectioning19921 -Node: Large-type completion21501 -Node: Maketitle-type completion22232 -Node: Arbitrary completion22784 -Node: End completion23174 -Node: Accent completion23644 -Node: Image completion24261 -Node: Greek letters completion26518 -Node: Local dictionaries27245 -Node: Commenting out28182 -Node: Cursor jump29641 -Node: Jump to corresponding object29953 -Node: Invoking image processor31354 -Node: Jump to main file32697 -Node: Jumping around the environment33062 -Node: Jumping to last completion position33480 -Node: Changing and Deleting33989 -Node: Changing LaTeX commands34381 -Node: Killing LaTeX commands35558 -Node: Filling36743 -Node: Updation of includeonly38594 -Node: What column39391 -Node: Intelligent newline40476 -Node: Usepackage checker42130 -Node: Online help42721 -Node: Browsing file hierarchy44396 -Node: Cooperation with other packages46133 -Node: Customizations46838 -Node: Lisp variables47172 -Node: All customizable variables48176 -Node: Sample definitions59211 -Node: Hook variables59724 -Node: Hook file60428 -Node: Add-in functions60767 -Node: How the add-in function works61627 -Node: Defining option-add-in63826 -Node: Defining argument-add-in64548 -Node: Defining enclosing-add-in65430 -Node: How the function is called66284 -Node: Useful functions for creating add-in66960 -Node: Contribution68365 -Node: Add-in generator68639 -Node: Etcetera74011 -Node: Copying74616 +Node: Top256 +Node: What is YaTeX?1583 +Node: Main features1956 +Node: Installation3591 +Node: Typesetting4368 +Node: Calling typesetter5489 +Node: Calling previewer8016 +Node: Printing out8377 +Node: %#notation8669 +Node: Changing typesetter9040 +Node: Splitting input files9404 +Node: Static region for typesetting10833 +Node: Lpr format11962 +Node: Controlling which command to invoke13035 +Node: Editing %# notation13992 +Node: Completion14536 +Node: Begin-type completion15072 +Node: Section-type completion17926 +Node: view-sectioning20318 +Node: Label Generation21897 +Node: Large-type completion22797 +Node: Maketitle-type completion23443 +Node: Arbitrary completion23995 +Node: End completion24385 +Node: Accent completion24855 +Node: Image completion25472 +Node: Greek letters completion27727 +Node: Inserting parentheses28483 +Node: Local dictionaries28890 +Node: Commenting out29827 +Node: Cursor jump31286 +Node: Jump to corresponding object31577 +Node: Invoking image processor32977 +Node: Jump to main file34320 +Node: Jumping around the environment34686 +Node: Jumping to last completion position35104 +Node: Changing and Deleting35613 +Node: Changing LaTeX commands35994 +Node: Killing LaTeX commands37171 +Node: Filling38356 +Node: Updation of includeonly40211 +Node: What column41008 +Node: Intelligent newline42093 +Node: Usepackage checker43754 +Node: Online help44345 +Node: Browsing file hierarchy46020 +Node: Cooperation with other packages47757 +Node: Customizations48462 +Node: Lisp variables48758 +Node: All customizable variables49717 +Node: Sample definitions61682 +Node: Hook variables62195 +Node: Hook file62899 +Node: Add-in functions63238 +Node: How the add-in function works64076 +Node: Defining option-add-in66262 +Node: Defining argument-add-in66984 +Node: Defining enclosing-add-in67865 +Node: How the function is called68721 +Node: Useful functions for creating add-in69397 +Node: Contribution70807 +Node: Add-in generator71081 +Node: Etcetera76657 +Node: Copying77262 End tag table
--- a/docs/yatexe.tex Fri Dec 26 01:06:32 2014 +0900 +++ b/docs/yatexe.tex Sun Sep 17 10:25:38 2017 +0859 @@ -8,7 +8,7 @@ @iftex @c @syncodeindex fn cp -@c Last modified Fri Dec 26 00:09:22 2014 on firestorm +@c Last modified Sat Sep 9 23:41:37 2017 on firestorm @syncodeindex vr cp @end iftex @@ -18,7 +18,7 @@ @subtitle Yet Another tex-mode for emacs @title Wild Bird @subtitle // YaTeX // -@author @copyright{} 1991-2012 by HIROSE, Yuuji [yuuji@@yatex.org] +@author @copyright{} 1991-2017 by HIROSE, Yuuji [yuuji@@yatex.org] @end titlepage @node Top, What is YaTeX?, (dir), (dir) @@ -29,7 +29,7 @@ @cindex YaTeX @menu -* What is YaTeX?:: +* What is YaTeX?:: * Main features:: What YaTeX can do * Installation:: Guide to install * Typesetting:: Call typesetting processes @@ -77,7 +77,7 @@ @code{\section} etc. (@kbd{C-c b}, @kbd{C-c s}, @kbd{C-c l}, @kbd{C-c m}) @item Enclosing text into La@TeX{} environments or commands - (@kbd{C-u} @var{AboveKeyStrokes}) + (@var{AboveKeyStrokes} after region setting) @item Displaying the structure of text at entering sectioning commands @item Lump shifting of sectioning commands (@ref{view-sectioning}) @item Learning unknown/new La@TeX{} commands for the next completion @@ -96,6 +96,7 @@ macro with completion @item Allow you to forget creating \label@{@}s, \ref@{@} or \cite@{@} completion automatically generate labels. +@item \includegraphics by Drag&Drop of image file @end itemize @node Installation, Typesetting, Main features, Top @@ -146,12 +147,12 @@ @table @kbd @item [prefix] t j - @dots{} invoke latex + @dots{} invoke typesetter @item [prefix] t r - @dots{} invoke latex on region + @dots{} invoke typesetter on region @item [prefix] t e - @dots{} invoke latex on current environment or whole - portion of current formulas in math-mode. + @dots{} `on-the-fly preview' on current environment or whole + portion of current formulas in math-mode @item [prefix] t d @dots{} invoke dvipdfmx after successful typesetting @item [prefix] t k @@ -171,9 +172,9 @@ @end table @menu -* Calling typesetter:: -* Calling previewer:: -* Printing out:: +* Calling typesetter:: +* Calling previewer:: +* Printing out:: @end menu @node Calling typesetter, Calling previewer, Typesetting, Typesetting @@ -215,9 +216,16 @@ edit splitting files. The @kbd{[prefix] te} key automatically marks current inner environment -or inner math mode and then call typeset-region with marked region. This +or inner math mode or paragraph, and then call typeset-region with marked +region. This is convenient to quick view of current tabular environment or current -editing formulas. Keeping previewer window for @file{texput.dvi} is handy +editing formulas. If running Emacs has the ability of displaying images, +typeset image will be shown in the next window. Further more, +if you modify the content within that environment, YaTeX performs +`on-the-fly' preview that automatically update preview image as you typed. + +If your Emacs does not supply on-the-fly preview, +keeping previewer window for @file{texput.dvi} is handy for debugging. Since @kbd{[prefix] te} selects the inner-most environment as region, it is not suitable for partial typesetting of doubly or more composed environment. If you want to do partial typesetting for a nested @@ -254,12 +262,12 @@ notations in the source text. @menu -* Changing typesetter:: -* Splitting input files:: -* Static region for typesetting:: -* Lpr format:: -* Controlling which command to invoke:: -* Editing %# notation:: +* Changing typesetter:: +* Splitting input files:: +* Static region for typesetting:: +* Lpr format:: +* Controlling which command to invoke:: +* Editing %# notation:: @end menu @node Changing typesetter, Splitting input files, %#notation, %#notation @@ -415,12 +423,20 @@ La@TeX{} related process. @table @code - @item %#BIBTEX + @item %#PREVIEW + @dots{} Command line for DVI viewing ([prefix] t p) + @item %#MAKEINDEX @dots{} Command line for makeindex ([prefix] t i) - @item %#MAKEINDEX + @item %#BIBTEX @dots{} Command line for bibtex ([prefix] t b) @item %#DVIPDF @dots{} Command line for dvipdf(mx) ([prefix] t b) + @item %#LPR + @dots{} Command line for printing out([prefix] t l) + @item %#PDFVIEW + @dots{} Command line for PDF viewing + @item %#IMAGEDPI + @dots{} DPI value for converting to on-the-fly prewview image @end table If you want to invoke ``makeidx hogehoge'' to update index, @@ -464,15 +480,17 @@ kinds of completion type, begin-type, section-type, large-type, etc... @menu -* Begin-type completion:: -* Section-type completion:: -* Large-type completion:: -* Maketitle-type completion:: -* Arbitrary completion:: -* End completion:: -* Accent completion:: -* Image completion:: -* Greek letters completion:: +* Begin-type completion:: +* Section-type completion:: +* Label Generation:: +* Large-type completion:: +* Maketitle-type completion:: +* Arbitrary completion:: +* End completion:: +* Accent completion:: +* Image completion:: +* Greek letters completion:: +* Inserting parentheses:: @end menu @node Begin-type completion, Section-type completion, Completion, Completion @@ -559,28 +577,17 @@ automatically inserted such as @code{\item} for @code{itemize} environment. If you don't want the entry, it can be removed by undoing. - If you want to enclose some paragraphs which have already been -written, invoke the begin-type completion with changing the case -of @kbd{b} of key sequence upper(or invoke it with universal argument -by @kbd{C-u} prefix). + If you want to enclose some paragraphs which have already been written +into environment, invoke the begin-type completion right after region marking. @cindex enclose region into environment - The following example encloses a region with `description' -environment. - -@table @kbd -@item [prefix] B D -@itemx (or ESC 1 [prefix] b D) -@itemx (or C-u [prefix] b D) - - @dots{} begin-type completion for region -@end table - - This enclosing holds good for the completing input by @kbd{[prefix] b -SPC}. @kbd{[prefix] B SPC} enclose a region with the environment selected -by completing-read. - -@node Section-type completion, Large-type completion, Begin-type completion, Completion +If you set @code{transient-mark-mode} to @code{nil} in your +@file{~/.emacs}, typing @kbd{C-space} (@code{set-mark-command}) twice +turns @code{transient-mark-mode} on temporarily. Then, type call +begin-type completion to enclose text into a environment. + + +@node Section-type completion, , Begin-type completion, Completion @comment node-name, next, previous, up @section Section-type completion @cindex section-type completion @@ -682,7 +689,7 @@ minibuffer. @menu -* view-sectioning:: +* view-sectioning:: @end menu @node view-sectioning, , Section-type completion, Section-type completion @@ -731,8 +738,38 @@ @dots{} Hide sectioning commands whose level is lower than n @end table - -@node Large-type completion, Maketitle-type completion, Section-type completion, Completion +@node Label Generation, Large-type completion, Section-type completion, Completion +@section Label Generation +@comment label generation +@cindex label generation +@cindex ref label cite + +When you want to type-in references of @code{\ref} or @code{\cite}, +all you have to do is type @kbd{[prefix] s ref} without adding labels +beforehand. You will see possible La@TeX{}-counters in the next window +even if some counter does not have @code{\label}. Selecting the counter +will automatically set the label to that counter. + +All possible counter list in the buffer tends to be large. +You can reduce the number of list by filtering type of counters by +key-commands as follows. +@table @kbd + @item M-a + @dots{} Show all(disable filtering) + @item M-c + @dots{} Captions only + @item M-e + @dots{} equations (with counters) only + @item M-i + @dots{} numbers items only + @item M-s + @dots{} sections only + @item M-m + @dots{} other counters only +@end table + + +@node Large-type completion, Maketitle-type completion, Label Generation, Completion @comment node-name, next, previous, up @section Large-type completion @@ -755,9 +792,8 @@ TeX commands to change fonts or sizes, @code{it}, @code{huge} and so on, in the completion table. - Region-based completion is also invoked by changing the letter after -prefix key stroke as @kbd{[prefix] L}. It encloses the region by braces -with large-type command. + Region-based completion is also invoked by calling completion +after region activated. @node Maketitle-type completion, Arbitrary completion, Large-type completion, Completion @comment node-name, next, previous, up @@ -912,7 +948,7 @@ Emacs-Lisp variable @code{YaTeX-math-sign-alist-private}. See also @file{yatexmth.el} for the information of the structure of this variable. -@node Greek letters completion, , Image completion, Completion +@node Greek letters completion, Inserting parentheses, Image completion, Completion @comment node-name, next, previous, up @section Greek letters completion @cindex Greek letters completion @@ -930,6 +966,15 @@ @kbd{;} or @kbd{:} after universal-argument(@kbd{C-u}) which forces @kbd{;} and @kbd{:} to work as math-prefix. +@node Inserting parentheses, , Greek letters completion, Completion +@section Inserting parentheses + + Typing opening parenthesis, one of @code{(}, @code{@{ and @code{[}}, +automatically inserts the closing one. If a opening bracket is typed +after @code{\}, @code{\]} is automatically inserted with computed +indentation. If you stop automatic insertion, type @kbd{C-q} before +opening parenthesis. + @node Local dictionaries, Commenting out, Completion, Top @comment node-name, next, previous, up @chapter Local dictionaries @@ -1033,11 +1078,11 @@ @menu -* Jump to corresponding object:: -* Invoking image processor:: -* Jump to main file:: -* Jumping around the environment:: -* Jumping to last completion position:: +* Jump to corresponding object:: +* Invoking image processor:: +* Jump to main file:: +* Jumping around the environment:: +* Jumping to last completion position:: @end menu @node Jump to corresponding object, Invoking image processor, Cursor jump, Cursor jump @@ -1181,8 +1226,8 @@ @cindex prefix k @menu -* Changing LaTeX commands:: -* Killing LaTeX commands:: +* Changing LaTeX commands:: +* Killing LaTeX commands:: @end menu @node Changing LaTeX commands, Killing LaTeX commands, Changing and Deleting, Changing and Deleting @@ -1596,9 +1641,9 @@ add-in functions. @menu -* Lisp variables:: -* Add-in functions:: -* Add-in generator:: +* Lisp variables:: +* Add-in functions:: +* Add-in generator:: @end menu @node Lisp variables, Add-in functions, Customizations, Customizations @@ -1621,10 +1666,10 @@ that variable to 1 instead of @code{t}). @menu -* All customizable variables:: -* Sample definitions:: -* Hook variables:: -* Hook file:: +* All customizable variables:: +* Sample definitions:: +* Hook variables:: +* Hook file:: @end menu @node All customizable variables, Sample definitions, Lisp variables, Lisp variables @@ -1694,6 +1739,22 @@ Default command name to convert .dvi to PDF (@code{"dvipdfmx"}) @end defvar +@defvar YaTeX-on-the-fly-preview-interval +Interval time in seconds of idle to trigger on-the-fly preview of +environment by @kbd{[prefix] t e}(0.9). +@code{Nil} disables on-the-fly preview. +@end defvar + +@defvar YaTeX-on-the-fly-math-preview-engine +Function symbol to use on-the-fly preview of MATH environment +started by @kbd{[prefix] t e} (@code{'YaTeX-typeset-environment-by-lmp} +which calls latex-math-preview-expression function if latex-math-preview +is available, otherwise @code{'YaTeX-typeset-environment-by-builtin} which +alls built-in function). + +@code{Nil} disables on-the-fly preview. +@end defvar + @defvar YaTeX-cmd-gimp Command name of GIMP (code{"gimp"}) @end defvar @@ -1929,6 +1990,13 @@ All verbatime-like environment name should match with. @end defvar +@defvar YaTeX-electric-indent-mode +Emacs 24.4 introduces automatic indentation of current and new lines. +This might be annoying for some people. Pass this value to the function +'electric-indent-local-mode. If you prefer to stop electric-indent-mode +in yatex-mode, set `-1' to this variable. +@end defvar + @defvar YaTeX-ref-default-label-string Default \\ref time string format. This format is like strftime(3) but allowed conversion char are as follows; @@ -2041,10 +2109,10 @@ @end enumerate @menu -* How the add-in function works:: -* How the function is called:: -* Useful functions for creating add-in:: -* Contribution:: +* How the add-in function works:: +* How the function is called:: +* Useful functions for creating add-in:: +* Contribution:: @end menu @node How the add-in function works, How the function is called, Add-in functions, Add-in functions @@ -2119,9 +2187,9 @@ @code{/} to @code{@}@{}. @menu -* Defining option-add-in:: -* Defining argument-add-in:: -* Defining enclosing-add-in:: +* 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 @@ -2472,9 +2540,12 @@ anything as a result of using this software. Adopting code from this program is also free. But I would not do contract act. + This software can be treated with: ``The 2-Clause BSD License'' +(since 2017-09-09, yatex 1.80). + Any reports and suggestions are welcome as long as I feel interests in this software. My possible e-mail address is `yuuji@@yatex.org'. (as of -Jan.2004) And there is mailing list for YaTeX. Although the common +Sep.2017) 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 question, please ask to
--- a/docs/yatexj Fri Dec 26 01:06:32 2014 +0900 +++ b/docs/yatexj Sun Sep 17 10:25:38 2017 +0859 @@ -1,7 +1,7 @@ Info file: yatexj, -*-Text-*- produced by `texinfo-format-buffer' from file `yatexj.tex' -using `texinfmt.el' version 2.38 of 3 July 1998. +using `texinfmt.el' version 2.42 of 7 Jul 2006. START-INFO-DIR-ENTRY * YaTeX: (yatexj). Yet Another tex-mode for Emacs (Japanese). @@ -16,47 +16,44 @@ * Menu: -* Intro:: マク睛 -* Terminology:: ゙ヒ蠅イネ衾ユ -* Main features:: 醋。ス -* Installation:: 、ケネシ -* Invocation:: ラサケッー -* %#notation :: %#ュ。 -* Completion:: 莢マ -* Local dictionary:: シォュ -* Commenting out:: ウ碯ネ「ヲネ -* Cursor jump:: ォシスク胚ラ -* Modifying/Deleting:: LaTeXヴノホムケ/ -* Filling:: 蟾ィ -* Includeonly:: 。ヒ includeonly -* What column:: ォ鰲フヨャ、ノ -* Intelligent newline:: ェ゙ォサヤ -* Usepackage cheker:: 頤黏sepackage -* Changing mode of YaTeX:: サー箴ノムケ -* Online help:: LaTeXェ鬢リラ -* Inclusion hierarchy browser:: ユ。、ャ莅リス、ホスィ -* Cooperation with other packages:: セムテアシクネホ「ネ -* Customizations:: ォケゾ、コ -* Etc:: スホセ -* Copying:: 韭キ、 -* Concept Index:: +* Intro:: はじめに +* Terminology:: マニュアル参照上の注意 +* Main features:: 主な機能 +* Installation:: インストール +* Invocation:: プロセス起動 +* %#notation :: %#記法 +* Completion:: 補完入力 +* Local dictionary:: ローカル辞書 +* Commenting out:: コメントアウト +* Cursor jump:: カーソルジャンプ +* Modifying/Deleting:: LaTeXコマンドの変更/削除 +* Filling:: 桁揃え +* Includeonly:: 勝手に includeonly +* What column:: カラム位置ガイド +* Intelligent newline:: おまかせ改行 +* Usepackage cheker:: 先回りusepackage +* Changing mode of YaTeX:: 野鳥動作モード変更 +* Online help:: LaTeXオンラインヘルプ +* Inclusion hierarchy browser:: ファイル分割階層構造の表示 +* Cooperation with other packages:: 他パッケージとの連携 +* Customizations:: カスタマイズ +* Etc:: その他 +* Copying:: 取り扱い +* Concept Index:: 索引 File: yatexj, Node: Intro, Next: Terminology, Prev: Top, Up: Top -マク睛 -**************** - - サマ「GNU Emacs ヌ LaTeX -ムホクョケヒ pLaTeX ハノホ -ソ、ラサテネヴノ茲ラ蠑「ホッー -Emacs ヤク靂讚 -ヤィ隕ヒケネヲヒ「ネ・ュホ筅ケホ莢。スヒ韭スシケニュ -ケネホヤクル邱゙ケ」オ鰺 LaTeX -ヴノホェ鬢リラヒ -韭゙ヒ蠅エルヨレコギケ」 +はじめに +******** + + 野鳥は、GNU Emacs で LaTeX 用の文書を作成する時に pLaTeX などのタイ +プセットコマンドや、プレヴューアの起動を Emacs 編集画面中から行えるよ +うにすると共に、拡張性の高い種々の補完機能によりソーステキストの編集を +支援します。さらに LaTeX コマンドのオンラインヘルプによりマニュアルを +調べる手間を軽減します。 English manual *Note Top: (yatexe)Top. @@ -64,348 +61,327 @@ File: yatexj, Node: Terminology, Next: Main features, Prev: Intro, Up: Top -ヷヒ蠅イネ衾ユ -************************************************ - - ヷヒ蠅ヌマハシホスュム、゙ケ」 - - * beginソヴノ - - `\begin{トュ} チ - \end{トュ}'ネ、ヲチーホLaTeXヴノリギケ」 - beginソヴノ莢マケウネbeginソ莢ネニモ゙ケ」 - - * sectionソヴノ - - `\section{ソ、ネ}'臍\mbox{簇}'ホ隕ヒ - 齏LaTeXヴノリギケ」 - - * maketitleソヴノ - - `\maketitle'臍\tableofcontents'ホ隕ヒ韜ハ、LaTeXヴ - ノリギケ」 - - * largeソヴノ - - `{\large ...}' `{\tt ...}' - ホ隕ハユゥネ/オ、コリメ - リギケ」 +本マニュアル参照上の注意 +************************ + + 本マニュアルでは以下の表記を用います。 + + * begin型コマンド + + `\begin{環境} 〜 \end{環境}'という形式のLaTeXコマンドを指します。 + begin型コマンドを補完入力することをbegin型補完と呼びます。 + + * section型コマンド + + `\section{タイトル}'や`\mbox{内容}'のように引数を取るLaTeXコマン + ドを指します。 + + * maketitle型コマンド + + `\maketitle'や`\tableofcontents'のように引数を取らないLaTeXコマン + ドを指します。 + + * large型コマンド + + `{\large ...}' や `{\tt ...}' のようなフォント/サイズ指定子を指し + ます。 * `[prefix]' - サホ。スニモミケソ睾ラユ」ッケュシ」ヌユゥネヌマ`C-c'ヒ蓐 - ニ鴈ニ、ホヌ「テヒムケキニ、ハ、釛゙ヒ蠅ホ - `[prefix]' ネ 、ヲスュマ「`C-c' - ネノ゚ケィニッタオ、」 + 野鳥の機能を呼び出すためのプリフィクスキー。デフォルトでは`C-c'に + 割り当てられているので、特に変更していない場合本マニュアルの + `[prefix]' という表記は、`C-c' と読み換えてください。 File: yatexj, Node: Main features, Next: Installation, Prev: Terminology, Up: Top -醋。ス -**************** - - * ソ、ラサテソ葫蠑「ハノホヤク靂ォ鯰ッー(`C-c t') - * ォシスフヨヒ韜ハ、ヌク銛ホャソ、ラサテネ - * \includeonlyホソテチケキ - * ィ鮠ユリホォーク胚ラ(`C-c '') - * `\begin{}, \end{}, \section...' ハノホ LaTeX - ヴノホ莢マ (`C-c b', `C-c s', `C-c l', `C-c - m') - * ヒマキソニュケネトュ莎゙ノホ賤韭珸莢 - (`C-u' +フ莢ュシ) - * サッキ銛靺マホクス、「ヲネ鬢スィ - * サッキ銛ヴノホ邱ユネ (*Note view-sectioning::) - * 莢ュホリャ - * LaTeX ホトュ莎゙ノヒクソャ、ノユュマ - * サヒハ、ャ、ノユュマリホォークョ(`yatexgen.el') - * LaTeX ヴノホ/ムケ(`C-c k', `C-c c') - * ユ。、ヨ「`\begin'<->`\end'ヨ「 - `\ref'<->`\label'ヨ「 `\cite'<->`\bibitem'ク胚ラ(`C-c - g') - * 邉碯ネ「ヲネ/「ウ碯ネ「ヲネ - (`C-c >', `C-c <', `C-c ,', `C-c .') - * 「ッサネュ/ートュムヴノ/ョキ羣ホマル - (`C-c a', `;', `/') - * tabular/arrayトュホォ鰲フヨャ、ノ - * ク爼 LaTeX ヴノホェ鬢リラ(`C-c ?', `C-c /') - * ノュ裔ネホ、ッシノス、ホミェスィネミテユ。レリィ - (`C-c d') - * 莢マキゾッヒクニャラハ - \userpackage ニッ頤 userpackage - * \labelヌトウネマ筥コ隕! ref臘ite莢マヌォークョギケ +主な機能 +******** + + * タイプセッタやプレヴューアなどの編集画面からの起動(`C-c t') + * カーソル位置によらない固定リジョンの部分タイプセット + * \includeonlyのワンタッチ更新 + * エラー箇所への自動ジャンプ(`C-c '') + * `\begin{}, \end{}, \section...' などの LaTeXコマンドの補完入力 + (`C-c b', `C-c s', `C-c l', `C-c m') + * 既に入力したテキストを環境やコマンド引数の中に取り込む括り補完(リ + ジョン指定後に通常補完キー) + * セクション区切り入力時の文書構造アウトライン表示 + * セクションコマンドの一括シフト (*Note view-sectioning::) + * 補完辞書の学習 + * LaTeX の環境やコマンドに応じたガイド付き引数入力 + * 野鳥にないガイド付き引数入力関数の自動生成(`yatexgen.el') + * LaTeX コマンドの削除/変更(`C-c k', `C-c c') + * ファイル間、`\begin'<->`\end'間、 + `\ref'<->`\label'間、 + `\cite'<->`\bibitem'ジャンプ(`C-c g') + * 一括コメントアウト/アンコメントアウト(`C-c >', `C-c <', `C-c ,', + `C-c .') + * アクセント記号/数式環境用コマンド/ギリシャ文字の入力支援(`C-c a', + `;', `/') + * tabular/array環境のカラム位置ガイド + * 標準的 LaTeX コマンドのオンラインヘルプ(`C-c ?', `C-c /') + * ドキュメントのインクルード構造の視覚的表示とバッファ切り替え(`C-c + d') + * 補完入力したマクロに応じて必要な \userpackage を入れてくれる先回 + りuserpackage + * \labelを打つことはもう忘れよう! refやcite補完入力で自動生成します + * 画像ファイルのドラッグ&ドロップによる自動 \includegraphics File: yatexj, Node: Installation, Next: Invocation, Prev: Main features, Up: Top -ッー。 -************ - -サッーホソ睾゚ -======================================== - - ~/.emacsヒシホ2玳ティ゙ケ」 +起動法 +****** + +野鳥起動のための設定 +==================== + + ~/.emacsに下の2項目を加えます。 (setq auto-mode-alist (cons (cons "\\.tex$" 'yatex-mode) auto-mode-alist)) (autoload 'yatex-mode "yatex" "Yet Another LaTeX mode" t) -。ヒサホ emacs-lisp -ユ。、イヨッヌ」ッネ load-path -ヒティ゙ケ」 ソネィミ「 -`~/src/emacs/yatex'ヒヨッホヌ「ミ「 +次に野鳥の emacs-lisp ファイル群を置くディレクトリを load-path に加え +ます。たとえば、 `~/src/emacs/yatex'に置くのであれば、 (setq load-path (cons (expand-file-name "~/src/emacs/yatex") load-path)) -ハノネギケ」 - - ハ衾゚ヒ韭「ネ・メャ .tex -ヌ「ユ。、ヤクケネォーェヒサャ -シノオ゙ケ」サャオヒッーヌュソネュマ箴ノ鬢ホスィャヨ菷ユラ -ヒム゙ケ」 - - -ソ、ラサテソ/ラ蠑「トュポ -===================================================================== - - ムケーラー鰲ヒリケハシホムホァキ「ャラハ魴キ、ヘヒムケ -ギケ」 +などとします。 + + 以上の設定により、拡張子が .tex であるファイルを編集すると自動的に野 +鳥がロードされます。野鳥が正常に起動できたときはモードラインの表示が +「やてふ」に変わります。 + + +タイプセッタ/プレヴューア環境の設定 +=================================== + + 利用する外部プログラムに関する以下の変数を確認し、必要なら正しい値に +変更します。 `tex-command' - ... ッーケソ、ラサテソホヴノセ + ... 起動するタイプセッタのコマンド名 `dvi2-command' - ... ッーケラ蠑「ホヴノセ + ... 起動するプレヴューアのコマンド名 `NTT-jTeX' - ... ヤ+、ヌネヒ霤ニ「ソ、ラサテネ衾ヨャ、ニギ - ヲボゥケ醉tヒケ(ナ、NTT-jTeXヌイヒス)」ホェヒマ「 - fillケネュヒニヤホェヒ%ユテケ隕ヒハ」 + ... 改行+インデントによって、タイプセット後の字間が空いて + しまうのを抑制する場合にtにする(古いNTT-jTeXで顕著に現れ + る)。具体的には、fillするときに各行の終わりに%を付加する + ようになる。 `YaTeX-kanji-code' - ... クョケホチウシノ + ... 文書を作成する時の漢字コード `dviprint-command-format' - ... ユ。、ホヒネヴノホー + ... ファイルの印刷に使われるコマンド列の書式 `YaTeX-dvipdf-command' - ... DVIPDFヒムケケヴノ - -ウ鶯ムケケ醯「蔆鸛~/.emacs'ヒニ「ソネィミ -(setq tex-command "pdflatex") -ホ隕ヒキニッタオ、」ノホ隕ハヘサテネケミノ、ォヒト、ニマ「 -*Note All customizable variables::イネキニッタオ、」 + ... DVIをPDFに変換するコマンド + +これらを変更する場合は、やはり`~/.emacs'にて、たとえば + (setq tex-command "pdflatex") +のようにしてください。どのような値をセットすれば良いかについては、 +*Note All customizable variables::を参照してください。 File: yatexj, Node: Invocation, Next: %#notation, Prev: Installation, Up: Top -latexヴノッー -***************************** - -LaTeXスシケホヤク譴。ホュシマヒ韭「platex -ハノホソ、ラサテネラー -(ハ蠢、ラサテソネニヨ)「ラ蠑「ハノホッーャヌュ゙ケ」 +latexコマンド起動 +***************** + +LaTeXソースの編集中、次のキー入力により、platex などのタイプセットプロ +グラム(以後タイプセッタと呼ぶ)、プレヴューアなどの起動ができます。 `[prefix] t j' - ... ソ、ラサテソ(platex)ッー + ... タイプセッタ(platex)起動 `[prefix] t r' - ... ソ、ラサテソッー(ホ靼) + ... タイプセッタ起動(領域指定) `[prefix] t e' - ... ソ、ラサテソッー - (ン、ネフヨホトュ゙ソマー箴ノポミン) + ... 部分タイプセット&プレヴュー(ポイント位置の段落、環境 + または数式モードのみをタイプセットして隣のバッファに組版 + 結果の画像を出す) `[prefix] t k' - ... ー賽ソ、ラサテソホ葹 + ... 動作中のタイプセッタの停止 `[prefix] t b' - ... jbibtexッー + ... jbibtex起動 `[prefix] t i' - ... makeindexッー + ... makeindex起動 `[prefix] t d' - ... ソ、ラサテネーサ蘚vipdfmxッー + ... タイプセット完了後dvipdfmx起動 `[prefix] t p' - ... ラ蠑「ッー + ... プレヴューア起動 `[prefix] t l' - ... lpr(ラネ「ヲネム)ヴノッー + ... lpr(プリントアウト用)コマンド起動 `[prefix] t s' - ... xdvi -remote ヌホオシチ + ... xdvi -remote でのサーチ * Menu: -* Calling typesetter:: ソ、ラサテソッー -* Calling previewer:: ラ蠑「ッー -* Print out:: ラネ「ヲネムヴノホッー +* Calling typesetter:: タイプセッタ起動 +* Calling previewer:: プレヴューア起動 +* Print out:: プリントアウト用コマンドの起動 File: yatexj, Node: Calling typesetter, Next: Calling previewer, Prev: Invocation, Up: Invocation -ソ、ラサテソッー -================================ - - ソ、ラサテソッーケネ「ヤクヲ」ノヲャ2トヒャ莊「メホヲ」ノ -ヲヒソ、ラサテネ靂ャスィオ゙ケ」ミマオ眦サシクネ「ーキソ、ラサテ -ネミテユ。マォーェヒケッシギケ」箙「モ貮ィ鮠ャッウテニ゚゙テニ -ギテソ醉マソ、ラサテネミテユ。ヒワ瑤(`C-x -o') ソ、ラサテソホミ キニ、 ? -ララネヒミキニ「`x' -(ホ貮)ハノホリィウネャ -ヌュ゙ケ」ィ鮠、オケ醯「 +タイプセッタ起動 +================ + + タイプセッタを起動すると、編集ウィンドウが2つに分割され、片方のウィ +ンドウにタイプセット画面が表示されます。出力されるメッセージと連動しタ +イプセットバッファは自動的にスクロールします。もし、途中でエラーが起こっ +て止まってしまった場合にはタイプセットバッファに移り、(`C-x o') タイプ +セッタの出している ? プロンプトに対して、`x' (処理の中断)などの指示を +送ることができます。エラーを修正する場合は、 `[prefix] '' -`(prefix+「ンケネユ」)' - ... セーホィ鮠ックヤリク胚ラ - -マケウネヒ韭「ソ、ラサテソャィ鮠ックキソヤヒワウネャヌュ゙ケ」 -゙ソ「ソ、ラサテソホミマケ overfull hbox -ハノホヲゥシヒーヤヒ簟キ -ニ、゙ケホヌ「遑 `[prefix] '' -。ケウネヒ韭「トーホヲゥシヒー -ックヤヒク胚ラキニ、ュ゙ケ」 - - 箙「、ヒハィ鮠ヤャ「テソ醯「ソ、ラサテネミテユ。ヌ「ィ -鮠ホスィオニ、ヤヒォシス鉐サケレシケュシ。ケネ -LaTeX -スシケホミケヤヒク胚ラギケ」 - - -ホ霑、ラサテネ --------------------------------- - - ン、ネネ゙シッホヨ「「、マニュケネ賤蓊タ -`%#BEGIN' ネ `%#END'ホヨホホ(*Note -%#notation::)タアレ霤ニソ、ラサテネケウネャ -ヌュ゙ケ」ウホ釿、ユ。、ホラ瑤ヨャユ。、ホ -ラ瑤ヨネキニネ゙ケ」キソャテニラ瑤ヨヒハ、゙ッチャ -ホ鞣ヒ「ネィ鮠ヒバケ」ホ霑、ラサテネネヲ遒 -ャゴッチマラ瑤ヨ(`\begin{document}'韭ー)ヒヨッ隕 -ヒキニシオ、」ユ。、マ皃ユ。、ホ「 -ヌ」ッネホ`texput.tex'ネ、ヲセーヌミマオホヌ「 -褥ュヒマユキニッタオ、」 - - -トュソ、ラサテネ --------------------------------- - - `[prefix] te' -。ケネ「ン、ネフヨホヌ粐ヲホトュ「゙ソマー箴 -ノ簧醯スホー箴ノエホャォーェヒホ隱オニ「ホ霑、ラサテネ -ニモミギケ」tabularトュ蔬ー箴ノヌ」ィハ簧テニ、醯ホォ眩 -、ャタアホァヌュホヌリヌケ」ウ -`texput.tex' ヒコャ -ュミギケ」ラ蠑「ヌ `texput.dvi' -ォ、ゾ゙ヒキニェアミ -、オネホァャヌ皹ヌュヌキ遖」 +`(prefix+アポストロフィ)' + ... 直前のエラー発生行へジャンプ + +を入力することにより、タイプセッタがエラーを発生した行に移ることができ +ます。また、タイプセッタの出力する overfull hbox などのウォーニング行 +にも対応していますので、順次 `[prefix] '' を押すことにより、一つ前の +ウォーニング発生行にジャンプしていきます。 + + もし、気になるエラー行があった場合は、タイプセットバッファで、エラー +の表示されている行にカーソルを合わせスペースキーを押すと LaTeX ソース +の対応する行にジャンプします。 + + +領域タイプセット +---------------- + + ポイントとマークの間、あるいはテキスト中に埋め込んだ `%#BEGIN' と +`%#END'の間の領域(*Note %#notation::)だけを切り取ってタイプセットする +ことができます。この場合メインファイルのプリアンブルが一時ファイルのプ +リアンブルとして使われます。したがってプリアンブルにないマクロ定義が領 +域内にあるとエラーになります。領域タイプセットを使う場合、必ずマクロ定 +義はプリアンブル(`\begin{document}'より前)に置くようにして下さい。一時 +ファイルはメインファイルのあるディレクトリの`texput.tex'という名前で出 +力されるので、上書きには注意してください。 + + +環境タイプセット +---------------- + + `[prefix] te' を押すと、ポイント位置の最も内側の環境、または数式モー +ド内の場合はその数式モード全体、あるいは環境がなければその段落が自動的 +に領域選択されて、領域タイプセットを呼び出します。tabular環境や数式モー +ドで複雑なものを作っている場合は確かめたい部分だけを確認できるので便利 +です。Emacsが画像表示可能な場合は、部分タイプセットの結果を画像化して +隣のウィンドウに表示します。また、特定の環境で呼び出した場合は、環境内 +の文字を書き換える度に自動的にプレビュー画像を更新します(on-the-flyプ +レヴュー)。自動表示されない場合はプレヴューアで `texput.dvi'を開いたま +まにしておけば修正と確認が素早くできるでしょう。 + + 画像プレヴューの場合の大きさ(解像度)はデフォルトで200dpi(数式は +300dpi)です。dpiを変えたい場合はLaTeXソースのどこかに`%#PREVIEWDPI +150'のようにdpi値を書いてください。 File: yatexj, Node: Calling previewer, Next: Print out, Prev: Calling typesetter, Up: Invocation -ラ蠑「ッー -================================ - `[prefix] t p' -ヒ韭ラ蠑「ホッーャヌュ゙ケ」オ鰺「箙「ハ -ソャ「-remote -。ストュホxdviムキニ、醯 `[prefix] -t s' 。ケ -ウネヒ韭ォシスフヨホク。キニスホレシクスィケ隕ヒケヌヒッ -ー賽xdviヒソ碪゙ケ」ウヒ韭「ス゚ヤク賽ユホソ、ラサテネフ -ィツヒォウネャヌュ゙ケ」 +プレヴューア起動 +================ + `[prefix] t p' によりプレヴューアの起動ができます。さらに、もしあな +たが、-remote 機能つきのxdviを利用している場合は `[prefix] t s' を押す +ことによりカーソル位置の文字列を検索してそのページを表示するようにすで +に起動中のxdviに命令を送ります。これにより、現在編集中の箇所のタイプセッ +ト結果を即座に見ることができます。 File: yatexj, Node: Print out, Prev: Calling previewer, Up: Invocation -ラネ「ヲネ -============================ - - `[prefix] t -l'。キニラネ「ヲネリィケネ「ミマォマ/ェサレシ -クケ、ニッホヌ「スセヒィ゙ケ」ウハャキソ、マ「 -universal-argument トア「 +プリントアウト +============== + + `[prefix] t l'を押してプリントアウトを指示すると、出力開始/終了ペー +ジを聞いてくるので、それぞれに答えます。これを省略したい時は、 +universal-argument をつけ、 `C-u [prefix] t l' - ... レシクホァハャlprッー - -ホ隕ヒッーキニッタオ、」 + ... ページ確認省略lpr起動 + +のように起動してください。 File: yatexj, Node: %#notation, Next: Completion, Prev: Invocation, Up: Top -%#ュ。 -********** - - ワク賤`%#'ヌマグュシシノ蓊犁ネヌソ、ラサテソッー -ホゥ踉ケウネャヌュ゙ケ」 +%#記法 +****** + + 本文中に`%#'ではじまるキーワードを埋め込むことでタイプセッタ起動等の +制御をすることができます。 * Menu: -* Changing typesetter:: ソ、ラサテネムヴノホムケ -* Splitting input files:: マユ。、ャ -* Fix region for typesetting:: ホ靜ヌ -* lpr format:: ラネ「ヲネヴノムユゥジテネ -* Controlling which command to invoke:: スホセホッーヴノゥ -* Editing %# notation:: %#ュ。ホヤク +* Changing typesetter:: タイプセット用コマンドの変更 +* Splitting input files:: 入力ファイル分割 +* Fix region for typesetting:: 領域の固定 +* lpr format:: プリントアウトコマンド用フォーマット +* Controlling which command to invoke:: その他の起動コマンド制御 +* Editing %# notation:: %#記法の編集 File: yatexj, Node: Changing typesetter, Next: Splitting input files, Prev: %#notation, Up: %#notation -ソ、ラサテネムヴノムケ -==================================================== - - ッーケヴノムィソ、マワク賤。ホ隕ハヤュ゙ケ」 +タイプセット用コマンド変更 +========================== + + 起動するコマンドを変えたい時は本文中に次のような行を書きます。 %#!jlatex-ntt -NTT jTeX ネ「ASCII jTeX -ネ、ャアソ、隕ハ醉リヌキ遖」 +NTT jTeX と、ASCII jTeX を使い分けたいような場合に便利でしょう。 File: yatexj, Node: Splitting input files, Next: Fix region for typesetting, Prev: Changing typesetter, Up: %#notation -マユ。、ャ -================================ - -゙ソ「マ靈フユ。、ホ .tex -ョキニ、酩「`main.tex'ォ `sub.tex' - -`\include'キニ、隕ハマ「`sub.tex'ホ、ユホ -フヨヒ。ホ隕ハヤ蓊゚゙ケ」 +入力ファイル分割 +================ + +また、章毎に別ファイルの .tex を作成している場合で、`main.tex'から +`sub.tex' を `\include'しているような時は、`sub.tex'の任意の位置に次の +ような行を埋め込みます。 %#!platex main.tex -衾耒隕ヒヴノセタアヌハッ糂、ソ醉マ「エニスボ゙ -shell ヒマケホヌ。ホ隕ヒアミ「ghostview -ハノラ蠑「ヒネヲヒリ -ヌケ」 +上の例のようにコマンド名だけでなく引数も書いた場合には、全てをそのまま +shell に渡すので次のように書けば、ghostview などをプレヴューアに使う時 +に便利です。 %#!platex main && dvi2ps main.dvi > main -ハェ「ウホヤホヌ衾アホヤェノハーヨ皃ユ。、ラホルシケ -ヘシ猊「ネセギケ(衾2トホ酲チ鰾`main')」 -ウホヤヒュメキソ「`%f'マ皃ユ。、セヒ「 -`%r' -マ皃ユ。、ホネ・メ韭、ソャヒヨケオ゙ケ」 -ソタキ「`%f,%r'ムキソ遒鴣ソ、ラサテネヒャコ皃ユ。、 -セホマ・オ゙ケ」 - - `[prefix] g' (*Note Cursor jump::イネ) ヌホ -ユ。、ヨク胚ラュヒ。スオサソ發マユ。、ャヒマ。ホウネヒ -ユキニシオ、」 - - 1. オヨヌ」ッネテニ「スホ賤オヨユ。、ヨッウネマヌュャ - オヨヌ」ッネホオヨヌ」ッネヒマヨアハ、」 - 2. 皃ユ。、ォ魴ヨヌ」ッネ簧ユ。、 - include ケヒマ「 - ミムケリム、ニ「 - `\include{chap1/sub}'ホ隕ヒュメ」 - 3. 皃ユ。、ャト衾ヌ」ッネヒ「鈔「オヨユ。、ヒマ - %#!platex main.tex - ホ隕ヒュメケ(../mainヌマハ、)」 +なお、この行の最後の単語のピリオド以前を「メインファイル」のベースネー +ムであると仮定します(上の2つの場合どちらも`main')。この行に記述した、 +`%f'はメインファイル名に、 `%r' はメインファイルの拡張子を取り除いた部 +分に置換されます。ただし、`%f,%r'を利用した場合、初回タイプセット時に +必ずメインファイル名の入力を促されます。 + + `[prefix] g' (*Note Cursor jump::参照) でのファイル間ジャンプを有効 +に機能させるため、入力ファイル分割時には次のことに注意して下さい。 + + 1. サブディレクトリを作って、その中にサブファイルを置くことはできる + がサブディレクトリのサブディレクトリには置けない。 + 2. メインファイルからサブディレクトリ内のファイルを include する時には、 + 相対パス指定を用いて、 + `\include{chap1/sub}'のように記述。 + 3. メインファイルが一つ上のディレクトリにある場合も、サブファイルに + は%#!platex main.tex のように記述する(../mainではない)。 @@ -413,58 +389,51 @@ File: yatexj, Node: Fix region for typesetting, Next: lpr format, Prev: Splitting input files, Up: %#notation -ホ靜ヌ -==================== - - `[prefix] tr' -ホホ靼ホソ、ラサテネヌマ「ネッヒリホハ、ォョ瑤 -`C-SPC'ヌ゙シッキソフヨネ「ン、ネ(ォシスフヨ)ホヨホ霾゚ハギ -ケャ「ャコ鞐テソホ頸ソ、ラサテネキソ、醯「スホホ頸 +領域の固定 +========== + + `[prefix] tr' の領域指定のタイプセットでは、とくに指定のないかぎり、 +`C-SPC'でマークした位置と、ポイント(カーソル位置)の間を領域とみなしま +すが、必ず決まった領域をタイプセットしたい場合は、その領域を %#BEGIN - <マキソ、ホ> + <渡したい領域> %#END -ホ隕ヒ`%#BEGIN'ネ`%#END'ヌマ゚「ォシスヨ`%#BEGIN'パラ -ヒヨ、ニッタオ、」ウホホホ韋ャァ゙ネ硴ネ。ホ隕ヒバケ」 - - - 1. ォシスフヨ韭ミテユ。ホ隰ヒ`%#BEGIN'ネ、ヲュシシノャ - 「 - - 1. `%#BEGIN'韭ミテユ。ホヒ`%#END'ネ、ヲュシシノャォトォテ - ソ逎 - =>`%#BEGIN' ォ鬚スホ `%#END' ホ「フヨ゙ヌ」 - 2. `%#END' ャォトォ鯡ォテソ逎 - =>ミテユ。ホヌ褸゙ヌ」 - - 2. ォシスフヨ韭ミテユ。ホ隰ヒ - `%#BEGIN' ネ、ヲュシシノャ - ォトォ鯡ォテソ逎 - =>゙シッ(`C-SPC'フヨ)ネン、ネ(ォシスフヨ)ホヨホホ陬 - - tabular -トュソル粽ヤキニ、隕ハ醯「`\begin'ホーホヤ -ヒ `%#BEGIN' ネュ「`\end' ホ。ホヤヒ -`%#END' ネ、ニェッ -ネハアヒスフニケネケウネャヌュ゙ケ」゙ソ「ケ、 -.tex ユ。、ホ蠕 ヒ `%#BEGIN' -、ニェアミ「ーセホャマオヌュ゙ケ」ウホBEGINネEND -ホテキコヒマスャエユシオ、」 +のように`%#BEGIN'と`%#END'で囲み、カーソルを「`%#BEGIN'以降」に置いて +ください。この時の領域決定規則をまとめると次のようになります。 + + + 1. カーソル位置よりバッファの先頭方向に`%#BEGIN'というキーワードがあ + る場合 + + 1. `%#BEGIN'よりバッファの末尾方向に`%#END'というキーワードが見つかっ + た場合。 + =>`%#BEGIN' から、その `%#END' のある位置まで。 + 2. `%#END' が見つからなかった場合。 + =>バッファの最後尾まで。 + + 2. カーソル位置よりバッファの先頭方向に `%#BEGIN' というキーワードが + 見つからなかった場合。 + =>マーク(`C-SPC'位置)とポイント(カーソル位置)の間の領域。 + + tabular 環境を何度も試行錯誤しているような場合は、`\begin'の前の行に +`%#BEGIN' と書き、`\end' の次の行に `%#END' と書いておくと簡単に作表結 +果をテストすることができます。また、長い .tex ファイルの後半に +`%#BEGIN' を書いておけば、前半の部分は無視できます。このBEGINとENDの消 +し忘れには十分ご注意下さい。 File: yatexj, Node: lpr format, Next: Controlling which command to invoke, Prev: Fix region for typesetting, Up: %#notation -lprユゥジテネ -=========================== - - ゙コ「ラネ「ヲネムヴノホユゥジテネヒト、ニ簑ギケ」 -ヴノユゥジテネマ「3トホ Lisp -ムヒ霤ニススオ゙ケ」ヌ -ユゥネホ dvi2ps -ムホユゥジテネ耆簑ギケ」 +lprフォーマット +=============== + + まず、プリントアウト用コマンド列のフォーマットについて説明します。コ +マンド列フォーマットは、3つの Lisp 変数によって表現されます。デフォル +トの dvi2ps 用のフォーマットを例に説明します。 `(1)dviprint-command-format' `"dvi2ps %f %t %s | lpr"' @@ -475,117 +444,118 @@ `(3)dviprint-to-format' `"-t %e"' -ツンヒラネ「ヲネケマ「(1)賽 %s -ャユ。、セヒヨュケィ鴈「%f ャ -(2)ホ簇「%t -ャ(3)ホ簇ヒヨュケィ鴈゙ケ」スホンヒ(2)ホク賽 -%b マ -ヨミマォマレシクラ「(3)ホク賽 %e -マヨミマェサレシクラヒヨュケィ鴈 -゙ケ」箙「レシクリキハ、ヒマ「%f, -%t セネ箏オ゙ケ」 - - ウホ「dviprint-command-format -ラヒムィソ、マ「LaTeX ホ -スシケニュケネ賽、ユホヒ「 +実際にプリントアウトする時は、(1)中の %s がファイル名に置き換えられ、 +%f が(2)の内容、%t が(3)の内容に置き換えられます。その際に(2)の文字列 +中の %b は「出力開始ページ」、(3)の文字列中の %e は「出力終了ページ」 +に置き換えられます。もし、ページを指定しない時には、%f, %t 両方とも無 +視されます。 + + この、dviprint-command-format を臨時に変えたい時は、LaTeX のソーステ +キスト中の任意の場所に、 %#LPR dvi2ps %f %t %s | 4up -page 4 | texfix | lpr -Plp2 -ホ隕ヒ、ニシオ、」ラネ「ヲネケレシクママ、チ、チケォサハ、隕 -ヒケヒ +のように書いて下さい。プリントアウトするページ範囲をいちいち聞かせない +ようにする時に %#LPR dvi2ps %s | lpr -ハノネケホ籀ォ箙゙サ」 +などとするのも便利かもしれません。 File: yatexj, Node: Controlling which command to invoke, Next: Editing %# notation, Prev: lpr format, Up: %#notation -スホセホッーヴノゥ -================================================ - -LaTeX クヒリ「ケヴノマハシホ %# -ュ。ヌリケウネャヌュ゙ケ」 - +その他の起動コマンド制御 +======================== + +LaTeX 文書に関連するコマンドは以下の %# 記法で指定することができます。 + + `%#PREVIEW' + + ... Command line for DVI viewing ([prefix] t p) `%#BIBTEX' - - ... makeindexヤハヲヴノ鬢([prefix] t b) + + ... makeindexを行なうコマンドライン([prefix] t b) `%#MAKEINDEX' - - ... bibtexヤハヲヴノ鬢([prefix] t i) + + ... bibtexを行なうコマンドライン([prefix] t i) `%#DVIPDF' - - ... DVIォ餘DFムケヤハヲヴノ鬢([prefix] - t d) - -ヤャャウ鯰ュシシノヌマ゙ヤLaTeXクホ隰ユ睛、ニェアミ「 -スヌリキソヴノッーヌュ゙ケ」 + + ... DVIからPDF変換を行なうコマンドライン([prefix] t d) + `%#LPR' + + ... 印刷用のコマンドライン([prefix] t l) + `%#PDFVIEW' + + ... PDFファイルを見るためのコマンドライン + `%#IMAGEDPI' + + ... 即時プレヴュー(on-the-fly preview)用の画像のDPI + +行頭がこれらのキーワードで始まる行をLaTeX文書の先頭付近に書いておけば、 +それで指定したコマンドを起動できます。 File: yatexj, Node: Editing %# notation, Prev: Controlling which command to invoke, Up: %#notation -%#ュ。ォホホヤク -============================== - -ハ衾隕ハ`%#'ヌマ゙ニゥ豁。ヤクケソ睛マ +%#記法自体の編集 +================ + +以上のような`%#'で始まる各種制御記法を編集するためには `[prefix] %' - ... `%#'ュ。ヤク睛蠑 - -。ギケ」 + ... `%#'記法編集メニュー + +を押します。 !)Edit-%#! B)EGIN-END-region L)Edit-%#LPR -ネ、ヲ睛蠑ャミニ齏ホヌ「`%#!'ヒウッヴノムケキソ、ヒマ -`!'「`%#LPR'ヌ lpr -ユゥジテネムィソ、マ`l'「「鬮 -ク矚キソク銛 `%#BEGIN' チ `%#END' -ヌ鉤ソ、マ「 -`b'。ギケ」`b'ェタヒマ「ズヌミテユ。賤ヨォニ、ソ -`%#BEGIN', `%#END' ャォーェヒテオ゙ケ」 +というメニューが出て来るので、`%#!'に続くコマンドを変更したい時には +`!'を、`%#LPR'で lpr フォーマットを変えたい時は`l'を、あらか +じめ設定したリジョンを `%#BEGIN' 〜 `%#END' で括りたい時は、 +`b'を押します。`b'を選んだ時には、それまでバッファ中に置かれていた +`%#BEGIN', `%#END' が自動的に消去されます。 File: yatexj, Node: Completion, Next: Local dictionary, Prev: %#notation, Up: Top -莢マ -**************** - - LaTeX -ヌホトュセハノマ「サホ莢。スムキニスィェヒマケウネ -ャヌュ゙ケ」 +補完入力 +******** + + LaTeX での環境名などは、野鳥の補完機能を利用して能率的に入力すること +ができます。 * Menu: -* beginソ莢:: -* sectionソ莢:: -* largeソ莢:: -* maketitleソ莢:: -* Arbitrary completion:: 莢 -* end莢:: -* Accent mark completion:: 「ッサネュ趾ー -* Image completion:: ーュ讀眈ク莢 -* Greek letter completion:: ョキ羣莢 +* begin型補完:: +* section型補完:: +* large型補完:: +* maketitle型補完:: +* Arbitrary completion:: 随時補完 +* end補完:: +* Accent mark completion:: アクセント記号補完 +* Image completion:: 数式記号イメージ補完 +* Greek letter completion:: ギリシャ文字補完 +* Inserting parens:: -File: yatexj, Node: beginソ莢, Next: sectionソ莢, Prev: Completion, Up: Completion - -beginソ莢 -================= - - `\begin{env}...\end{env}'ホヘハチーホマホ莢beginソ莢ネ -ニヨウネヒギケ」begin ソ莢マ「 +File: yatexj, Node: begin型補完, Next: section型補完, Prev: Completion, Up: Completion + +begin型補完 +=========== + + `\begin{env}...\end{env}'の様な形式の入力の補完をbegin型補完と呼ぶこ +とにします。begin 型補完は、 `[prefix] b' - ... begin ソ莢ォマ(ク猊マ `C-c b') - -ヌマ゙゙ケ」ムヒヒム、鴈。ホ LaTeX -トュホ莢マ「[prefix] `b' -ヒウッ。ホ1クマケタアヌ「`\begin{xxx}...\end{xxx}'ーョ -オザケ」 + ... begin 型補完開始(標準では `C-c b') + +で始まります。頻繁に用いられる次の LaTeX 環境の補完は、[prefix] `b'に +続く次の1文字を入力するだけで、`\begin{xxx}...\end{xxx}'を完成させます。 `[prefix] b c' ... `\begin{center}...\end{center}' @@ -622,393 +592,373 @@ `[prefix] b V' ... `\begin{verse}...\end{verse}' - 蟄ホ簧ハーホトュセマ Emacs -ホト、ッ碯ソハ莢。スム、ニ -マギケ(蟄ホトュセ簗シホ莢マトス)」 + 上記のもの以外の環境名は Emacs の持つインクリメンタルな補完機能を用 +いて入力します(上記の環境名も以下の補完入力可能)。 `[prefix] b SPC' - ... begin ソ莢マ - -`[prefix] b SPC' -ネマケネ「ヌシヤポヒミテユ。ヒ + ... begin 型補完入力 + +`[prefix] b SPC' と入力すると、最下行のミニバッファに Begin environment(default document): -ネスィオ゙ケ」ウウヌ「ソコヒソシュシポ。ケネ「醂簍ミニ、 -ヌユゥネホトュセャマオ゙ケャ「ャハトュセマケネ「 -`\begin{トュセ} ト -\end{トュセ}'ャク賤゙オ゙ケ」゚ヒミテ -ユ。ヌトュセマケネュヒ「トュセホャクマキヨケレシケラソソッネ「 -ラケトュセャ糜ニシヨヒク゚キソ遒オキ、トュセヒ莢オホヌ「 -マホヨャハア゙ケ」糜ニシヨヒク゚キハ、トュセマキソマ貍カ -ムホニシヨヒミソオ「オ鰺スホニシヨォーェヒ「貍カュ(ヌユゥ -ネヌマ `~/.yatexrc')ヒンクギケ」 - -オ鰺「テホトュ莢マキソヒマスホトュヌャコム、鴈ィネォ -ー゙ギケ(: -`itemize'トュヒェア`\item'ハノ)」゙オソィ -ネャヤラハ醉マundoヒ霤ニテキニシオ、」 - - -ヒ、ソニュケネトュヌ鉈 ------------------------------------------------------------- - - ネウヌ「ヌ鰺、ニギテソヨテッ雖鬚itemize -トュホ -ヒトクウ眩、ネラヲウネャ「゙ケャ「スホ隕ハネュマ「「鬮ク -トクウ眩、バシッキニ「begin -ソ莢ホニヴノホ `[prefix]' -ホ。ホリョクホ 'b'ル -リ邵ルヒムィニッーキニシオ、」(゙ソマ「 -`C-u' 靈ヌチ「universal argument -トアニ籠スヌケ) - - 罟ミ「ム魏鰈 description -トュホ賤ソ、ネュマ「 -スホム魏鰈゙シッキニォ鬚 - -`[prefix] B D' -`(゙ソマ ESC 1 [prefix] b D)' -`(゙ソマ C-u [prefix] b D ハノ)' - -ネソ、ラキニッタオ、」ウマ「`[prefix] b -SPC'ホ莢マヒ笋ニマ゙瑤 `b' -邵ヒムィニ「`[prefix] B SPC' -ネソ、ラケミ「「鬮ク -゙シッキニェ、ソク銛「begin ネ end -ホトュヌ鉤゙ケ」 +と表示されます。ここで、何も入れずにリターンキーのみ押すと、括弧内に出 +ているデフォルトの環境名が入力されますが、適当な環境名を入力すると、 +`\begin{環境名} … \end{環境名}'が文書中に挿入されます。ミニバッファで +環境名を入力するときに、環境名の頭文字を入力し「スペース」をたたくと、 +一致する環境名が内部テーブルに存在した場合、正しい環境名に補完されるの +で、入力の手間が省けます。内部テーブルに存在しない環境名を入力した時は +ユーザ専用のテーブルに登録され、さらにそのテーブルを自動的に、ユーザ辞 +書(デフォルトでは `~/.yatexrc')に保存します。 + +さらに、特定の環境を補完入力した時にはその環境で必ず用いられるエントリ +を自動挿入します(例: `itemize'環境における`\item'など)。挿入されたエン +トリが不要な場合にはundoによって消去して下さい。 + + +既に書いたテキストを環境で括る +------------------------------ + + ところで、最初に書いてしまったブロックを後から、itemize 環境の中 +に閉じこめたいと思うことがありますが、そのようなときは、あらかじめ +閉じこめたい段落をマークして、begin 型補完の各コマンドの `[prefix]' +の次の『小文字の 'b'』 を『大文字』に変えて起動して下さい。(または、 +`C-u' を先に打ち、universal argument をつけても可能です) + + 例えばあるパラグラフを description 環境の中に入れたいときは、そのパ +ラグラフをマークしてから、補完機能を呼び出してください(description環境 +の場合は `[prefix] b D')。 + +選択された領域を括ります。ただしこれは `transient-mark-mode' が t +(Emacsの標準)になっている場合のみで、普段 +`transient-mark-mode' を `nil' にしている場合は、 +補完キー前に `universal-argument' 指定(`C-u') +をタイプしてから `[prefix] b D' など、補完キーを +タイプすれば括り補完になります。 +なおEmacs22以降であれば `transient-mark-mode' 無効時も +`set-mark-command' (`C-space')の連打で一時的に +`transient-mark-mode' が有効になります。 + -File: yatexj, Node: sectionソ莢, Next: largeソ莢, Prev: beginソ莢, Up: Completion - -sectionソ莢 -=================== - - `\section{ワェ}' -ホ隕ハチーホマホ莢 section -ソ莢ネニヨウ ネヒギケ」section -ソ莢マ「 +File: yatexj, Node: section型補完, Next: large型補完, Prev: begin型補完, Up: Completion + +section型補完 +============= + + `\section{目的}' のような形式の入力の補完を section 型補完と呼ぶこと +にします。section 型補完は、 `[prefix] s' - ... section ソ莢 - - -ヌツヤギケ」`[prefix] s' -マケネ゚ヒミテユ。ヒ「 + ... section 型補完 + + +で実行します。`[prefix] s' を入力するとミニバッファに、 (C-v for view-section) \???{} (default documentclass): -ネ、ヲララネャスホヌ「スウヌ -`section' ホ隕ハ LaTeX ヴ -ノセマギケ」ウウヌ粲ソシュシポヌ醂簧ヌユゥネヘャェオ -ロォ「`chapter'ハノホ隕ハムルホ筅セホマヒマケレシケュシヒ -莢。スャュヌケ」 -。ヒ「{}ホ貶ホマ・ケ「 +というプロンプトが現れるので、そこで `section' のような LaTeX コマンド +名を入力します。ここでもリターンキーのみで括弧内のデフォルト値が選択さ +れるほか、`chapter'などのような頻度の高い名称入力にはスペースキーによ +る補完機能が有効です。 次に、{}の中身の入力を促す、 \section{???}: -ネ、ヲララネャスホヌ「サッキ銛ホソ、ネハノマギケ」 -ソネィミ「 +というプロンプトが現れるので、セクションのタイトルなどを入力します。た +とえば、 (C-v for view-section) \???{} (default documentclass): section - \section{???}: ワェ - -ホ隕ヒマキソ醯「クマ賤 - - \section{ワェ} - -ャ゙オ「 + \section{???}: 目的 + +のように入力した場合は、文章中に + + \section{目的} + +が挿入され、 (C-v for view-section) \???{} (default section): vspace* \vspace*{???}: -ホ隕ヒ{}ホ貶ハャキソネュマ「 +のように{}の中身を省略したときは、 \vspace*{} -タアャ゙オ「ヤマサコォシスマォーェヒ跚フホ筥ヒワーギケ」 +だけが挿入され、改行はせずカーソルは自動的に中括弧の内側に移動します。 * Menu: -* 2トハ衾ネ sectionソヴノ:: -* Enclose section-type command:: 鉤莢 -* Recursive completion:: ニ「莢 -* view-sectioning:: サッキ銛靺ホ「ヲネ鬢スィ -* label-generation:: 鰮ォークョ +* 2個以上の引数をとる section型コマンド:: +* Enclose section-type command:: 括り補完 +* Recursive completion:: 再帰補完 +* view-sectioning:: セクション区切りのアウトライン表示 +* label-generation:: ラベル自動生成 -File: yatexj, Node: 2トハ衾ネ sectionソヴノ, Next: Enclose section-type command, Prev: sectionソ莢, Up: sectionソ莢 - -2トハ衾ネ sectionソヴノ ------------------------------------------------------------------ - - ネウヌ「`\addtolength{\topmargin}{8mm}' -ハノホ隕ヒ「ト ハ裴 LaTeX -ヴノャ「゙ケ」ウホ隕ハヴノホ莢マヒマ「 -section -ソ莢ニモミキヒユアニッタオ、」罟ミ衾`addtolength' -ホ翩「ミ「2リギケ」ド瑤 - - C-u 2 [prefix] s (゙ソマ「ESC 2 [prefix] s) - -ネ section ソ莢ニモミキソ蠅 +File: yatexj, Node: 2個以上の引数をとる section型コマンド, Next: Enclose section-type command, Prev: section型補完, Up: section型補完 + +2個以上の引数をとる section型コマンド +------------------------------------- + + ところで、`\addtolength{\topmargin}{8mm}' などのように、引数を二つ以 +上取る LaTeX コマンドがあります。このようなコマンドの補完入力には、 +section 型補完呼び出しに引数を付けてください。例えば上の`addtolength' +の例であれば、引数2を指定します。つまり、 + + C-u 2 [prefix] s (または、ESC 2 [prefix] s) + +と section 型補完を呼び出した後、 (Ctrl-v for view-section) \???{} (default vspace*): addtolength \addtolength{???}: \topmargin Argument 2: 8mm -ホ隕ヒマキニッタオ、」ヌ鯰 -addtolength ホャネ「韲ヌ「 \topmargin -ホママウケレシケヒ齏莢マャトスヌケ」貍カュヒミソ -オ LaTeX -ヴノヒマ「ウホホ籀ャオホヌ「ヌ鯰莢ホ -ホリキニッーキニェアミ「ハ衾莢ヒマ「ュアオソトタア -ケ、ニ齏隕ヒバケ」「ネヌホトムィソ、マ「ニモ -`C-u' -ム、ニトリキセケウネヌ「ォーェヒュ賽ホトホャケキギ -ケ」 +のように入力してください。最初の addtolength の部分と、第一引数である +\topmargin の入力は当然スペースによる補完入力が可能です。ユーザ辞書に +登録される LaTeX コマンドには、この引数の数も学習されるので、最初の補 +完の時引数の数を指定して起動しておけば、以後の補完時には、記憶された個 +数だけ引数を聞いて来るようになります。あとで引数の個数を変えたい時は、 +再び `C-u' を用いて個数を指定し直すことで、自動的に辞書中の引数の個数 +の部分を更新します。 + + + + +File: yatexj, Node: Enclose section-type command, Next: Recursive completion, Prev: 2個以上の引数をとる section型コマンド, Up: section型補完 + +既に書いたテキストを括る +------------------------ + + また、section型補完機能の呼び出し時に領域選択状態にしておくと +領域内のテキストを section 型コマンドの第一引数として括ります。 +これも普段 `transient-mark-mode' を `nil' にしている場合は +`C-u' のあとに補完キーをタイプすれば強制的に括り補完になります。 -File: yatexj, Node: Enclose section-type command, Next: Recursive completion, Prev: 2トハ衾ネ sectionソヴノ, Up: sectionソ莢 - -ヒ、ソニュケネ鉈 ------------------------------------------------- - - ゙ソ「ッーヴノホ`s'邵ヒムィニッーケネ「「鬮ク碵 -、ソクマ section -ソヴノホ韲ネキニ鉤゙ケ」 - - - -File: yatexj, Node: Recursive completion, Next: view-sectioning, Prev: Enclose section-type command, Up: sectionソ莢 - -ニ「莢 ----------------- - - 籐ハネ、ヒハォ箙゙サャ「sectionソ莢ホホマヒオ鰺 -莢マムケウネャヌュ゙ケ(section/large/maketitleソヒツ)」section -ソヴノホヒケヒ LaTeX -ヴノャ齏醉マ゚ヒミテユ。ヌサホ -莢ュシニ「ェヒマケウネヌホマ糶ィェヒヤハィ゙ケ」 +File: yatexj, Node: Recursive completion, Next: view-sectioning, Prev: Enclose section-type command, Up: section型補完 + +再帰補完 +-------- + + 高度な使い方になるかもしれませんが、section型補完の引数の入力時にさ +らに補完入力を利用することができます(section/large/maketitle型に限る)。 +section型コマンドの引数に更に LaTeX コマンドが来る場合にはミニバッファ +で野鳥の補完キーを再帰的に入力することで引数の入力も効率的に行なえます。 -File: yatexj, Node: view-sectioning, Next: label-generation, Prev: Recursive completion, Up: sectionソ莢 - -サッキ銛靺ホ「ヲネ鬢スィ --------------------------------------------------------------------- - - フホsectionソ莢ホピヒミテユ。ヌ`C-v'。ケネス゚ク゚ケサッ -キ銛靺ヴノエニ `*Sectioning -Lines*'ネ、ヲミテユ。ヒス -ィギケ(ヨ<<--ラホト、ニ、ヤャ篥ネ粃、サッキ銛靺)」ウポヒ -ミテユ。ヌ`C-p', `C-n' 。ケネ`part', `chapter', ..., -`subparagraph' -ホヴノャタャリホ箏ヒキソャテニ蠑ギケ」゙ソ「 -`C-v', `M-v' -。ケネサッキ銛靺ミテユ。ャケッシキ「 -ホ`0'チ`7'。ケネ「箏ハ衾サッキ銛靺タアェヌス -ィギケ(ツンヒ菘ニォミャォ゙ケ)」 - -`*Sectioning Lines*'ミテユ。マ「 +File: yatexj, Node: view-sectioning, Next: label-generation, Prev: Recursive completion, Up: section型補完 + +セクション区切りのアウトライン表示 +---------------------------------- + + 通常のsection型補完の時にミニバッファで`C-v'を押すと現在存在するセク +ション区切りコマンド全てを `*Sectioning Lines*'というバッファに一覧表 +示します(「<<--」のついている行がもっとも近いセクション区切り)。この時 +ミニバッファで`C-p', `C-n' を押すと`part', `chapter', ..., +`subparagraph' のコマンドが論理階層の高さにしたがって上下します。また、 +`C-v', `M-v' を押すとセクション区切り一覧バッファがスクロールし、数字 +の`0'〜`7'を押すとある高さ以上のセクション区切りだけを選んで表示します +(実際にやって見れば分かります)。 + +`*Sectioning Lines*'バッファは、 `M-x YaTeX-section-overview' - ... サッキ銛靺ミテユ。クョ - -ヌョケウネャヌュ゙ケ」ウホミテユ。ェキ、ユホヤヌケレシケ。ケネ「 -コケサッキ銛靺ホ「ワク賽ヒク胚ラギケ」オ鰺「アミテ -ユ。ヌ `u' -。ケネ「スシケニュケネホミケサッキ銛ヴノャャ -リ螫(: subsection ャ section -ヒム)「`d'。ケネャリシャ -゙ケ」`*Sectioning -Lines*'ミテユ。ヒ「サッキ銛靺ホヤ゙シッ -キニェ、ニ`U'。ケネク銛簧簧ヒミケスシケニュケネホサッキ -ヴノケルニャャリ螫瑤`D'。ケネシャ゙ケ」サッキ銛靺 -ミテユ。ヌムヌュュシヴノヒマハシホ簧ャ「゙ケ」 + ... セクション区切り一覧バッファを生成 + +で作成することができます。このバッファを選択し任意の行でスペースを押す +と、該当するセクション区切りのある本文中の場所にジャンプします。さらに、 +同バッファで `u' を押すと、ソーステキストの対応するセクションコマンド +が一階層上がり(例: subsection が section に変わる)、`d'を押すと一階層 +下がります。`*Sectioning Lines*'バッファにあるセクション区切りの行をマー +クしておいて`U'を押すとリジョン内のものに対応するソーステキストのセク +ションコマンドすべてが一階層上がり、`D'を押すと下がります。セクション +区切り一覧バッファで利用できるキーコマンドには以下のものがあります。 `SPC' - ... ミケスシケヤリク胚ラ + ... 対応するソース行へジャンプ `.' - ... ミケスシケヤスィ + ... 対応するソース行を表示 `u' - ... ォシスフヨヒミケサッキ銛ヴノャリ蟯 + ... カーソル位置に対応するセクションコマンドを一階層上げる `d' - ... ォシスフヨヒミケサッキ銛ヴノャリシイ + ... カーソル位置に対応するセクションコマンドを一階層下げる `U' - ... ゙シッキソサッキ銛ヴノャリ蟯 + ... マークしたセクションコマンドを一階層上げる `D' - ... ゙シッキソサッキ銛ヴノャリ蟯 -`0チ6' - ... ル n - ハシホサッキ銛ヴノ」キニスィ + ... マークしたセクションコマンドを一階層上げる +`0〜6' + ... レベル n 以下のセクションコマンドを隠して表示 -File: yatexj, Node: label-generation, Prev: view-sectioning, Up: sectionソ莢 - -鰮ォークョ ----------------------------- - - `\ref{}' `\cite{}' -゙ッsectionソ莢ヌソ -イネ霾ハタ簧エニオキニ睛蠑ヒキニェヌュ゙ケ」イネ靈マ -`\label{}'トアニェッャラマ「゙サ」箙「ミ「スホ鰮 -ネ、「ハアミスホヌイネ靈`\label{}'鮟ニッ゙ケ」 -鰮セヘィホマヒヒカク簧ヌケ」エニホォヲソヒ鰮 -トアホ篩、リヌケ」筥鰮セヒソトアォ「鰮トアォトア゙ -、ォ「ハノネ、ヲウネマゴキ遖! +File: yatexj, Node: label-generation, Prev: view-sectioning, Up: section型補完 + +ラベル自動生成 +-------------- + + `\ref{}' や `\cite{}' マクロをsection型補完で入れた場合参照先となり +得るものを全て探してメニューにして選択できます。参照先には`\label{}'を +つけておく必要はありません。もしあれば、そのラベルを使い、なければその +場で参照先に`\label{}'を作らせてくれます。ラベル名を考えるのは苦痛に感 +じるものです。全てのカウンタにラベルをつけるのもたいへんです。もうラベ +ル名に何をつけるか、ラベルをつけるかつけまいか、などということは忘れま +しょう! + +ラベルを打つべき項目の選択の際には、可能性のあるすべてのカウンタが表示 +されます。これを「数式のみ」のように種別で絞りたいときは以下のキーコマ +ンドが利用できます。 + `M-a' + + ... 絞り込みを解除してすべてのカウンタを表示 + `M-c' + + ... キャプションのみを表示 + `M-e' + + ... 番号のつく数式のみを表示 + `M-i' + + ... 番号つき箇条書のみを表示 + `M-s' + + ... セクションのみを表示 + `M-m' + + ... その他のカウンタのみを表示 -File: yatexj, Node: largeソ莢, Next: maketitleソ莢, Prev: sectionソ莢, Up: Completion - -largeソ莢 -================= - - `{\large }' ホ隕ハチーホ莢 large -ソ莢ネニヨウネヒギケ」 +File: yatexj, Node: large型補完, Next: maketitle型補完, Prev: section型補完, Up: Completion + +large型補完 +=========== + + `{\large }' のような形式の補完を large 型補完と呼ぶことにします。 `[prefix] l' - ... large ソ莢ォマ - -ャlargeソ莢ホォマヌケ」`[prefix] l' -。ケネ「゚ヒミテユ。ヒ + ... large 型補完開始 + +がlarge型補完の開始です。`[prefix] l' を押すと、ミニバッファに {\??? } (default large): -ネスィオホヌ「蟄ホ簧ネアクラホヌ莢マキニシオ、」莢萢ムユ -オニ、ホマ「`footnotesize' `huge' -ホ隕ハクオ、コリ -メネ「`bf'臍dg'ホ隕ハユゥネリメヌケ」 - - -ヒ、ソク鉈 ----------------------------------------- - - ゙ソ「beginソ莢ホネアヘ「靈、ニギテソ「ホクマホクホオ、コ -ムィソ、ネラヲャ「゙ケャ「スホ隕ハマ「オ、コ蓍ュオムィソ、ク -ホママ゙シッキニォ鬚ニモミキュシ -`[prefix] L' ネ「邵ホ L -ヒムィニニモミサミ「スホク銛エホャ「ヨシケヌマ゙゙ケ」 +と表示されるので、上記のものと同じ要領で補完入力して下さい。補完候補に +用意されているのは、`footnotesize' や `huge' のような文字サイズ指定子 +と、`bf'や`dg'のようなフォント指定子です。 + + +既に書いた文字を括る +-------------------- + + また、begin型補完の時と同様、先に書いてしまった一連の文章の文字のサ +イズを変えたいと思う時がありますが、そのような時は、サイズや大きさを変 +えたい文字の範囲をマークしてからlarge型補完を呼んでください。 -File: yatexj, Node: maketitleソ莢, Next: Arbitrary completion, Prev: largeソ莢, Up: Completion - -maketitleソ莢 -===================== - - `\maketitle' ホチーホ莢 maketitle -ソ莢ネニヨウネヒギケ」 +File: yatexj, Node: maketitle型補完, Next: Arbitrary completion, Prev: large型補完, Up: Completion + +maketitle型補完 +=============== + + `\maketitle' の形式の補完を maketitle 型補完と呼ぶことにします。 `[prefix] m' - ... maketitle ソ莢ォマ - -ヌ「maketitle -ソ莢ォマギケ」莢ホラホマ」゙ヌホ簧ネ゙テソッアクヌ -ケ」LaTeX -ムホヴノセャ莢菠キニムユオニ、゙ケ」 + ... maketitle 型補完開始 + +で、maketitle 型補完を開始します。補完の要領は今までのものとまったく同 +じです。LaTeX 用のコマンド名が補完候補として用意されています。 -File: yatexj, Node: Arbitrary completion, Next: end莢, Prev: maketitleソ莢, Up: Completion - -莢 -================ - - オニ「」゙ヌメルソオソェハ LaTeX -ヴノチーホ莢マム、コヒ「」 -マキ隕ネキニ、 LaTeX -ヴノク賽、ユホフヨヌ莢ケウ -ネ簓ュ゙ケ」LaTeX -ヴノ(隰ャ\ヌマ゙)マキニ、モ貮「 +File: yatexj, Node: Arbitrary completion, Next: end補完, Prev: maketitle型補完, Up: Completion + +随時補完 +======== + + さて、今まで述べた典型的な LaTeX コマンド形式の補完入力を用いずに、 +今入力しようとしている LaTeX コマンドを文書中の任意の位置で随時補完す +ることもできます。LaTeX コマンド(先頭が\で始まる)を入力している途中で、 `[prefix] SPC' - ... 莢 - -マケミ「エニホ莢萸讚鴈ラケ簧ャェミォシスフヨビ -オ゙ケ」 + ... 随時補完 + +を入力すれば、全ての補完候補の中から一致するものが選ばれカーソル位置に +挿入されます。 -File: yatexj, Node: end莢, Next: Accent mark completion, Prev: Arbitrary completion, Up: Completion - -end莢 -=========== - - ス゚ォ、ゾ゙ホトュセォーェヒ。ミキ「`\end{トュセ}'゙ギ -ケ」begin -ソ莢ム、ミトュホトクコマハ、ホヌケャ「ヒマト、ト、ヌ -`\begin{トュセ}' -ニギ、「盥、ラ、ケウネャ「゙ケ」ス -ホ隕ハヒマ、ヒサコウアニクママキ「キォホチヒ +File: yatexj, Node: end補完, Next: Accent mark completion, Prev: Arbitrary completion, Up: Completion + +end補完 +======= + + 現在開いたままの環境名を自動的に検出し、`\end{環境名}'を挿入します。 +begin 型補完を用いれば環境の閉じ忘れはないのですが、時にはついつい手で +`\begin{環境名}' を入れてしまい、悲しい思いをすることがあります。その +ような時には気にせず続けて文章を入力し、しかるのちに `[prefix] e' - ... end 莢 - -ネケウネヌ「ス゚ォ、ニ、トュセヌ -\end{} ャ蔡゙ケ」 + ... end 補完 + +とすることで、現在開いている環境名で \end{} が補われます。 -File: yatexj, Node: Accent mark completion, Next: Image completion, Prev: end莢, Up: Completion - -「ッサネュ趾ー -==================================== - - 、クホ「ッサネュ(`\`{o}'ハノ)マケマ「 +File: yatexj, Node: Accent mark completion, Next: Image completion, Prev: end補完, Up: Completion + +アクセント記号補完 +================== + + 欧文のアクセント記号(`\`{o}'など)を入力する時は、 `[prefix] a' - ... 「ッサネュマ - -。ケネ「゚ヒミテユ。ヒ + ... アクセント記号入力 + +を押すと、ミニバッファに 1:` 2:' 3:^ 4:" 5:~ 6:= 7:. u v H t c d b -ネ、ヲ睛蠑ャミニ齏ホヌ「「゙ソマミケュ/ムマ -キニシオ、」ケネヤクミテユ。ヒ「 +というメニューが出て来るので、数字、または対応する記号/英字を入力して +下さい。すると編集バッファに、 \`{} -ャス「ォシスャ{}簍フヨケホヌ「オ鰺クマケヌ「 +が現われ、カーソルが{}内に位置するので、さらに一文字入力する事で、 \`{o} -ャーョオ「ォシスマ{}ホーヒ碎゙ケ」 +が完成され、カーソルは{}の外に戻ります。 File: yatexj, Node: Image completion, Next: Greek letter completion, Prev: Accent mark completion, Up: Completion -ーュ讀眈ク莢 -======================================== - - 醉ー箴ノヌネムオ「茣ハノホュ踉シェヒススケュシマ -ヌ「LaTeX -ヴノマヌュ゙ケ」ウマサォネホヨー箴ノラヌポ -ーギケ」サマォシスャTeXホートュホ賤「ヒ`;'茲 -`:'ヒテハ。スソザケ」 - - オニ「罟ミ「ォ(leftarrow)ASCIIクタアヌススケ遒フェヒマヨ<-ラ -ホ隕ヒギケャ「ウムキニ「ーュ讀眈クマ箴ノヌ -`\leftarrow'マケヒマ「`;'(サ゚ウ)ヌテニォ饒<-'ネ -マギケ」アヘヒ「ケ、ォ-(long-leftarrow) -ASCIIクタアヌススケ -釉<--ラネケホヌ「`\longleftarrow'マケソ睛マ「`;<--' -ネマギケ」「、マオツ遲踉ASCIIクタアヌススケマヨooラホ隕 -ヒケウネォ鬚`\infty' -マケマ「`;oo'ネュシマギケ」 - - ウ鯰瑁゙ネ硴ネ。ホ隕ヒバケ」 - - INPUT マオ LaTeX ヴノ +数式記号イメージ補完 +==================== + + 主に数式モードで使用される、矢印やΣなどの記号を擬似的に表現するキー入力 +で、LaTeX コマンドを入力できます。これは野鳥自身の「数式モード」でのみ +動作します。野鳥はカーソルがTeXの数式環境の中にある時に`;'や、 +`:'に特殊な機能を持たせます。 + + さて、例えば、←(leftarrow)をASCII文字だけで表現する場合、一般的には +「<-」のようにしますが、これを利用して、数式記号イメージ入力モードで +`\leftarrow'を入力するには、`;'(セミコロン)を打ってから`<-'と入力しま +す。同様に、長い矢印←-(long-leftarrow) をASCII文字だけで表現する場合 +「<--」とするので、`\longleftarrow'を入力するためには、`;<--'と入力し +ます。あるいは無限大記号をASCII文字だけで表現する時は「oo」のようにす +ることから、`\infty' を入力する時は、`;oo'とキー入力します。 + + これらの操作をまとめると次のようになります。 + + INPUT 入力される LaTeX コマンド ; < - `\leftarrow' ; < - - `\longleftarrow' ; < - - > `\longleftrightarrow' @@ -1017,1113 +967,1011 @@ - 、コホ鈔「、眈クマヤテニ、モ貮セ゚ホ簧ャミテユ。 -ヒスィオソハ鬚スウヌ、眈クマ゚眸。ホヤクーヒワテニ -ス、゙サ」 - - ートュ貮`;'ォネマケヒマ`;;'ホ隕ヒギケ」、眈ク -マホモ貮TAB。ケネ「ズヌマキソクヌマ゙簧ャスィオ゙ -ケ」ウウヌワェホ LaTeX -ヴノ゙ヌォシスワーキニルTAB。ケウネヌ -スホ LaTeX -ヴノャミテユ。ビオ゙ケ」 - - ノホュシマヒノホュ谺ミキニ、ォエニホソ、マ「`;'。キソ -セ衢TAB。キニッタオ、」ハシホ耘「`;<'ネ。キソ衢TAB。キソ簧 -ヌケ」 + いずれの場合も、イメージ入力を行っている途中で望みのものがバッファに +表示されたなら、そこでイメージ入力を止めて次の編集動作に移っても構いま +せん。 + + 数式環境中で`;'自身を入力するには`;;'のようにします。イメージ入力の +途中でTABを押すと、それまで入力した文字で始まるもの一覧が表示されます。 +ここで目的の LaTeX コマンドまでカーソルを移動し再度TABを押すことでその +LaTeX コマンドがバッファに挿入されます。 + + どのキー入力にどの記号が対応しているか全て知りたい時は、`;'を押した +直後にTABを押してください。以下の例は、`;<'と押した後にTABを押したもの +です。 KEY LaTeX sequence sign - < \leq - << \ll ヤ - <- \leftarrow ォ + < \leq ≦ + << \ll 《 + <- \leftarrow ← <= \Leftarrow <= -クォ饉マュシ]「[ミケ LaTeX -ヴノ]「[(シ)ュ赭ィ]「ネ -、ヲ酩睛蠑ャミニ齏ホヌ「隸ネヲ簧ミィニェッネノ、ヌキ -ヲ」簧ヒ霤ニマASCIIクヌススケウネャ、ハホヌ「「゙ミィ -荵、ュシツモヌマハ、簧ャ「ヌキ遖ォ鬚スホ隕ハ醯 -\maketitle -ソ莢ヌマケォ「ハシヒメルミスポヤテニア -飜ュシツモホ簧゚ケネノ、ヌキ遖」 - - マュシネ LaTeX -ヴノ「ュ賽ミストヘェピキソ、醯 -Emacs-Lisp ム `YaTeX-math-sign-alist-private' -ヒチキニッタオ、」 -スホ簇ネヌユゥネホ簧鉐サソ簧ャミスネキニネムオ゙ケ(private -ホャ・襍)」ハェ「ウホムホス、ヒト、ニマ -`yatexmth.el' イ ネキニッタオ、」 +左から[入力キー]、[対応する LaTeX コマンド]、[(擬似)記号図示]、という +順でメニューが出て来るので、よく使うものを覚えておくと良いでしょう。も +のによってはASCII文字で表現することが困難なので、あまり覚えやすいキー +並びではないものがあるでしょうから、そのような場合は \maketitle 型補完 +で入力するか、以下に述べる対応表の設定を行って単純なキー並びのものを設 +定すると良いでしょう。 + + 入力キーと LaTeX コマンド、記号の対応表を個人的に設定したい場合は +Emacs-Lisp 変数 `YaTeX-math-sign-alist-private' に定義してください。そ +の内容とデフォルトのものを合わせたものが対応表として使用されます +(privateの方が優先される)。なお、この変数の構造については +`yatexmth.el' を参照してください。 -File: yatexj, Node: Greek letter completion, Prev: Image completion, Up: Completion - -ョキ羣莢 -================================ - - 筥ト「ートュ貮`:'。ケネョキ羣マ箴ノビケ」 -`:'。キソセ衢`a'。ケネ`\alpha'ャ「`g' -。ケネ -`\gamma'ャ「ハノ「ユ。ルテネヒミキソョキ羣ャ゙オ゙ケ」 -瑁。マ;ホーュ趾ーネ゙テソッアクヌケ」゙コマ`:'ホセ衢 -TAB。キニノホ「ユ。ルテネヒノホョキ羣ャミキニ、ォエルニ゚ニ -ッタオ、」 - - `;'ネ`:'ートュ貮。キニ、ヒ筬ォ鮗「、眈ク莢ャッ -ォハ、醯「`C-u ;'ホ隕ヒ universal-argument -トアニュシ。ケウ -ネヒ韭「ッゥェヒ、眈ク莢ヒウネャヌュ゙ケ」゙ソ「ウホヒノホ隕 -ハヨヌートュ篆ヒコヤキソォエ「シオ、」 +File: yatexj, Node: Greek letter completion, Next: Inserting parens, Prev: Image completion, Up: Completion + +ギリシャ文字補完 +================ + + もう一つ、数式環境中で`:'を押すとギリシャ文字入力モードに入ります。 +`:'を押した直後に`a'を押すと`\alpha'が、`g' を押すと `\gamma'が、など +アルファベットに対応したギリシャ文字が挿入されます。操作方法は;の数式 +記号補完とまったく同じです。まずは`:'の直後にTABを押してどのアルファベッ +トにどのギリシャ文字が対応しているか調べてみてください。 + + `;'と`:'を数式環境中で押しているにもかかわらず、イメージ補完が働かな +い場合は、`C-u ;'のように universal-argument をつけてキーを押すことに +より、強制的にイメージ補完に入ることができます。また、この時にどのよう +な状態で数式環境内判定に失敗したかをご連絡下さい。 + + + +File: yatexj, Node: Inserting parens, Prev: Greek letter completion, Up: Completion + +括弧入力補助 +============ + + 3種類ある括弧 () {} [] の開き括弧を入れたときに閉じ括弧を自動的に入 +れます。`\' の直後にの `[' を入れると行を分けてインデントを揃え、数式 +入力に備えます。その他 LaTeX のマクロに応じて括弧の釣合の取れた状態に +導きます。開き括弧そのものを1つだけ入れたいときは `C-q' でクォート入力 +するか、`[prefix] w m' で修正モードをOFFにしてください。 + + 領域選択してから開き括弧を入れるとその領域をその種類の括弧で括ります。 File: yatexj, Node: Local dictionary, Next: Commenting out, Prev: Completion, Up: Top -シォュ -************************ - - 莢マムホ蔆ー猥ュォ鮨ョオニ、゙ケ」トマ -`yatex.el'ヒネ゚゙ソヨク牆ラ「筥トマ貍カャトヘェヒム -ケヴノンクケヨ貍カュラ「スキニ筥メネトマ「ヌ」ッネヌ -ポュハヴノンクケヨシォュラヌケ」 - - 莢マヒキキ、アソ醉「スホアノホュヒォケ、ニ -鞐ケ」 +ローカル辞書 +************ + + 補完入力用の候補は三種類の辞書から構成されています。一つは`yatex.el' +に組み込まれた「標準辞書」、もう一つはユーザが個人的に常用するコマンド +を保存する「ユーザ辞書」、そしてもうひとつはあるディレクトリでのみ有効 +なコマンドを保存する「ローカル辞書」です。 + + 補完入力時に新しい単語を入れた場合に、その単語をどの辞書に入れるか聞 +いて来ます。 `foo' is not in table. Register into: U)serDic L)ocalDic N)one D)iscard -ネ、ヲララネヒミキ「`u'ネィネヨ貍カュラ「`l'ネィ -ネシォュケキキ「`n'ネィネュユ。、マケキサコス゚ホEmacs -サテキ銛ポュハアネキ「`d'ネィネキソハアリャサコヒホニ -ウネヒバケ」 - - 箙「シォュホ。スマ、鮗「エニ貍カュホケキポヌ隍ネタヲ -醉マ`~/.emacs'ハノヌ「 +というプロンプトに対し、`u'と答えると「ユーザ辞書」を、`l'と答えるとロー +カル辞書を更新し、`n'と答えると辞書ファイルは更新せず現在のEmacsセッショ +ンのみ有効な単語とし、`d'と答えると新たな単語を学習せずに捨てることに +なります。 + + もし、ローカル辞書の機能はいらず、全てユーザ辞書の更新のみでよいと言 +う場合には`~/.emacs'などで、 (setq YaTeX-nervous nil) -ネキニシオ、」 +として下さい。 File: yatexj, Node: Commenting out, Next: Cursor jump, Prev: Local dictionary, Up: Top -ウ碯ネ「ヲネ -**************************** - - - LaTeXホヤクヒマヤャトュ簧ヌケ」「ャ酩ウ碯ネ「ヲネ -キソ瑤ウ碯ネーキソキソ、ウネャ「゙ケ」 +コメントアウト +************** + + + LaTeXの編集には試行錯誤がつきものです。ある部分を一括でコメントアウ +トしたり、コメントを外したりしたいことがあります。 `[prefix] >' - ... ク銛 % ヌウ碯ネ「ヲネ + ... リジョンを % でコメントアウト `[prefix] <' - ... ク銛ホ % ホウ碯ネーケ - -マ「「鬮ク矚キソク銛ヒミキニホ瑁「 + ... リジョンの % のコメントを外す + +は、あらかじめ設定したリジョンに対しての操作、 `[prefix] .' - ... ス゚ホム魏鰈ウ碯ネ「ヲネ + ... 現在のパラグラフをコメントアウト `[prefix] ,' - ... ス゚ホム魏鰈ホウ碯ネーケ - -マ「ォシスホフヨケム魏鰈エホヒミキニホ瑁ヌケ」ハェ「ウウヌ、ヲ -ヨム魏鰈ラマ (`mark-paragraph') -リヒ韭゙シッオママリキ -゙ケ(ク珀ヌ`ESC -h'ヒミ、ノオニ、)」ハェ「ヒ`%'ヌウ -ネ「ヲネオニ、ム魏鰈ヒミキニォヨキム魏鰈ホウ碯ネネムキ -ソ醫ーマンレギサホヌ跫ユッタオ、」 - - オニ「クマヒミキニタアヌハッ「ヒマ`\begin', -`\end' ォホヒミ -キニ箋碯ネ「ヲネホ瑁キソ、ネュャ「゙ケ」ウホ隕ハネュマ「 -`\begin{}' 「、マ `\end{}' -ホヤヒォシス鉐サ「 + ... 現在のパラグラフのコメントを外す + +は、カーソルの位置するパラグラフ全体に対しての操作です。なお、ここでい +う「パラグラフ」は (`mark-paragraph') 関数によりマークされる範囲を指し +ます(標準設定で`ESC h'にバインドされている)。なお、既に`%'でコメントア +ウトされているパラグラフに対して繰り返しパラグラフのコメントを使用した +場合の動作は保証しませんので御注意ください。 + + さて、文章に対してだけでなく、時には`\begin', `\end' 自体に対 +してもコメントアウトの操作をしたいときがあります。このようなときは、 +`\begin{}' あるいは `\end{}' の行にカーソルを合わせ、 `[prefix] >' - ... `\begin{}'チ`\end{}' - エニウ碯ネ「ヲネ + ... `\begin{}'〜`\end{}' 全てコメントアウト `[prefix] <' - ... `\begin{}'チ`\end{}' - エニウ碯ネーケ - -ネケウネヌ「`\beginチ\end'ヌマ゙トュエニヒミキニウ碯ネ瑁キ「 + ... `\begin{}'〜`\end{}' 全てコメントを外す + +とすることで、`\begin〜\end'で囲まれる環境全てに対してコメント操作し、 `[prefix] .' - ... `\begin{}' ネ `\end{}' ウ碯ネ「ヲネ + ... `\begin{}' と `\end{}' をコメントアウト `[prefix] ,' - ... `\begin{}' ネ `\end{}' ホウ碯ネーケ - -マ「ミケ `\begin' ネ `\end' -2ヤタア「ウ碯ネ瑁ホミンネ -ギケ」ク銛ウ碯ネ「ヲネキ隕ネキニ「゙シッ゚キソホチヒォシス -ワーキ`[preifx] >' 。キニ筬シスャ -`\begin{}' ホ衢「 -ネ`\begin{}'チ`\end{}'箴ノヌウ碯ネ。スャッ、ニギヲホ -ヌユキニシオ、」 + ... `\begin{}' と `\end{}' のコメントを外す + +は、対応する `\begin' と `\end' 2行だけを、コメント操作の対象とします。 +リジョンをコメントアウトしようとして、マークを設定したのちにカーソルを +移動し`[preifx] >' を押してもカーソルが `\begin{}' の上にあると +`\begin{}'〜`\end{}'モードでコメント機能が働いてしまうので注意して下さ +い。 File: yatexj, Node: Cursor jump, Next: Modifying/Deleting, Prev: Commenting out, Up: Top -ォシスク胚ラ -******************************** +カーソルジャンプ +**************** * Menu: -* ミェヨクァッネリホク胚ラ:: -* ェィチュトシッー:: -* 皃ユ。、リホク胚ラ:: -* トュアフネキソク胚ラ:: -* ヌ衾莢フヨリホク胚ラ:: +* 対応オブジェクトへのジャンプ:: +* お絵描きツール起動:: +* メインファイルへのジャンプ:: +* 環境を単位としたジャンプ:: +* 最後の補完位置へのジャンプ:: -File: yatexj, Node: ミェヨクァッネリホク胚ラ, Next: ェィチュトシッー, Prev: Cursor jump, Up: Cursor jump - -ミェヨクァッネリホク胚ラ -======================================================== - - ク賽、、ハヌ +File: yatexj, Node: 対応オブジェクトへのジャンプ, Next: お絵描きツール起動, Prev: Cursor jump, Up: Cursor jump + +対応オブジェクトへのジャンプ +============================ + + 文書中のいろいろな場所で `[prefix] g' - ... ミケェヨクァッネヒク胚ラ - -。ケウネヒ韭「ォシスフヨホLaTeXヴノヒミケヒク胚ラ -ギケ」ミリクャク゚ケネ盞ヴノヒマハシホ簧ャ「゙ケ」 - - * `\begin{}' ォェ `\end{}' - * `%#BEGIN' ォェ `%#END' - * 顰ユ。、ホ韭゚゙ッ ェ ミケviewer/ェィォュトシッー - * `\label{}' ォェ `\ref{}' - * `\include(\input)' ェ ミケユ。、 - * `\bibitem{}' ォェ `\cite{}' - - `\begin{}' ォ `\end{}' ホヤヌ`[prefix] -g'。ケウネヒ -韭「ミケ`end/begin'ホヤヒク胚ラギケ」簔ミケ簧ャ -ハ、醯ィ鮠ヒバケ」゙ソウマ「ホ霽ホソ睾 -`%#BEGIN' ネ `%#END' -ホレ「ヒミキニ箜ヘヒーギケ」ハェ「`label/ref' -`cite/bibitem'ミケ簧ャフユ。、ヒ「マ「ク胚ラ霾ハユ。 -、ャェシラオニ、ハアミバサ」*Note -%#notation::. 皃ホ .tex ユ。、ホ -`\include{chap1}' ハノヒォシス鉐サ「 -`[prefix] g' 。ケネ「`chap1.tex' -ヒク胚ラギケ」 - -゙ソ「 + ... 対応するオブジェクトにジャンプ + +を押すことにより、カーソル位置のLaTeXコマンドに対応する場所にジャンプ +します。対応関係が存在すると解釈されるコマンドには以下のものがあります。 + + * `\begin{}' ←→ `\end{}' + * `%#BEGIN' ←→ `%#END' + * 画像ファイルの取り込みマクロ → 対応するviewer/お絵かきツール起動 + * `\label{}' ←→ `\ref{}' + * `\include(\input)' → 対応するファイル + * `\bibitem{}' ←→ `\cite{}' + + `\begin{}' か `\end{}' の行で`[prefix] g'を押すことに +より、対応する`end/begin'の行にジャンプします。もちろん対応するものが +ない場合はエラーになります。またこれは、領域固定のための `%#BEGIN' と +`%#END' のペアに対しても同様に動作します。なお、`label/ref'や +`cite/bibitem'対応するものが別ファイルにある時は、ジャンプ先となるファ +イルがオープンされていなければなりません。*Note %#notation::. +メインの .tex ファイルの `\include{chap1}' などにカーソルを合わせ、 +`[prefix] g' を押すと、`chap1.tex' にジャンプします。 + +また、 `[prefix] 4 g' - ... フヲ」ノヲヌミェヨクァッネヒク胚ラ - -。ケネ「ミケェヨクァッネリホク胚ラフヲ」ノヲヌヤ、゙ケ」ソタキ「 -ウホ。スマ `begin/end', `%#BEGIN/%#END' -ヨホク胚ラヒミキニマ -(ユ」ャハ、ネラホヌ)。スキハ、ホヌユキニッタオ、」 + ... 別ウィンドウで対応オブジェクトにジャンプ + +を押すと、対応するオブジェクトへのジャンプを別ウィンドウで行います。た +だし、この機能は `begin/end', `%#BEGIN/%#END' 間のジャンプに対しては +(意味がないと思われるので)機能しないので注意してください。 -File: yatexj, Node: ェィチュトシッー, Next: 皃ユ。、リホク胚ラ, Prev: ミェヨクァッネリホク胚ラ, Up: Cursor jump - -ェィチュトシッー -==================================== - -蟄ホヨ顰ユ。、ホ韭゚゙ッラネマ「罟ミ -`\epsfile{file=foo}' -ホ隕バィ韭゚ヴノホウネヌ「ウホヤヒ -ォシス鉐サニ`[prefix] -g'。ケネスホ顰ユ。、ホオネハテソユ。 -、ミケェィチュトシッーキニェシラギケ」ッーケトシホス -マハシホ隕ヒハオ゙ケ」 - - 1. ォネヤャム `YaTeX-processed-file-regexp-alist' - ヒチオ - ニ、オャススホ、コォネ゙テチキソ鬚ユ。、セヒケャ - \\(\\)ォ魘ュミキニミィニェッ(ソヨワホ\\(\\)ォマムホニケネホ - cdr ヒ - ニェッ)」゙テチキハアミソ箙ハ、」 - 2. ヤヒ「ム `YaTeX-file-processor-alist' - ヒミソオニ、ヴノャ - ヨ%ヴノラ - ホ隕ヒ、ニ「ミッゥェヒヨヴノ - ユ。、セ.ネ・メラ ッー」 - 3. ハアミ「ム `YaTeX-file-processor-alist' - ホニケネホcdrヒテニ - 、ネ・メヨユ。、セラホ褊ヒュキソユ。、ャク゚ケォ遑エルニ「ク - ゚キソ軣arヒテニ、ヴノッーケ」 - 4. ハ衙ォビテチキハアミ「ュ鱆」 - - -ム `YaTeX-file-processor-alist' ネム -`YaTeX-file-processor-alist' -ポ。ヒト、ニマスセホムヒト、 -ニ describe-variable -キニ簑ノヌシオ、」ヺッ゚ケネ「顰ユ。、 -ヒォョ鮗「、ユホチーホユ。、、ユホラサテオヌケヴノハ -アヒニモミケウネャヌュ゙ケ」 +File: yatexj, Node: お絵描きツール起動, Next: メインファイルへのジャンプ, Prev: 対応オブジェクトへのジャンプ, Up: Cursor jump + +お絵描きツール起動 +================== + +上記の「画像ファイルの取り込みマクロ」とは、例えば +`\epsfile{file=foo}' のような挿絵取り込みコマンドのことで、この行にカー +ソルを合わせて`[prefix] g'を押すとその画像ファイルの元となったファイル +を対応するお絵描きツールを起動してオープンします。起動するツールの判定 +は以下のようになされます。 + + 1. カレント行が変数 `YaTeX-processed-file-regexp-alist' に定義されて + いる正規表現のいずれかとマッチしたら、ファイル名に相当する部分を + \\(\\)から抜き出して覚えておく(何番目の\\(\\)かは変数の各リストの + cdr 部に入れておく)。マッチしなければ何もしない。 + 2. 行末に、変数 `YaTeX-file-processor-alist' に登録されているコマン + ドが「%コマンド」 のように書いてあれば強制的に「コマンド ファイル + 名.拡張子」を起動。 + 3. なければ、変数 `YaTeX-file-processor-alist' の各リストのcdr部に入っ + ている拡張子を「ファイル名」の後ろに足したファイルが存在するか順 + 次調べて、存在した場合car部に入っているコマンドを起動する。 + 4. 以上どれかにマッチしなければあきらめる。 + + +変数 `YaTeX-file-processor-alist' と変数 `YaTeX-file-processor-alist' +の設定方法についてはそれぞれの変数について describe-variable して説明 +を読んで下さい。うまく設定すると、画像ファイルにかぎらず、任意の形式の +ファイルを任意のプロセッサで処理するコマンドを簡単に呼び出すことができ +ます。 -File: yatexj, Node: 皃ユ。、リホク胚ラ, Next: トュアフネキソク胚ラ, Prev: ェィチュトシッー, Up: Cursor jump - -皃ユ。、リホク胚ラ -==================================================== - -`chap1.tex'ホ隕ハオヨユ。、ヌ「 +File: yatexj, Node: メインファイルへのジャンプ, Next: 環境を単位としたジャンプ, Prev: お絵描きツール起動, Up: Cursor jump + +メインファイルへのジャンプ +========================== + +`chap1.tex'のようなサブファイルで、 `[prefix] ^' - ... 皃ユ。、ヒク胚ラ + ... メインファイルにジャンプ `[prefix] 4 ^' - ... フヲ」ノヲヌ皃ユ。、ヒク胚ラ - -。ケネ「皃ユ。、ホヤクミテユ。ヒレリィ゙ケ」箙「皃ユ。、 -ェシラキニ、ハ、醯「ォネヌ」ッネォ魴キニォーェヒェシラキ -゙ケ」 + ... 別ウィンドウでメインファイルにジャンプ + +を押すと、メインファイルの編集バッファに切替えます。もし、メインファイ +ルをオープンしていない場合は、カレントディレクトリから探して自動的にオー +プンします。 -File: yatexj, Node: トュアフネキソク胚ラ, Next: ヌ衾莢フヨリホク胚ラ, Prev: 皃ユ。、リホク胚ラ, Up: Cursor jump - -トュアフネキソク胚ラ -================================================ - -オ鰺ス゚ホトュアフネキニ。スケヴノヒハシホ簧ャ「゙ケ」 +File: yatexj, Node: 環境を単位としたジャンプ, Next: 最後の補完位置へのジャンプ, Prev: メインファイルへのジャンプ, Up: Cursor jump + +環境を単位としたジャンプ +======================== + +さらに現在の環境を単位として機能するコマンドに以下のものがあります。 `M-C-a' - ... トュホ隰(`\begin')リク胚ラ + ... 環境の先頭(`\begin')へジャンプ `M-C-e' - ... トュホ(`\end')リク胚ラ + ... 環境の末尾(`\end')へジャンプ `M-C-@' - ... トュエボシッ - -蟄ホヴノマフホ`[prefix]'ュシヌマハッ`META'ュシラユ」ッ -ケネキニ。スケホヌエユシオ、」 + ... 環境全体をマーク + +上記のコマンドは通常の`[prefix]'キーではなく`META'キーをプリフィクスと +して機能するのでご注意下さい。 -File: yatexj, Node: ヌ衾莢フヨリホク胚ラ, Prev: トュアフネキソク胚ラ, Up: Cursor jump - -ヌ衾莢フヨリホク胚ラ -==================================================== - -サマ莢マキソフヨヒクケソ -`3'ヒンクキニ、゙ケ」 -マモ貮。ソハユ。、ホ。ソハフヨヒヤテソネキニ笋 -`C-x j -3'(`jump-to-register')ネテニセチヒヌ衾莢マフヨヒ -ウネャヌュ゙ケ」 +File: yatexj, Node: 最後の補完位置へのジャンプ, Prev: 環境を単位としたジャンプ, Up: Cursor jump + +最後の補完位置へのジャンプ +========================== + +野鳥は補完入力した位置を常にレジスタ `3'に保存しています。入力途中で如 +何なるファイルの如何なる位置に行ったとしても、`C-x j +3'(`jump-to-register')を使って直ちに最後の補完入力位置に戻ることができ +ます。 File: yatexj, Node: Modifying/Deleting, Next: Filling, Prev: Cursor jump, Up: Top -ムケ/ -***************** - - ヒマオニ、 LaTeX -ヴノホムケ/ホソ睛ハシホ。スャムユ -オニ、゙ケ」 +変更/削除 +********* + + 既に入力されている LaTeX コマンドの変更/削除のために以下の機能が用意 +されています。 `[prefix] c' - ... ォシスフヨホ LaTeX - ヴノホムケ + ... カーソル位置の LaTeX コマンドの変更 `[prefix] k' - ... ォシスフヨホ LaTeX - ヴノホ - - -ウ鯰ヴノマ「ヴノッーケヒ霤ニー韭ケホヌユキ -ニシオ、」 + ... カーソル位置の LaTeX コマンドの削除 + + +これらのコマンドは、コマンドを起動する場所によって動作を決定するので注 +意して下さい。 * Menu: -* Changing LaTeX command:: LaTeX ヴノホムケ -* Killing LaTeX command:: LaTeX ヴノホ +* Changing LaTeX command:: LaTeX コマンドの変更 +* Killing LaTeX command:: LaTeX コマンドの削除 File: yatexj, Node: Changing LaTeX command, Next: Killing LaTeX command, Prev: Modifying/Deleting, Up: Modifying/Deleting -LaTeX ヴノホムケ -================================== - -ムケキソ、 LaTeX -ヴノヒォシス鉐サニ `[prefix] c' -。ケネスホヴノ莢マハノム、ニレヒムィウネャヌュ゙ケ」 -`[prefix] c' -ヌムケヌュヴノヒマハシホ簧ャ「゙ケ」 - - * `begin/end' ホトュセ - * sectionソヴノホヴノセ - * sectionソヴノホ - * sectionソヴノホェラキ銛ム鱆シソ([]ヌマ゙ソ簧) - * largeソヴノ - * (、眈ク莢ヌマトスハ)ー箴ノムホmaketitleソヴノ - - ムィソ、sectionソヴノホャオ鰺 -LaTeX ヴノ゙瑟醯「 -スホマ琥醂ホ衂 `[prefix] c' -。ケウネヌ賽ヴノムケ -ミンスォ鵈ーケウネャヌュ゙ケ」 +LaTeX コマンドの変更 +==================== + +変更したい LaTeX コマンドにカーソルを合わせて `[prefix] c' +を押すとそのコマンドを補完入力などを用いて手軽に変えることができます。 +`[prefix] c' で変更できるコマンドには以下のものがあります。 + + * `begin/end' の環境名 + * section型コマンドのコマンド名 + * section型コマンドの引数 + * section型コマンドのオプションパラメータ([]で囲まれたもの) + * large型コマンド + * (イメージ補完で入力可能な)数式モード専用のmaketitle型コマンド + + 変えたいsection型コマンドの引数がさらに LaTeX コマンドを含む場合は、 +その引数を囲む中括弧の上で `[prefix] c' を押すことで中のコマンドを変更 +対象判定から除外することができます。 File: yatexj, Node: Killing LaTeX command, Prev: Changing LaTeX command, Up: Modifying/Deleting -LaTeX ヴノホ -================================== - -`[prefix] k' マッーケフヨヒ韭 -。ホ隕ハーヤ、゙ケ」 - - - ッーフヨ ー - \begin, \endホヤ `\begin\end'レ「ホ - %#BEGIN, %#END ホヤ %#BEGIN,%#ENDレ「ホ - sectionソヴノホ() sectionソヴノホ - ユゥネリ醂ホ ユゥネリホ - 醂ホ ミハケ醂ホ - - -`\begin, \end' ェ勒 `%#BEGIN, %#END' -ケ遒 `\begin, \end' `%#BEGIN, %#END' -ホク゚ケヤマ -゙エネオホヌ「ス鯰ヤヒ -`\begin' ハノトハ蠅ヘニ -ォハ、隕ヒユキニッタオ、」 -蟄ホ簧マケルニワクマヲヨニラケ隕ヒッュ゙ケャ「 -universal-argument (`C-u') ヌテソ衂`[prefix] -k'ソ、ラケネ「 -スセホヨニラビ゙ヨ貶ラ粮、ヒギケ」ハシホ胄イヘヒキ -ニシオ、」 - - オホニュケネ: [prefix] k C-u [prefix] k - ワク\footnote{モ}ヌケ」 ワクモヌケ」 ワクヌケ」 - ャ(ォシスフヨ) +LaTeX コマンドの削除 +==================== + +`[prefix] k' は起動する位置により次のような動作を行います。 + + + 起動位置 動作 + \begin, \endの行 `\begin\end'ペアの削除 + %#BEGIN, %#END の行 %#BEGIN,%#ENDペアの削除 + section型コマンドの上(中) section型コマンドの削除 + フォント指定括弧の上 フォント指定の削除 + 括弧の上 対をなす括弧の削除 + + +`\begin, \end' および `%#BEGIN, %#END' を削除する場合、`\begin, \end' +や `%#BEGIN, %#END' の存在する行はまるごと削除されるので、それらの一行 +に `\begin' などを二つ以上連ねて書かないように注意してください。上記の +ものはすべて本文を囲う「容器」を削除するように働きますが、 +universal-argument (`C-u') を打った後で`[prefix] k'をタイプすると、そ +れぞれの「容器」に含まれる「中身」も一気に削除します。以下の例を参考に +して下さい。 + + 元のテキスト: [prefix] k C-u [prefix] k + 本文\footnote{脚注}です。 本文脚注です。 本文です。 + ↑(カーソル位置) File: yatexj, Node: Filling, Next: Includeonly, Prev: Modifying/Deleting, Up: Top -蟾ィ -************ - - -itemホ蟾ィ -==================== - - itemize -トュ賤「`\item'ホ玳(クマ)ャ」ヤヒマ醉「 -ワホ隰蟾ィキソ、醉マ「 +桁揃え +****** + + +itemの桁揃え +============ + + itemize 環境中にある`\item'の項目(文章)が複数行に渡る場合に、項目の +先頭を桁揃えしたい場合には、 `M-q' - ... 蟾ィ - -ヒ霤ニ「スホ item -ホ、ヌネホシオヒクニ fill -オ゙ケ」ハェ「ナ、 NTT jTeX -ネムキニ、醉マ「Lisp -ム`NTT-jTeX'`t'ヒサテ ネキニシオ、」 - - ウホネュ「ム`YaTeX-item-regexp'ホヘ(ク猊マ -`"\\\\item"') -玳リヴノホオャススネキニ。ヒネムギケ」itemize -トュヌ「ネォホウ -゙ノチキニ玳キニ、(罟ミ`\underlineitem')マ「 -`~/.emacs' ヌ。ホ隕ヒリキニシオ、」 + ... 桁揃え + +によって、その item のインデントの深さに応じて fill されます。なお、古 +いNTT jTeX を使用している場合には、Lisp 変数`NTT-jTeX'を`t'にセットし +て下さい。 + + このとき、変数`YaTeX-item-regexp'の値(標準では `"\\\\item"')を +項目指定コマンドの正規表現として検索に使用します。itemize 環境で、独自のコ +マンドを定義して項目を列挙している場合(例えば`\underlineitem')は、 +`~/.emacs' で次のように指定して下さい。 (setq YaTeX-item-regexp "\\(\\\\\\(sub\\)*item\\)\\|\\(\\\\underlineitem\\)") -ウホムホリホナャ隸ャォ鯡、醯「ネォホ玳ヴノホセー -``"\item"'ヌマ゙簧ヒキニシオ、(罟ミ"\itembf"')」 - -サホ `M-q' ヌマ `\item' -トュヒクニハシホ隕ヒヨマー、 -ヌネラギケ」 - - itemize, enumerateトュ: - >\item[ロイロイ] ムヌマ「テヒユ」ホハ、ア `foo' ヌ「鴆ギ - > ケャ「ウホワヌネ筅ィアャヨロイロイラ - > ヌケ」 - descriptionトュ: - > \item[リリ] ヨロイロイラヌソ鱆ャアネキニネテソヒ「 - > 2ホヌソ鱆ハアネキニヨリリラャネウネャソ - > 、隕ヌケ」 - - -ム魏鰈ホ蟾ィ -==================================== - - itemizeトュハーヌホム魏鰈ホ蟾ィ(fill)マ「ワェヒセホ箴ノネアク -隕ヒ。スギケャ「verbatimトュ茲tabularトュハノ蟾ィケネ盒ハ -キヒハ隕ハトュ貮マ。スギサ」゙ソ「\verb -ヌ酖ニ「簧マ霍ニ -ヤャ莊゙サ(ム `YaTeX-verb-regexp' -ヌゥ) )」オ鰺「ェヒ -、ヌネホシオムィニ「ユヌマ「スホ、ヌネホ隰ヌ`M-q'。 -ケウネヒ韭 fill-prefix -、チ、チムケキハッニ蟾ィャヌュ゙ケ」 +この変数の指定の仕方がよく分からない場合は、独自の項目列挙コマンドの名前を +``"\item"'で始まるものにして下さい(例えば"\itembf"')。 + +野鳥の `M-q' では `\item' を環境に応じて以下のように「ハングインデント」 +します。 + + itemize, enumerate環境: + >\item[ほげほげ] 英語では、特に意味のない単語を `foo' であらわしま + > すが、これの日本語版ともいえる単語が「ほげほげ」 + > です。 + description環境: + > \item[へろへろ] 「ほげほげ」をでたらめが単語として使った時に、第 + > 2のでたらめな単語として「へろへろ」が使われることが多 + > いようです。 + + +パラグラフの桁揃え +================== + + itemize環境以外でのパラグラフの桁揃え(fill)は、基本的に他のモードと +同じように機能しますが、verbatim環境や、tabular環境など桁揃えをすると +悲惨な状況になるような環境中では機能しません。また、\verb で括ってある +ものは決して行分割されません(変数 `YaTeX-verb-regexp' で制御) )。さら +に、一時的にインデントの深さを変えてある箇所では、そのインデントの先頭 +で`M-q'を押すことにより fill-prefix をいちいち変更しなくて桁揃えができ +ます。 File: yatexj, Node: Includeonly, Next: What column, Prev: Filling, Up: Top -。ヒincludeonly -*********************** - - ユ。、ャ莵ニクママキニ、ヒマ「皃ユ。、賤 - - \includeonly{ス゚ヤク賽ユ。、セ} - -ホ隕ヒ、ニェッウネヌ「ソ、ラサテネホヨ碯ヌュ゙ケャ「チ酖ネセホ -ユ。、セキキソ、ヒマ - - \includeonly{チ酖ネセキキソ、ユ。、セ} - - -ネュセオハアミハ鮗ヨャォォ゙ケ」サヌマス゚ヤクキニ、ユ。、 -セャ皃ユ。、ホ`\includeonly'ヒハ、醉マォーェヒウ。ミキ「 -。ホリィトョ゙ケ」 +勝手にincludeonly +***************** + + ファイルを分割して文章を入力している時には、メインファイル中に + + \includeonly{現在編集中のファイル名} + +のように書いておくことで、タイプセットの時間を節約できますが、ちょっと +他のファイルを手直ししたい時には + + \includeonly{ちょっと手直ししたいファイル名} + + +と書き直さなければならず手間がかかります。野鳥では現在編集しているファ +イル名がメインファイルの`\includeonly'にない場合には自動的にこれを検出 +し、次の指示を仰ぎます。 A)dd R)eplace %)comment? -ス゚ヤク賽ユ。、 `\includeonly' -ホケネヒティソ、ヒマ`a' -「ス゚ヤク賽ユ。、タア -`\includeonly' ヒキソ、マ`r'「 `\includeonly' -ホヤウ碯ネ「ヲネキニオスキソ、ヒマ「`%' -スセ。キニシオ、」 +現在編集中のファイルを `\includeonly' のリストに加えたい時には`a'を、 +現在編集中のファイルだけを `\includeonly' にしたい時は`r'を、 +`\includeonly' の行をコメントアウトして無効化したい時には、`%'をそれぞ +れ押して下さい。 File: yatexj, Node: What column, Next: Intelligent newline, Prev: Includeonly, Up: Top -ウウマノウ? -********************* - - 玳ホソ、 tabular -ハノソッオ、ニ、ネシホホヤヌ「、゙、ニ -、螫ノウヒミケホォォ鯡ッハテニギヲウネャ「゙ケ」罟ミ「ハ -シホ隕ハ tabular ヒェ、ニ「 +ここはどこ? +*********** + + 項目数の多い tabular などをたくさん書いていると下の方の行で、いま書 +いている桁がどこに対応するのかわからなくなってしまうことがあります。例 +えば、以下のような tabular において、 \begin{tabular}{|c|c|c|c|c|c|c|c|}\hline - 眄&ー&ゥ&サ&ナテ&FAX&「ハ&「ハ霰テ\\ \hline - 褫コ & 6 & 223 & 」ヘヤチフ顰ネ & xxx-yyy & - zzz-www & ネャ & 9876-54321 \\ - ネョホ & 2 & \multicolumn{2}{c|}{オィハ、} + 氏名&所属&〒&住所&電話&FAX&帰省先&帰省先電話\\ \hline + 矢上二郎 & 6 & 223 & 横浜市港北区日吉 & xxx-yyy & + zzz-www & トンガ & 9876-54321 \\ + 日吉小僧 & 2 & \multicolumn{2}{c|}{教えない} &&&(???) \\ \hline \end{tabular} -(???)ホャャノホ玳ハホォケーヒスヌケホマキ、ヌキ遖」ウハマ「 +(???)の部分がどの項目なのかすぐに判断するのは難しいでしょう。こんな時 +は、 `[prefix] &' - ... ス゚ホォ鰲スィ - -。ケネォシスフヨホォ鰲ャノホ玳ヒコケォ゚ヒミテユ。ヒスィギ -ケ」tabular/arrayトュホ1ヤワ玳セホツモネ゚ハキニミケ簧オギ -ケ」箙玳セネキニフホ簧スィキニ゚キ、醯「ヤャ`%'ヒキニタ -゚シホ玳ツモテニェッネノ、ヌキ遖」 + ... 現在のカラム表示 + +を押すとカーソル位置のカラムがどの項目に該当するかをミニバッファに表示 +します。tabular/array環境の第1行目を項目名の並びとみなして対応するもの +を探します。もし項目名として別のものを表示して欲しい場合は、行頭を`%' +にしてダミーの項目並びを作っておくと良いでしょう。 File: yatexj, Node: Intelligent newline, Next: Usepackage cheker, Prev: What column, Up: Top -ェ゙ォサヤ -************************ - - tabular[*], array, itemize, enumerate, tabbing -トュbeginソ莢ヌマキ -ソ「゙ソマニトュ簓 +おまかせ改行 +************ + + tabular[*], array, itemize, enumerate, tabbing 環境をbegin型補完で入 +力した時、または各環境内で `ESC RET' - ... ェ゙ォサヤ - - -。ケネ「スホトュヒクソヤィネ。ホヤビギケ(beginソ莢ヒォ -ー゙オソィネャヤラハ醯 undo -ヒ霤ニテヌュ゙ケ)」罟ミ「 -tabularトュヌマ「スホトュホォ鰲ヒミキソトホ -`&' ヒティ「ヤ ホ `\\' -゙ケ」ウホスハーヒ `\hline' -ャ「ミス籃ア -ティ゙ケ」トュネスヒクニォーマケ簧ホミマハシホ隕ヒバケ」 + ... おまかせ改行 + + +を押すと、その環境に応じた行エントリを次の行に挿入します(begin型補完時 +に自動挿入されたエントリが不要な場合は undo によって消去できます)。例 +えば、tabular環境では、その環境のカラム数に対応した個数の `&' に加え、 +行末の `\\' を入れます。この時それ以前に `\hline' があればそれも付け加 +えます。環境とそれに応じて自動入力するものの対応は以下のようになります。 * `tabular', `tabular*', `array' - ォ鰲-1 タアホ `&' ネ - `\\'」ャラヒクニ `\hline' + カラム数-1 だけの `&' と `\\'。必要に応じて `\hline' * `tabbing' - ヤワヌチキニ、 `\=' - ネアクトホ `\>'」 + 一行目で定義している `\=' と同じ個数の `\>'。 * `itemize', `enumerate', `description', `list' - `\item' ゙ソマ `item[]' - - tabular -トュホ耒隕ヒ「ワ。スマニトュホヤワホ簇イヘヒキニーケ -ホヌ「ハルッヤワパヌニモミケ隕ヒキニッタオ、」 - - 箙「スホセホトュ「罟ミ -`foo'「ヒミキニ`ェ゙ォサヤ'ー -オサソ、マ「`YaTeX-intelligent-newline-foo' -ネ、ヲセーホリチ -ギケ」チキソリマ「ス゚ホヤヒヤ゙キソセ衾ヤャホフヨヌニミ゙ -ケ」リ `YaTeX-indent-line' -ニヨネス゚ホトュホヘケネヒクソシオヒ -、ヌネオホヌ「ウニヌォ鯀ォ゙ケ隕ハウシノッネ -、ヌキ遖」`yatexenv.el'簧リ -`YaTeX-intelligent-newline-itemize' -ホチハノイヘヒキニッタオ、」 + `\item' または `item[]' + + tabular 環境の例のように、本機能は各環境の一行目の内容を参考にして動 +作するので、なるべく二行目以降で呼び出すようにしてください。 + + もし、その他の環境、例えば `foo'、に対して`おまかせ改行'を動作 +させたい時は、`YaTeX-intelligent-newline-foo' という名前の関数を定義 +します。定義した関数は、現在の行に改行を挿入した直後の行頭の位置で呼ばれま +す。関数 `YaTeX-indent-line' を呼ぶと現在の環境のネストに応じた深さに +インデントされるので、これを呼んでから何かを挿入するようなコードを書くとよ +いでしょう。`yatexenv.el'内の関数 +`YaTeX-intelligent-newline-itemize' の定義などを参考にしてください。 File: yatexj, Node: Usepackage cheker, Next: Changing mode of YaTeX, Prev: Intelligent newline, Up: Top -頤黏sepackage -********************** - - beginソ「sectionソ「maketitleソ「、コォホLaTeX2e゙ッ莢マケネ「 -スボッホムヒームテアシクャラネケ遒スホムテアシク -ワク貮 `\usepackage{}' -キニ、ォノヲォエコキ「箙キニ、ハアミ -ラ瑤ヨヒミケムテアシクヒキソ -`\usepackage' ク (ホァ衢)゙ギケ」 - - ソタキウホ。スャッッソ睛マ「ムテアシクセネスホ貮チオニ、゙ッ -イalistホチーヌム `YaTeX-package-alist-private' -ピキニェッャ ラャ「゙ケ」 +先回りusepackage +**************** + + begin型、section型、maketitle型、いずれかのLaTeX2eマクロを補完入力す +ると、そのマクロの利用に外部パッケージを必要とする場合、そのパッケージ +を本文中で `\usepackage{}' しているかどうかを調査し、もししていなけれ +ばプリアンブルに対応するパッケージを引数にした `\usepackage' 文を(確認 +後に)挿入します。 + + ただしこの機能が働くためには、パッケージ名とその中で定義されているマ +クロ群をalistの形式で変数 `YaTeX-package-alist-private' に設定しておく +必要があります。 File: yatexj, Node: Changing mode of YaTeX, Next: Online help, Prev: Usepackage cheker, Up: Top -サホー箴ノレリィ -************************************************ +野鳥の動作モード切り替え +************************ `[prefix] w' - ... サー箴ノレリィ睛蠑 - -ヌサォネホー韭ケハシホ箴ノレリィ゙ケ」 - - * 、オ箴ノ - * サー箴ノ - -、オ箴ノマ「ォュ醂マホウネシキ「、オ箴ノONホマォュ -醂ホママォュ醂ポホマヒハ瑤、オ箴ノOFFホマォュ醂ホマタ -アヌトク醂゙ヌマギケ」ヌユゥネ(ッー)ポマ*OFF*ヌケ」 - - サー箴ノマ「ム `YaTeX-auto-math-mode' ャ -`nil' ホホ -゚ュヌ「ウホネュ`;'臍:'。キソ(*Note -Image completion::イネ)ヒ「 -ノホ隕ハ、眈ク莢。スオサォ「フホュシネキニ。スオサォーヌ -レリィ゙ケ」ォースャル、゙キヌマ`YaTeX-auto-math-mode' -`nil'ヒサテネキ「サー箴ノーヌレリィネノ、ヌキ遖」 + ... 野鳥動作モード切り替えメニュー + +で野鳥自身の動作を決定する以下のモードを切り替えます。 + + * 修正モード + * 野鳥数式モード + +修正モードは、開き括弧入力時の処理をコントロールし、修正モードONの時は +開き括弧の入力は開き括弧のみの入力になり、修正モードOFFの時は開き括弧 +の入力だけで閉じ括弧まで入力します。デフォルト(起動時)の設定は*OFF*で +す。 + + 野鳥数式モードは、変数 `YaTeX-auto-math-mode' が `nil' の時の +み有効で、このとき`;'や`:'を押した時(*Note Image completion::参照)に、 +どのようなイメージ補完を機能させるか、通常のキーとして機能させるかを手動で +切り替えます。自動判定が遅いマシンでは`YaTeX-auto-math-mode' +`nil'にセットし、野鳥数式モードを手動で切り替えると良いでしょう。 File: yatexj, Node: Online help, Next: Inclusion hierarchy browser, Prev: Changing mode of YaTeX, Up: Top -ェ鬢リラ -******************************** - - ネェヲネケ LaTeX -ヴノホム。ャ隸ャォ鯡、マ「ェ鬢リ -ラメュ゙キ遖」リラヒリケュシヒマハシホ簧ャ「゙ケ」 +オンラインヘルプ +**************** + + 使おうとする LaTeX コマンドの用法がよく分からない時は、オンラインヘ +ルプをひきましょう。ヘルプに関するキーには以下のものがあります。 `[prefix] ?' - ... ェ鬢リラ + ... オンラインヘルプ `[prefix] /' - ... ェ鬢apropos - - -ェ鬢リラ -================================ - - ヨェ鬢リララマ「フェハ LaTeX -ヴノ(ヌユゥネヌォシス -フヨホヴノ)ヒミケ簑ルホミテユ。ヒスィギケ」ウホイネオリ -ラムユ。、ヒマヨーシミリララネヨラ鬢ルシネリララホ牀「 -瑤ーヤマ LaTeX -ホク犁゙ノホ醋簧ホ簑゙獨。、ヌ「ム -`YaTeX-help-file'ホヘヌリオ゙ケ」ウホユ。、マフヲホ(ヌ -ユゥネヌ`$EMACSEXECPATH')ヒヨォ「ッ筮スホ簇ケキヌュ隕ヒ -エヒュ゚「ャソィ鴈ルュ簧ヌケ」袂マ「ク珞キッマトヘェバ -ッチヒリケ簑ャォニ、ユ。、ヌ「ム -`YaTeX-help-file-private'ホヘヌリオ゙ケ」ウチ鰕貍カホロシ猊」 -ッネホシハノヒヨォ゙ケ」 - - -ェ鬢apropos -=========================== - - ヨェ鬢aproposラマ GNU Emacs ホ apropos -ネアヘ「貍カャリキソュシ -シノ簑クビ珥ワケルニルホミテユ。ヒスィギケ」 - - 箙「エル隕ネキソLaTeXヴノヒミケ簑ャリラユ。、賤ォト -ォ鯡ォテソ醯「簑クホマ矣ニッホヌ「トスヌ「ミイヘハノ -エルニスホヴノホ簑マキニッタオ、」箙「ハヒォク爼ハヴノヒ -ミケ簑、ソハ鰔シメ葯ヌスホ簑ェシオ、」。ホロロビ -ソ、ネラ、゙ケ」 + ... オンラインapropos + + +オンラインヘルプ +================ + + 「オンラインヘルプ」は、一般的な LaTeX コマンド(デフォルトでカーソル +位置のコマンド)に対する説明を隣のバッファに表示します。この時参照され +るヘルプ用ファイルには「グローバルヘルプ」と「プライベートヘルプ」の二 +種類があり、前者は LaTeX の標準コマンドの主なものの説明を含むファイル +で、変数`YaTeX-help-file'の値で指定されます。このファイルは通常公共の +場所(デフォルトで`$EMACSEXECPATH')に置かれ、誰もがその内容を更新できる +ように全員に書き込み権が与えられるべきものです。後者は、非標準もしくは +個人的なマクロ定義に関する説明が書かれているファイルで、変数 +`YaTeX-help-file-private'の値で指定されます。こちらはユーザのホームディ +レクトリの下などに置かれます。 + + +オンラインapropos +================= + + 「オンラインapropos」は GNU Emacs の apropos と同様、ユーザが指定し +たキーワードを説明文に含む項目すべてを隣のバッファに表示します。 + + もし、調べようとしたLaTeXコマンドに対する説明がヘルプファイル中に見 +つからなかった場合は、説明文の入力を求めてくるので、可能であれば参考書 +などを調べてそのコマンドの説明を入力してください。もし、なにか標準的な +コマンドに対する説明を書いたならばぜひ私までその説明をお送り下さい。次 +回の配布に含めたいと思います。 File: yatexj, Node: Inclusion hierarchy browser, Next: Cooperation with other packages, Prev: Online help, Up: Top -、ッシノス、ヨ鬥カ -************************************************ - -」ホユ。、ヒャ莵ニ、ノュ裔ネ、ニ、遒 +インクルード構造ブラウザ +************************ + +複数のファイルに分割しているドキュメントを書いている場合、 `[prefix] d' - ... 、ッシノス、ヨ鬥コ - -。ケネ「スホノュ裔ネホニユ。、ケ、ニ鞐ケ」ウウヌエニホユ。、 -ホニネハユ。、(ヌユゥネャィオニ、ホヌ銖マRETポ)マケネ -、ッシノキニ、エニホユ。、マキ「、ッシノキミェヒスィ -ギケ」ウホミテユ。ヌマハシホュシ瑁ャュヌケ」 + ... インクルード構造ブラウズ + +を押すと、そのドキュメントの親ファイルを聞いて来ます。ここで全てのファ +イルの親となるファイル(デフォルトが示されているので大抵はRETのみ)を入 +力するとインクルードしている全てのファイルを解析し、インクルード状況を +視覚的に表示します。このバッファでは以下のキー操作が有効です。 `n' - ... 。ホヤヒワーキミケユ。、ルホミテユ。ヒスィ + ... 次の行に移動し対応するファイルを隣のバッファに表示 `p' - ... 衾ヤヒワーキミケユ。、ルホミテユ。ヒスィ + ... 上の行に移動し対応するファイルを隣のバッファに表示 `N' - ... アク、ッシノルホ。ホユ。、ヒワー + ... 同じインクルードレベルの次のファイルに移動 `P' - ... アク、ッシノルホーホユ。、ヒワー + ... 同じインクルードレベルの前のファイルに移動 `j' - ... 。ホヤヒワー + ... 次の行に移動 `k' - ... 衾ヤヒワー + ... 上の行に移動 `u' - ... 衄ヒ「ソユ。、ヒワー + ... 一代親にあたるファイルに移動 `.' - ... ォシスフヨホユ。、ルホミテユ。ヒスィ + ... カーソル位置のファイルを隣のバッファに表示 `SPC' - ... ルホミテユ。ホミユ。、ケッシ「テラ + ... 隣のバッファの対応ファイルをスクロールアップ `DEL, b' - ... ルホミテユ。ホミユ。、ケッシタヲ + ... 隣のバッファの対応ファイルをスクロールダウン `<' - ... ルホミテユ。ホミユ。、ホ隰スィ + ... 隣のバッファの対応ファイルの先頭を表示 `>' - ... ルホミテユ。ホミユ。、ホスィ + ... 隣のバッファの対応ファイルの末尾を表示 `'' - ... (`<'臍>'ホ衂)オホスィフヨヒ硴 + ... (`<'や`>'の後で)元の表示位置に戻る `RET, g' - ... ォシスフヨホユ。、ルホミテユ。ヌェシラ + ... カーソル位置のファイルを隣のバッファでオープン `mouse-2' - ... RETネアク(ヲ」ノヲネムポ) + ... RETと同じ(ウィンドウ使用時のみ) `o' - ... ルホヲ」ノヲヒワー + ... 隣のウィンドウに移動 `1' - ... セホヲ」ノヲテケ + ... 他のウィンドウを消す `-' - ... ヨ鬥コヲ」ノヲョオッケ + ... ブラウズウィンドウを小さくする `+' - ... ヨ鬥コヲ」ノヲ遲ッケ + ... ブラウズウィンドウを大きくする `?' - ... リラスィ + ... ヘルプ表示 `q' - ... スィーホヨヒ硴 - - ソタキ「ルホヲ」ノヲホユ。、ホ簇スィケ。スヒリキニマ「ミケ -ユ。、ッシコキニギヲネヺッッュ゙サホヌエユッタオ、」 + ... 表示前の状態に戻る + + ただし、隣のウィンドウのファイルの内容を表示する機能に関しては、対応 +するファイルをクローズしてしまうとうまく働きませんのでご注意ください。 File: yatexj, Node: Cooperation with other packages, Next: Customizations, Prev: Inclusion hierarchy browser, Up: Top -セムテアシクネホ「ネ -**************************************** +他パッケージとの連携 +******************** gmhist ====== - `gmhist.el'ネ`gmhist-mh.el' -シノキニ、遒ラ蠑ウ -゙ノホマ(`[prefix] -tp]')「ヴノホマ(`[prefix] tl')ホ -ヒネゥキソメケネムヌュ゙ケ」スセホララネヌ「`M-p' -。 -ケネセーヒムキソヴノクッヨキニモミケウネャヌュ゙ケ」 + `gmhist.el'と`gmhist-mh.el' をロードしている場合、プレヴューコマンド +の入力(`[prefix] tp]')、印刷コマンドの入力(`[prefix] tl')の時に独立し +たヒストリを利用できます。それぞれのプロンプトで、`M-p' を押すと直前に +利用したコマンド文字列をくり返し呼び出すことができます。 min-out ======= - `min-out.el' (`outline-minor-mode') -ネサネ゚鉐サニネヲウ -ネ粐チトスヌケ」゚ホ。ヒリキニマ`yatexm-o.el'エッタオ、」 + `min-out.el' (`outline-minor-mode') と野鳥を組み合わせて使うこともも +ちろん可能です。設定の方法に関しては`yatexm-o.el'をご覧ください。 File: yatexj, Node: Customizations, Next: Etc, Prev: Cooperation with other packages, Up: Top -ォケゾ、コ -************************ - - サホーゥ貉ケホムネォピケウネヒ韭「莢 -マッーケュシ「オ、ムィソ瑤トュセホ莢蔗オ鰺シツオ -サウネハノャヌュ゙ケ」 +カスタマイズ +************ + + 野鳥の動作を制御する種々の変数を独自に設定することにより、補完入力を +起動するキーアサインを変えたり、環境名の補完候補をさらに充実させること +などができます。 * Menu: -* Lisp variables:: lisp ム -* Add-in functions:: ユテリ(「ノ、リ) +* Lisp variables:: lisp 変数 +* Add-in functions:: 付加関数(アドイン関数) File: yatexj, Node: Lisp variables, Next: Add-in functions, Prev: Customizations, Up: Customizations -lisp ム -============= - - 罟ミ prefix ュシ `C-c' -ハーホュシヒキソ、醯「 `YaTeX-prefix'ヒ -prefix -ュシヒキソ、キワチキニッタオ、」オ -ヒ「ヨ`C-c -ム'ラネ、ヲュシミ、ノマネォホリャ蓐ニニ「ホヌネ -、ソッハ、」ウホ隕ハマ「`YaTeX-inhibit-prefix-letter' - `t' ピケウネヒ韭「`C-c -ムト'ホミ、ノャエニ「ミケ`C-c -C-ムト'ヒム゙ケ(ソタキ「beginソ -largeソ莢ホ邵ッーヒ齏ク -リマトスバ゙ヌケ」ウ箏ヒキソ、醯`t'ヌマハッ -1 ヒサテ ネキニシオ、」)」 +lisp 変数 +========= + + 例えば prefix キーを `C-c' 以外のキーにしたい場合は、`YaTeX-prefix' +に prefix キーにしたいシンボルを定義してください。さらに、「`C-c 英字'」 +というキーバインドは独自の関数が割り当ててあるので使いたくない。このよ +うな時は、`YaTeX-inhibit-prefix-letter' を `t' に設定することにより、 +`C-c 英字…'のバインドが全て、対応する`C-c C-英字…'に変わります(ただ +し、begin型 large型補完の大文字起動によるリジョン指定は可能なままです。 +これも無効にしたい場合は`t'ではなく 1 にセットして下さい。)。 * Menu: -* All customizable variables:: ォケゾ、コム -* Sample definitions:: ォケゾ、コム゚ -* Hook variables:: hookム -* Hook file:: hookムユ。、 +* All customizable variables:: カスタマイズ変数一覧 +* Sample definitions:: カスタマイズ変数設定例 +* Hook variables:: hook変数 +* Hook file:: hook用ファイル File: yatexj, Node: All customizable variables, Next: Sample definitions, Prev: Lisp variables, Up: Lisp variables -ォケゾ、コム ----------------------------------------- - - yatex-mode -ヒェア。ホムャォケゾ、コトスヌケ」`~/.emacs' -ヌ `setq' -キニェアミ「スチ鯰チャ・襍゙ケ」醂ホ賺ヌユゥネヘ -ヌケ」ツンヒムホヘムケケ醯 -`M-x describe-variable' ヌ -ムホワルハ簑イネキニッタオ、」 +カスタマイズ変数一覧 +-------------------- + + yatex-mode における次の変数がカスタマイズ可能です。`~/.emacs' で +`setq' しておけば、そちらの定義が優先されます。括弧の中はデフォルト値 +です。実際に変数の値を変更する場合は `M-x describe-variable' で変数の +詳細な説明を参照してください。 -- Variable: YaTeX-prefix - yatex-mode 賽ラユ」ッケュシ (`\C-c') + yatex-mode 中のプリフィクスキー (`\C-c') -- Variable: YaTeX-inhibit-prefix-letter - prefix ュシホセ衾ュシミ、ノヌ - `ム' ホ簧 `C-ム' ヒムケ (`nil') + prefix キーの直後のキーバインドで `英字' のものを `C-英字' に変更 + (`nil') -- Variable: YaTeX-fill-prefix - ワクッホヤャビケワャュケハチ - fill-prefix (`""(nil)') + 本文を書く時の行頭に挿入する接頭辞すなわち fill-prefix + (`""(nil)') -- Variable: YaTeX-user-completion-table - リャキソLaTeXヴノンクユ。、セ - (`"~/.yatexrc"') + 学習したLaTeXコマンド保存ファイル名 (`"~/.yatexrc"') -- Variable: YaTeX-kanji-code - クョケホチウシノ - nil=クホウシノボ゙ 0=no-conversion 1=Shift JIS, - 2=JIS, 3=EUC, 4=UTF-8 (2 (MS-DOSヌマ1)) + 文書を作成する時の漢字コードnil=既存のコードのまま + 0=no-conversion 1=Shift JIS, 2=JIS, 3=EUC, 4=UTF-8 (2 (MS-DOSでは + 1)) -- Variable: tex-command - LaTeXソ、ラサテソヴノセ (`"platex"') + LaTeXタイプセッタコマンド名 (`"platex"') -- Variable: dvi2-command - ラ蠑「ヴノセ (`"xdvi -geo +0+0 -s - 4"') + プレヴューアコマンド名 (`"xdvi -geo +0+0 -s 4"') -- Variable: dviprint-command-format - dviユ。、ホヒネヴノー - (`"dvi2ps %f %t %s | lpr"') + dviファイルの印刷に使われるコマンド式 (`"dvi2ps %f %t %s | lpr"') -- Variable: dviprint-from-format - 衾`%f'ヒケォマレシクリー「`%b' - ャォマレシクヨ賤ム (`"-f %b"') + 上の`%f'に相当する開始ページ指定書式、`%b' が開始ページ番号に変わ + る (`"-f %b"') -- Variable: dviprint-to-format - `%t' - ヒケェサレシクリー「`%e'ャェサレシクヨ賤ム + `%t' に相当する終了ページ指定書式、`%e'が終了ページ番号に変わる (`"-t %e"') -- Variable: makeindex-command - makeindexヴノ (`"makeindex"' (MS-DOSヌマ`"makeind"')) + makeindexコマンド (`"makeindex"' (MS-DOSでは`"makeind"')) -- Variable: YaTeX-dvipdf-command - dviPDFヒムケケヴノ (`"dvipdfmx"') + dviをPDFに変換するコマンド (`"dvipdfmx"') + + -- Variable: YaTeX-on-the-fly-preview-interval + `[prefix] t e'で環境即時previewをする場合の変換処理までの + 無操作時間(秒) (0.9) + `nil' の場合は即時プレヴューをしない。 + + -- Variable: YaTeX-on-the-fly-math-preview-engine + `[prefix] t e'で数式環境を即時previewする時に用いるエンジン + (latex-math-previewが利用可能なときは + latex-math-preview-expression を呼ぶ + `'YaTeX-typeset-environment-by-lmp'そうでないときは内蔵関数を呼ぶ + `'YaTeX-typeset-environment-by-builtin') -- Variable: YaTeX-cmd-gimp - GIMPッーケヴノ (code{"gimp"}) + GIMPを起動するコマンド (code{"gimp"}) -- Variable: YaTeX-cmd-tgif - tgifッーケヴノ (code{"tgif"}) + tgifを起動するコマンド (code{"tgif"}) -- Variable: YaTeX-cmd-inkscape - Inkscapeッーケヴノ (code{"inkscape"}) + Inkscapeを起動するコマンド (code{"inkscape"}) -- Variable: YaTeX-cmd-dia - Diaッーケヴノ (code{"dia"}) + Diaを起動するコマンド (code{"dia"}) -- Variable: YaTeX-cmd-ooo - OpenOffice.org゙ソマLibreOfficeッーケヴノ + OpenOffice.orgまたはLibreOfficeを起動するコマンド (code{"soffice"}) -- Variable: YaTeX-cmd-gs - Ghostscriptッーケヴノ (code{"gs"}) + Ghostscriptを起動するコマンド (code{"gs"}) -- Variable: YaTeX-cmd-dvips - dvipsッーケヴノ(トュヒ霤ニマpdvipsハノ) - (code{"dvips"}) + dvipsを起動するコマンド(環境によってはpdvipsなど) (code{"dvips"}) -- Variable: YaTeX-cmd-displayline - displaylineッーケヴノ + displaylineを起動するコマンド (code{"/Applications/Skim.app/Contents/SharedSupport/displayline"}) -- Variable: YaTeX-cmd-edit-ps - PostScriptユ。、ヤクケヴノ - (ムcode{"YaTeX-cmd-gimp"}ホヘ) + PostScriptファイルを編集するコマンド (変数code{"YaTeX-cmd-gimp"} + の値) -- Variable: YaTeX-cmd-edit-pdf - PDFユ。、ヤクケヴノ - (ムcode{"YaTeX-cmd-ooo"}ホヘ) + PDFファイルを編集するコマンド (変数code{"YaTeX-cmd-ooo"}の値) -- Variable: YaTeX-cmd-edit-ai - .aiユ。、ヤクケヴノ (ムcode{"YaTeX-cmd-inkscape"}ホヘ) + .aiファイルを編集するコマンド (変数code{"YaTeX-cmd-inkscape"}の値) -- Variable: YaTeX-cmd-edit-svg - SVGユ。、ヤクケヴノ - (ムcode{"YaTeX-cmd-inkscape"}ホヘ) + SVGファイルを編集するコマンド (変数code{"YaTeX-cmd-inkscape"}の値) -- Variable: YaTeX-cmd-edit-images - スホセ顰ユ。、ヤクケヴノ - (ムcode{"YaTeX-cmd-gimp"}ホヘ) + その他画像ファイルを編集するコマンド (変数code{"YaTeX-cmd-gimp"} + の値) -- Variable: YaTeX-need-nonstop - `\nonstopmode{}'ォーェヒユテケォ (`nil') + `\nonstopmode{}'を自動的に付加するか (`nil') -- Variable: latex-warning-regexp - latexヴノホミマケヲゥシヒーヤホオャスス - (`"line.* [0-9]*"') + latexコマンドの出力するウォーニング行の正規表現 (`"line.* + [0-9]*"') -- Variable: latex-error-regexp - アクッィ鮠ヤホオャスス - (`"l\\.[1-9][0-9]*"') + 同じくエラー行の正規表現 (`"l\\.[1-9][0-9]*"') -- Variable: latex-dos-emergency-message - MS-DOS衂ーケ latex - ヴノャ「ィ鮠ヒ韭葹ケネュミマケ眦 - サシク (`"Emergency stop"') + MS-DOS上で動作する latex コマンドが、エラーにより停止するとき出力 + するメッセージ (`"Emergency stop"') -- Variable: latex-message-kanji-code - ソ、ラサテソホミマケ眦サシクホチウシノ.ソ、ラサテネミテユ。 - ホミマャスアマ「ウ゚ケ - (2, Nemacsヌポュ) + タイプセッタの出力するメッセージの漢字コード.タイプセットバッファ + の出力が化ける時は、これを設定する (2, Nemacsでのみ有効) -- Variable: NTT-jTeX - ナ、NTT-jTeXネムホ隕ヒ、ヌネキソヤホ隰ネーホヤホ - (ソ、ラサテネ衾)ヨャ、ニギヲホヲ醯`t'ヒケ - (`nil') + 古いNTT-jTeX使用時のようにインデントした行の先頭と前の行の(タイプ + セット後の)字間が空いてしまうのを嫌う場合は`t'にする(`nil') -- Variable: YaTeX-item-regexp - itemホ蟾ィホヒム、「itemホオャスス - (`"\\\\(sub\\)*item"') + itemの桁揃えの時に用いる、itemの正規表現 (`"\\\\(sub\\)*item"') -- Variable: YaTeX-verb-regexp - verbヴノホオャスス」隰ホ\\\\マトアハ、 + verbコマンドの正規表現。先頭の\\\\はつけない (`"verb\\*?\\|path"') -- Variable: YaTeX-nervous - シォュム、 `t' (`t') + ローカル辞書を用いる時 `t' (`t') -- Variable: YaTeX-sectioning-regexp - サッキ銛靺゚ヴノホオャスス + セクション区切り設定コマンドの正規表現 (`"\\(part\\|chapter\\*?\\|\\(sub\\)*\\(section\\|paragraph\\)\\*?\\)\\b"') -- Variable: YaTeX-fill-inhibit-environments - fill ゙゚ケトュセホケネ (`'("tabular" - "tabular*" "array" "picture" "eqnarray" "eqnarray*" "equation" "math" - "displaymath" "verbatim" "verbatim*")') + fill を抑止する環境名のリスト (`'("tabular" "tabular*" "array" + "picture" "eqnarray" "eqnarray*" "equation" "math" "displaymath" + "verbatim" "verbatim*")') -- Variable: YaTeX-uncomment-once - ホ鑾ncommentヌヤャホ」ホ`%'エニケォ - (`nil') + 領域uncommentで行頭の複数の`%'を全て削除するか (`nil') -- Variable: YaTeX-close-paren-always - ォュ醂ホマヌヒトク醂マケ - (`t') + 開き括弧の入力で常に閉じ括弧を入力する (`t') -- Variable: YaTeX-auto-math-mode - ー箴ノホレリィォーェヒヤヲ - (`t') + 数式モードの切り替えを自動的に行う (`t') -- Variable: YaTeX-math-key-list-private - ー、眈ク莢ヌム、 - (ラユ」ッケュシ . ミ莢ニシヨ) - ホ alist - (`nil')」莢ニシヨホュヒト、ニマ`yatexmth.el'イネ」 + 数式イメージ補完で用いる (プリフィクスキー . 対応補完テーブル) の + alist (`nil')。補完テーブルの書き方については`yatexmth.el'を参照。 -- Variable: YaTeX-default-pop-window-height - 1靂ホヒソ、ラサテネミテユ。鱆ニョケホ箏」ヘヌヤ「 - クヌEmacsヲ」ノヲヒミケエャィ - (10) + 1画面の時にタイプセットバッファを初めて作成する時の高さ。数値で行 + 数、数字文字列でEmacsウィンドウに対する百分率 (10) -- Variable: YaTeX-help-file - ヲムリラユ。、 - (`$doc-directory/../../site-lisp/YATEXHLP.jp') + 共用ヘルプファイル (`$doc-directory/../../site-lisp/YATEXHLP.jp') -- Variable: YaTeX-help-file-private - トヘムリラユ。、 (`"~/YATEXHLP.jp"') + 個人用ヘルプファイル (`"~/YATEXHLP.jp"') -- Variable: YaTeX-no-begend-shortcut - `[prefix] b ??' - ホキ郛ネォテネネコ「`[prefix] b' - タアヌ莢 マヒ (`nil') + `[prefix] b ??' のショートカットを使わず、`[prefix] b' だけで補完 + 入力に入る (`nil') -- Variable: YaTeX-hilit-pattern-adjustment-private - オャススネスビテチケ簧ホタェユ」キワヌ「鴆キソ簧ホ - ケネトホケネ」hilit19 - ネ゚ヌ、ポュ」 - ワキッマ `(assq 'yatex-mode hilit-patterns-alist)' - キソフネ「ム - `YaTeX-hilit-pattern-adjustment-default' ホヘ(ネ - ヒ霤ニマ hilit19 - ホノュ裔ネ)イネサ陬 + 正規表現とそれにマッチするものの論理的意味をシンボルであらわした + もののリスト…のリスト。hilit19 を組み込んでいる時のみ有効。詳し + くは `(assq 'yatex-mode hilit-patterns-alist)' した結果と、変数 + `YaTeX-hilit-pattern-adjustment-default' の値(と場合によっては + hilit19 のドキュメント)を参照せよ。 -- Variable: YaTeX-sectioning-level - LaTeXホサッキ銛アフタヴノネスホタェ箏ホalist」 + LaTeXのセクション単位宣言コマンドとその論理的高さのalist。 -- Variable: YaTeX-hierarchy-ignore-heading-regexp - Hierarchy - ミテユ。マフユ。、リテタネキニ「LaTeXホサッキ銛タヴ - ノホ。キ「スャハアミウ碯ネヤオケャ「スホンヒリテタネキニマ - ユ」ソハ、ムソシウホムピケ」ヌユゥネヌマ - RCS リテタネ箴 ノリヤ(-*- xxx - -*-)ャ゚オニ、」 + Hierarchy バッファは通常ファイルヘッダとして、LaTeXのセクション宣 + 言コマンドの引数を検索し、それがなければコメント行を探すが、その + 際にヘッダとしては意味を持たないパターンをこの変数に設定する。デ + フォルトでは RCS ヘッダとモード指定行(-*- xxx -*-)が設定されてい + る。 -- Variable: YaTeX-skip-default-reader - Non-nil - ピケネsectionソヴノホマ「「ノ、リャハアミ - ゚ヒミテユ。ヌホノ゚゚サコヒマーサオサ - (`nil') + Non-nil に設定するとsection型コマンドの引数入力時、アドイン関数が + なければミニバッファでの読み込みをせずに入力を完了させる (`nil') -- Variable: YaTeX-create-file-prefix-g - `\include'ハノヌ `prefix - g'キソヒ「ク胚ラ隰ク゚キハ、ユ。、 - ヌ「テニ筱シラケ (`nil') + `\include'などで `prefix g'した時に、ジャンプ先が存在しないファイ + ルであってもオープンする (`nil') -- Variable: YaTeX-simple-messages - ニ莢ホ眦サシクミマハヌスケ - (`nil') + 各種補完時のメッセージ出力を簡素化する (`nil') -- Variable: YaTeX-hilit-sectioning-face - ァユアャュハホ `\part' ホァ - (`'(yellow/dodgerblue yellow/slateblue)')」 - ケネホ韲ラヌマ `hilit-background-mode' ャ - `'light' ホホ「 頤ラヌマ `'dark' ホホ - `\chapter' ホァヌ「クァ/リハァ ホ - ヲヒリケ」 + 色付けが有効な時の `\part' の色 (`'(yellow/dodgerblue + yellow/slateblue)')。リストの第一要素は `hilit-background-mode' + が `'light' の時の、第二要素は `'dark' の時の `\chapter' の色で、 + 文字色/背景色 のように指定する。 -- Variable: YaTeX-hilit-sectioning-attenuation-rate - ァユアャュハホ「`\subparagraph' ホァ - `\chapter' ホサルホソ - %ッキソ簧ヒケォ (`'(15 40)') - `YaTeX-hilit-sectioning-face' ホ犂ネ」 + 色付けが有効な時の、`\subparagraph' の色を `\chapter' の濃度の何% + 薄くしたものにするか (`'(15 40)') `YaTeX-hilit-sectioning-face'の + 項参照。 -- Variable: YaTeX-use-AMS-LaTeX - AMS-LaTeX ネムケ醯 `t' ピケ - (`nil') + AMS-LaTeX を使用する場合は `t' に設定する (`nil') -- Variable: YaTeX-use-LaTeX2e - LaTeX2e ネムケ醯 `t' ピケ - (`t') + LaTeX2e を使用する場合は `t' に設定する (`t') -- Variable: YaTeX-template-file - キャユ。、ョヒォー゙ケユ。、セ + 新規ファイル作成時に自動挿入するファイル名 (`~/work/template.tex') -- Variable: YaTeX-search-file-from-top-directory - inputケユ。、オケネュホ猊」ッネmainユ。、ホ「ヌ」ッネ - ヒケォ (`t') + inputするファイルを探すときの基準ディレクトリをmainファイルのある + ディレクトリにするか (`t') -- Variable: YaTeX-use-font-lock - スシケホァナアムテアシクネキニ - font-lock ムケォノヲォ (`(featurep - 'font-lock)') + ソースの色づけパッケージとして font-lock を利用するかどうか + (`(featurep 'font-lock)') -- Variable: YaTeX-use-hilit19 - スシケホァナアムテアシクネキニ hilit19 - ムケォノヲォ (`(featurep 'hilit19)') + ソースの色づけパッケージとして hilit19 を利用するかどうか + (`(featurep 'hilit19)') -- Variable: YaTeX-use-italic-bold - italic, boldユゥネサャオケォノヲォ - (Emacs20パハ饒t') - font-lockムポュ」 (`(featurep 'hilit19)' + italic, boldフォントを野鳥が探すかどうか (Emacs20以降なら`t') + font-lock利用時のみ有効。(`(featurep 'hilit19)' -- Variable: YaTeX-singlecmd-suffix - エニホmaketitleソヴノホ莢マセ衢゙ケク」 - `"{}"' ハノャェォ皀 + 全てのmaketitle型コマンドの補完入力直後に挿入する文字列。 + `"{}"' などがお勧め。 -- Variable: YaTeX-package-alist-private - LaTeX2eホムテアシクセネスホ賤゙゙゙ッホケネ」 - ャレピキニェッネワクマビッ莢マケネ - スボッヒャラハムテアシク - usepackage - ケォォーェヒ。コキニッ」 - キニ、ハアミ \usepackage - ォーノテケウネ簓ュ」 - ケネマ '((ムテアシクセ1 (莢ソ、ラ - ゙ッホケネトト) (莢ソ、ラ - ゙ッホケネトト)) (ムテアシクセ2 - (莢ソ、ラ ゙ッホケネトト) - (莢ソ、ラ - ゙ッホケネトト))トトト) - ネ、ヲチーヒケ」莢ソ、ラマ `env, - section, maketitle' ホノォ」 ホ耘ム - `YaTeX-package-alist-default' ホヘイネ」 + LaTeX2eのパッケージ名とその中に含まれるマクロのリスト。適切に設定 + しておくと本文入力時にマクロを補完入力するとそのマクロに必要なパッ + ケージを usepackage するか自動的に検査してくれる。していなければ + \usepackage を自動追加することもできる。リストは'((パッケージ名1 + (補完タイプ マクロのリスト……) (補完タイプ マクロのリスト……)) + (パッケージ名2 (補完タイプ マクロのリスト……) (補完タイプ マクロ + のリスト……))………)という形式にする。補完タイプは `env, + section, maketitle' のどれか。具体例は変数 + `YaTeX-package-alist-default'の値参照。 -- Variable: YaTeX-tabular-indentation - tabular/array - トュヌス゚ヤホ隰フヨャスホ鎭ォ鰲ホネュマ - ク爨ヌネフヨォ - N*YaTeX-tabular-indentation 蠑イソ - 、ヌネヒケ」 + tabular/array 環境で現在行の先頭位置が表の第Nカラムのときは標準イ + ンデント位置から N*YaTeX-tabular-indentation 桁下げたインデントに + する。 -- Variable: YaTeX-noindent-env-regexp - フホトュ簍「テニ \begin{} - ャヤャォ鰕゙ルュトュセホオャスス」 - verbatimトュハノリケ」 + 別の環境内にあっても \begin{} が行頭から始まるべき環境名の正規表 + 現。verbatim環境などを指定する。 + + -- Variable: YaTeX-electric-indent-mode + Emacs 24.4 で導入された改行時の、自動インデントをどうするか。 + この値がそのまま electric-indent-local-mode に渡される。 + -1でoff。 -- Variable: YaTeX-ref-default-label-string - \ref{} - ホ鰮莢ヌ鰮、゚ホ簧ヒォーェヒクョケ - 鰮セホー」strftime(3)リヒソユルシケヌリケ」 - ムヌューマハシホネェ凜 %y -> - セシ, %b -> ホムセ, %m -> (1チ12) %d - -> , %H -> , %M -> ャ, %S -> テ, %qx -> - 「ユ。ルテネヌ26ハスキソ yymmdd. %qX - -> 「ユ。ルテネヌ26ハスキソ HHMMSS. - ヌユゥネマ "%H%M%S_%d%b%y" + \ref{} のラベル補完でラベル未設定のものに自動的に生成するラベル名 + の書式。strftime(3)関数に似た日付ベースで指定する。利用できる書式 + は以下のとおり。%y -> 西暦下二桁, %b -> 月の英名, %m -> 月(1〜12) + %d -> 日, %H -> 時, %M -> 分, %S -> 秒, %qx -> アルファベットで26 + 進数化した yymmdd. %qX -> アルファベットで26進数化した + HHMMSS. デフォルトは "%H%M%S_%d%b%y" -- Variable: YaTeX-ref-generate-label-function - \ref{}ホ鰮セォークョホネュヒネヲリホキワ」 - ヌユゥネマク猥 YaTeX::ref-generate-label - リャ蓐ニニ「」 - 2ト齏リチキニ「ウホムヒサテネケネスホリニタ - フヌユゥネホ鰮セ菠ケ」゚: + \ref{}のラベル名自動生成のときに使う関数のシンボル。デフォルトは + 標準の YaTeX::ref-generate-label 関数が割り当ててある。引数を2つ + 取る関数を定義して、この変数にセットするとその関数を呼んだ結果を + デフォルトのラベル名候補とする。設定例: (setq YaTeX-ref-generate-label-function 'my-yatex-generate-label) (defun my-yatex-generate-label (command value) (and (string= command "caption") @@ -2142,346 +1990,331 @@ File: yatexj, Node: Sample definitions, Next: Hook variables, Prev: All customizable variables, Up: Lisp variables -ォケゾ、コム゚ --------------------------------------------- - - ソネィミ「prefix -ュシネキニ`ESC'ネムキ「キソハ莢蔗ハシケユ。 -、「`~/src/emacs/yatexrc' ヒキ「ヤャホ prefix -ソヨクトヒム ィソ、ネュマ「 +カスタマイズ変数設定例 +---------------------- + + たとえば、prefix キーとして`ESC'を使用し、新たな補完候補を格納するファ +イルを、`~/src/emacs/yatexrc' にし、行頭の prefix をタブ文字一つに変え +たいときは、 (setq YaTeX-prefix "\e" YaTeX-user-completion-table "~/src/emacs/yatexrc" YaTeX-fill-prefix " ") - `~/.emacs' ヒティ゙ケ」 +を `~/.emacs' に加えます。 File: yatexj, Node: Hook variables, Next: Hook file, Prev: Sample definitions, Up: Lisp variables -hookム ------------- - - ゙ソ「hook ム `yatex-mode-hook', `yatex-mode-load-hook' -ム ユキニ、゙ケ」ケルニホ yatex-mode -ホミテユ。ヌムオサソ、簧マ「 -`yatex-mode-hook' ヒュメキ「`yatex.el' -シノケタアムオ -サソ、簧マ`yatex-mode-load-hook' -ヒュメギケ」罟ミ「 `outline-minor-mode' -ムケ遒スセホミテユ。ヌ -`outline-minor-mode' -ュヒキソ、ホヌ「`yatex-mode-hook' 。 -ホ隕ピギケ」 +hook変数 +-------- + + また、hook 変数 `yatex-mode-hook', `yatex-mode-load-hook' を用意して +います。すべての yatex-mode のバッファで作用させたいものは、 +`yatex-mode-hook' に記述し、`yatex.el' をロードする時だけ作用させたい +ものは`yatex-mode-load-hook' に記述します。例えば、 +`outline-minor-mode' を利用する場合、それぞれのバッファで +`outline-minor-mode' を有効にしたいので、`yatex-mode-hook' を次のよう +に設定します。 (setq yatex-mode-hook '(lambda () (outline-minor-mode t))) -ユヒ「ネォホュシチヤ、ソ、ハノマ「`yatex-mode-load-hook' -ム ギケ」罟ミ「begin -ソ莢ヒェ、ニ「 document 茲enumerate -ハーホトュセ -箙郛ネォテネュシヌソ、ハノネ、ヲマ「。ホ隕ヒギケ」ハシホ耘「 -`[prefix] ba' ヌ `\begin{abstract}', `\end{abstract}' -゙ギケ」 +逆に、独自のキー定義を行いたい時などは、`yatex-mode-load-hook' を利用 +します。例えば、begin 型補完において、 document や、enumerate 以外の環 +境名もショートカットキーで入れたいなどという時は、次のようにします。以 +下の例は、`[prefix] ba' で `\begin{abstract}', `\end{abstract}' を挿入 +します。 (setq yatex-mode-load-hook '(lambda() (YaTeX-define-begend-key "ba" "abstract"))) -ハェ「キソハュシホチヒマ「リ -`YaTeX-define-key' -`YaTeX-define-begend-key'ムケ隕ヒキニッタオ、」 +なお、新たなキーの定義には、関数 `YaTeX-define-key' +`YaTeX-define-begend-key'を利用するようにしてください。 File: yatexj, Node: Hook file, Prev: Hook variables, Up: Lisp variables -hookムユ。、 ------------------------- - - ム `yatex-mode-load-hook' -ヌチケ簇ャソ、マ「 -`yatexhks.el'ネ、ヲユ。、瑤スホ賤サリ「ポッヌ「 -鵈スホヒォーェヒシノギケ」 +hook用ファイル +-------------- + + 変数 `yatex-mode-load-hook' で定義する内容が多い時は、`yatexhks.el' +というファイルを作り、その中に野鳥関連の設定を書く事で、初期化の時に自 +動的にロードします。 File: yatexj, Node: Add-in functions, Prev: Lisp variables, Up: Customizations -ユテリ(「ノ、リ) -========================================== - - ニ莢ヒ「トュセ莎゙ノセヒクソュ瞼茘ハ莢マ。スツスケ -ソ睾リョケウネャヌュ゙ケ」ウホリホョ。茲ネ゚゚。ヒ -リキニマ「`yatexadd.doc' エッタオ、」 +付加関数(アドイン関数) +====================== + + 各種補完時に、環境名やコマンド名に応じたきめ細やかな補完入力機能を実 +現するための関数を作成することができます。この関数の作成方法や、組み込 +み方法に関しては、`yatexadd.doc' をご覧ください。 File: yatexj, Node: Etc, Next: Copying, Prev: Customizations, Up: Top -スホセ -************ - - サホク猥 LaTeX -ヴノホュヒマ「ヤャムヒヒネヲ簧キォミソオ -ニ、゙サ」ウマ「莢萢ネ、スヲ簗、ヴノャク゚キニ「莢キソ -、ヴノミゲヌホケネシッ莵ニギヲノ゚ケソ睇ケ」ク -牆ヒハ、ヴノ笋ヌュタア莢マームキ「貍カュシツオ -サウネヌ「「ハソホ LaTeX -ケソ、ヒ「テソサリネ鯏ニ、ッウネヌキ -ヲ」 +その他 +****** + + 野鳥の標準の LaTeX コマンドの辞書には、作者が頻繁に使うものしか登録 +されていません。これは、補完候補に使いそうもないコマンドが存在して、補 +完したいコマンドを出すまでのストローク数を増やしてしまう事を防止するた +めです。標準辞書にないコマンドも、できるだけ補完入力方式を利用し、ユー +ザ辞書を充実させることで、あなたの LaTeX スタイルにあった野鳥へと育っ +ていくことでしょう。 File: yatexj, Node: Copying, Next: Concept Index, Prev: Etc, Up: Top -韭キ、 -**************** - - ワラー鰲マユシスユネヲァ「ヌケ」ワラー鰲ネムキニククソ、ォハ -フヒミキニ粽ヤマユ、鴆ハ、ウネネギケ」セワヒリキニマゥツ、ソ -ギサ」アェヒキテニッタオ、」゙ソ「ワラー鰲ビ゙ウシノム -ケウネ「、ケウネ筬ウヒヤハテニス、゙サャ「ョムケウネヒ韭タ -ホャラャクク遒蔆、ォハタ糴ギサ」ホェヒマGPLリホ -オ、マギサホヌ「GNUヒ」ケ簧テニ、鈕ホハォ鳧 -タウシノョムケネォケォ箙゙サ」、ォハウシノョム糂ンギ -サャタマュ犢゙ケ」 - - 「セ「ミー「カロマゾ、ソギケ」 -「マ yuuji@yatex.org ゙ヌ(2004ッ1ス゚)」 -ムウェヒネムキニッタオマ皃ーケネヨfjサホラヒ -ァテキニッタオ、」テ。ヒト、ニマワムテアシクホ -`docs/qanda' -ユ。、ホヨスホセラホマ踟ッタオ、」 - -ナヘマ「スハッホツヒ(、ャ。霽)ムケオ゙ケ:-p」 - - ュ・コ +取り扱い +******** + + 本プログラムはフリーソフトウェアです。本プログラムを使用して生じたい +かなる結果に対しても作者は責任を負わないこととします。転載等に関しては +制限いたしません。常識的に扱ってください。また、本プログラムに含まれる +コードを利用すること、改造することも自由に行なって構いませんが、流用す +ることにより契約締結の必要が生じる場合、私はいかなる契約も締結しません。 +具体的にはGPLへのサインはしませんので、GNUに寄贈するものを作っている場 +合私の作品から取り込んだコードを流用すると苦労するかもしれません。いか +なるコード流用も拒否しませんが契約締結は辞退します。 + + 苦情、希望、バグ報告、感想等は歓迎いたします。連絡は yuuji@yatex.org +まで(2017年9月現在)。継続的に使用してくださる方はメイリングリスト「fj +野鳥の会」に是非加入してください。加入方法については本パッケージの +`docs/qanda'ファイルの「その他」の章を御覧ください。 + +仕様は、予告なく確実に(気分次第で)変更されます:-p。 + + 広瀬雄二 File: yatexj, Node: Concept Index, Prev: Copying, Up: Top - -******** +索引 +**** * Menu: -* :: Greek letter completion. 4. -* ;: Image completion. 4. -* イ[キッ゙]: Image completion. 4. -* 鉈[ッッ]: Enclose section-type command. 4. -* 鉈[ッッ]: largeソ莢. 25. -* ;ォネ[;キキ]: Image completion. 36. -* [メュケヲ]: 2トハ衾ネ sectionソヴノ. 4. -* ェィチュトシッー[ェィォュトヲュネヲ]: ェィチュトシッー. 4. -* トュホ隰リ[ォュ隕ホサネヲリ]: トュアフネキソク胚ラ. 7. -* トュホリ[ォュ隕ボトメリ]: トュアフネキソク胚ラ. 7. -* トュ゙シッ[ォュ隕゙「ッ]: トュアフネキソク胚ラ. 7. -* 、ク[ェヲユ]: Accent mark completion. 4. -* 躰牾ソ、]: Image completion. 4. -* [莵キ]: Image completion. 4. -* ホトムィ[メュケヲホウケヲォィ]: 2トハ衾ネ sectionソヴノ. 30. -* 「ッサネュ趾ー[「ッサネュウヲロォ]: Accent mark completion. 4. -* ォケゾ、コム[ォケゾ、ケリケヲ、チ鴣]: All customizable variables. 4. -* 莢[ケ、キロォ]: Arbitrary completion. 4. -* トュセホ莢[ォュ隕皃ホロォ]: beginソ莢. 4. -* 貍カュ[讎オキキ鐓: beginソ莢. 77. -* トク硴[ネキウ硴]: beginソ莢. 91. -* ヨテッ[ユトッ]: beginソ莢. 91. -* ィ鮠、オ[ィ鬚キ讎サ、]: Calling typesetter. 4. -* ソ、ラサテソッー[ソ、ユサトソュネヲ]: Calling typesetter. 4. -* ソ、ラサテネィ鮠[ソ、ユサトネィ鬚]: Calling typesetter. 4. -* トュセホムケ[ォュ隕皃ホリウヲ]: Changing LaTeX command. 24. -* 箴ノレリィ[筥ネュォィ]: Changing mode of YaTeX. 4. -* ソ、ラサテソホネ、ャア[ソ、ユサトソホトォ、ア]: Changing typesetter. 13. -* ッーケヴノムィ[ュネヲケヴネォィ]: Changing typesetter. 7. -* ウ碯ネ「ヲネ[ウ碯ネ「ヲネ]: Commenting out. 4. -* スホセホヴノゥ觴スホソホヴネサ、ュ鐓: Controlling which command to invoke. 4. -* セムテアシクネホ「ネ[ソマトアィキネホア、]: Cooperation with other packages. 4. -* ヴノメケネ鷦ヴネメケネ鷯: Cooperation with other packages. 8. -* メケネ鷦メケネ鷯: Cooperation with other packages. 8. -* ォシスク胚ラ[ォ「スキ蔘ユ]: Cursor jump. 4. -* ォケゾ、コ[ォケゾ、ケ]: Customizations. 4. -* ュシ「オ、[ュ、「オ、]: Customizations. 4. -* %#ュ。ォホホヤク[%#ュロヲキソ、ホリキ讎]: Editing %# notation. 4. -* 蟾ィ[アソスィ]: Filling. 4. -* ム魏鰈ホ蟾ィ[マ魃鰈ホアソスィ]: Filling. 53. -* ホ韋ャァ[隕、ュアトニ、ュスッ]: Fix region for typesetting. 27. -* ヌホ靜ソ、ラサテネ[ウニ、隕、ュホソ、ユサトネ]: Fix region for typesetting. 4. -* ケ、ユ。、ホヤク[ハォ、ユ「、ホリキ讎]: Fix region for typesetting. 40. -* ョキ羣莢[ュキ葢キロォ]: Greek letter completion. 4. -* 、眈ク莢[、皖キロォ]: Image completion. 4. -* ーュ讀眈ク莢[ケヲキュュウヲ、皖キロォ]: Image completion. 4. -* ー箴ノ[ケヲキュ筱ネ]: Image completion. 4. -* セホユ。、ホセキ[ロォホユ「、ホニハェキ]: Includeonly. 11. -* 、ッシノス、[、ッヲネウヲスヲ]: Inclusion hierarchy browser. 4. -* 、ケネシ[、ケネェ]: Installation. 4. -* &マ[&ヒ讎隸]: Intelligent newline. 4. -* ェ゙ォサヤ[ェ゙ォサォ、ュ隕]: Intelligent newline. 4. -* 菽遖[菽隕]: Intro. 4. -* ソ、ラサテソ[ソ、ユサトソ]: Invocation. 4. -* ラネ「ヲネ[ユネ「ヲネ]: Invocation. 4. -* ラ蠑「[ユメ讎「]: Invocation. 4. -* トュホ[ォュ隕ホオッキ鐓: Killing LaTeX command. 7. -* 鰮ォークョ[鰄キネヲサ、サ、]: label-generation. 4. -* クオ、コリメ[箙オ、ケキニ、キ]: largeソ莢. 21. -* ユゥネリメ[ユェネキニ、キ]: largeソ莢. 21. -* シォュ[ェォキキ鐓: Local dictionary. 4. -* ムケ/[リウヲ/オッキ鐓: Modifying/Deleting. 4. -* ーシミリラ[ッェマリユ]: Online help. 17. -* ラ鬢ルシネリラ[ユ鬢リィネリユ]: Online help. 17. -* ェ鬢リラ[ェ鬢リユ]: Online help. 4. -* ュシシノ。[ュ、「ネアオッ]: Online help. 4. -* ミマェサレシク[キ貽隸キ讎隕リィキ]: Print out. 10. -* ミマォマレシク[キ貽隸ォ、キリィキ]: Print out. 10. -* ニ「莢[オ、ュロォ]: Recursive completion. 4. -* ゚綣サトニ、、]: Sample definitions. 4. -* マユ。、ャ膽ヒ讎隸ユ「、ユォト]: Splitting input files. 13. -* サッキ銛靺ミテユ。[サッキ頤ッュ熙チ鴣マトユ「]: view-sectioning. 22. -* 「ヲネ鬢[「ヲネ鬢]: view-sectioning. 4. -* ク胚ラ[キ蔘ユ]: view-sectioning. 50. -* サッキ銛靺鷦サッキ頤ッュ鷯: view-sectioning. 50. -* タャリ[ォ、スヲ]: view-sectioning. 50. -* ス゚ホォ鰲スィ[アオ、ホォ鰲メ隕キ]: What column. 24. -* ウウマノウ?[ウウマネウ?]: What column. 4. -* 」ィハtabular[ユッオトハtabular]: What column. 4. -* apropos: Online help. 4. -* autoload: Installation. 4. -* auto-mode-alist: Installation. 4. -* %#BEGIN: Fix region for typesetting. 4. -* beginソ莢[beginォソロォ]: beginソ莢. 4. -* C-c: Invocation. 4. -* Demacs: Intro. 4. -* .emacs: Installation. 4. -* %#END: Fix region for typesetting. 4. -* end莢[endロォ]: end莢. 4. -* ghostview: Splitting input files. 19. -* gmhist: Cooperation with other packages. 8. -* hookム[hookリケヲ]: Hook variables. 4. -* includeonly: Includeonly. 4. -* Install: Installation. 4. -* itemハノホ蟾ィ[itemハネホアソスィ]: Filling. 8. -* jlatex: Invocation. 4. -* largeソ莢[largeォソロォ]: largeソ莢. 4. -* LaTeX: Intro. 4. -* leftarrow: Image completion. 4. -* lpr format: lpr format. 4. -* lprユゥジテネホムケ[lprユェェ゙トネホリウヲ]: Editing %# notation. 21. -* lprユゥジテネ[lprユェェ゙トネ]: lpr format. 4. -* lprユゥジテネ[lprユェェ゙トネ]: lpr format. 4. -* maketitleソ莢[maketitleォソロォ]: maketitleソ莢. 4. -* M-C-@: トュアフネキソク胚ラ. 7. -* M-C-a: トュアフネキソク胚ラ. 7. -* M-C-e: トュアフネキソク胚ラ. 7. -* min-out: Cooperation with other packages. 20. -* M-q: Filling. 53. -* Mule: Intro. 4. -* 。ヒincludeonly[ォトニヒincludeonly]: Includeonly. 4. -* NTT-jTeX[ィフニ、、ニ、、キィ、ニトッ]: Filling. 16. -* platex: Invocation. 4. -* prefix ,: Commenting out. 4. -* prefix .: Commenting out. 4. -* prefix <: Commenting out. 4. -* prefix >: Commenting out. 4. -* prefix /: Online help. 4. -* prefix ?: Online help. 4. -* prefix &: What column. 4. -* prefix a: Accent mark completion. 4. -* prefix b: beginソ莢. 4. -* prefix c: Modifying/Deleting. 4. -* prefix d: Inclusion hierarchy browser. 4. -* prefix e: end莢. 4. -* prefix g: Cursor jump. 4. -* prefix i: Filling. 8. -* prefix k: Modifying/Deleting. 4. -* prefix key: Invocation. 4. -* prefix l: largeソ莢. 4. -* prefix m: maketitleソ莢. 4. -* prefix s: sectionソ莢. 4. -* prefix SPC: Arbitrary completion. 4. -* prefix w: Changing mode of YaTeX. 4. -* prefixュシムケ[prefixュ、リウヲ]: Lisp variables. 4. -* レシクホァハャlprッー[リィキォッヒキ隕莟lprュネヲ]: Print out. 13. -* sectionソ莢[sectionォソロォ]: sectionソ莢. 4. -* 頤黏sepackage[オュ゙鷯: Usepackage cheker. 4. -* YaTeX-help-file: Online help. 17. -* YaTeX-help-file-private: Online help. 17. -* YaTeX-item-regexp: Filling. 23. -* YaTeX-math-sign-alist-private: Image completion. 69. -* yatex-mode-hook: Hook variables. 4. -* yatex-mode-load-hook: Hook variables. 4. -* YaTeX-nervous: Local dictionary. 22. -* .yatexrc: Local dictionary. 4. - - - - +* 引数の個数を変える[ひきすうのこすうをかえる]: 2個以上の引数をとる section型コマンド. (line 26) +* 引数[ひきすう]: 2個以上の引数をとる section型コマンド. (line 5) +* 欧文[おうふん]: Accent mark completion. (line 5) +* アクセント記号補完[あくせんときこうほかん]: Accent mark completion. (line 5) +* カスタマイズ変数一覧[かすたまいすへんすういちらん]: All customizable variables. (line 5) +* 随時補完[すいしほかん]: Arbitrary completion. (line 5) +* %#BEGIN: Fix region for typesetting. (line 5) +* C-c: Invocation. (line 5) +* エラー修正[えらあしゆうせい]: Calling typesetter. (line 5) +* タイプセットエラー[たいふせつとえらあ]: Calling typesetter. (line 5) +* タイプセッタ起動[たいふせつたきとう]: Calling typesetter. (line 5) +* 環境名の変更[かんきようめいのへんこう]: Changing LaTeX command. (line 21) +* モード切り替え[もうときりかえ]: Changing mode of YaTeX. (line 5) +* タイプセッタの使い分け[たいふせつたのつかいわけ]: Changing typesetter. (line 13) +* 起動するコマンドを変える[きとうするこまんとをかえる]: Changing typesetter. (line 8) +* コメントアウト[こめんとあうと]: Commenting out. (line 5) +* その他のコマンド制御[そのたのこまんとせいきよ]: Controlling which command to invoke. (line 5) +* 他パッケージとの連携[たはつけえしとのれんけい]: Cooperation with other packages. (line 5) +* ヒストリ[ひすとり]: Cooperation with other packages. (line 9) +* コマンドヒストリ[こまんとひすとり]: Cooperation with other packages. (line 9) +* カーソルジャンプ[かあそるしやんふ]: Cursor jump. (line 5) +* キーアサイン[きいあさいん]: Customizations. (line 5) +* カスタマイズ[かすたまいす]: Customizations. (line 5) +* Demacs: Intro. (line 5) +* %#END: Fix region for typesetting. (line 5) +* %#記法自体の編集[%#きほうしたいのへんしゆう]: Editing %# notation. (line 5) +* 括る[くくる]: Enclose section-type command. (line 5) +* パラグラフの桁揃え[はらくらふのけたそろえ]: Filling. (line 48) +* 桁揃え[けたそろえ]: Filling. (line 5) +* 領域決定規則[りよういきけつていきそく]: Fix region for typesetting. (line 27) +* 長いファイルの編集[なかいふあいるのへんしゆう]: Fix region for typesetting. (line 36) +* 固定領域のタイプセット[こていりよういきのたいふせつと]: Fix region for typesetting. (line 5) +* :: Greek letter completion. (line 5) +* ギリシャ文字補完[きりしやもしほかん]: Greek letter completion. (line 5) +* ;自身[;ししん]: Image completion. (line 34) +* ∞[むけんたい]: Image completion. (line 5) +* Σ[しくま]: Image completion. (line 5) +* 矢印[やしるし]: Image completion. (line 5) +* 数式モード[すうしきもおと]: Image completion. (line 5) +* ;: Image completion. (line 5) +* イメージ補完[いめえしほかん]: Image completion. (line 5) +* 数式記号イメージ補完[すうしききこういめえしほかん]: Image completion. (line 5) +* 他のファイルの手直し[ほかのふあいるのてなおし]: Includeonly. (line 12) +* インクルード構造[いんくるうとこうそう]: Inclusion hierarchy browser. (line 5) +* 括弧入力補助[かつこにゆうりよくほしよ]: Inserting parens. (line 5) +* Install: Installation. (line 5) +* インストール[いんすとおる]: Installation. (line 5) +* &入力[&にゆうりよく]: Intelligent newline. (line 5) +* おまかせ改行[おまかせかいきよう]: Intelligent newline. (line 5) +* やちょう[やちよう]: Intro. (line 5) +* プリントアウト[ふりんとあうと]: Invocation. (line 5) +* プレヴューア[ふれひゆうあ]: Invocation. (line 5) +* タイプセッタ[たいふせつた]: Invocation. (line 5) +* 環境の削除[かんきようのさくしよ]: Killing LaTeX command. (line 7) +* LaTeX: Intro. (line 5) +* ローカル辞書[ろおかるししよ]: Local dictionary. (line 5) +* M-C-a: 環境を単位としたジャンプ. (line 8) +* M-C-e: 環境を単位としたジャンプ. (line 8) +* M-C- 環境を単位としたジャンプ. (line 8) +* M-q: Filling. (line 48) +* 変更/削除[へんこう/さくしよ]: Modifying/Deleting. (line 5) +* Mule: Intro. (line 5) +* NTT-jTeX[えぬていいていいしえいてつく]: Filling. (line 16) +* プライベートヘルプ[ふらいへえとへるふ]: Online help. (line 17) +* グローバルヘルプ[くろおはるへるふ]: Online help. (line 17) +* キーワード検索[きいわあとけんさく]: Online help. (line 5) +* オンラインヘルプ[おんらいんへるふ]: Online help. (line 5) +* 出力終了ページ[しゆつりよくしゆうりようへえし]: Print out. (line 10) +* 出力開始ページ[しゆつりよくかいしへえし]: Print out. (line 10) +* 再帰補完[さいきほかん]: Recursive completion. (line 5) +* 設定例[せつていれい]: Sample definitions. (line 5) +* 入力ファイル分割[にゆうりよくふあいるふんかつ]: Splitting input files. (line 12) +* 現在のカラム表示[けんさいのからむひようし]: What column. (line 25) +* ここはどこ?[ここはとこ?]: What column. (line 5) +* YaTeX-help-file: Online help. (line 17) +* YaTeX-help-file-private: Online help. (line 17) +* YaTeX-item-regexp: Filling. (line 21) +* YaTeX-math-sign-alist-private: Image completion. (line 61) +* YaTeX-nervous: Local dictionary. (line 23) +* apropos: Online help. (line 5) +* auto-mode-alist: Installation. (line 5) +* autoload: Installation. (line 5) +* begin型補完[beginかたほかん]: begin型補完. (line 5) +* 環境名の補完[かんきようめいのほかん]: begin型補完. (line 5) +* ユーザ辞書[ゆうさししよ]: begin型補完. (line 72) +* 閉じ込める[としこめる]: begin型補完. (line 82) +* ブロック[ふろつく]: begin型補完. (line 82) +* .emacs: Installation. (line 5) +* end補完[endほかん]: end補完. (line 5) +* ghostview: Splitting input files. (line 17) +* gmhist: Cooperation with other packages. (line 9) +* hook変数[hookへんすう]: Hook variables. (line 5) +* includeonly: Includeonly. (line 5) +* 勝手にincludeonly[かつてにincludeonly]: Includeonly. (line 5) +* itemなどの桁揃え[itemなとのけたそろえ]: Filling. (line 9) +* jlatex: Invocation. (line 5) +* ラベル自動生成[らへるしとうせいせい]: label-generation. (line 5) +* large型補完[largeかたほかん]: large型補完. (line 5) +* フォント指定子[ふおんとしていし]: large型補完. (line 19) +* 文字サイズ指定子[もしさいすしていし]: large型補完. (line 19) +* 括る[くくる]: large型補完. (line 23) +* leftarrow: Image completion. (line 5) +* お絵描きツール起動[おえかきつうるきとう]: お絵描きツール起動. (line 5) +* 環境をマーク[かんきようをまあく]: 環境を単位としたジャンプ. (line 8) +* 環境の末尾へ[かんきようのまつひへ]: 環境を単位としたジャンプ. (line 8) +* 環境の先頭へ[かんきようのせんとうへ]: 環境を単位としたジャンプ. (line 8) +* lpr format: lpr format. (line 5) +* lprフォーマットの変更[lprふおおまつとのへんこう]: Editing %# notation. (line 20) +* ページ確認省略lpr起動[へえしかくにんしようりやくlprきとう]: Print out. (line 13) +* lprフォーマット[lprふおおまつと]: lpr format. (line 5) +* lprふぉーまっと[lprふおおまつと]: lpr format. (line 5) +* maketitle型補完[maketitleかたほかん]: maketitle型補完. (line 5) +* min-out: Cooperation with other packages. (line 18) +* platex: Invocation. (line 5) +* prefix ,: Commenting out. (line 5) +* prefix .: Commenting out. (line 5) +* prefix >: Commenting out. (line 5) +* prefix <: Commenting out. (line 5) +* prefix /: Online help. (line 5) +* prefix ?: Online help. (line 5) +* prefix SPC: Arbitrary completion. (line 5) +* prefix &: What column. (line 5) +* prefix a: Accent mark completion. (line 5) +* prefix b: begin型補完. (line 5) +* prefix c: Modifying/Deleting. (line 5) +* prefix d: Inclusion hierarchy browser. (line 5) +* prefix e: end補完. (line 5) +* prefix g: Cursor jump. (line 5) +* prefix i: Filling. (line 9) +* prefix k: Modifying/Deleting. (line 5) +* prefix key: Invocation. (line 5) +* prefix l: large型補完. (line 5) +* prefix m: maketitle型補完. (line 5) +* prefixキー変更[prefixきいへんこう]: Lisp variables. (line 5) +* prefix s: section型補完. (line 5) +* prefix w: Changing mode of YaTeX. (line 5) +* section型補完[sectionかたほかん]: section型補完. (line 5) +* 複雑なtabular[ふくさつなtabular]: What column. (line 5) +* 先回りusepackage[さきまわり]: Usepackage cheker. (line 5) +* セクション区切り一覧バッファ[せくしよんくきりいちらんはつふあ]: view-sectioning. (line 20) +* ジャンプ[しやんふ]: view-sectioning. (line 44) +* セクション区切り[せくしよんくきり]: view-sectioning. (line 44) +* 論理階層[ろんりかいそう]: view-sectioning. (line 44) +* アウトライン[あうとらいん]: view-sectioning. (line 5) +* yatex-mode-hook: Hook variables. (line 5) +* yatex-mode-load-hook: Hook variables. (line 5) +* .yatexrc: Local dictionary. (line 5) Tag table: -Node: Top254 -Node: Intro1308 -Node: Terminology1619 -Node: Main features2299 -Node: Installation3361 -Node: Invocation4646 -Node: Calling typesetter5477 -Node: Calling previewer6762 -Node: Print out7094 -Node: %#notation7374 -Node: Changing typesetter7806 -Node: Splitting input files8090 -Node: Fix region for typesetting9073 -Node: lpr format9998 -Node: Controlling which command to invoke10819 -Node: Editing %# notation11319 -Node: Completion11791 -Node: beginソ莢12272 -Node: sectionソ莢14892 -Node: 2トハ衾ネ sectionソヴノ15993 -Node: Enclose section-type command16836 -Node: Recursive completion17097 -Node: view-sectioning17410 -Node: label-generation18645 -Node: largeソ莢19009 -Node: maketitleソ莢19614 -Node: Arbitrary completion19919 -Node: end莢20240 -Node: Accent mark completion20585 -Node: Image completion21028 -Node: Greek letter completion22864 -Node: Local dictionary23340 -Node: Commenting out23956 -Node: Cursor jump25140 -Node: ミェヨクァッネリホク胚ラ25393 -Node: ェィチュトシッー26408 -Node: 皃ユ。、リホク胚ラ27370 -Node: トュアフネキソク胚ラ27732 -Node: ヌ衾莢フヨリホク胚ラ28113 -Node: Modifying/Deleting28377 -Node: Changing LaTeX command28801 -Node: Killing LaTeX command29365 -Node: Filling30254 -Node: Includeonly31615 -Node: What column32182 -Node: Intelligent newline32971 -Node: Usepackage cheker34025 -Node: Changing mode of YaTeX34458 -Node: Online help35057 -Node: Inclusion hierarchy browser36076 -Node: Cooperation with other packages37378 -Node: Customizations37853 -Node: Lisp variables38162 -Node: All customizable variables38772 -Node: Sample definitions47464 -Node: Hook variables47920 -Node: Hook file48819 -Node: Add-in functions49035 -Node: Etc49282 -Node: Copying49573 -Node: Concept Index50204 +Node: Top257 +Node: Intro1311 +Node: Terminology1614 +Node: Main features2254 +Node: Installation3376 +Node: Invocation4636 +Node: Calling typesetter5512 +Node: Calling previewer6973 +Node: Print out7289 +Node: %#notation7555 +Node: Changing typesetter7983 +Node: Splitting input files8241 +Node: Fix region for typesetting9197 +Node: lpr format10105 +Node: Controlling which command to invoke10915 +Node: Editing %# notation11629 +Node: Completion12087 +Node: begin型補完12498 +Node: section型補完15247 +Node: 2個以上の引数をとる section型コマンド16340 +Node: Enclose section-type command17156 +Node: Recursive completion17480 +Node: view-sectioning17785 +Node: label-generation18981 +Node: large型補完19655 +Node: maketitle型補完20189 +Node: Arbitrary completion20488 +Node: end補完20801 +Node: Accent mark completion21142 +Node: Image completion21567 +Node: Greek letter completion23382 +Node: Inserting parens23866 +Node: Local dictionary24214 +Node: Commenting out24818 +Node: Cursor jump25978 +Node: 対応オブジェクトへのジャンプ26195 +Node: お絵描きツール起動27181 +Node: メインファイルへのジャンプ28099 +Node: 環境を単位としたジャンプ28435 +Node: 最後の補完位置へのジャンプ28792 +Node: Modifying/Deleting29029 +Node: Changing LaTeX command29435 +Node: Killing LaTeX command29985 +Node: Filling30857 +Node: Includeonly32187 +Node: What column32748 +Node: Intelligent newline33528 +Node: Usepackage cheker34560 +Node: Changing mode of YaTeX34987 +Node: Online help35563 +Node: Inclusion hierarchy browser36540 +Node: Cooperation with other packages37818 +Node: Customizations38273 +Node: Lisp variables38570 +Node: All customizable variables39177 +Node: Sample definitions48157 +Node: Hook variables48591 +Node: Hook file49486 +Node: Add-in functions49692 +Node: Etc49919 +Node: Copying50204 +Node: Concept Index50828 End tag table
--- a/docs/yatexj.tex Fri Dec 26 01:06:32 2014 +0900 +++ b/docs/yatexj.tex Sun Sep 17 10:25:38 2017 +0859 @@ -13,7 +13,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 Dec 26 00:09:05 2014 on firestorm +@c Last modified Sat Sep 9 23:43:04 2017 on firestorm @syncodeindex vr cp @end iftex @@ -23,7 +23,7 @@ @subtitle Yet Another tex-mode for emacs @title 『野鳥』 @subtitle // YaTeX // -@author @copyright{} 1991-2012 by HIROSE, Yuuji [yuuji@@yatex.org] +@author @copyright{} 1991-2017 by HIROSE, Yuuji [yuuji@@yatex.org] @end titlepage @node Top, Intro, (dir), (dir) @@ -124,7 +124,7 @@ コマンドの補完入力 (@kbd{C-c b}, @kbd{C-c s}, @kbd{C-c l}, @kbd{C-c m}) @item 既に入力したテキストを環境やコマンド引数の中に取り込む括り補完 -(@kbd{C-u} +通常補完キー) +(リジョン指定後に通常補完キー) @item セクション区切り入力時の文書構造アウトライン表示 @item セクションコマンドの一括シフト (@ref{view-sectioning}) @item 補完辞書の学習 @@ -145,6 +145,7 @@ @item 補完入力したマクロに応じて必要な \userpackage を入れてくれる先回り userpackage @item \labelを打つことはもう忘れよう! refやcite補完入力で自動生成します +@item 画像ファイルのドラッグ&ドロップによる自動 \includegraphics @end itemize @node Installation, Invocation, Main features, Top @@ -228,8 +229,9 @@ @item [prefix] t r @dots{} タイプセッタ起動(領域指定) @item [prefix] t e - @dots{} タイプセッタ起動 - (ポイント位置の環境または数式モードのみ対象) + @dots{} 部分タイプセット&プレヴュー + (ポイント位置の段落、環境または数式モードのみをタイプセットして + 隣のバッファに組版結果の画像を出す) @item [prefix] t k @dots{} 動作中のタイプセッタの停止 @item [prefix] t b @@ -296,11 +298,20 @@ @subsection 環境タイプセット @kbd{[prefix] te} を押すと、ポイント位置の最も内側の環境、または数式モー -ド内の場合はその数式モード全体が自動的に領域選択されて、領域タイプセットを -呼び出します。tabular環境や数式モードで複雑なものを作っている場合は確かめた -い部分だけを確認できるので便利です。これも @file{texput.tex} に該当部分を -書き出します。プレヴューアで @file{texput.dvi} を開いたままにしておけば -修正と確認が素早くできるでしょう。 +ド内の場合はその数式モード全体、あるいは環境がなければその段落が自動的に +領域選択されて、領域タイプセットを呼び出します。 +tabular環境や数式モードで複雑なものを作っている場合は確かめたい部分だけを +確認できるので便利です。Emacsが画像表示可能な場合は、 +部分タイプセットの結果を画像化して隣のウィンドウに表示します。また、 +特定の環境で呼び出した場合は、環境内の文字を書き換える度に自動的に +プレビュー画像を更新します(on-the-flyプレヴュー)。 +自動表示されない場合はプレヴューアで @file{texput.dvi} +を開いたままにしておけば修正と確認が素早くできるでしょう。 + + 画像プレヴューの場合の大きさ(解像度)はデフォルトで200dpi(数式は300dpi)です。 +dpiを変えたい場合はLaTeXソースのどこかに +@code{%#PREVIEWDPI 150} +のようにdpi値を書いてください。 @node Calling previewer, Print out, Calling typesetter, Invocation @comment node-name, next, previous, up @@ -524,12 +535,20 @@ La@TeX{} 文書に関連するコマンドは以下の %# 記法で指定することができます。 @table @code + @item %#PREVIEW + @dots{} Command line for DVI viewing ([prefix] t p) @item %#BIBTEX @dots{} makeindexを行なうコマンドライン([prefix] t b) @item %#MAKEINDEX @dots{} bibtexを行なうコマンドライン([prefix] t i) @item %#DVIPDF @dots{} DVIからPDF変換を行なうコマンドライン([prefix] t d) + @item %#LPR + @dots{} 印刷用のコマンドライン([prefix] t l) + @item %#PDFVIEW + @dots{} PDFファイルを見るためのコマンドライン + @item %#IMAGEDPI + @dots{} 即時プレヴュー(on-the-fly preview)用の画像のDPI @end table 行頭がこれらのキーワードで始まる行をLa@TeX{}文書の先頭付近に書いておけば、 @@ -570,15 +589,16 @@ ができます。 @menu -* begin型補完:: -* section型補完:: -* large型補完:: -* maketitle型補完:: +* begin型補完:: +* section型補完:: +* large型補完:: +* maketitle型補完:: * Arbitrary completion:: 随時補完 -* end補完:: +* end補完:: * Accent mark completion:: アクセント記号補完 * Image completion:: 数式記号イメージ補完 * Greek letter completion:: ギリシャ文字補完 +* Inserting parens:: @end menu @node begin型補完, section型補完, Completion, Completion @@ -678,17 +698,19 @@ @cindex 閉じ込める[としこめる] 例えばあるパラグラフを description 環境の中に入れたいときは、 -そのパラグラフをマークしてから、 - -@table @kbd -@item [prefix] B D -@itemx (または ESC 1 [prefix] b D) -@itemx (または C-u [prefix] b D など) -@end table - -とタイプしてください。これは、@kbd{[prefix] b SPC}の補完入力にもあてはまり、 -@kbd{b} を大文字に変えて、@kbd{[prefix] B SPC} とタイプすれば、あらかじめ -マークしておいたリジョンを、begin と end の環境で括ります。 +そのパラグラフをマークしてから、補完機能を呼び出してください(description +環境の場合は @kbd{[prefix] b D})。 + +選択された領域を括ります。ただしこれは @code{transient-mark-mode} が t +(Emacsの標準)になっている場合のみで、普段 +@code{transient-mark-mode} を @code{nil} にしている場合は、 +補完キー前に @code{universal-argument} 指定(@kbd{C-u}) +をタイプしてから @kbd{[prefix] b D} など、補完キーを +タイプすれば括り補完になります。 +なおEmacs22以降であれば @code{transient-mark-mode} 無効時も +@code{set-mark-command} (@kbd{C-space})の連打で一時的に +@code{transient-mark-mode} が有効になります。 + @node section型補完, large型補完, begin型補完, Completion @comment node-name, next, previous, up @@ -801,8 +823,11 @@ @subsection 既に書いたテキストを括る @cindex 括る[くくる] - また、起動コマンドの@kbd{s}を大文字に変えて起動すると、あらかじめ書 -いた文章を section 型コマンドの第一引数として括ります。 + また、section型補完機能の呼び出し時に領域選択状態にしておくと +領域内のテキストを section 型コマンドの第一引数として括ります。 +これも普段 @code{transient-mark-mode} を @code{nil} にしている場合は +@kbd{C-u} のあとに補完キーをタイプすれば強制的に括り補完になります。 + @node Recursive completion, view-sectioning, Enclose section-type command, section型補完 @comment node-name, next, previous, up @@ -879,6 +904,24 @@ つけるのもたいへんです。もうラベル名に何をつけるか、ラベルをつけるかつけま いか、などということは忘れましょう! +ラベルを打つべき項目の選択の際には、可能性のあるすべてのカウンタが表示され +ます。これを「数式のみ」のように種別で絞りたいときは以下のキーコマンドが +利用できます。 +@table @kbd + @item M-a + @dots{} 絞り込みを解除してすべてのカウンタを表示 + @item M-c + @dots{} キャプションのみを表示 + @item M-e + @dots{} 番号のつく数式のみを表示 + @item M-i + @dots{} 番号つき箇条書のみを表示 + @item M-s + @dots{} セクションのみを表示 + @item M-m + @dots{} その他のカウンタのみを表示 +@end table + @node large型補完, maketitle型補完, section型補完, Completion @comment node-name, next, previous, up @section large型補完 @@ -911,8 +954,7 @@ また、begin型補完の時と同様、先に書いてしまった一連の文章の文字のサイズ を変えたいと思う時がありますが、そのような時は、サイズや大きさを変えたい文 -字の範囲をマークしてから、呼び出しキーを @kbd{[prefix] L} と、大文字の L -に変えて呼び出せば、そのリジョン全体が、ブレースで囲まれます。 +字の範囲をマークしてからlarge型補完を呼んでください。 @node maketitle型補完, Arbitrary completion, large型補完, Completion @comment node-name, next, previous, up @@ -1082,7 +1124,7 @@ 照してください。 @cindex YaTeX-math-sign-alist-private -@node Greek letter completion, , Image completion, Completion +@node Greek letter completion, Inserting parens, Image completion, Completion @comment node-name, next, previous, up @section ギリシャ文字補完 @cindex ギリシャ文字補完[きりしやもしほかん] @@ -1100,6 +1142,18 @@ とにより、強制的にイメージ補完に入ることができます。また、この時にどのよう な状態で数式環境内判定に失敗したかをご連絡下さい。 +@node Inserting parens, , Greek letter completion, Completion +@section 括弧入力補助 +@cindex 括弧入力補助[かつこにゆうりよくほしよ] + + 3種類ある括弧 () {} [] の開き括弧を入れたときに閉じ括弧を自動的に入れます。 +@code{\} の直後にの @code{[} を入れると行を分けてインデントを揃え、 +数式入力に備えます。その他 La@TeX{} のマクロに応じて括弧の釣合の取れた +状態に導きます。開き括弧そのものを1つだけ入れたいときは @kbd{C-q} で +クォート入力するか、@kbd{[prefix] w m} で修正モードをOFFにしてください。 + + 領域選択してから開き括弧を入れるとその領域をその種類の括弧で括ります。 + @node Local dictionary, Commenting out, Completion, Top @comment node-name, next, previous, up @chapter ローカル辞書 @@ -1897,6 +1951,19 @@ dviをPDFに変換するコマンド (@code{"dvipdfmx"}) @end defvar +@defvar YaTeX-on-the-fly-preview-interval +@kbd{[prefix] t e}で環境即時previewをする場合の変換処理までの +無操作時間(秒) (0.9) +@code{nil} の場合は即時プレヴューをしない。 +@end defvar + +@defvar YaTeX-on-the-fly-math-preview-engine +@kbd{[prefix] t e}で数式環境を即時previewする時に用いるエンジン +(latex-math-previewが利用可能なときは latex-math-preview-expression を呼ぶ +@code{'YaTeX-typeset-environment-by-lmp} +そうでないときは内蔵関数を呼ぶ @code{'YaTeX-typeset-environment-by-builtin}) +@end defvar + @defvar YaTeX-cmd-gimp GIMPを起動するコマンド (code{"gimp"}) @end defvar @@ -2137,6 +2204,12 @@ verbatim環境などを指定する。 @end defvar +@defvar YaTeX-electric-indent-mode +Emacs 24.4 で導入された改行時の、自動インデントをどうするか。 +この値がそのまま electric-indent-local-mode に渡される。 +-1でoff。 +@end defvar + @defvar YaTeX-ref-default-label-string \ref@{@} のラベル補完でラベル未設定のものに自動的に生成する ラベル名の書式。strftime(3)関数に似た日付ベースで指定する。 @@ -2265,7 +2338,7 @@ せんが契約締結は辞退します。 苦情、希望、バグ報告、感想等は歓迎いたします。 -連絡は yuuji@@yatex.org まで(2004年1月現在)。 +連絡は yuuji@@yatex.org まで(2017年9月現在)。 継続的に使用してくださる方はメイリングリスト「fj野鳥の会」に 是非加入してください。加入方法については本パッケージの @file{docs/qanda} ファイルの「その他」の章を御覧ください。
--- a/docs/yatexref.eng Fri Dec 26 01:06:32 2014 +0900 +++ b/docs/yatexref.eng Sun Sep 17 10:25:38 2017 +0859 @@ -47,15 +47,16 @@ [Process invoking] + *invoke latex [prefix] tj + *invoke latex (on region) [prefix] tr + *on-the-fly preview environment [prefix] te *invoke bibtex [prefix] tb - *invoke latex [prefix] tj *invoke makeindex [prefix] ti *kill current typesetting process [prefix] tk ** *lpr dvi-file [prefix] tl *lpr dvi-file (all pages) C-u [prefix] tl *invoke previewer [prefix] tp *invoke lpq [prefix] tq - *invoke jlatex (on region) [prefix] tr Hitting [prefix] t will get you the menu, so there is no need to remember the key after [prefix] t. @@ -71,7 +72,7 @@ *To the typeset error [prefix] ' Will jump to the position where the typeset error occurred from the - end. Only effective when there was a error returned from latex. + end. Only effective when there was a error returned from typesetter. *Jump to corresponding object [prefix] g *Jump to corresponding object (in another her window) [prefix] 4g @@ -84,6 +85,7 @@ -on a \include(only) or \input to the matching file -on a \ref or \label to the matching \label or \ref -on a \cite or \bibitem to the matching \bibitem or \cite + -other to the matching line in previewer *Jump to the main file [prefix] ^ *Jump to the main file in another window [prefix] 4^ @@ -153,6 +155,7 @@ enumerate, list and description environments. *Browse included structure [prefix] d + *Force re-highlight font-lock [prefix] u HIROSE Yuuji yuuji@yatex.org
--- a/install Fri Dec 26 01:06:32 2014 +0900 +++ b/install Sun Sep 17 10:25:38 2017 +0859 @@ -3,59 +3,32 @@ Installation of YaTeX / 野鳥のインストール ****************************************** -Put these expressions into your ~/.emacs -まず ~/.emacsに下の2項目を加えます。 - - (setq auto-mode-alist - (cons (cons "\\.tex$" 'yatex-mode) auto-mode-alist)) - (autoload 'yatex-mode "yatex" "Yet Another LaTeX mode" t) - -Then, add certain path name where you put files of YaTeX to your -load-path. If you want to put them in `~/src/emacs', write -次に野鳥の emacs-lisp ファイル群を置くディレクトリを load-path に加えます。 -たとえば、`~/src/emacs/yatex'に置くのであれば、 - - (setq load-path (cons (expand-file-name "~/src/emacs/yatex") load-path)) - -in your ~/.emacs. -などとします。 - -Then edit makefile and set your environment variable `DISPLAY' correctly, -exec the next. -続いて makefile を編集し、環境変数 DISPLAY の値を正しくセットしてから +First, take a look at makefile to confirm or modify EMACS= and PREFIX= +lines and exec the next command. +このディレクトリにある makefile の EMACS= と PREFIX= の行を確認し、 +必要なら修正した後に以下のコマンドを起動してください。 % make install - -でインストールを行ってください。 - - If `make install' fails, do as follows; - もし `make install' でうまく行かない時は下記のように手動でインストール -を行ってください。 + (or "sudo make install") -First, copy `*.el' to suitable directory. -最初に、野鳥の emacs-lisp ファイル群を適当なディレクトリにコピーします。 +Then, type `make show-init' on the shell in this directory as below +and ou will get elisp expressions. Add the expressions to your ~/.emacs. +続いて以下のようにコマンドを起動し、得られた結果出力を ~/.emacs +に足してください。 -Then copy `help/YATEXHLP.eng' to $EMACS/etc directory, which is -displayed by typin `exec-directory C-j' in the *scratch* buffer -(on Emacs19, $exec-directory/../../site-lisp). -つぎに、help/YATEXHLP.jp を Emacs の etc ディレクトリに入れます。 -(*scratch* バッファで「exec-directory C-j」とうって示されるところです - Emacs19以降の場合 doc-directory の ../../site-lisp) + % make show-init + +After copying output from make command to your ~/.emacs, you will be able to +use yatex-mode for *.tex files. +以上で、初期設定は終わりです。 -Finally, copy `docs/yatexe' and `docs/yahtmle' to Info directory and -append the contents of `dir' in this directory to `dir' of Info directory. -最後に、info ディレクトリに docs/yatexj, docs/yatexe, docs/yahtmlj, -docs/yahtmle をコピーし、info ディレクトリの dir というファイルにこのディ -レクトリの dir ファイルの中身を追加します。 +Without installing to default-dir, you can use yatex by adding the elisp +obtained by below to ~/.emacs. +インストールしなくても以下のコマンド出力を ~/.emacs に追加すれば +普通に使えます。 -Note that when you byte-compile yatex19.el, do it on window system. -This file cannot be compiled on terminal Emacs because it requires -hilit19.el, which cannot be loaded on terminal Emacs. But you don't -have to byte-compile it. -注意: yatex19.el をバイトコンパイルする時はウィンドウシステム上の emacs -で行って下さい。emacs -nw では、hilit19.el がロードできず、正常にコンパ -イルできません。うまくいかない場合はバイトコンパイルしなくて構いません。 + % make show-init2 About yahtml / yahtmlについて
--- a/makefile Fri Dec 26 01:06:32 2014 +0900 +++ b/makefile Sun Sep 17 10:25:38 2017 +0859 @@ -3,13 +3,13 @@ # # Edit these variables to be suitable for your site -PREFIX = /usr/local +EMACS = emacs +#EMACS = mule +PREFIX = `${EMACS} -batch --eval '(princ (expand-file-name "../../../.." data-directory))'` +# PREFIX = /usr/local -## mule2 -#EMACS = mule #EMACSDIR= ${PREFIX}/lib/${EMACS} ## emacs20 or later -EMACS = emacs EMACSDIR= ${PREFIX}/share/${EMACS} ## XEmacs #EMACS = xemacs @@ -25,8 +25,8 @@ LISPDIR = ${EMACSDIR}/site-lisp/yatex # LISPDIR = ${EMACSDIR}/site-packages/lisp/yatex DOCDIR = ${LISPDIR}/docs -HELPDIR = ${EMACSDIR}/site-lisp -INFODIR = ${PREFIX}/info +HELPDIR = ${LISPDIR}/help +INFODIR = ${PREFIX}/share/info TAR = tar INSTALL = install -c -m 444 @@ -41,19 +41,16 @@ # Do not edit below ################### # make install to install YaTeX into public space -# make install-nw same as above, but -nw mode, or Emacs18(Nemacs) # make ajimi to feel taste # make ajimi-nw same as above, but -nw mode # make package to create package for relase # make yahtmlpack to create package for relase # make clean to delete all producted files -# make ci to check in all -# make co to check out all -MVER = 1.78 +# make tag to add release tags LISP = ${LISP18} ${LISP19} ${LISP23} YAHTML = yahtml.el COMMON = yatexlib.el yatexprc.el -LISP18 = comment.el yatex.el yatexadd.el yatexgen.el yatexenv.el \ +LISP18 = yatex.el yatexadd.el yatexgen.el yatexenv.el \ ${COMMON} \ yatexmth.el yatexhks.el yatexhlp.el \ yatexm-o.el yatexsec.el yatexhie.el yatexpkg.el ${YAHTML} @@ -81,13 +78,13 @@ all: @echo "Edit this makefile first." - @echo 'Type "make install" to install YaTeX.' - @echo 'Type "make install-yahtml" to install yahtml.' - @echo 'If you cling to elc files. type "make elc" before make install' + @echo 'Type "${MAKE} install" to install YaTeX.' + @echo 'Type "${MAKE} install-yahtml" to install yahtml.' + @echo 'If you love elc files, type "${MAKE} elc" before ${MAKE} install' # @echo "If you don't use X-clinet of Emacs," # @echo 'type "make install-nw" instead.' -install: install-real +install: install-real install-message #install-yahtml: bytecompile-yahtml install-yahtml: [ -d ${LISPDIR} ] || mkdir ${LISPDIR} @@ -98,9 +95,10 @@ ${INSTALL} *.el* ${LISPDIR} install-real: - if [ ! -d ${LISPDIR} ]; then ${MKDIR} ${LISPDIR}; fi - if [ ! -d ${DOCDIR} ]; then ${MKDIR} ${DOCDIR}; fi - if [ ! -d ${INFODIR} ]; then ${MKDIR} ${INFODIR}; fi + [ -d ${LISPDIR} ] || ${MKDIR} ${LISPDIR} + [ -d ${HELPDIR} ] || ${MKDIR} ${HELPDIR} + [ -d ${DOCDIR} ] || ${MKDIR} ${DOCDIR} + [ -d ${INFODIR} ] || ${MKDIR} ${INFODIR} for f in *.el; do \ rm -f ${LISPDIR}/$${f}c; \ done @@ -108,10 +106,24 @@ ${INSTALL} ${DOCSRC} ${DOCDIR} ${INSTALL} ${DOCOBJ} ${INFODIR} ${INSTALL} ${HELP} ${HELPDIR} + +install-message: @echo "--------------------------------" - @echo "If you have install-info command, type 'make install-info'." + @echo "If you have install-info command, type '${MAKE} install-info'." @echo "If not, add next lines into your site's info dir manually." @cat dir + @echo "--------------------------------" + @echo "=== INSTALLATION DONE ===" + @echo " You might need to add these expression below to your ~/.emacs" + @echo " 螳御コ. ~/.emacs 遲峨↓莉・荳九r霑ス蜉縺吶k蠢隕√′縺ゅk縺九b縺励l縺セ縺帙s." + @echo + @echo ";;; ------ Startup definitions for YaTeX ------ ;;;" + @${MAKE} show-init + @echo ";;; ------------------------------------------- ;;;" + @echo + @echo " To get elisp above again, call ${MAKE} command as below." + @echo " 荳願ィ脇lisp繧貞榊コヲ蠕励k縺ォ縺ッ莉・荳九ョ繧医≧縺ォ${MAKE}繧定オキ蜍輔@縺ヲ縺上□縺輔>." + @echo " % ${MAKE} $${PREFIX:+PREFIX=$$PREFIX }show-init" install-info: for f in ${DOCOBJ}; do \ @@ -120,6 +132,31 @@ --section=Emacs $${f} ${INFODIR}/dir; \ done +show-init: + @printf '%s\n' \ + '(setq auto-mode-alist' \ + " (cons (cons \"\\.tex$$\" 'yatex-mode) auto-mode-alist))" \ + "(autoload 'yatex-mode \"yatex\" \"Yet Another LaTeX mode\" t)" \ + "(add-to-list 'load-path \"${LISPDIR}\")" \ + "(setq YaTeX-help-file \"${LISPDIR}/help/YATEXHLP.eng\")" + @printf '(setq tex-command "%s")\n' \ + `CMDS='platex pdflatex ptex2pdf lualatex' DFLT=latex \ + ${MAKE} -s search-cmd` + @printf '(setq dvi2-command "%s")\n' \ + `CMDS='pxdvi xdvik kxdvi dviout texworks' DFLT=xdvi \ + ${MAKE} -s search-cmd` + @printf '(setq tex-pdfview-command "%s")\n' \ + `CMDS='evince mupdf xpdf kpdf texworks sumatrapdf' \ + DFLT=acroread \ + ${MAKE} -s search-cmd` + +show-init2: + @${MAKE} LISPDIR=$$PWD show-init + +search-cmd: + @for f in $$CMDS; do \ + type $$f >/dev/null 2>&1 && echo $$f && exit 0; done; echo $$DFLT + install-nw: bytecompile-nw install-real elc: bytecompile @@ -143,7 +180,6 @@ lp1: lp echo '(load-file "./yatex.el")' >>lp.el - echo '(load-file "./comment.el")' >>lp.el lp2: echo '(setq load-path (cons "'`pwd`'" load-path))' >>lp.el @@ -186,25 +222,15 @@ ( version=${VERSION}; cd ${TMPDIR}; \ ${TAR} vzcf ${TMPDIR}/yahtml$$version.tar.gz yatex$$version) -ci: - ci -r${VERSION} -sRel -f ${RCSFILE} - ci -u${VERSION} makefile 00readme - -co: - co ${RCSFILE} - -co-l: - co -l ${RCSFILE} +tag: + hg tag yatex-${VERSION} +# ci: +# ci -r${VERSION} -sRel -f ${RCSFILE} +# ci -u${VERSION} makefile 00readme -tci: - ci -l${VERSION}.0 -Ncurrent ${RCSFILE} makefile +# co: +# co ${RCSFILE} -dostci: - ci -l${MVER}.0 -Ncurrent @rcsfile - -gohome: - zip -u -r /com/okoma/yuuji/tmp/dosconv/yatex.zip . \ - -x '*RCS/*' -x 'texinfo/*' RSYNCDIR = ${HOME}/http/yatex/rsync/yatex #sync:
--- a/manifest Fri Dec 26 01:06:32 2014 +0900 +++ b/manifest Sun Sep 17 10:25:38 2017 +0859 @@ -1,4 +1,3 @@ -comment.el コメントアウト関連 dir sample `dir' file for Info docs/htmlqa yahtmlに関する一般的な質問と回答 docs/htmlqa.eng Q and A on using yahtml @@ -25,6 +24,7 @@ yatex.el 野鳥・主 Emacs-Lisp ファイル yatex.new 各バージョンの変更履歴 yatex19.el Emacs-19(Mule2)用の設定 +yatex23.el Emacs-23以降用の設定 yatexadd.el 付加関数の定義例 yatexenv.el LaTeX 環境依存の関数 yatexgen.el 野鳥用付加関数自動作成モード
--- a/yahtml.el Fri Dec 26 01:06:32 2014 +0900 +++ b/yahtml.el Sun Sep 17 10:25:38 2017 +0859 @@ -1,9 +1,8 @@ ;;; yahtml.el --- Yet Another HTML mode -*- coding: sjis -*- -;;; (c) 1994-2013 by HIROSE Yuuji [yuuji(@)yatex.org] -;;; Last modified Mon Dec 22 22:17:24 2014 on firestorm +;;; (c) 1994-2017 by HIROSE Yuuji [yuuji(@)yatex.org] ;;; $Id$ -(defconst yahtml-revision-number "1.77" +(defconst yahtml-revision-number "1.80" "Revision number of running yahtml.el") ;;; Commentary: @@ -51,7 +50,7 @@ ;;; (setq yahtml-kanji-code 2) ;;; ;HTMLファイルの漢字コードを変更する場合は ;;; ;1=SJIS、2=JIS、3=EUC 4=UTF-8 -;;; ;で設定して下さい。デフォルトは 2 です。 +;;; ;で設定して下さい。デフォルトは 4 です。 ;;; ;;; を適切に書き換えて ~/.emacs に足して下さい。 ;;; @@ -186,7 +185,7 @@ "*Prefix key stroke of yahtml functions.") (defvar yahtml-image-viewer "display" "*Image viewer program") (defvar yahtml-www-browser "firefox" "*WWW Browser command") -(defvar yahtml-kanji-code 2 +(defvar yahtml-kanji-code 4 "*Kanji coding system number of html file; 1=sjis, 2=jis, 3=euc, 4=UTF-8") ;;(defvar yahtml-coding-system ;; (cdr (assq yahtml-kanji-code YaTeX-kanji-code-alist)) @@ -286,6 +285,10 @@ "*Non-nil means editing HTML 4.01 Strict. Completing read for obsoleted attributes disabled.") +(defvar yahtml-electric-indent-mode -1 + "*(Emacs 24.4+) Pass this value to electric-indent-local-mode. +-1 means `off'.") + ;;; --- customizable variable ends here --- (defvar yahtml-prefix-map nil) (defvar yahtml-mode-map nil "Keymap used in yahtml-mode.") @@ -365,6 +368,7 @@ (yahtml-define-begend-key "b3" "h3" map) (yahtml-define-begend-key "ba" "a" map) (yahtml-define-begend-key "bf" "form" map) + (yahtml-define-begend-key "bl" "label" map) (yahtml-define-begend-key "bs" "select" map) (yahtml-define-begend-key "bv" "div" map) (yahtml-define-begend-key "bS" "span" map) @@ -378,7 +382,7 @@ (YaTeX-define-key "k" 'yahtml-kill-* map) (YaTeX-define-key "c" 'yahtml-change-* map) (YaTeX-define-key "t" 'yahtml-browse-menu map) - (YaTeX-define-key "a" 'yahtml-complete-mark map) + (YaTeX-define-key "a" 'yahtml-char-entity-ref map) (YaTeX-define-key "'" 'yahtml-prev-error map) (YaTeX-define-key ";" 'yahtml-translate-region map) (YaTeX-define-key ":" 'yahtml-translate-reverse-region map) @@ -420,7 +424,7 @@ ;;; Completion tables for `form' (defvar yahtml-form-table - '(("img") ("input") ("link") ("meta"))) + '(("img") ("input") ("link") ("meta") ("label") ("source"))) (defvar yahtml-user-form-table nil) (defvar yahtml-tmp-form-table nil) (defvar yahtml-last-form "img") @@ -437,7 +441,9 @@ ("h1") ("h2") ("h3") ("h4") ("h5") ("h6") ;; ("p") ;This makes indentation screwed up! ("style") ("script") ("noscript") ("div") ("object") ("ins") ("del") - ("option") + ("option") ("datalist") + ;;HTML5 + ("video") ("audio") ("figure") ("iframe") )) (if yahtml-html4-strict @@ -469,7 +475,10 @@ (append '(("dfn") ("em") ("cite") ("code") ("kbd") ("samp") ("caption") ("strong") ("var") ("b") ("i") ("tt") ("big") ("small") - ("sup") ("sub") ("span") ("abbr")) + ("sup") ("sub") ("span") ("abbr") ("label") + ;; HTML5 + ("figcaption") + ) (if (not yahtml-html4-strict) '(("strike") ("s") ("u") ("font"))) yahtml-env-table) @@ -559,7 +568,7 @@ (defun yahtml-dir-default-charset () (let*((fn (file-name-nondirectory (or buffer-file-name ""))) (ext (substring fn (or (string-match "\\.[a-z0-9]+$" fn) 0))) - (ptn (format "^\\s *AddType.*charset=\\(.*\\)\\%s$" ext)) + (ptn (format "^\\s *AddType.*charset=\\(.*\\)\\%s\\>" ext)) (case-fold-search t) line charset) @@ -671,10 +680,12 @@ (use-local-map yahtml-mode-map) (YaTeX-read-user-completion-table) (yahtml-css-scan-styles) - (turn-on-auto-fill) ;Sorry, this is prerequisite + ;(turn-on-auto-fill) ;Sorry, this is prerequisite (and (= 0 (buffer-size)) (file-exists-p yahtml-template-file) (y-or-n-p (format "Insert %s?" yahtml-template-file)) (insert-file-contents (expand-file-name yahtml-template-file))) + (if (fboundp 'electric-indent-local-mode) + (electric-indent-local-mode yahtml-electric-indent-mode)) (run-hooks 'text-mode-hook 'yahtml-mode-hook) ;; This warning should be removed after a while(2000/12/2) @@ -830,7 +841,8 @@ (defun yahtml-insert-begend (&optional region env) "Insert <cmd> ... </cmd>." (interactive "P") - (setq yahtml-current-completion-type 'multiline) + (setq yahtml-current-completion-type 'multiline + region (or region (YaTeX-region-active-p))) (let*((completion-ignore-case t) (cmd (or env @@ -862,7 +874,7 @@ (insert "\n") (indent-to-column cc) (insert (format "</%s>" cmd))) - (if (string-match "^a\\|p$" cmd) ;aとp決め打ちってのが美しくない… + (if (string-match "^[ap]$" cmd) ;aとp決め打ちってのが美しくない… (newline) (yahtml-intelligent-newline nil)) (yahtml-indent-line)))) @@ -894,14 +906,16 @@ (save-excursion (insert (format "</%s>" form)))) (if (search-backward "\"\"" p t) (forward-char 1)))) -(defun yahtml-read-css (alist) +(defun yahtml-read-css (alist &optional element) (let ((completion-ignore-case t) (delim " ") - (minibuffer-completion-table alist)) - (read-from-minibuffer - (substitute-command-keys - (if YaTeX-japan - "クラス(複数指定は\\[quoted-insert] SPCで区切る): " - "class(or class list delimited by \\[quoted-insert] SPC): ")) + (minibuffer-completion-table alist) + (quotekey (substitute-command-keys "\\[quoted-insert]"))) + (read-from-minibuffer-with-history + (if YaTeX-japan + (format "%sクラス(複数指定は%s SPCで区切る): " + (if element (concat element "の") "") quotekey) + (format "class%s(multiple class can be delimited by %s SPC): " + (if element (concat " for " element) "") quotekey)) nil YaTeX-minibuffer-completion-map nil))) (defvar yahtml-newpage-command "newpage.rb" @@ -931,9 +945,9 @@ (and (setq a (yahtml-css-get-element-completion-alist form)) (not (equal (YaTeX-last-key) ?\C-j)) (memq yahtml-current-completion-type '(multiline inline)) - (not (string-match "#" form)) + (not (string-match "#\\|source" form)) (yahtml-make-optional-argument ;should be made generic? - "class" (yahtml-read-css a))) + "class" (yahtml-read-css a form))) (if (and (intern-soft addin) (fboundp (intern-soft addin)) (stringp (setq s (funcall (intern addin)))) (string< "" s)) @@ -941,18 +955,20 @@ "")))) (defvar yahtml-completing-buffer nil) -(defun yahtml-collect-labels (&optional file) +(defun yahtml-collect-labels (&optional file ptn withouthash) "Collect current buffers label (<?? name=...>). If optional argument FILE is specified collect labels in FILE." - (let (list end) + (let ((attrptn (concat "\\(" (or ptn "name\\|id") "\\)\\s *=")) + (hash (if withouthash "" "#")) + list end) (save-excursion - (set-buffer yahtml-completing-buffer) + (set-buffer (or yahtml-completing-buffer (current-buffer))) (if file (let (hilit-auto-highlight) (set-buffer (find-file-noselect file)))) (save-excursion (goto-char (point-min)) (while ;(re-search-forward "<\\w+\\b" nil t) - (re-search-forward "\\(name\\|id\\)\\s *=" nil t) + (re-search-forward attrptn nil t) ;(setq bound (match-end 0)) ;(search-forward ">" nil t) (setq end (match-end 0)) @@ -963,10 +979,13 @@ (skip-chars-forward " \t\n") (looking-at "\"?#?\\([^\">]+\\)\"?\\b"))) (setq list (cons - (list (concat "#" (YaTeX-match-string 1))) + (list (concat hash (YaTeX-match-string 1))) list)))) list)))) +(defun yahtml-collect-ids (&optional file) + (yahtml-collect-labels file "id" 'withouthash)) + (defvar yahtml-url-completion-map nil "Key map used in URL completion buffer") (if yahtml-url-completion-map nil (setq yahtml-url-completion-map @@ -982,7 +1001,7 @@ (min (if (fboundp 'field-beginning) (field-beginning) (point-min)))) (setq initial (YaTeX-minibuffer-string)) (cond - ((string-match "^http:" initial) + ((string-match "^htt" initial) (setq cmpl (try-completion initial yahtml-urls) listfunc (list 'lambda nil (list 'all-completions initial 'yahtml-urls)) @@ -1118,30 +1137,35 @@ (set-marker e nil)))) ;; ab%defgls/.| -(defun yahtml:a () - "Add-in function for <a>" +(defun yahtml-read-url (prompt) (let ((href "")) (setq yahtml-completing-buffer (current-buffer) yahtml-urls (append yahtml-urls-private yahtml-urls-local) href (yahtml-escape-chars-string - (read-from-minibuffer "href: " "" yahtml-url-completion-map))) + (read-from-minibuffer-with-history + prompt "" yahtml-url-completion-map))) (prog1 - (concat (yahtml-make-optional-argument - "href" href) - (yahtml-make-optional-argument - "name" (read-string "name: "))) - (if (and (string-match "^http://" href) + href + (if (and (string-match "^https?://" href) (null (assoc href yahtml-urls-private)) (null (assoc href yahtml-urls-local))) (YaTeX-update-table (list href) 'yahtml-urls-private 'yahtml-urls-private 'yahtml-urls-local))))) +(defun yahtml:a () + "Add-in function for <a>" + (let ((href (yahtml-read-url "href: "))) + (concat (yahtml-make-optional-argument + "href" href) + (yahtml-make-optional-argument + "name" (read-string-with-history "name: "))))) + (defvar yahtml-parameters-completion-alist '(("align" ("top") ("middle") ("bottom") ("left") ("right") ("center")) ("clear" ("left") ("right") ("center") ("all") ("none")) ("lang" ("ja") ("en") ("kr") ("ch") ("fr")) - ("src" . file) ("file" . file) + ("src" . file) ("file" . file) ("poster" . file) ("background" . file) ("class file name" . file) ("data" . file) ("method" ("POST") ("GET")) @@ -1149,7 +1173,9 @@ ("rel" . yahtml-link-types-alist) ("type" . yahtml-content-types-alist) ("codetype" . yahtml-content-types-alist) - ("http-equiv" ("Refresh")))) + ("http-equiv" ("Refresh") ("Content-Language") ("Content-Type")) + ("charset" + ("utf-8")("euc-jp")("iso-2022-jp")("iso-8859-1")("shift_jis")))) (defvar yahtml-link-types-alist '(("alternate") ("stylesheet") ("start") ("next") ("prev") @@ -1165,7 +1191,7 @@ ("image/jpeg") ("image/gif") ("image/tiff") ("image/png") ("video/mpeg")) "Alist of content-types") -(defun yahtml-read-parameter (par &optional default alist) +(defun yahtml-read-parameter (par &optional default alist predicate) (let* ((alist (cdr-safe (assoc (downcase par) (or alist yahtml-parameters-completion-alist)))) @@ -1174,17 +1200,29 @@ (cond ((eq alist 'file) (let ((insert-default-directory)) - (read-file-name prompt "" default nil ""))) + (read-file-name prompt "" default nil "" predicate))) ((eq alist 'command) (if (fboundp 'read-shell-command) (read-shell-command prompt) - (read-string prompt))) + (read-string-with-history prompt))) ((and alist (symbolp alist)) - (completing-read prompt (symbol-value alist) nil nil default)) + (completing-read-with-history + prompt (symbol-value alist) nil nil default)) (alist - (completing-read prompt alist nil nil default)) + (completing-read-with-history prompt alist nil nil default)) (t - (read-string prompt default))))) + (read-string-with-history prompt default))))) + +(defun yahtml-read-file-name-regexp + (prompt regexp &optional dir default-filename mustmatch initial) + (let ((pred + (function + (lambda (f) + (or (file-name-directory f) + (string-match regexp f))))) + (insert-default-directory nil)) + (read-file-name prompt dir default-filename mustmatch initial pred))) + (defun yahtml-make-optional-argument (opt arg) "Make optional argument string." @@ -1210,11 +1248,11 @@ (cond (yahtml-html4-strict nil) (t - (let ((b (read-string "bgcolor=")) + (let ((b (read-string-with-history "bgcolor=")) (bg (yahtml-read-parameter "background" "")) - (x (read-string "text color=")) - (l (read-string "link color=")) - (v (read-string "vlink color="))) + (x (read-string-with-history "text color=")) + (l (read-string-with-history "link color=")) + (v (read-string-with-history "vlink color="))) (concat (yahtml-make-optional-argument "bgcolor" b) (yahtml-make-optional-argument "background" bg) @@ -1233,9 +1271,9 @@ (defun yahtml:img () "Add-in function for <img>" (let ((src (yahtml-read-parameter "src")) - (alg (yahtml-read-parameter "align")) + (alg (if yahtml-html4-strict nil (yahtml-read-parameter "align"))) alt - (brd (read-string "border=")) + (brd (read-string-with-history "border=")) (l yahtml-prefer-upcase-attributes) info width height bytes comments) (and (stringp src) (string< "" src) (file-exists-p src) @@ -1272,7 +1310,7 @@ (cons "align" alg)) (if (string< "" brd) (cons "border" - (format "%dpx" (string-to-int brd)))))))) + (format "%dpx" (YaTeX-str2int brd)))))))) (concat (yahtml-make-optional-argument "border" brd) (yahtml-make-optional-argument "align" alg)))))) @@ -1393,25 +1431,31 @@ "Add-in function `form' input format" (concat " " (if yahtml-prefer-upcase-attributes "METHOD" "method") "=\"" - (completing-read "Method: " '(("POST") ("GET")) nil t) + (completing-read-with-history "Method: " '(("POST") ("GET")) nil t) "\"" (yahtml-make-optional-argument (if yahtml-prefer-upcase-attributes "ENCTYPE" "enctype") - (completing-read + (completing-read-with-history "Enctype: " '(("application/x-www-form-urlencoded") ("multipart/form-data")))) " " (if yahtml-prefer-upcase-attributes "ACTION" "action") "=\"" - (read-string "Action: ") "\"")) + (read-string-with-history "Action: ") "\"")) (defun yahtml:select () "Add-in function for `select' input format" - (setq yahtml-last-single-cmd "option") + (setq yahtml-last-single-cmd "option" ;;<- it's old + yahtml-last-typeface-cmd "option") (concat " " (if yahtml-prefer-upcase-attributes "NAME" "name") "=\"" - (read-string "name: ") "\"")) + (read-string-with-history "name: ") "\"")) +(defun yahtml:label () + "Add-in function for `<label>'" + (yahtml-make-optional-argument + "for" + (YaTeX-completing-read-or-skip "for=" (yahtml-collect-ids) nil t))) (defun yahtml:ol () "Add-in function for <ol>" - (setq yahtml-last-single-cmd "li") + (setq yahtml-last-typeface-cmd "li") (let ((start (YaTeX-read-string-or-skip "start=")) (type (YaTeX-completing-read-or-skip "type=" '(("1") ("a") ("A") ("i") ("I")) nil t))) @@ -1419,11 +1463,11 @@ (yahtml-make-optional-argument "start" start) (yahtml-make-optional-argument "type" type)))) (defun yahtml:ul () - (setq yahtml-last-single-cmd "li") "") + (setq yahtml-last-typeface-cmd "li") "") (defun yahtml:dl () - (setq yahtml-last-single-cmd "dt") "") + (setq yahtml-last-typeface-cmd "dt") "") (defun yahtml:dt () - (setq yahtml-last-single-cmd "dd") "") + (setq yahtml-last-typeface-cmd "dd") "") (defun yahtml:p () (if yahtml-html4-strict nil @@ -1436,12 +1480,14 @@ (defun yahtml:input () "Add-in function for `input' form" - (let ((size "") name type value checked (maxlength "") + (let ((size "") name type value id (maxlength "") (l yahtml-prefer-upcase-attributes)) - (setq name (read-string "name: ") + (setq name (read-string-with-history "name: ") type (YaTeX-completing-read-or-skip "type (default=text): " yahtml-input-types nil t) value (YaTeX-read-string-or-skip "value: ")) + (or (string-match "submit\\|reset" type) + (setq id (YaTeX-read-string-or-skip "id: "))) (if (string-match "text\\|password\\|^$" type) (setq size (YaTeX-read-string-or-skip "size: ") maxlength (YaTeX-read-string-or-skip "maxlength: "))) @@ -1449,16 +1495,24 @@ (if l "NAME" "name") "=\"" name "\"" (yahtml-make-optional-argument "type" type) (yahtml-make-optional-argument "value" value) + (yahtml-make-optional-argument "id" id) (yahtml-make-optional-argument "size" size) (yahtml-make-optional-argument "maxlength" maxlength)))) +(defun yahtml:datalist () + "Add-in function for `datalist' form" + (setq yahtml-last-typeface-cmd "option") + (let ((ids (yahtml-collect-ids))) + (yahtml-make-optional-argument + "id" (YaTeX-completing-read-or-skip "id: " ids nil t)))) + (defun yahtml:textarea () "Add-in function for `textarea'" (interactive) (let (name rows cols) - (setq name (read-string "Name: ") - cols (read-string "Columns: ") - rows (read-string "Rows: ")) + (setq name (read-string-with-history "Name: ") + cols (read-string-with-history "Columns: ") + rows (read-string-with-history "Rows: ")) (concat (concat (if yahtml-prefer-upcase-attributes "NAME=" "name=") "\"" name "\"") @@ -1467,9 +1521,10 @@ (defun yahtml:table () "Add-in function for `table'" - (let ((b (read-string "border=")) - (a (yahtml-read-parameter - "align" nil '(("align" ("right")("center")))))) + (let ((b (read-string-with-history "border=")) + (a (if yahtml-html4-strict "" + (yahtml-read-parameter + "align" nil '(("align" ("right")("center"))))))) (if yahtml-html4-strict (yahtml-make-optional-argument "style" @@ -1478,7 +1533,7 @@ (append (if (string< "" b) (list - (cons "border" (format "%dpx solid" (string-to-int b))) + (cons "border" (format "%dpx solid" (YaTeX-str2int b))) (cons "border-collapse" "collapse"))) (if (string< "" a) (cond @@ -1505,13 +1560,13 @@ (defun yahtml:font () "Add-in function for `font'" (concat - (yahtml-make-optional-argument "color" (read-string "color=")) - (yahtml-make-optional-argument "size" (read-string "size=")))) + (yahtml-make-optional-argument "color" (read-string-with-history "color=")) + (yahtml-make-optional-argument "size" (read-string-with-history "size=")))) (defun yahtml:style () "Add-in function for `style'" (yahtml-make-optional-argument - "type" (read-string "type=" "text/css"))) + "type" (read-string-with-history "type=" "text/css"))) (defun yahtml:script () "Add-in function for `script'" @@ -1523,8 +1578,7 @@ (defun yahtml:tr () "Add-in function for `tr'" - (setq ;yahtml-last-begend "td" ;; which do you prefer? - yahtml-last-typeface-cmd "td") + (setq yahtml-last-typeface-cmd "td") "") (defun yahtml:link () @@ -1546,7 +1600,8 @@ "type" (yahtml-read-parameter "type" "text/css")) (progn (setq href - (read-from-minibuffer "href: " "" yahtml-url-completion-map)) + (read-from-minibuffer-with-history + "href: " "" yahtml-url-completion-map)) (if (string< "" href) (progn (if (and (file-exists-p (yahtml-url-to-path href)) @@ -1563,45 +1618,56 @@ "type" (yahtml-read-parameter "type" "text/css")) (yahtml-make-optional-argument "href" - (read-from-minibuffer "href: " "" yahtml-url-completion-map))))))) + (read-from-minibuffer-with-history + "href: " "" yahtml-url-completion-map))))))) -(defvar yahtml:meta-names - '(("name" ("keywords")("author")("copyright")("date")("GENERATOR")))) +(defvar yahtml:meta-attrs + '(("charset" value) + ("name" content ("keywords")("author")("copyright")("date")("GENERATOR")) + ("http-equiv" content))) (defun yahtml:meta () - (let ((name (yahtml-make-optional-argument - "name" - (yahtml-read-parameter "name" nil yahtml:meta-names))) - http-equiv content) - (if (string= "" name) - (if (string-match - "Content-type" - (setq http-equiv (yahtml-make-optional-argument - "http-equiv" - (yahtml-read-parameter "http-equiv" nil)))) - (error "It's very bad idea to set Content-type in META. %s" - "See docs/qanda") - (concat http-equiv - (yahtml-make-optional-argument - "content" (yahtml-read-parameter "content")))) + (let ((attr (completing-read-with-history + "Meta Attribute: " yahtml:meta-attrs)) + (case-fold-search t) + (completion-ignore-case t) + todonext name http-equiv content) + (cond + ((string= "" attr) nil) + ((and (setq todonext (cdr-safe (assoc attr yahtml:meta-attrs))) + (eq 'value (car todonext))) + (yahtml-make-optional-argument attr (yahtml-read-parameter attr))) + ((eq 'content (car todonext)) + (setq name (if (cdr todonext) + (completing-read-with-history + (format "%s: " attr) (cdr todonext)) + (yahtml-read-parameter attr))) (concat - name + (yahtml-make-optional-argument attr name) (yahtml-make-optional-argument "content" (cond ((string-match "date" name) - (read-string "Date: " (current-time-string))) + (read-string-with-history "Date: " (current-time-string))) ((string-match "author" name) - (read-string "Author: " + (read-string-with-history "Author: " (if (and (user-full-name) (string< "" (user-full-name))) (user-full-name) (user-login-name)))) ((string-match "GENERATOR" name) - (setq content (read-string "Generator: " "User-agent: ")) + (setq content (read-string-with-history + "Generator: " "User-agent: ")) (if (string-match "yahtml" content) (message "Thank you!")) content) - (t (read-string (concat name ": "))))))))) + ((string-match "content-type" name) + (if (string-match "http-equiv" attr ) + (error "Use <meta charset=\"...\" instead.. See docs/qanda.") + (yahtml-make-optional-argument + "content" (yahtml-read-parameter "content")))) + (t (read-string-with-history (concat name ": "))))))) + (t (yahtml-make-optional-argument + attr (yahtml-read-parameter attr)))))) (defun yahtml:br () (yahtml-make-optional-argument "clear" (yahtml-read-parameter "clear"))) @@ -1622,9 +1688,7 @@ (yahtml-make-optional-argument "width" (yahtml-read-parameter "width")) (yahtml-make-optional-argument - "height" (yahtml-read-parameter "height")) - (yahtml-make-optional-argument - "align" (yahtml-read-parameter "align")))) + "height" (yahtml-read-parameter "height")))) (t "")))) @@ -1646,7 +1710,8 @@ (defun yahtml-insert-tag (region-mode &optional tag) "Insert <TAG> </TAG> and put cursor inside of them." (interactive "P") - (setq yahtml-current-completion-type 'inline) + (setq yahtml-current-completion-type 'inline + region-mode (or region-mode (YaTeX-region-active-p))) (or tag (let ((completion-ignore-case t)) (setq tag @@ -1743,6 +1808,50 @@ (format "cmd=\"%s\"--" (yahtml-read-parameter "cmd" "" '(("cmd" . command))))) +(defun yahtml:media-read-options (&optional opts-alist) + (let*((delim " ") + (minibuffer-completion-table + (or opts-alist '(("autoplay") ("controls") ("loop") ("preload")))) + (quotekey (substitute-command-keys "\\[quoted-insert]"))) + (read-from-minibuffer-with-history + (format "Media Opts(`%s SPC' for more options): " quotekey) + "controls" YaTeX-minibuffer-completion-map))) + +(defun yahtml:audio () + ;preload autoplay loop controls: `src' be specified via `source' + (yahtml:media-read-options)) + +(defun yahtml:video () + ;`src' be specified via `source' + (let ((poster (yahtml-make-optional-argument + "poster" + (yahtml-read-file-name-regexp + "Poster: " "\\.\\(gif\\|png\\|jpg\\|w?bmp\\|pict\\|tif\\)" + ""))) + (opts (yahtml:media-read-options))) + (concat poster (if (string< "" opts) (concat " " opts))))) + +(defvar yahtml-media-file-regexp + "\\.\\(mp[0-9]\\|wav\\|og[gv]\\|opus\\|aac\\)" + "*Default filename regexp of media files.") + +(defun yahtml:source () + ;; source element must have src attribute + (format "src=\"%s\"" (yahtml-read-file-name-regexp + "source: " yahtml-media-file-regexp "" "" nil ""))) + +(defun yahtml:figure () + (setq yahtml-last-typeface-cmd "figcaption")) + +(defun yahtml:iframe () + (let ((src (yahtml-read-url "src: "))) + (concat + (yahtml-make-optional-argument "src" src) + (yahtml-make-optional-argument + "width" (YaTeX-read-string-or-skip "width: ")) + (yahtml-make-optional-argument + "height" (YaTeX-read-string-or-skip "height: "))))) + ;;; ---------- Jump ---------- (defun yahtml-on-href-p () "Check if point is on href clause." @@ -1831,7 +1940,9 @@ (cond ((string-match "^\\(ht\\|f\\)tps?:" href) (yahtml-browse-html href)) - (t (setq file (substring href 0 (string-match "#" href))) + (t (if (string-match "\&" href) + (setq href (yahtml-untranslate-string href))) + (setq file (substring href 0 (string-match "#" href))) (if (string-match "#" href) (setq name (substring href (1+ (string-match "#" href))))) (if (string< "" file) @@ -2137,7 +2248,7 @@ (if (and (equal attr "class") ;treat "class" attribute specially (setq css (yahtml-css-get-element-completion-alist tag))) - (setq new (yahtml-read-css css)) + (setq new (yahtml-read-css css tag)) ;;other than "class", read parameter normally (setq new (yahtml-read-parameter attr))) (goto-char (car (get 'yahtml-on-assignment-p 'region))) @@ -2374,7 +2485,8 @@ (let ((e (cond ((null e) "td") ((stringp e) e) - (t (read-string "Enclose with(`thd' means th td td..): " "th")))) + (t (read-string-with-history + "Enclose with(`thd' means th td td..): " "th")))) (ws "[ \t]") elm p i) (if (string= delim "") (setq delim " \t\n")) @@ -2406,8 +2518,8 @@ "Enclose lines in a form tab-sv/csv with <tr><td>..</td></tr>." (interactive "P\nsDelimiter(s): \nr") (setq e (if (and e (listp e)) - (read-string "Enclose with(td or th, `thd' -> th td td td...: " - "th"))) + (read-string-with-history + "Enclose with(td or th, `thd' -> th td td td...: " "th"))) (save-excursion (save-restriction (narrow-to-region (point) (mark)) @@ -2493,13 +2605,6 @@ (match-beginning 0)))) (fset 'move-to-column yahtml-saved-move-to-column))))) -;(defun yahtml-indent-new-commnet-line () -; (unwind-protect -; (progn -; (fset 'move-to-column 'yahtml-move-to-column) -; (apply 'YaTeX-saved-indent-new-comment-line (if soft (list soft)))) -; (fset 'move-to-column yahtml-saved-move-to-column))) - ;;; ;;; ---------- move forward/backward field ---------- ;;; @@ -2513,7 +2618,8 @@ "body"))) (setq path (cons elm path) elm nil)) - (and elm (setq path (cons elm path)))))) + (and elm (setq path (cons elm path))) + path))) (defun yahtml-forward-field (arg) "Move ARGth forward cell to table element. @@ -2753,7 +2859,7 @@ (if (file-directory-p (car (car list))) (progn (setq url (cdr (car list))) - (if (string-match "\\(http://[^/]*\\)/" url) + (if (string-match "\\(https?://[^/]*\\)/" url) (setq docroot (substring url (match-end 1))) (setq docroot url)) (cond @@ -2826,6 +2932,11 @@ (fset 'yahtml-intelligent-newline-ol 'yahtml-intelligent-newline-ul) +(defun yahtml-intelligent-newline-datalist () + (interactive) + (yahtml-insert-form "option") + (save-excursion (yahtml-insert-form "/option"))) + (defun yahtml-intelligent-newline-dl () (interactive) (let ((case-fold-search t)) @@ -2871,7 +2982,7 @@ (YaTeX-reindent c)))) (defun yahtml-intelligent-newline-head () - (let ((title (read-string "Document title: ")) + (let ((title (read-string-with-history "Document title: ")) (b "<title>") (e "</title>") p) (yahtml-indent-line) (insert (format "%s" (if yahtml-prefer-upcases (upcase b) b))) @@ -2913,7 +3024,7 @@ (progn (skip-chars-forward "\"' \t\n") (looking-at "[0-9]+"))) - (setq cols (+ (string-to-int (YaTeX-match-string 0)) cols)) + (setq cols (+ (YaTeX-str2int (YaTeX-match-string 0)) cols)) (setq cols (1+ cols))) (goto-char rb) (setq p (point))) @@ -2932,7 +3043,8 @@ (setq line (concat line (if (and (= i 0) th) "<th></th>" "<td></td>")) th nil i (1+ i))) - (setq fmt (read-string "`th' or `td' format: " "th td td")) + (setq fmt (read-string-with-history + "`th' or `td' format: " "th td td")) (while (string-match "t\\(h\\)\\|td" fmt i) (setq line (concat line (if (match-beginning 1) "<th></th>" "<td></td>")) @@ -2949,6 +3061,25 @@ (goto-char (+ 8 cp)) (yahtml-indent-line))))))) +(defun yahtml-intelligent-newline-audio () + (let (b e) + (if (save-excursion + (goto-char (setq b (get 'YaTeX-inner-environment 'point))) + (forward-list 1) + (setq e (point)) + (catch 'src + (while (re-search-forward "\\s src\\>" e t) + (skip-chars-forward " \t\n") + (and (looking-at "=") (throw 'src t))))) + ;; if src= attribute found, do nothing + (setq yahtml-last-begend "p") + (yahtml-insert-single "source") + ))) +(fset 'yahtml-intelligent-newline-video 'yahtml-intelligent-newline-audio) + +(defun yahtml-intelligent-newline-iframe () + (insert "<p>Your browser does not support iframes.</p>")) + ;;; ---------- Marking ---------- (defun yahtml-mark-begend () "Mark current tag" @@ -2964,18 +3095,19 @@ (if (eolp) (forward-char 1))) ;;; ---------- complete marks ---------- -(defun yahtml-complete-mark () - "Complete >, <, &ersand, and "e." +(defun yahtml-char-entity-ref () + "Complete >, <, &, and "." (interactive) (message "1:< 2:> 3:& 4:\" 5:' 6:nbsp") - (let ((c (read-char))) - (setq c (if (or (< c ?0) (> c ?7)) - (string-match (regexp-quote (char-to-string c)) "<>&\"") + (let ((c (read-char)) d) + (setq d (if (or (< c ?0) (> c ?7)) + (string-match (regexp-quote (char-to-string c)) "<>&\"' ") (- c ?1))) - (if (or (< c 0) (> c 6)) - nil + (cond + ((null d) (insert (format "&#x%x;" c))) + ((and (>= d 0) (<= d 6)) (insert (format "&%s;" - (nth c '("lt" "gt" "amp" "quot" "apos" "nbsp"))))))) + (nth d '("lt" "gt" "amp" "quot" "apos" "nbsp")))))))) ;;; ---------- jump to error line ---------- @@ -2995,7 +3127,7 @@ (let ((f (if (string= "" (YaTeX-match-string 1)) YaTeX-current-file-name (YaTeX-match-string 1))) - (l (string-to-int (or (YaTeX-match-string 2) + (l (YaTeX-str2int (or (YaTeX-match-string 2) (YaTeX-match-string 3))))) (if sit (sit-for 1)) (forward-line -1) @@ -3232,5 +3364,4 @@ ; fill-prefix: ";;; " ; paragraph-start: "^$\\|\\|;;;$" ; paragraph-separate: "^$\\|\\|;;;$" -; coding: sjis ; End:
--- a/yatex.el Fri Dec 26 01:06:32 2014 +0900 +++ b/yatex.el Sun Sep 17 10:25:38 2017 +0859 @@ -1,14 +1,22 @@ ;;; yatex.el --- Yet Another tex-mode for emacs //野鳥// -*- coding: sjis -*- -;;; (c)1991-2014 by HIROSE Yuuji.[yuuji@yatex.org] -;;; Last modified Fri Dec 26 00:04:43 2014 on firestorm +;;; (c)1991-2017 by HIROSE Yuuji.[yuuji@yatex.org] +;;; Last modified Sun Sep 17 10:22:43 2017 on firestorm ;;; $Id$ ;;; The latest version of this software is always available at; -;;; http://www.yatex.org/ +;;; https://www.yatex.org/ + +;;; This program is distributed as a free software. You can +;;; use/copy/modify/redistribute this software freely but with NO +;;; warranty to anything as a result of using this software. Adopting +;;; code from this program is also free. But I would not do contract +;;; act. +;;; +;;; This software can be treated with: ``The 2-Clause BSD License'' +;;; (since 2017-09-09, yatex 1.80). ;;; Code: -(require 'comment) (require 'yatexlib) -(defconst YaTeX-revision-number "1.78" +(defconst YaTeX-revision-number "1.80.1" "Revision number of running yatex.el") ;---------- Local variables ---------- @@ -44,16 +52,19 @@ (YaTeX-use-LaTeX2e "platex") (YaTeX-japan "jlatex") (t "latex")) - "*Default command for typesetting LaTeX text.") + "*Default command for typesetting LaTeX text. +Overridden with `%#! CommandLine...' in the buffer.") (defvar bibtex-command (if YaTeX-japan "jbibtex" "bibtex") - "*Default command of BibTeX.") + "*Default command of BibTeX. +Overridden with `%#BIBTEX CommandLine...' in the buffer.") (defvar dvi2-command ;previewer command for your site - (if YaTeX-dos "dviout -wait=0" - "xdvi -geo +0+0 -s 4") + (cond (YaTeX-dos "dviout -wait=0") + (YaTeX-macos "open -a Preview") + (t "xdvi -geo +0+0 -s 4")) "*Default previewer command including its option. -This default value is for X window system.") +Overridden with `%#PREVIEW CommandLine...' in the buffer.") (defvar YaTeX-cmd-gimp "gimp") (defvar YaTeX-cmd-tgif "tgif") @@ -61,7 +72,8 @@ (defvar YaTeX-cmd-dia "dia") (defvar YaTeX-cmd-ooo "soffice") (defvar YaTeX-cmd-gs "gs") -(defvar YaTeX-cmd-dvips "dvips") ;Set "pdvips" for Vine Linux +(defvar YaTeX-cmd-dvips + (if (YaTeX-executable-find "pdvips") "pdvips" "dvips")) (defvar YaTeX-cmd-displayline "/Applications/Skim.app/Contents/SharedSupport/displayline") (defvar YaTeX-cmd-edit-ps YaTeX-cmd-gimp) @@ -78,15 +90,18 @@ ((file-executable-p YaTeX-cmd-displayline) "open -a Skim") (t "open"))) (t "evince")) - "*Default PDF viewer command including its option.") + "*Default PDF viewer command including its option. +Overridden with `%#PDFVIEW CommandLine...' in the buffer.") (defvar makeindex-command (if YaTeX-dos "makeind" "makeindex") - "*Default makeindex command.") + "*Default makeindex command. +Overridden with `%#MAKEINDEX CommandLine...' in the buffer.") (defvar dviprint-command-format (if YaTeX-dos "dviprt %s %f%t" "dvi2ps %f %t %s | lpr") "*Command line string to print out current file. +Overridden with `%#LPR CommandLine...' in the buffer. Format string %s will be replaced by the filename. Do not forget to specify the `from usage' and `to usage' with their option by format string %f and %t. @@ -102,7 +117,8 @@ (defvar YaTeX-dvipdf-command "dvipdfmx" - "*Command name to convert dvi file to PDF.") + "*Command name to convert dvi file to PDF. +Overridden with `%#DVIPDF CommandLine...' in the buffer.") (defvar YaTeX-default-document-style (concat (if YaTeX-japan "js") "article") @@ -230,6 +246,10 @@ (defvar YaTeX-tabular-indentation 4 "*Indentation column-depth of continueing line in tabular environment.") +(defvar YaTeX-electric-indent-mode -1 + "*(for Emacs 24.4+) Pass this value to electric-indent-local-mode. +-1 means `off'.") + ;;-- Math mode values -- (defvar YaTeX-math-key-list-default @@ -272,7 +292,7 @@ ("footnote") ("footnotetext") ("index") ("hspace*") ("vspace*") ("bibliography") ("bibitem") ("cite") ("input") ("include") ("includeonly") ("mbox") ("hbox") ("caption") - ("arabic") + ("arabic") ("cetering") ("uline") ("newcounter") ("newlength") ("setlength" 2) ("addtolength" 2) ("settowidth" 2) ("setcounter" 2) ("addtocounter" 2) ("stepcounter" 2) @@ -285,16 +305,19 @@ ("tilde") ("hat") ("check") ("bar") ("dot") ("ddot") ("vec") ("widetilde") ("widehat") ("overline") ("overrightarrow") ;; section types in mathmode - ("frac" 2) ("sqrt") ("mathrm") ("mathbf") ("mathit") + ("frac" 2) ("sqrt") ("mathrm") ("mathbf") ("mathit") ("mathbb") + ("mathscr") ("mathrsfs") ;;cleveref ("cref") ("crefrange") ("cpageref") ("labelcref") ("labelcpageref") + ;; beamer + ("frametitle") ("framesubtitle") ) (if YaTeX-use-LaTeX2e '(("documentclass") ("usepackage") ("textbf") ("textgt") ("textit") ("textmc") ("textmd") ("textnormal") ("textrm") ("textsc") ("textsf") ("textsl") ("texttt") ("textup") ("mathbf") ("mathcal") ("mathit") ("mathnormal") ("mathrm") - ("mathsf") ("mathtt") + ("mathsf") ("mathtt") ("text") ("textcircled") ("scalebox" 1) ;is faking of argument position ("rotatebox" 2) ("resizebox" 3) ("reflectbox") @@ -325,12 +348,23 @@ ("split") ("split*") ("aligned") ("aligned*") ("alignedat") ("gathered") ("smallmatrix") ("cases") ("subequations"))) ;; Prepare list(not alist) for YaTeX::ref in yatexadd.el +(defvar YaTeX-math-other-env-alist-default + '(("numcases") ("subnumcases")) + "Default alist of additional environments for equations") +(defvar YaTeX-math-other-env-alist-private nil + "*User defined alist of additional environments for equations") +(defvar YaTeX-math-other-env-alist + (append YaTeX-math-other-env-alist-default + YaTeX-math-other-env-alist-private) + "Alist of additional environments for equations") +(defvar YaTeX-math-other-env-list + (mapcar 'car YaTeX-math-other-env-alist)) + (defvar YaTeX-math-begin-list (mapcar 'car YaTeX-ams-math-begin-alist)) (defvar YaTeX-math-gathering-list ;used in yatexadd.el#yatex::ref (mapcar 'car YaTeX-ams-math-gathering-alist)) - (defvar YaTeX-ams-env-table (append YaTeX-ams-math-begin-alist YaTeX-ams-math-gathering-alist) "*Standard AMS-LaTeX(2e) environment completion table.") @@ -348,6 +382,7 @@ ("minipage") ("supertabular") ("wrapfigure") ("wraptable") + ("frame") ("block") ("example") ("columns") ("column") ;beamer ) (if YaTeX-use-LaTeX2e '(("comment") ;defined in version @@ -356,7 +391,8 @@ ("alltt") ;defined in alltt ("multicols") ;defined in multicol ("breakbox"))) ;defined in eclbkbox - (if YaTeX-use-AMS-LaTeX YaTeX-ams-env-table)) + (if YaTeX-use-AMS-LaTeX YaTeX-ams-env-table) + YaTeX-math-other-env-alist) "Default completion table for begin-type completion.") (defvar user-env-table nil) @@ -390,15 +426,17 @@ (defvar singlecmd-table (append - '(("maketitle") ("makeindex") ("sloppy") ("protect") ("par") + '(("maketitle") ("makeindex") ("sloppy") ("protect") ("par") ("and") ("LaTeX") ("TeX") ("item") ("item[]") ("appendix") ("hline") ("kill") ;;("rightarrow") ("Rightarrow") ("leftarrow") ("Leftarrow") ("pagebreak") ("nopagebreak") ("tableofcontents") ("newpage") ("clearpage") ("cleardoublepage") ("footnotemark") ("verb") ("verb*") ("linebreak") ("pagebreak") ("noindent") ("indent") + ("raggedright") ("raggedleft") ("centering") ("left") ("right") ("dots") ("smallskip") ("medskip") ("bigskip") ("displaystyle") + ("onslide") ("pause") ;beamer ) (if YaTeX-greek-by-maketitle-completion '(("alpha") ("beta") ("gamma") ("delta") ("epsilon") @@ -567,7 +605,7 @@ "*Initial tex-section completion") (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) +(defvar YaTeX-kanji-code nil "*File kanji code used by Japanese TeX. nil: Do not care (Preserve coding-system) 0: no-converion (mule) @@ -601,6 +639,18 @@ (modify-syntax-entry ?\\ "/" YaTeX-mode-syntax-table) (modify-syntax-entry ?~ " " YaTeX-mode-syntax-table)) +(defvar YaTeX-mode-syntax-table-nonparen nil + "Syntax table for yatex-mode with normal parentheses treated white spaces") +(if YaTeX-mode-syntax-table-nonparen nil + (setq YaTeX-mode-syntax-table-nonparen + (make-syntax-table YaTeX-mode-syntax-table)) + (let ((zenparens "()()「」『』【】[]{}《》〈〉〔〕") (i 0) s) + (while (string-match "." zenparens i) + (setq s (substring zenparens (match-beginning 0) (match-end 0)) + i (1+ i)) + (modify-syntax-entry + (string-to-char s) " " YaTeX-mode-syntax-table-nonparen)))) + ;---------- Provide YaTeX-mode ---------- ;;; ;; Major mode definition @@ -708,7 +758,9 @@ (YaTeX-read-user-completion-table) (and (fboundp 'YaTeX-hilit-setup-alist) (YaTeX-hilit-setup-alist)) (makunbound 'inenv) - (turn-on-auto-fill) ;1.63 + ;(turn-on-auto-fill) ;1.63 -> 1.79off + (if (fboundp 'electric-indent-local-mode) + (electric-indent-local-mode YaTeX-electric-indent-mode)) (and (= 0 (buffer-size)) (file-exists-p YaTeX-template-file) (y-or-n-p (format "Insert %s?" YaTeX-template-file)) (insert-file-contents (expand-file-name YaTeX-template-file))) @@ -864,16 +916,18 @@ you can put REGION into that environment between \\begin and \\end." (interactive "P") (let* - ((mode (if arg " region" "")) + ((region-p (or arg (YaTeX-region-active-p))) + (mode (if region-p " region" "")) (env - (YaTeX-read-environment - (format "Begin environment%s(default %s): " mode YaTeX-env-name)))) + (save-excursion ;for Emacs24 work-around to avoid point warp + (YaTeX-read-environment + (format "Begin environment%s(default %s): " mode YaTeX-env-name))))) (if (string= env "") (setq env YaTeX-env-name)) (setq YaTeX-env-name env) (YaTeX-update-table (list YaTeX-env-name) 'env-table 'user-env-table 'tmp-env-table) - (YaTeX-insert-begin-end YaTeX-env-name arg))) + (YaTeX-insert-begin-end YaTeX-env-name region-p))) (defun YaTeX-make-begin-end-region () "Call YaTeX-make-begin-end with ARG to specify region mode." @@ -928,7 +982,8 @@ Optional 4th arg CMD is LaTeX command name, for non-interactive use." (interactive "P") (setq YaTeX-current-completion-type 'section) - (if (equal arg '(4)) (setq beg (region-beginning) end (region-end))) + (if (or (equal arg '(4)) (YaTeX-region-active-p)) + (setq beg (region-beginning) end (region-end))) (unwind-protect (let* ((source-window (selected-window)) @@ -969,7 +1024,7 @@ (addin-args (funcall arg-reader j)) (YaTeX-skip-default-reader "") (t - (read-string + (read-string-with-history (format "Argument %d of %s: " j section))))) (insert (concat ;to allow nil return value @@ -1028,7 +1083,9 @@ \(key binding for universal-argument is \\[universal-argument]\)" (interactive "P") (YaTeX-sync-local-table 'tmp-fontsize-table) - (let* ((mode (if arg "region" "")) + (let* ((region-p (if (or arg (YaTeX-region-active-p)) + (cons (region-beginning) (region-end)))) + (mode (if region-p "region" "")) (fontsize (or fontsize (YaTeX-read-fontsize @@ -1050,12 +1107,14 @@ (setq fontsize (cdr (assoc YaTeX-fontsize-name LaTeX2e-fontstyle-alist))) (setq YaTeX-fontsize-name fontsize)) - (if arg - (save-excursion - (if (> (point) (mark)) (exchange-point-and-mark)) + (if region-p + (let ((b (car region-p)) + (e (set-marker (make-marker) (cdr region-p)))) + (goto-char b) (insert "{\\" YaTeX-fontsize-name " ") - (exchange-point-and-mark) - (insert "}")) + (goto-char e) + (insert "}") + (set-marker e nil)) (insert (concat "{\\" YaTeX-fontsize-name " }")) (forward-char -1) (if YaTeX-current-position-register @@ -1262,11 +1321,13 @@ (car (where-is-internal 'YaTeX-make-begin-end)))) (point)) (put 'YaTeX-insert-braces 'begend-guide - (+ 1 (string-to-int ;increment counter of beg-end guidance + (+ 1 (YaTeX-str2int ;increment counter of beg-end guidance (prin1-to-string (get 'YaTeX-insert-braces 'begend-guide))))))))) env macro not-literal b e) (cond + ((YaTeX-region-active-p) + (YaTeX-insert-braces-region (region-beginning) (region-end))) ((YaTeX-jmode) (YaTeX-self-insert arg)) ((not (YaTeX-closable-p)) (YaTeX-self-insert arg)) ((save-excursion @@ -1386,6 +1447,8 @@ (interactive "p") (let ((col (1- (current-column)))) (cond + ((YaTeX-region-active-p) + (YaTeX-insert-brackets-region (region-beginning) (region-end))) ((YaTeX-jmode) (YaTeX-self-insert arg)) ((not (YaTeX-closable-p)) (YaTeX-self-insert arg)) @@ -1432,6 +1495,8 @@ "Insert parenthesis pair." (interactive "p") (cond + ((YaTeX-region-active-p) + (YaTeX-insert-parens-region (region-beginning) (region-end))) ((YaTeX-jmode) (YaTeX-self-insert arg)) ((not (YaTeX-closable-p)) (YaTeX-self-insert arg)) ((save-excursion @@ -1656,20 +1721,23 @@ "Operate %# notation." ;;Do not use interactive"r" for the functions which require no mark (interactive) - (message "!)Edit-%%#! B)EGIN-END-region P)review L)Edit-%%#LPR make(I)ndex B)ibtex") + (message "!)Edit-%%#! D)VIPDF B)EGIN-END P)review pdf(V)iew L)PR M)akeidx b)ibtex dp(I)") (let ((c (or char (read-char))) (string "") key (b (make-marker)) (e (make-marker))) (save-excursion (cond - ((rindex "!plib" c) ;Edit %#xxx + ((rindex "!plmibdv" c) ;Edit %#xxx (setq key (cdr (assq c '((?! . "!") (?p . "PREVIEW") (?l . "LPR") - (?i . "MAKEINDEX") + (?m . "MAKEINDEX") + (?d . "DVIPDF") + (?v . "PDFVIEW") + (?i . "IMAGEDPI") (?b . "BIBTEX"))))) (YaTeX-getset-builtin key t)) - ((= c ?b) ;%#BEGIN %#END region + ((= c ?B) ;%#BEGIN %#END region (or end (setq beg (min (point) (mark)) end (max (point) (mark)))) (set-marker b beg) (set-marker e end) @@ -1684,8 +1752,7 @@ (goto-char e) (insert "%#END\n") (set-marker b nil) - (set-marker e nil)) - )))) + (set-marker e nil)))))) (defvar YaTeX-refcommand-def-regexp-default "label\\|bibitem") @@ -2036,10 +2103,14 @@ (goto-char (match-beginning 0)) (throw 'found t)) ;;If inside of parentheses, try to escape. - (while (and (not (= (preceding-char) ?\])) ;skip optional arg - (condition-case err - (progn (up-list -1) t) - (error nil)))) + (unwind-protect + (progn + (set-syntax-table YaTeX-mode-syntax-table-nonparen) + (while (and (not (= (preceding-char) ?\])) ;skip optional arg + (condition-case err + (progn (up-list -1) t) + (error nil))))) + (set-syntax-table YaTeX-mode-syntax-table)) (while (equal (preceding-char) ?\]) (backward-list)) ;;(2) search command directly (skip-chars-forward "^{}[]") @@ -2131,7 +2202,7 @@ (concat "\\(" YaTeX-struct-name-regexp "\\)") "" "" "") "\\|\\(" YaTeX-ec-regexp ;;"[][()]\\)" - "[][]\\)" + "[\\]\\[]\\)" ) (point-end-of-line) t))) @@ -2194,34 +2265,40 @@ it comments out whole environment" (interactive "P") (if (not (YaTeX-on-begin-end-p)) - (comment-out-region + (YaTeX-comment-region-sub (if alt-prefix - (read-string "Insert prefix: ") + (read-string-with-history "Insert prefix: ") YaTeX-comment-prefix)) - (YaTeX-comment-uncomment-env 'comment-out-region))) + (YaTeX-comment-uncomment-env 'YaTeX-comment-region-sub))) (defun YaTeX-uncomment-region (alt-prefix) "Uncomment out region by '%'." (interactive "P") (if (not (YaTeX-on-begin-end-p)) - (uncomment-out-region - (if alt-prefix (read-string "Remove prefix: ") + (YaTeX-uncomment-region-sub + (if alt-prefix (read-string-with-history "Remove prefix: ") YaTeX-comment-prefix) (region-beginning) (region-end) YaTeX-uncomment-once) - (YaTeX-comment-uncomment-env 'uncomment-out-region))) + (YaTeX-comment-uncomment-env 'YaTeX-uncomment-region-sub))) (defun YaTeX-comment-uncomment-env (func) "Comment or uncomment out one LaTeX environment switching function by FUNC." - (let (beg (p (point))) + (let (beg beg2 (p (point))) (save-excursion - (beginning-of-line) - (setq beg (point)) - (YaTeX-goto-corresponding-environment) - (beginning-of-line) - (if (> p (point)) (setq beg (1+ beg)) (forward-char 1)) - (funcall func YaTeX-comment-prefix beg (point) YaTeX-uncomment-once))) + (beginning-of-line) + (setq beg (point)) + (save-match-data + (while (and (not (eobp)) + (not (eolp)) + (looking-at YaTeX-comment-prefix)) + (goto-char (match-end 0)))) + (setq beg2 (point)) + (YaTeX-goto-corresponding-environment) + (beginning-of-line) + (if (> p (point)) (setq beg (1+ beg2)) (forward-char 1)) + (funcall func YaTeX-comment-prefix beg (point) YaTeX-uncomment-once))) (message "%sommented out current environment." - (if (eq func 'comment-out-region) "C" "Un-c"))) + (if (string-match "uncom" (symbol-name func)) "Un-c" "C"))) (defun YaTeX-comment-paragraph () "Comment out current paragraph." @@ -2239,7 +2316,7 @@ (t (mark-paragraph) (if (looking-at paragraph-separate) (forward-line 1)) - (comment-out-region "%"))))) + (YaTeX-comment-region-sub "%"))))) (defun YaTeX-uncomment-paragraph () "Uncomment current paragraph." @@ -2261,7 +2338,7 @@ (paragraph-separate paragraph-start)) (mark-paragraph) (if (not (bobp)) (forward-line 1)) - (uncomment-out-region "%" nil nil YaTeX-uncomment-once)) + (YaTeX-uncomment-region-sub "%" nil nil YaTeX-uncomment-once)) (message "This line is not a comment line."))))) (defun YaTeX-remove-prefix (prefix &optional once) @@ -2590,6 +2667,9 @@ ((YaTeX-on-section-command-p YaTeX-command-token-regexp);on any command (YaTeX-kill-section-command (match-beginning 0) arg)) ((YaTeX-kill-paren arg)) + ((and (fboundp 'overlays-at) + (member YaTeX-on-the-fly-overlay (overlays-at (point)))) + (YaTeX-on-the-fly-cancel)) (t (message "I don't know what to kill.")))) (defun YaTeX-change-* () @@ -2666,64 +2746,6 @@ YaTeX-verbatim-environments)))))) (store-match-data md)))) -(defun YaTeX-in-environment-p (env) - "Return if current LaTeX environment is ENV. -ENV is given in the form of environment's name or its list." - (let ((md (match-data)) (nest 0) p envrx) - (cond - ((atom env) - (setq envrx - (concat "\\(" - (regexp-quote - (YaTeX-replace-format-args - YaTeX-struct-begin env "" "")) - "\\>\\)\\|\\(" - (regexp-quote - (YaTeX-replace-format-args - YaTeX-struct-end env "" "")) - "\\)")) - (save-excursion - (setq p (catch 'open - (while (YaTeX-re-search-active-backward - envrx YaTeX-comment-prefix nil t) - (if (match-beginning 2) - (setq nest (1+ nest)) - (setq nest (1- nest))) - (if (< nest 0) - (throw 'open (cons env (match-beginning 0))))))))) - ((listp env) - (setq p - (or (YaTeX-in-environment-p (car env)) - (and (cdr env) (YaTeX-in-environment-p (cdr env))))))) - (store-match-data md) - p;(or p (YaTeX-in-verb-p (match-beginning 0))) - )) - -(defun YaTeX-quick-in-environment-p (env) - "Check quickly but unsure if current environment is ENV. -ENV is given in the form of environment's name or its list. -This function returns correct result only if ENV is NOT nested." - (save-excursion - (let ((md (match-data)) m0 (p (point)) rc clfound) - (cond - ((listp env) - (or (YaTeX-quick-in-environment-p (car env)) - (and (cdr env) (YaTeX-quick-in-environment-p (cdr env))))) - (t - (unwind-protect - (if (prog1 - (YaTeX-search-active-backward - (YaTeX-replace-format-args YaTeX-struct-begin env "" "") - YaTeX-comment-prefix nil t) - (setq m0 (match-beginning 0))) - (if (YaTeX-search-active-forward - (YaTeX-replace-format-args - YaTeX-struct-end env) - YaTeX-comment-prefix p t nil) - nil ;if \end{env} found, return nil - (cons env m0))) ;else, return meaningful values - (store-match-data md))))))) - ;; Filling \item (defun YaTeX-remove-trailing-comment (start end) "Remove trailing comment from START to end." @@ -3271,7 +3293,3 @@ ;; `History' was moved to ChangeLog ;----------------------------- End of yatex.el ----------------------------- - -; Local variables: -; coding: sjis -; End:
--- a/yatex.new Fri Dec 26 01:06:32 2014 +0900 +++ b/yatex.new Sun Sep 17 10:25:38 2017 +0859 @@ -1,6 +1,39 @@ What's new in YaTeX/yahtml 野鳥/yahtml - 各バージョンの変更点について +1.80 string-to-int除外と同時に emacs-18 をサポート外に。 + 2-Clause BSDでもOKという風に書いてみた。 + RCS管理を外した。 + == yatex == + ラベル補完バッファで M-e, M-i 等でラベル種の絞り込み可能。 + dviからPS変換コマンドを少し丁寧に探すようにした。 + mathbb, mathscr, mathrsfs, text, and, onslide, pause + YaTeX-math-other-env-alist-private で追加数式環境を足しやすくした。 + YaTeX-electric-indent-mode で C-m での自動インデントを制御。 + %#キーワードに追加: DVIPDF, PDFVIEW, IMAGEDPI(ワンタッチ更新も可)。 + Beamer用の補完アドインを追加(原案谷村さん)。 + YaTeX-kanji-code のデフォルトをnil(温存)に変更。 + == yahtml == + figure, iframe 対応。 + a要素の属性補完を修正。 + meta要素の属性補完を拡充、<meta charset="..."> に対応。 + yahtml-kanji-code のデフォルトを4(UTF-8)に変更。 + +1.79 別フレームに同一バッファがあるときのミニバッファ入力で、 + ポイント位置がずれるEmacsの問題への対策を入れた。 + === yatex === + 数式環境など特定環境内の [prefix] t e で On-the-fly preview 発動。 + 環境に対する On-the-fly preview は編集中持続する。 + 持続中の On-the-fly preview の無効化は何もない場所で [prefix] k。 + YaTeX-help-file のデフォルト位置を site-lisp/yatex/help/ に変更。 + 領域活性時に呼び出す補完は領域括りになるようにした。 + タイプセットでPDF出力がありそうなときは次回previewをPDFヴューアに。 + === yahtml === + 領域活性時に呼び出す補完は領域括りになるようにした。 + audio, video, label要素対応 + datalistでidを補完対象に + 文字実体参照補完([prefix] a)でタイプした文字を入力できるようにした。 + 1.78 Drag&Dropサポートを追加。 tabular環境内で2連続以上Tabで、1カラム進む機能を追加。 === yatex ===
--- a/yatex19.el Fri Dec 26 01:06:32 2014 +0900 +++ b/yatex19.el Sun Sep 17 10:25:38 2017 +0859 @@ -1,6 +1,6 @@ -;;; yatex19.el -- YaTeX facilities for Emacs 19 or later -;;; (c)1994-2013 by HIROSE Yuuji.[yuuji@yatex.org] -;;; Last modified Sun Dec 21 14:03:48 2014 on firestorm +;;; yatex19.el -- YaTeX facilities for Emacs 19 or later -*- coding: sjis -*- +;;; (c)1994-2017 by HIROSE Yuuji.[yuuji@yatex.org] +;;; Last modified Sun Sep 17 10:22:54 2017 on firestorm ;;; $Id$ ;;; Code: @@ -15,10 +15,10 @@ (defvar YaTeX-background-mode (or (if (fboundp 'get-frame-background-mode) (get-frame-background-mode (selected-frame))) + (if (boundp 'frame-background-mode) + frame-background-mode) (if (fboundp 'frame-parameters) (cdr (assq 'background-mode (frame-parameters)))) - (if (boundp 'frame-background-mode) - frame-background-mode) (if (boundp 'hilit-background-mode) hilit-background-mode) (if (face-background 'default) @@ -484,6 +484,14 @@ (defun YaTeX-19-create-face (sym fgcolor &optional bgcolor) "Create face named SYM with face of FGCOLOR/BGCOLOR." + (if (consp fgcolor) + (setq fgcolor (if (eq YaTeX-background-mode 'light) + (car fgcolor) + (cdr fgcolor)))) + (if (consp bgcolor) + (setq bgcolor (if (eq YaTeX-background-mode 'light) + (car bgcolor) + (cdr bgcolor)))) (cond ((and YaTeX-use-font-lock (fboundp 'defface)) (custom-declare-face @@ -632,7 +640,8 @@ (if single (list single 0 'macro)))))))))) ;;2006/6/23 new face, `delimiter' introduced -(YaTeX-19-create-face 'delimiter "saddlebrown" "ivory") +(YaTeX-19-create-face + 'delimiter '("saddlebrown" . "lightyellow") '("ivory". "navy")) ;;(YaTeX-19-collect-macros) ;causes an error (defun YaTeX-hilit-setup-alist () @@ -814,5 +823,4 @@ ; fill-prefix: ";;; " ; paragraph-start: "^$\\|\\|;;;$" ; paragraph-separate: "^$\\|\\|;;;$" -; coding: sjis ; End:
--- a/yatex23.el Fri Dec 26 01:06:32 2014 +0900 +++ b/yatex23.el Sun Sep 17 10:25:38 2017 +0859 @@ -1,8 +1,9 @@ ;;; yatex23.el --- YaTeX facilities for Emacs 23 or later -*- coding: sjis -*- -;;; (c)2014 by HIROSE Yuuji.[yuuji@yatex.org] -;;; Last modified Tue Dec 23 12:44:35 2014 on firestorm +;;; (c)2014-2017 by HIROSE Yuuji.[yuuji@yatex.org] +;;; Last modified Sun Sep 17 10:23:02 2017 on firestorm ;;; $Id$ +(require 'yatex19) ;;; Code: (defvar YaTeX-dnd-auto-figure "figure" "*If set, include dropped \\includegraphcs{} into that environment. @@ -17,7 +18,7 @@ "DnD handler for yatex-mode Convert local image URI to \\includegraphcis{} and .tex file names to \\include{}." - (let*((file (dnd-get-local-file-name uri)) + (let*((file (dnd-get-local-file-name uri t)) (path (save-excursion (YaTeX-visit-main t) (file-relative-name file))) @@ -89,11 +90,18 @@ (insert "\\input{" path "}")))) (t (message "%s" action))))) +(defvar YaTeX-on-the-fly-bg-face '("#f0f0c0" . "#706868") + "Background color of on-the-fly preview image activated environment.") +(defvar YaTeX-on-the-fly-overlay nil + "Overlay of on-the-fly preview image") +(defface YaTeX-on-the-fly-activated-face + (list + (list (list '(class color) '(min-colors 65536)) + (list ':background + (if (eq YaTeX-background-mode 'light) + (car YaTeX-on-the-fly-bg-face) + (cdr YaTeX-on-the-fly-bg-face)))) + (list t (list ':bold t))) + "Face of on-the-fly preview image mode") + (provide 'yatex23) - -; Local variables: -; fill-prefix: ";;; " -; paragraph-start: "^$\\|\\|;;;$" -; paragraph-separate: "^$\\|\\|;;;$" -; coding: sjis -; End:
--- a/yatexadd.el Fri Dec 26 01:06:32 2014 +0900 +++ b/yatexadd.el Sun Sep 17 10:25:38 2017 +0859 @@ -1,7 +1,6 @@ -;;; yatexadd.el --- YaTeX add-in functions -;;; yatexadd.el rev.21 -;;; (c)1991-2014 by HIROSE Yuuji.[yuuji@yatex.org] -;;; Last modified Sat Dec 20 14:55:10 2014 on firestorm +;;; yatexadd.el --- YaTeX add-in functions -*- coding: sjis -*- +;;; (c)1991-2017 by HIROSE Yuuji.[yuuji@yatex.org] +;;; Last modified Sun Sep 17 10:23:10 2017 on firestorm ;;; $Id$ ;;; Code: @@ -26,8 +25,9 @@ (if (string= YaTeX-env-name "tabular*") (setq width (concat "{" (YaTeX:read-length "Width: ") "}"))) (setq loc (YaTeX:read-position "tb") - bars (string-to-int - (read-string "Number of columns(0 for default format): " "3"))) + bars (YaTeX-str2int + (YaTeX-read-string-or-skip + "Number of columns(0 for default format): " "3"))) (if (<= bars 0) (setq ;if 0, simple format rule YaTeX:tabular-default-rule @@ -41,7 +41,7 @@ (setq ans (read-char)) (cond ((or (equal ans ?t) (equal ans ?T)) - (setq ans (read-string "Rule width: " "1pt") + (setq ans (read-string-with-history "Rule width: " "1pt") rule (concat "@{" (format YaTeX:tabular-thick-vrule ans) "}" rule @@ -50,7 +50,7 @@ (t (setq rule (concat "|" rule "|") hline "\\hline")))) - (setq rule (read-string "rule format: " rule)) + (setq rule (YaTeX-read-string-or-skip "rule format: " rule)) (setq YaTeX-single-command "hline") (format "%s%s{%s}" width loc rule))) @@ -58,15 +58,15 @@ (fset 'YaTeX:tabular* 'YaTeX:tabular) (fset 'YaTeX:supertabular 'YaTeX:tabular) (defun YaTeX:alignat () - (concat "{" (read-string "Number of columns: ") "}")) + (concat "{" (read-string-with-history "Number of columns: ") "}")) (defun YaTeX:array () (concat (YaTeX:read-position "tb") - "{" (read-string "Column format: ") "}")) + "{" (read-string-with-history "Column format: ") "}")) (defun YaTeX:subequations () (message (if YaTeX-japan "分かりやすいコメントに変えるとref補完が楽よ" "Changing comment string reduces effort at `ref' completion")) (concat " " YaTeX-comment-prefix - (YaTeX::ref-default-label "%H:%M") + (YaTeX::ref-default-label " %Y-%m-%d %H:%M") (if YaTeX-japan "の式群" "equations"))) (defun YaTeX:read-oneof (oneof &optional quick allow-dup) @@ -176,12 +176,6 @@ YaTeX:alignat YaTeX:alignat* YaTeX:xalignat YaTeX:xalignat* YaTeX:xxalignat YaTeX:xxalignat*)) -(defun YaTeX:alignat () - (YaTeX:equation) - (concat "{" (read-string "Number of cols: ") "}")) - - - (defun YaTeX:list () "%\n{} %default label\n{} %formatting parameter") @@ -191,10 +185,10 @@ (defun YaTeX:thebibliography () (setq YaTeX-section-name "bibitem") - (concat "{" (read-string "Longest label: ") "}")) + (concat "{" (read-string-with-history "Longest label: ") "}")) (defun YaTeX:multicols () - (concat "{" (read-string "Number of columns: ") "}")) + (concat "{" (read-string-with-history "Number of columns: ") "}")) ;; wrapfig.sty @@ -214,7 +208,7 @@ (defun YaTeX:multiput () (concat (YaTeX:read-coordinates "Pos") (YaTeX:read-coordinates "Step") - "{" (read-string "How many times: ") "}")) + "{" (read-string-with-history "How many times: ") "}")) (defun YaTeX:put () (YaTeX:read-coordinates "Pos")) @@ -243,16 +237,16 @@ (defun YaTeX::parbox (argp) (cond ((= argp 1) (YaTeX:read-length "Width: ")) - ((= argp 2) (read-string "Text: ")))) + ((= argp 2) (YaTeX-read-string-or-skip "Text: ")))) (defun YaTeX::dashbox () - (concat "{" (read-string "Dash dimension: ") "}" + (concat "{" (read-string-with-history "Dash dimension: ") "}" (YaTeX:read-coordinates "Dimension"))) (defun YaTeX::savebox (argp) (cond - ((= argp 1) (read-string "Saved into name: " "\\")) - ((= argp 2) (read-string "Text: ")))) + ((= argp 1) (read-string-with-history "Saved into name: " "\\")) + ((= argp 2) (YaTeX-read-string-or-skip "Text: ")))) (defvar YaTeX-minibuffer-quick-map nil) (if YaTeX-minibuffer-quick-map nil @@ -301,13 +295,15 @@ (defun YaTeX:read-coordinates (&optional mes varX varY) (concat "(" - (read-string (format "%s %s: " (or mes "Dimension") (or varX "X"))) + (read-string-with-history + (format "%s %s: " (or mes "Dimension") (or varX "X"))) "," - (read-string (format "%s %s: " (or mes "Dimension") (or varY "Y"))) + (read-string-with-history + (format "%s %s: " (or mes "Dimension") (or varY "Y"))) ")")) (defun YaTeX:itembox () - (concat "{" (read-string "Item heading string: ") "}")) + (concat "{" (YaTeX-read-string-or-skip "Item heading string: ") "}")) ;;; ;;Sample functions for maketitle-type command. @@ -322,9 +318,9 @@ (defun YaTeX:lim () "Insert limit notation of \\lim." (YaTeX:check-completion-type 'maketitle) - (let ((var (read-string "Variable: ")) limit) + (let ((var (read-string-with-history "Variable: ")) limit) (if (string= "" var) "" - (setq limit (read-string "Limit ($ means infinity): ")) + (setq limit (read-string-with-history "Limit ($ means infinity): ")) (if (string= "$" limit) (setq limit "\\infty")) (concat "_{" var " \\rightarrow " limit "}")))) @@ -335,15 +331,16 @@ (defun YaTeX:read-boundary (ULchar) "Read boundary usage by _ or ^. _ or ^ is indicated by argument ULchar." - (let ((bndry (read-string (concat ULchar "{???} ($ for infinity): ")))) + (let ((bndry (read-string-with-history + (concat ULchar "{???} ($ for infinity): ")))) (if (string= bndry "") "" (if (string= bndry "$") (setq bndry "\\infty")) (concat ULchar "{" bndry "}")))) (defun YaTeX:verb () "Enclose \\verb's contents with the same characters." - (let ((quote-char (read-string "Quoting char: " "|")) - (contents (read-string "Quoted contents: "))) + (let ((quote-char (read-string-with-history "Quoting char: " "|")) + (contents (YaTeX-read-string-or-skip "Quoted contents: "))) (concat quote-char contents quote-char))) (fset 'YaTeX:verb* 'YaTeX:verb) @@ -353,12 +350,12 @@ nil) (defun YaTeX:cite () - (let ((comment (read-string "Comment for citation: "))) + (let ((comment (YaTeX-read-string-or-skip "Comment for citation: "))) (if (string= comment "") "" (concat "[" comment "]")))) (defun YaTeX:bibitem () - (let ((label (read-string "Citation label for bibitem: "))) + (let ((label (YaTeX-read-string-or-skip "Citation label for bibitem: "))) (if (string= label "") "" (concat "[" label "]")))) @@ -407,11 +404,12 @@ (defvar YaTeX-label-menu-other (if YaTeX-japan "':他のバッファのラベル\n" "':LABEL IN OTHER BUFFER.\n")) (defvar YaTeX-label-menu-repeat - (if YaTeX-japan ".:直前の\\refと同じ\n" "/:REPEAT LAST \ref{}\n")) + (if YaTeX-japan ".:直前の\\refと同じ\n" ".:REPEAT LAST \\ref{}\n")) (defvar YaTeX-label-menu-any (if YaTeX-japan "*:任意の文字列\n" "*:ANY STRING.\n")) (defvar YaTeX-label-buffer "*Label completions*") -(defvar YaTeX-label-guide-msg "Select label and hit RETURN.") +(defvar YaTeX-label-guide-msg + "[RET] on the Label. M-a)All M-c)Capt M-e)Eqn M-i)Itm M-s)Sec M-m)misc") (defvar YaTeX-label-select-map nil "Key map used in label selection buffer.") (defun YaTeX::label-setup-key-map () @@ -437,6 +435,12 @@ (define-key YaTeX-label-select-map "'" 'YaTeX::label-search-tag) (define-key YaTeX-label-select-map "." 'YaTeX::label-search-tag) (define-key YaTeX-label-select-map "*" 'YaTeX::label-search-tag) + (define-key YaTeX-label-select-map "\M-a" 'YaTeX::label-sel-all) + (define-key YaTeX-label-select-map "\M-c" 'YaTeX::label-sel-cap) + (define-key YaTeX-label-select-map "\M-e" 'YaTeX::label-sel-eqn) + (define-key YaTeX-label-select-map "\M-i" 'YaTeX::label-sel-item) + (define-key YaTeX-label-select-map "\M-s" 'YaTeX::label-sel-sec) + (define-key YaTeX-label-select-map "\M-m" 'YaTeX::label-sel-misc) (message "Setting up label selection mode map...Done") (let ((key ?A)) (while (<= key ?Z) @@ -465,6 +469,38 @@ (goto-char (match-beginning 0)))) (message YaTeX-label-guide-msg))) +(defun YaTeX::label-sel-* (type &optional any) + "Label type filtering out in YaTeX Label completion buffer" + (save-excursion + (let (ov) + (goto-char (point-min)) + (while (not (eobp)) + (goto-char (next-overlay-change (point))) + (if (null (setq ov (car-safe (overlays-at (point))))) + nil ;do nothin if overlays not found + (overlay-put + ov 'invisible (not (or any + (eq (overlay-get ov 'type) type))))))))) + +(defun YaTeX::label-sel-all () + (interactive) + (YaTeX::label-sel-* 'any 'any)) +(defun YaTeX::label-sel-cap () + (interactive) + (YaTeX::label-sel-* 'cap)) +(defun YaTeX::label-sel-eqn () + (interactive) + (YaTeX::label-sel-* 'eqn)) +(defun YaTeX::label-sel-item () + (interactive) + (YaTeX::label-sel-* 'item)) +(defun YaTeX::label-sel-sec () + (interactive) + (YaTeX::label-sel-* 'sec)) +(defun YaTeX::label-sel-misc () + (interactive) + (YaTeX::label-sel-* 'misc)) + ; (defun YaTeX::ref (argp &optional labelcmd refcmd) ; (cond ; ((= argp 1) @@ -571,25 +607,27 @@ "Default auto-genarated label string." ;; We do not use (format-time-string) for emacs-19 (let*((ts (substring (current-time-string) 4)) + (Y (substring ts -4)) (y (substring ts -2)) (b (substring ts 0 3)) - (d (format "%d" (string-to-int (substring ts 4 6)))) + (d (format "%d" (YaTeX-str2int (substring ts 4 6)))) (H (substring ts 7 9)) (M (substring ts 10 12)) (S (substring ts 13 15)) - (HMS (+ (* 10000 (string-to-int H)) - (* 100 (string-to-int M)) - (string-to-int S))) + (HMS (+ (* 10000 (YaTeX-str2int H)) + (* 100 (YaTeX-str2int M)) + (YaTeX-str2int S))) (talphabex (YaTeX::ref-alphabex HMS)) (mnames "JanFebMarAprMayJunJulAugSepOctNovDec") (m (format "%02d" (/ (string-match b mnames) 3))) - (ymd (+ (* 10000 (string-to-int y)) - (* 100 (string-to-int m)) - (string-to-int d))) + (ymd (+ (* 10000 (YaTeX-str2int y)) + (* 100 (YaTeX-str2int m)) + (YaTeX-str2int d))) (dalphabex (YaTeX::ref-alphabex ymd))) (YaTeX-replace-formats (or format YaTeX-ref-default-label-string) (list (cons "y" y) + (cons "Y" Y) (cons "b" b) (cons "m" m) (cons "d" d) @@ -609,7 +647,7 @@ (let ((default (condition-case nil (YaTeX::ref-default-label) (error (substring (current-time-string) 4))))) - (read-string "Give a label for this line: " + (YaTeX-read-string-or-skip "Give a label for this line: " (if YaTeX-emacs-19 (cons default 1) default)))) (defun YaTeX::ref-getset-label (buffer point &optional noset) @@ -681,7 +719,7 @@ (if (condition-case nil (progn (goto-char curtop) - (YaTeX-goto-corresponding-environment)) + (YaTeX-goto-corresponding-environment nil t 'nonstop)) (error nil)) (setq end (point))) (goto-char inspoint) @@ -815,6 +853,265 @@ "*ref補完で収集するセクショニングコマンドの下限レベル YaTeX-sectioning-levelの数値で指定.") +(defun YaTeX::ref-1 (&optional nest-level) + ;; Sub-function of YaTeX::ref() for recursive call + ;; DO NOT CALL FROM OTHER FUNCTIONS but YaTeX:ref() + (setq nest-level (or nest-level 0)) + (let ((labelleader (substring " " 0 nest-level)) + label) + (while (YaTeX-re-search-active-forward + regexp ;;counter + percent nil t) + ;(goto-char (match-beginning 0)) + (setq e0 (match-end 0)) + (cond + ;; + ;;2005/10/21 Skip it if predicate function returns nil + ((and predf + (let ((md (match-data))) + (prog1 + (condition-case nil + (not (funcall predf)) + (error nil)) + (store-match-data md))))) + ((YaTeX-literal-p) nil) + ((YaTeX-match-string 1) + ;;if standard counter commands found + (setq cmd (YaTeX-match-string 2) + m0 (match-beginning 0)) + (setq match-point (match-beginning 0)) + (or initl + (if (< p (point)) (setq initl lnum))) + (cond + ;; In any case, variables e0 should be set + ((and YaTeX-use-AMS-LaTeX + (string-match YaTeX::ref-nestable-counter-regexp cmd)) + (skip-chars-forward "}") + (setq label (buffer-substring + (point) (min (+ 80 (point)) (point-max)))) + ;; to skip (maybe)auto-generated comment + (skip-chars-forward " \t") + (if (looking-at YaTeX-comment-prefix) + (forward-line 1)) + (setq e0 (point)) + (skip-chars-forward " \t\n") + (if (looking-at "\\\\label{\\([^}]+\\)}") + (setq label (format "(labe:%s)" (YaTeX-match-string 1)) + e0 (match-end 1))) + (funcall output + (format "--subequation--%s%s" labelleader label) + e0 'eqn)) + ((string-match mathenvs cmd) ;;if matches mathematical env + (skip-chars-forward "}") + (setq x (point) + envname (substring + cmd (match-beginning 0) (match-end 0))) + (save-restriction + (narrow-to-region + m0 + (save-excursion + (YaTeX-re-search-active-forward + (setq endrx (format "%send{%s}" YaTeX-ec-regexp + (regexp-quote envname))) + percent nil t))) + (catch 'scan + (while (YaTeX-re-search-active-forward + (concat + "\\\\end{\\(" (regexp-quote envname) "\\)" ;;(1) + "\\|\\\\\\(notag\\)" ;;2 + (if (string-match + YaTeX::ref-mathenv-exp1-regexp cmd) + "" "\\|\\(\\\\\\\\\\)$") ;;3 + ) + percent nil t) + (let*((quit (match-beginning 1)) + (notag (match-beginning 2)) + (newln (match-beginning 3)) + (label ".......................") l2 + (e (point)) (m0 (match-beginning 0)) + (ln (YaTeX-string-width label))) + (cond + (notag + (YaTeX-re-search-active-forward + "\\\\\\\\" percent nil 1) + (setq x (point))) ;use x as \label search bound + ((and newln ; `\\' found + (not (equal (YaTeX-inner-environment) + envname))) + (YaTeX-end-of-environment) + (goto-char (match-end 0))) + (t + (if (YaTeX-re-search-active-backward + YaTeX::ref-labeling-regexp + percent x t) + ;; if \label{x} in math-expression, display it + ;; because formula source is hard to recognize + (progn + (goto-char (match-end 0)) + (setq l2 (format "\"label:%s\"" + (buffer-substring + (1- (point)) + (progn (forward-sexp -1) + (1+ (point)))))) + (setq label + (if (< (YaTeX-string-width l2) ln) + (concat + l2 + (substring + label + 0 (- ln (YaTeX-string-width l2)))) + l2)) + (goto-char e))) + (funcall output + (concat + labelleader label " " + (buffer-substring x m0)) + x 'eqn) + (cond + ((YaTeX-quick-in-environment-p + YaTeX-math-gathering-list) + ;; if here is inner split/cases/gathered env., + ;; counter for here is only one. + ;; Go out this environment and, + (YaTeX-end-of-environment) + ;; search next expression unit boundary. + (YaTeX-re-search-active-forward + (concat endrx "\\|\\\\begin{") + percent nil 1) + (end-of-line))) + (if quit (throw 'scan t))))) + (setq x (point))))) + (setq e0 (point))) + ((string-match enums cmd) + ;(skip-chars-forward "} \t\n") + (save-restriction + (narrow-to-region + (point) + (save-excursion + (YaTeX-goto-corresponding-environment nil t 'nonstop) (point))) + (forward-line 1) + (let ((b0 nil) mb0) + (while (not (eobp)) + (setq x (and + (YaTeX-re-search-active-forward + (concat YaTeX-ec-regexp "item\\s ") + percent nil 1) + (match-beginning 0))) + + (if b0 ;Inspect sentence after previous \item + (save-excursion + (save-restriction + (let ((md (match-data))) ;save-match-data + (unwind-protect + (progn + (narrow-to-region b0 (or x (point))) + (goto-char (point-min)) + (let ((x x)) (YaTeX::ref-1 (1+ nest-level))) + (goto-char (point-max))) + (store-match-data md)))))) + (if x ;Output THIS \item line + (funcall + output + (concat + labelleader existlabel + (buffer-substring + (match-beginning 0) + (if (re-search-forward itemsep nil 1) + (progn (goto-char (match-beginning 0)) + (skip-chars-backward " \t") + (1- (point))) + (point-end-of-line)))) + x 'item)) + (setq b0 (point)) + )) + (setq e0 (point-max)))) + ((string-match "bibitem" cmd) ;maybe generated by myself + (setq label "") + (skip-chars-forward " \t") + (if (looking-at "{") ;sure to be true!! + (forward-list 1)) + (let ((list '(30 10 65)) + (delim ";") q lim len l str) + (save-excursion + (setq lim (if (re-search-forward itemsep nil 1) + (match-beginning 0) (point)))) + (while list + (skip-chars-forward " \t\n\\") + (setq q (looking-at "[\"'{]") + len (car list) + str + (buffer-substring + (point) + (progn + (if q (forward-sexp 1) + (search-forward delim lim 1) + (forward-char -1)) + (point)))) + (if (> (setq l (YaTeX-string-width str)) len) + (setq str (concat + (YaTeX-truncate-string-width + str (- len (if q 5 4))) + "... " + (if q (substring str -1))))) + (if (< (setq l (YaTeX-string-width str)) len) + (setq str (concat str (make-string (- len l) ? )))) + (if (looking-at delim) (goto-char (match-end 0))) + (setq label (concat label " " str) + list (cdr list))) + (funcall output (concat labelleader label) match-point 'bib))) + ;;else, simple section-type counter + ((= (char-after (1- (point))) ?{) + (setq label (buffer-substring + (match-beginning 0) + (progn (forward-char -1) + (forward-list 1) + (point)))) + (funcall output (concat labelleader label) match-point + (if (string-match "caption" cmd) 'cap 'sec)) + ;; Skip preceding label if exists + (if (YaTeX::ref-getset-label (current-buffer) match-point t) + (goto-char (get 'YaTeX::ref-getset-label 'foundpoint))) + (if (save-excursion + (skip-chars-forward "\t \n") + (looking-at YaTeX::ref-labeling-regexp)) + (setq e0 (match-end 0)))) + (t + (skip-chars-forward " \t") + (setq label (buffer-substring + (match-beginning 0) + (if (re-search-forward + itemsep + nil t) + (progn + (goto-char (match-beginning 0)) + (skip-chars-backward " \t") + (1- (point))) + (point-end-of-line)))) + (funcall output (concat labelleader label) match-point 'misc) + (if (save-excursion + (skip-chars-forward "\t \n") + (looking-at YaTeX::ref-labeling-regexp)) + (setq e0 (match-end 0))))) + ) ;;put label buffer + ;; + ;; if user defined label found + (t + ;; memorize line number and label into property + (goto-char (match-beginning 0)) + (let ((list YaTeX::ref-labeling-regexp-alist) + (cache (symbol-plist 'YaTeX::ref-labeling-regexp))) + (while list + (if (looking-at (car (car list))) + (progn + (setq label (YaTeX-match-string 0)) + (put 'YaTeX::ref-labeling-regexp lnum + (YaTeX-match-string (cdr (car list)))) + (funcall output (concat labelleader label) 0) ;;0 is dummy + (setq list nil))) + (setq list (cdr list)))) + )) + (goto-char e0)))) + (defun YaTeX::ref (argp &optional labelcmd refcmd predf) (setplist 'YaTeX::ref-labeling-regexp nil) ;erase memory cache (require 'yatexsec) @@ -855,14 +1152,22 @@ (percent (regexp-quote YaTeX-comment-prefix)) (output (function - (lambda (label p) + (lambda (label p &optional type) ;type: 'eqn 'item 'cap 'sec 'misc (while (setq x (string-match "[\n\t]" label)) (aset label x ? )) (while (setq x (string-match " +" label)) (setq label (concat (substring label 0 (1+ (match-beginning 0))) (substring label (match-end 0))))) - (princ (format "%c: <<%s>>\n" (+ (% lnum 26) ?A) label)) + (save-excursion + (set-buffer standard-output) + (overlay-put + (make-overlay + (point) + (progn + (insert (format "%c: <<%s>>\n" (+ (% lnum 26) ?A) label)) + (point))) + 'type type)) (setq point-list (cons p point-list)) (message "Collecting labels... %d" lnum) (setq lnum (1+ lnum))))) @@ -891,238 +1196,10 @@ (goto-char (point-min)) (let ((standard-output (get-buffer YaTeX-label-buffer)) existlabel) (princ (format "=== LABELS in [%s] ===\n" (buffer-name buf))) - (while (YaTeX-re-search-active-forward - regexp ;;counter - percent nil t) - ;(goto-char (match-beginning 0)) - (setq e0 (match-end 0)) - (cond - ;; - ;;2005/10/21 Skip it if predicate function returns nil - ((and predf - (let ((md (match-data))) - (prog1 - (condition-case nil - (not (funcall predf)) - (error nil)) - (store-match-data md))))) - ((YaTeX-literal-p) nil) - ((YaTeX-match-string 1) - ;;if standard counter commands found - (setq cmd (YaTeX-match-string 2) - m0 (match-beginning 0)) - (setq match-point (match-beginning 0)) - (or initl - (if (< p (point)) (setq initl lnum))) - (cond - ;; In any case, variables e0 should be set - ((and YaTeX-use-AMS-LaTeX - (string-match YaTeX::ref-nestable-counter-regexp cmd)) - (let (label) - (skip-chars-forward "}") - (setq label (buffer-substring - (point) (min (+ 80 (point)) (point-max)))) - ;; to skip (maybe)auto-generated comment - (skip-chars-forward " \t") - (if (looking-at YaTeX-comment-prefix) - (forward-line 1)) - (setq e0 (point)) - (skip-chars-forward " \t\n") - (if (looking-at "\\\\label{\\([^}]+\\)}") - (setq label (format "(labe:%s)" (YaTeX-match-string 1)) - e0 (match-end 1))) - (funcall output (format "--subequation--%s" label) e0))) - ((string-match mathenvs cmd) ;;if matches mathematical env - (skip-chars-forward "}") - (setq x (point) - envname (substring - cmd (match-beginning 0) (match-end 0))) - (save-restriction - (narrow-to-region - m0 - (save-excursion - (YaTeX-re-search-active-forward - (setq endrx (format "%send{%s}" YaTeX-ec-regexp - (regexp-quote envname))) - percent nil t))) - (catch 'scan - (while (YaTeX-re-search-active-forward - (concat - "\\\\end{\\(" (regexp-quote envname) "\\)";;(1) - "\\|\\\\\\(notag\\)" ;;2 - (if (string-match - YaTeX::ref-mathenv-exp1-regexp cmd) - "" "\\|\\(\\\\\\\\\\)$") ;;3 - ) - percent nil t) - (let*((quit (match-beginning 1)) - (notag (match-beginning 2)) - (newln (match-beginning 3)) - (label ".......................") l2 - (e (point)) (m0 (match-beginning 0)) - (ln (YaTeX-string-width label))) - (cond - (notag - (YaTeX-re-search-active-forward - "\\\\\\\\" percent nil 1) - (setq x (point))) ;use x as \label search bound - ((and newln ; `\\' found - (not (equal (YaTeX-inner-environment) - envname))) - (YaTeX-end-of-environment) - (goto-char (match-end 0))) - (t - (if (YaTeX-re-search-active-backward - YaTeX::ref-labeling-regexp - percent x t) - ;; if \label{x} in math-expression, display it - ;; because formula source is hard to recognize - (progn - (goto-char (match-end 0)) - (setq l2 (format "\"label:%s\"" - (buffer-substring - (1- (point)) - (progn (forward-sexp -1) - (1+ (point)))))) - (setq label - (if (< (YaTeX-string-width l2) ln) - (concat - l2 - (substring - label - 0 (- ln (YaTeX-string-width l2)))) - l2)) - (goto-char e))) - (funcall output - (concat - label " " - (buffer-substring x m0)) - x) - (cond - ((YaTeX-quick-in-environment-p - YaTeX-math-gathering-list) - ;; if here is inner split/cases/gathered env., - ;; counter for here is only one. - ;; Go out this environment and, - (YaTeX-end-of-environment) - ;; search next expression unit boundary. - (YaTeX-re-search-active-forward - (concat endrx "\\|\\\\begin{") - percent nil 1) - (end-of-line))) - (if quit (throw 'scan t))))) - (setq x (point))))) - (setq e0 (point))) - ((string-match enums cmd) - ;(skip-chars-forward "} \t\n") - (save-restriction - (narrow-to-region - (point) - (save-excursion - (YaTeX-goto-corresponding-environment) (point))) - (forward-line 1) - (while (YaTeX-re-search-active-forward - (concat YaTeX-ec-regexp "item\\s ") - percent nil t) - (setq x (match-beginning 0)) - (funcall - output - (concat - existlabel - (buffer-substring - (match-beginning 0) - (if (re-search-forward itemsep nil t) - (progn (goto-char (match-beginning 0)) - (skip-chars-backward " \t") - (1- (point))) - (point-end-of-line)))) - x)) - (setq e0 (point-max)))) - ((string-match "bibitem" cmd) ;maybe generated by myself - (setq label "") - (skip-chars-forward " \t") - (if (looking-at "{") ;sure to be true!! - (forward-list 1)) - (let ((list '(30 10 65)) - (delim ";") q lim len l str) - (save-excursion - (setq lim (if (re-search-forward itemsep nil 1) - (match-beginning 0) (point)))) - (while list - (skip-chars-forward " \t\n\\") - (setq q (looking-at "[\"'{]") - len (car list) - str - (buffer-substring - (point) - (progn - (if q (forward-sexp 1) - (search-forward delim lim 1) - (forward-char -1)) - (point)))) - (if (> (setq l (YaTeX-string-width str)) len) - (setq str (concat - (YaTeX-truncate-string-width - str (- len (if q 5 4))) - "... " - (if q (substring str -1))))) - (if (< (setq l (YaTeX-string-width str)) len) - (setq str (concat str (make-string (- len l) ? )))) - (if (looking-at delim) (goto-char (match-end 0))) - (setq label (concat label " " str) - list (cdr list))) - (funcall output label match-point))) - ;;else, simple section-type counter - ((= (char-after (1- (point))) ?{) - (setq label (buffer-substring - (match-beginning 0) - (progn (forward-char -1) - (forward-list 1) - (point)))) - (funcall output label match-point) - ;; Skip preceding label if exists - (if (YaTeX::ref-getset-label (current-buffer) match-point t) - (goto-char (get 'YaTeX::ref-getset-label 'foundpoint))) - (if (save-excursion - (skip-chars-forward "\t \n") - (looking-at YaTeX::ref-labeling-regexp)) - (setq e0 (match-end 0)))) - (t - (skip-chars-forward " \t") - (setq label (buffer-substring - (match-beginning 0) - (if (re-search-forward - itemsep - nil t) - (progn - (goto-char (match-beginning 0)) - (skip-chars-backward " \t") - (1- (point))) - (point-end-of-line)))) - (funcall output label match-point) - (if (save-excursion - (skip-chars-forward "\t \n") - (looking-at YaTeX::ref-labeling-regexp)) - (setq e0 (match-end 0))))) - ) ;;put label buffer - ;; - ;; if user defined label found - (t - ;; memorize line number and label into property - (goto-char (match-beginning 0)) - (let ((list YaTeX::ref-labeling-regexp-alist) - (cache (symbol-plist 'YaTeX::ref-labeling-regexp))) - (while list - (if (looking-at (car (car list))) - (progn - (setq label (YaTeX-match-string 0)) - (put 'YaTeX::ref-labeling-regexp lnum - (YaTeX-match-string (cdr (car list)))) - (funcall output label 0) ;;0 is dummy, never used - (setq list nil))) - (setq list (cdr list)))) - )) - (goto-char e0)) + + (YaTeX::ref-1) + + (princ YaTeX-label-menu-other) (princ YaTeX-label-menu-repeat) (princ YaTeX-label-menu-any) @@ -1256,7 +1333,7 @@ (let*((chmode (boundp (intern-soft "old"))) (dlab (if chmode old ;if called via YaTeX-change-section (tricky...) (YaTeX::ref-default-label))) - (label (read-string + (label (read-string-with-history (format "New %s name: " (or labname "label")) (cons dlab 1)))) (if (string< "" label) @@ -1400,7 +1477,7 @@ (hilit-auto-highlight nil) (pcnt (regexp-quote YaTeX-comment-prefix)) (bibrx (concat YaTeX-ec-regexp "bibliography{\\([^}]+\\)}")) - (bibptn (read-string "Pattern: ")) + (bibptn (YaTeX-read-string-or-skip "Pattern: ")) (bbuf (get-buffer-create " *bibitems*")) (standard-output bbuf) (me 'YaTeX::cite) ;shuld set this for using YaTeX::ref @@ -1507,13 +1584,14 @@ (defun YaTeX::newcommand (&optional argp) (cond ((= argp 1) - (let ((command (read-string "Define newcommand: " "\\"))) + (let ((command (read-string-with-history "Define newcommand: " "\\"))) (put 'YaTeX::newcommand 'command (substring command 1)) command)) ((= argp 2) (let ((argc - (string-to-int (read-string "Number of arguments(Default 0): "))) - (def (read-string "Definition: ")) + (YaTeX-str2int + (read-string-with-history "Number of arguments(Default 0): "))) + (def (YaTeX-read-string-or-skip "Definition: ")) (command (get 'YaTeX::newcommand 'command))) ;;!!! It's illegal to insert string in the add-in function !!! (if (> argc 0) (insert (format "[%d]" argc))) @@ -1540,7 +1618,7 @@ (defun YaTeX::newcounter (&optional argp) (cond ((= argp 1) - (read-string "New counter name: ")) + (read-string-with-history "New counter name: ")) (t ""))) ;; @@ -1623,7 +1701,7 @@ nil nil "\\") ) ((equal 2 argp) - (read-string-with-history "Length: " nil 'YaTeX:length-history)))) + (YaTeX-read-string-or-skip "Length: " nil 'YaTeX:length-history)))) (fset 'YaTeX::addtolength 'YaTeX::setlength) @@ -1638,13 +1716,13 @@ 'YaTeX:style-parameters-local nil nil "\\")) ((equal 2 argp) - (read-string "Text: ")))) + (YaTeX-read-string-or-skip "Text: ")))) (defun YaTeX::newlength (&optional argp) "YaTeX add-in function for arguments of \\newlength" (cond ((equal argp 1) - (let ((length (read-string "Length variable: " "\\"))) + (let ((length (read-string-with-history "Length variable: " "\\"))) (if (string< "" length) (YaTeX-update-table (list length) @@ -1658,11 +1736,11 @@ "YaTeX add-in function for arguments of \\multicolumn." (cond ((equal 1 argp) - (read-string "Number of columns: ")) + (read-string-with-history "Number of columns: ")) ((equal 2 argp) (YaTeX:read-oneof "|lrc" nil t)) ((equal 3 argp) - (read-string "Item: ")))) + (YaTeX-read-string-or-skip "Item: ")))) (defvar YaTeX:documentstyles-default '(("article") ("jarticle") ("j-article") @@ -1809,12 +1887,12 @@ YaTeX-default-documentclass sname))))) (defun YaTeX::title (&optional argp) - (prog1 (read-string "Document Title: ") + (prog1 (YaTeX-read-string-or-skip "Document Title: ") (setq YaTeX-section-name "author" YaTeX-single-command "maketitle"))) (defun YaTeX::author (&optional argp) - (prog1 (read-string "Document Author: ") + (prog1 (YaTeX-read-string-or-skip "Document Author: ") (setq YaTeX-section-name "date" YaTeX-single-command "maketitle"))) @@ -1868,7 +1946,7 @@ "Add-in for \\color's argument" (cond ((= argp 1) (YaTeX::color-completing-read "Color: ")) - ((= argp 2) (read-string "Colored string: ")))) + ((= argp 2) (YaTeX-read-string-or-skip "Colored string: ")))) (fset 'YaTeX:color 'YaTeX:textcolor) (fset 'YaTeX::color 'YaTeX::textcolor) @@ -1882,14 +1960,13 @@ (cond ((= argp 1) (YaTeX::color-completing-read "Frame color: ")) ((= argp 2) (YaTeX::color-completing-read "Inner color: ")) - ((= argp 3) (read-string "Colored string: ")))) + ((= argp 3) (YaTeX-read-string-or-skip "Colored string: ")))) (defun YaTeX:scalebox () "Add-in for \\scalebox" - (let ((vmag (read-string - (if YaTeX-japan "倍率(負で反転): " + (let ((vmag (YaTeX-read-string-or-skip (if YaTeX-japan "倍率(負で反転): " "Magnification(Negative for flipped): "))) - (hmag (read-string (if YaTeX-japan "縦倍率(省略可): " + (hmag (YaTeX-read-string-or-skip (if YaTeX-japan "縦倍率(省略可): " "Vertical magnification(Optional): ")))) (if (and hmag (string< "" hmag)) (format "{%s}[%s]" vmag hmag) @@ -1904,9 +1981,11 @@ (if (string< "" (setq r (YaTeX:read-oneof "htbpB"))) (concat "[origin=" r "]"))) ((memq c '(?X ?x ?Y ?y)) - (setq r (read-string "" (if YaTeX-emacs-19 (cons defx 3) defx)) + (setq r (read-string-with-history + "" (if YaTeX-emacs-19 (cons defx 3) defx)) x (if (string< "x=" r) r) - r (read-string "" (if YaTeX-emacs-19 (cons defy 3) defy)) + r (read-string-with-history + "" (if YaTeX-emacs-19 (cons defy 3) defy)) y (if (string< "y=" r) r) something (or x y)) (format "%s%s%s%s%s" @@ -1920,10 +1999,10 @@ "Argument add-in for \\rotatebox" (cond ((= argp 1) - (read-string (if YaTeX-japan "回転角(度; 左回り): " + (read-string-with-history (if YaTeX-japan "回転角(度; 左回り): " "Angle in degree(unclockwise): "))) ((= argp 2) - (read-string (if YaTeX-japan "テキスト: " "Text: "))))) + (YaTeX-read-string-or-skip (if YaTeX-japan "テキスト: " "Text: "))))) (defun YaTeX:includegraphics () "Add-in for \\includegraphics's option" @@ -1946,12 +2025,22 @@ (if (string= "" str) "" (concat "[" str "]")))) +(defvar YaTeX::get-boundingbox-cmd YaTeX-cmd-gs + "Command to get bounding box from PDF files. +Possible values are `gs' and `extractbb'.") + (defun YaTeX::get-boundingbox (file) "Return the bound box as a string This function relies on gs(ghostscript) command installed." (let ((str (YaTeX-command-to-string - (format "%s -sDEVICE=bbox -dBATCH -dNOPAUSE %s" - YaTeX-cmd-gs file)))) + (format + (cond + ((string-match "extractbb" YaTeX::get-boundingbox-cmd) + "%s -O %s") + ((string-match "gs" YaTeX::get-boundingbox-cmd) + "%s -sDEVICE=bbox -dBATCH -dNOPAUSE %s") + (t "echo %s %s")) + YaTeX::get-boundingbox-cmd file)))) (if (string-match "%%BoundingBox:\\s \\([0-9]+\\s [0-9]+\\s [0-9]+\\s [0-9]+\\)" str) @@ -2058,7 +2147,7 @@ (defun YaTeX::mask (argp) (cond ((equal argp 1) - (read-string "String: ")) + (YaTeX-read-string-or-skip "String: ")) ((equal argp 2) (let (c) (while (not (memq c '(?A ?B ?C ?D ?E ?F ?G ?H ?I ?J ?K))) @@ -2081,12 +2170,12 @@ ((equal argp 4) (YaTeX:read-oneof "lcr" 'quick)) ((equal argp 5) - (read-string "String: ")))) + (YaTeX-read-string-or-skip "String: ")))) (defun YaTeX::textcircled (argp) (cond ((equal argp 1) - (let ((char (read-string "Circled char: ")) + (let ((char (read-string-with-history "Circled char: ")) (left "") (right "") c) (setq c (read-char "Enclose also with (s)mall (t)iny s(C)riptsize (N)one:")) @@ -2096,6 +2185,85 @@ ((memq c '(?c ?C)) (setq left "{\\scriptsize " right "}"))) (format "%s%s%s" left char right))))) +;;; -------------------- beamer stuff -------------------- +(defvar YaTeX:frame-option-alist-default + '(("plain") ("containsverbatim") ("shrink") ("squeeze") + ("allowframebreaks") ("label="))) +(defvar YaTeX:frame-option-alist-private nil + "*Alist for completion list of the argument for `frame' environemnt") +(defvar YaTeX:frame-option-alist + (append YaTeX:frame-option-alist-private YaTeX:frame-option-alist-default)) + +(defun YaTeX:frame () + (let*((minibuffer-local-completion-map YaTeX-minibuffer-completion-map) + (delim ",") + (opt (YaTeX-completing-read-or-skip + "Frame option: " YaTeX:frame-option-alist)) + (title (YaTeX-read-string-or-skip "Title: ")) + (subtitle (YaTeX-read-string-or-skip "Subtitle: "))) + (setq YaTeX-env-name "columns") + (concat + (if (string< "" opt) (concat "[" opt "]")) + (if (string< "" title) (concat "{" title "}")) + (if (string< "" subtitle) (concat "{" subtitle "}"))))) + +(defun YaTeX:column-read-width () + "Completing function for column environment/macro of Beamer" + (let ((md (match-data)) (colsinf (YaTeX-quick-in-environment-p "columns")) + (totalw (float 1)) restw (ww "\\textwidth") defw cw) + (unwind-protect + (progn + (if (save-excursion + (YaTeX-re-search-active-backward + "totalwidth=\\([.0-9]+\\)\\(\\\\.*width\\)" + YaTeX-comment-prefix (cdr colsinf) t)) + (setq totalw (float (string-to-number (YaTeX-match-string 1))) + ww (YaTeX-match-string 2))) + (setq restw totalw) + (save-excursion + (while (YaTeX-re-search-active-backward + (concat + "\\\\begin{column}{\\([.0-9]+\\)\\(\\\\.*width\\)}" + "\\|" + "\\\\column{\\([.0-9]+\\)\\(\\\\.*width\\)}") + YaTeX-comment-prefix + (cdr colsinf) t) + (setq restw (- restw (string-to-number + (or (YaTeX-match-string 1) + (YaTeX-match-string 3))))))) + (setq defw (format "%.2f%s" + (if (= totalw restw) (/ totalw 2) restw) + (or (YaTeX-match-string 2) + (YaTeX-match-string 4) + ww)) + cw (YaTeX:read-length + (format "Column width(default: %s): " defw))) + (if (string= "" cw) (setq cw defw)) + (prog1 + cw + (setq YaTeX-section-name "column"))) + (store-match-data md)))) + +(defun YaTeX:column () + (if (eq YaTeX-current-completion-type 'begin) + (concat "{" (YaTeX:column-read-width) "}"))) +(defun YaTeX::column (argp) + (cond + ((= argp 1) (YaTeX:column-read-width)))) +(defvar YaTeX:columns-option-alist + '(("t") ("T") ("b") ("c") ("onlytextwidth") ("totalwidth=0.9\\textwidth")) + "*Default option alist for completing columns environment of Beamer") + +(defun YaTeX:columns () + (setq YaTeX-section-name "column" + YaTeX-env-name "column") + (let*((minibuffer-local-completion-map YaTeX-minibuffer-completion-map) + (delim ",=") + (tbl (append YaTeX:columns-option-alist)) ;XX + (opt (YaTeX-completing-read-or-skip "columns option: " tbl))) + (if (string< "" opt) + (concat "[" opt "]")))) + ;;; -------------------- math-mode stuff -------------------- (defun YaTeX::tilde (&optional pos) "For accent macros in mathmode" @@ -2183,7 +2351,7 @@ (defun YaTeX::DeclareMathOperator (argp) (cond ((equal argp 1) - (read-string "Operator: " "\\")))) + (YaTeX-read-string-or-skip "Operator: " "\\")))) ;;; ;; Add-in functions for large-type command. @@ -2200,5 +2368,4 @@ ; fill-prefix: ";;; " ; paragraph-start: "^$\\|\\|;;;$" ; paragraph-separate: "^$\\|\\|;;;$" -; coding: sjis ; End:
--- a/yatexenv.el Fri Dec 26 01:06:32 2014 +0900 +++ b/yatexenv.el Sun Sep 17 10:25:38 2017 +0859 @@ -1,6 +1,6 @@ ;;; yatexenv.el --- YaTeX environment-specific functions -;;; (c) 1994-2013 by HIROSE Yuuji.[yuuji@yatex.org] -;;; Last modified Mon Dec 22 12:49:03 2014 on firestorm +;;; (c) 1994-2017 by HIROSE Yuuji.[yuuji@yatex.org] +;;; Last modified Sun Sep 17 10:23:16 2017 on firestorm ;;; $Id$ ;;; Code: @@ -43,7 +43,7 @@ ((> n 1) (re-search-backward andptn) ;Sure to find! (while (re-search-backward "\\\\multicolumn{\\([0-9]+\\)}" bor t) - (setq n (+ n (string-to-int + (setq n (+ n (YaTeX-str2int (buffer-substring (match-beginning 1) (match-end 1))) -1))))) @@ -101,7 +101,7 @@ (forward-list 1)) ((equal elt ?*) ;*{N}{EXP} -> Repeat EXP N times (skip-chars-forward "^{" end) - (setq cols (* (string-to-int + (setq cols (* (YaTeX-str2int (buffer-substring (1+ (point)) (progn (forward-list 1) (1- (point))))) @@ -136,7 +136,7 @@ ((eq type 'alignat) (max 1 - (* 2 (string-to-int + (* 2 (YaTeX-str2int (buffer-substring (point) (progn (up-list -1) (forward-list 1) (1- (point)))))))) @@ -391,6 +391,11 @@ (fset 'YaTeX-enclose-eqnarray 'YaTeX-enclose-equation) (fset 'YaTeX-enclose-eqnarray* 'YaTeX-enclose-equation) +(mapcar (function ;; Add all AMS LaTeX envs + (lambda (sym) + (fset (intern (concat "YaTeX-enclose-" (car sym))) + 'YaTeX-enclose-equation))) + YaTeX-ams-math-begin-alist) (defun YaTeX-enclose-verbatim (beg end)) ;do nothing when enclose verbatim (fset 'YaTeX-enclose-verbatim* 'YaTeX-enclose-verbatim)
--- a/yatexgen.el Fri Dec 26 01:06:32 2014 +0900 +++ b/yatexgen.el Sun Sep 17 10:25:38 2017 +0859 @@ -1,6 +1,6 @@ ;;; yatexgen.el --- YaTeX add-in function generator(rev.5) -;;; (c)1991-1995,1999,2000 by HIROSE Yuuji.[yuuji@yatex.org] +;;; (c)1991-1995,1999,2000,2017 by HIROSE Yuuji.[yuuji@yatex.org] ;;; Last modified Sun Dec 21 14:04:49 2014 on firestorm ;;; $Id$ @@ -582,6 +582,6 @@ (YaTeX-generate-option-type command) (YaTeX-generate-argument-type command - (string-to-int (read-string "How many arguments?: ")))) nil)) + (YaTeX-str2int (read-string "How many arguments?: ")))) nil)) (provide 'yatexgen)
--- a/yatexhlp.el Fri Dec 26 01:06:32 2014 +0900 +++ b/yatexhlp.el Sun Sep 17 10:25:38 2017 +0859 @@ -1,7 +1,7 @@ -;;; yatexhlp.el --- YaTeX helper with LaTeX commands and macros +;;; yatexhlp.el --- YaTeX helper for LaTeX -*- coding: sjis -*- ;;; -;;; (c)1994,1998,2004,2014 by HIROSE Yuuji.[yuuji@yatex.org] -;;; Last modified Sun Dec 21 22:55:07 2014 on firestorm +;;; (c)1994,1998,2004,2014,2015 by HIROSE Yuuji.[yuuji@yatex.org] +;;; Last modified Sun Sep 17 10:23:19 2017 on firestorm ;;; $Id$ ;;; Code: @@ -12,8 +12,9 @@ (cond ((and (boundp 'site-directory) site-directory) site-directory) ((string-match "\\.app/" doc-directory) ;For Emacs.app(Darwin) - (expand-file-name "../site-lisp" doc-directory)) - (YaTeX-emacs-19 (expand-file-name "../../site-lisp" doc-directory)) + (expand-file-name "../site-lisp/yatex" doc-directory)) + (YaTeX-emacs-19 + (expand-file-name "../../site-lisp/yatex" doc-directory)) (t exec-directory)))) (defvar YaTeX-help-file (expand-file-name help-file help-dir)
--- a/yatexlib.el Fri Dec 26 01:06:32 2014 +0900 +++ b/yatexlib.el Sun Sep 17 10:25:38 2017 +0859 @@ -1,16 +1,25 @@ -;;; yatexlib.el --- YaTeX and yahtml common libraries +;;; yatexlib.el --- YaTeX and yahtml common libraries -*- coding: sjis -*- ;;; -;;; (c)1994-2013 by HIROSE Yuuji.[yuuji@yatex.org] -;;; Last modified Sun Dec 21 23:55:30 2014 on firestorm +;;; (c)1994-2017 by HIROSE Yuuji.[yuuji@yatex.org] +;;; Last modified Sun Sep 17 10:23:31 2017 on firestorm ;;; $Id$ ;;; Code: + +;; High-precedence compatible function +(fset 'YaTeX-str2int + (if (fboundp 'string-to-number) + (function + (lambda (string &optional base) + (ceiling (string-to-number string base)))) + 'string-to-int)) + ;; 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)) +(defvar YaTeX-emacs-19 (>= (YaTeX-str2int emacs-version) 19)) +(defvar YaTeX-emacs-20 (>= (YaTeX-str2int emacs-version) 20)) +(defvar YaTeX-emacs-21 (>= (YaTeX-str2int emacs-version) 21)) (defvar YaTeX-user-completion-table (if YaTeX-dos "~/_yatexrc" "~/.yatexrc") "*Default filename in which user completion table is saved.") @@ -559,7 +568,7 @@ (if (numberp height) (+ height 2) (/ (* (YaTeX-screen-height) - (string-to-int height)) + (YaTeX-str2int height)) 100))) (- (YaTeX-screen-height) window-min-height 1)) window-min-height)))) @@ -732,7 +741,8 @@ (if (fboundp 'completing-read-with-history-in) (completing-read-with-history-in minibuffer-history-symbol prompt table predicate must-match initial) - (completing-read prompt table predicate must-match initial)) + (save-excursion ;work around to avoid cursor warp + (completing-read prompt table predicate must-match initial))) (if (and YaTeX-emacs-19 hsym) (set hsym minibuffer-history))))) ;;;###autoload @@ -740,7 +750,8 @@ "Read from minibuffer with general history: gmhist, Emacs-19." (cond (YaTeX-emacs-19 - (read-from-minibuffer prompt init map read hsym)) + (save-excursion ;work around to avoid cursor warp + (read-from-minibuffer prompt init map read hsym))) (t (let ((minibuffer-history-symbol hsym)) (read-from-minibuffer prompt init map read))))) @@ -750,7 +761,8 @@ "Read string with history: gmhist(Emacs-18) and Emacs-19." (cond (YaTeX-emacs-19 - (read-from-minibuffer prompt init minibuffer-local-map nil hsym)) + (save-excursion ;work around to avoid cursor warp + (read-from-minibuffer prompt init minibuffer-local-map nil hsym))) ((featurep 'gmhist-mh) (read-with-history-in hsym prompt init)) (t (read-string prompt init)))) @@ -761,14 +773,16 @@ (if (equal (if (boundp 'last-input-event) last-input-event last-input-char) YaTeX-skip-next-reader-char) "" - (apply 'read-string args))) + (save-excursion ;work around to avoid cursor warp + (apply 'read-string args)))) (defun YaTeX-completing-read-or-skip (&rest args) "Do completing-read, or skip if last input char is \C-j." (if (equal (if (boundp 'last-input-event) last-input-event last-input-char) YaTeX-skip-next-reader-char) "" - (apply 'completing-read args))) + (save-excursion ;work around to avoid cursor warp + (apply 'completing-read args)))) ;;;###autoload (fset 'YaTeX-rassoc @@ -891,6 +905,19 @@ (buffer-string)) (kill-buffer tbuf)))))) +;;; (defun YaTeX-executable-find(cmd)...) +(fset 'YaTeX-executable-find + (if (fboundp 'executable-find) + 'executable-find + (function (lambda (cmd) + (let ((list exec-path) path) + (catch 'exec + (while list + (if (file-executable-p + (setq path (expand-file-name cmd (car list)))) + (throw 'exec path)) + (setq list (cdr list))))))))) + ;;;###autoload (defun YaTeX-reindent (col) "Remove current indentation and reindento to COL column." @@ -961,7 +988,65 @@ (progn (skip-chars-forward open) (1+ (point))) (progn (skip-chars-forward close) (point))))))) -(defun YaTeX-goto-corresponding-environment (&optional allow-mismatch noerr) +(defun YaTeX-in-environment-p (env) + "Return if current LaTeX environment is ENV. +ENV is given in the form of environment's name or its list." + (let ((md (match-data)) (nest 0) p envrx) + (cond + ((atom env) + (setq envrx + (concat "\\(" + (regexp-quote + (YaTeX-replace-format-args + YaTeX-struct-begin env "" "")) + "\\>\\)\\|\\(" + (regexp-quote + (YaTeX-replace-format-args + YaTeX-struct-end env "" "")) + "\\)")) + (save-excursion + (setq p (catch 'open + (while (YaTeX-re-search-active-backward + envrx YaTeX-comment-prefix nil t) + (if (match-beginning 2) + (setq nest (1+ nest)) + (setq nest (1- nest))) + (if (< nest 0) + (throw 'open (cons env (match-beginning 0))))))))) + ((listp env) + (setq p + (or (YaTeX-in-environment-p (car env)) + (and (cdr env) (YaTeX-in-environment-p (cdr env))))))) + (store-match-data md) + p;(or p (YaTeX-in-verb-p (match-beginning 0))) + )) + +(defun YaTeX-quick-in-environment-p (env) + "Check quickly but unsure if current environment is ENV. +ENV is given in the form of environment's name or its list. +This function returns correct result only if ENV is NOT nested." + (save-excursion + (let ((md (match-data)) m0 (p (point)) rc clfound) + (cond + ((listp env) + (or (YaTeX-quick-in-environment-p (car env)) + (and (cdr env) (YaTeX-quick-in-environment-p (cdr env))))) + (t + (unwind-protect + (if (prog1 + (YaTeX-search-active-backward + (YaTeX-replace-format-args YaTeX-struct-begin env "" "") + YaTeX-comment-prefix nil t) + (setq m0 (match-beginning 0))) + (if (YaTeX-search-active-forward + (YaTeX-replace-format-args + YaTeX-struct-end env) + YaTeX-comment-prefix p t nil) + nil ;if \end{env} found, return nil + (cons env m0))) ;else, return meaningful values + (store-match-data md))))))) + +(defun YaTeX-goto-corresponding-environment (&optional allow-mismatch noerr bg) "Go to corresponding begin/end enclosure. Optional argument ALLOW-MISMATCH allows mismatch open/clese. Use this for \left(, \right). @@ -973,14 +1058,14 @@ (m1 (match-beginning 1)) ;environment in \begin{} (m2 (match-beginning 2)) ;environment in \end{} (m3 (match-beginning 3))) ;environment in \[ \] \( \) - ;(setq env (regexp-quote (buffer-substring p (match-beginning 0)))) + ;(setq env (regexp-quote (buffer-substring p (match-beginning 0)))) (if (cond (m1 ;if begin{xxx} (setq env (if allow-mismatch YaTeX-struct-name-regexp (regexp-quote (buffer-substring m1 (match-end 1))))) - ; (setq regexp (concat "\\(\\\\end{" env "}\\)\\|" - ; "\\(\\\\begin{" env "}\\)")) + ; (setq regexp (concat "\\(\\\\end{" env "}\\)\\|" + ; "\\(\\\\begin{" env "}\\)")) (setq regexp (concat "\\(" @@ -995,8 +1080,8 @@ (setq env (if allow-mismatch YaTeX-struct-name-regexp (regexp-quote (buffer-substring m2 (match-end 2))))) - ; (setq regexp (concat "\\(\\\\begin{" env "}\\)\\|" - ; "\\(\\\\end{" env "}\\)")) + ; (setq regexp (concat "\\(\\\\begin{" env "}\\)\\|" + ; "\\(\\\\end{" env "}\\)")) (setq regexp (concat "\\(" @@ -1034,7 +1119,7 @@ (funcall (if noerr 'message 'error) "Corresponding environment `%s' not found." env) - (sit-for 1) + (or bg (sit-for 1)) nil)))))) (defun YaTeX-end-environment () @@ -1106,7 +1191,7 @@ (goto-char curp) (error "Cannot found the end of current environment.")) (YaTeX-goto-corresponding-environment) - (beginning-of-line) ;for confirmation + ;;(beginning-of-line) ;for confirmation ;OUT 2015/1/4 (if (< curp (point)) (progn (message "Mark this environment?(y or n): ") @@ -1115,8 +1200,10 @@ (error "Abort. Please call again at more proper position.")))) (set-mark-command nil) (YaTeX-goto-corresponding-environment) - (end-of-line) - (if (eobp) nil (forward-char 1)))))) + (goto-char (match-end 0)) + ;;(end-of-line) ;OUT 2015/1/5 + ;;(if (eobp) nil (forward-char 1)) ;OUT 2015/1/5 + )))) (defun YaTeX-kill-buffer (buffer) "Make effort to show parent buffer after kill." @@ -1284,6 +1371,9 @@ 'buffer-substring-no-properties 'buffer-substring)) +(defun YaTeX-region-active-p () + (and (fboundp 'region-active-p) (region-active-p))) + ;;; ;; hilit19 vs. font-lock ;;; @@ -1415,7 +1505,7 @@ '((((class static-color)) (:bold t)) (((type tty)) (:bold t)) (((class color) (background dark)) (:foreground "khaki" :bold t)) - (((class color) (background light)) (:foreground "Goldenrod")) + (((class color) (background light)) (:foreground "DarkGoldenrod4")) (t (:bold t :underline t))) "Font Lock mode face used to highlight formula." :group 'font-lock-faces) @@ -1425,7 +1515,7 @@ '((((class static-color)) (:bold t)) (((type tty)) (:bold t)) (((class color) (background dark)) - (:foreground "saddlebrown" :background "ivory" :bold t)) + (:foreground "lightyellow3" :background "navy" :bold t)) (((class color) (background light)) (:foreground "red")) (t (:bold t :underline t))) "Font Lock mode face used to highlight delimiters." @@ -1438,7 +1528,7 @@ (((class color) (background dark)) (:foreground "khaki" :bold t :underline t)) (((class color) (background light)) - (:foreground "Goldenrod" :underline t)) + (:foreground "DarkGoldenrod4" :underline t)) (t (:bold t :underline t))) "Font Lock mode face used to highlight subscripts in formula." :group 'font-lock-faces) @@ -1450,7 +1540,7 @@ (((class color) (background dark)) (:bold nil :foreground "ivory" :background "lightyellow4")) (((class color) (background light)) - (:underline t :foreground "gold")) + (:underline t :foreground "DarkGoldenrod3")) (t (:bold t :underline t))) "Font Lock mode face used to highlight superscripts in formula." :group 'font-lock-faces) @@ -1576,6 +1666,37 @@ (/ (nth 2 before) mil)))))) ;;; +;; Moved from comment.el +;;; +(defun YaTeX-comment-region-sub (string &optional beg end once) + "Insert STRING at the beginning of every line between BEG and END." + (if (not (stringp string)) (setq string YaTeX-comment-prefix)) + (let ((b (or beg (region-beginning))) (e (or end (region-end)))) + (save-excursion + (goto-char (max b e)) + (if (bolp) + (forward-line -1)) + (save-restriction + (narrow-to-region (min b e) (point)) + (goto-char (point-min)) + (message "%s" string) + (while (re-search-forward "^" nil t) + (insert string)))))) + +(defun YaTeX-uncomment-region-sub (string &optional beg end once) + "Delete STRING from the beginning of every line between BEG and END. +BEG and END are optional. If omitted, active region used. +Non-nil for optional 4th argument ONCE withholds from removing +successive comment chars at the beggining of lines." + (save-excursion + (save-restriction + (narrow-to-region (or beg (region-beginning)) (or end (region-end))) + (goto-char (point-min)) + (while (re-search-forward (concat "^" string) nil t) + (replace-match "") + (if once (end-of-line)))))) + +;;; ;; Functions for the Installation time ;;; @@ -1613,9 +1734,3 @@ (kill-emacs)))) (provide 'yatexlib) -; Local variables: -; fill-prefix: ";;; " -; paragraph-start: "^$\\|\\|;;;$" -; paragraph-separate: "^$\\|\\|;;;$" -; coding: sjis -; End:
--- a/yatexmth.el Fri Dec 26 01:06:32 2014 +0900 +++ b/yatexmth.el Sun Sep 17 10:25:38 2017 +0859 @@ -1,7 +1,7 @@ -;;; yatexmth.el --- YaTeX math-mode-specific functions +;;; yatexmth.el --- YaTeX math-mode-specific functions -*- coding: sjis -*- ;;; -;;; (c)1993-2013 by HIROSE Yuuji [yuuji@yatex.org] -;;; Last modified Fri Jul 5 23:28:28 2013 on firestorm +;;; (c)1993-2017 by HIROSE Yuuji [yuuji@yatex.org] +;;; Last modified Sun Sep 17 10:23:45 2017 on firestorm ;;; $Id$ ;;; Commentary: @@ -321,6 +321,7 @@ ("mi" "mathit" "\\mathit{}") ("mr" "mathrm" "\\mathrm{}") ("mb" "mathbf" "\\mathbf{}") + ("mB" "mathbb" "\\mathbb{}") ("mt" "mathtt" "\\mathtt{}") ("ms" "mathsf" "\\mathsf{}") ("mc" "mathcal" "\\mathcal{}") @@ -346,53 +347,64 @@ ;;) (defvar YaTeX-greek-key-alist-default - '( - ("a" "alpha" ("a" "α")) - ("b" "beta" ("|>\n|>\n|" "β")) - ("g" "gamma" ("~r" "γ")) - ("G" "Gamma" ("|~" "Γ")) - ("d" "delta" ("<~\n<>" "δ")) - ("D" "Delta" ("/\\\n~~" "Δ")) - ("e" "epsilon" "<\n<~") - ("e-" "varepsilon" ("(\n(~" "ε")) - ("z" "zeta" ("(~\n >" "ζ")) - ("et" "eta" ("n\n/" "η")) - ("th" "theta" ("8" "θ")) - ("Th" "Theta" ("(8)" "Θ")) - ("th-" "vartheta" ("-8" "-θ")) - ("i" "iota" ("i\n\\_/" "ι")) - ("k" "kappa" ("k" "κ")) - ("l" "lambda" ("\\n/\\" "λ")) - ("L" "Lambda" ("/\\" "Λ")) - ("m" "mu" (" u_\n/" "μ")) - ("n" "nu" ("|/" "ν")) - ("x" "xi" ("E\n >" "ξ")) - ("X" "Xi" ("---\n -\n---" "Ξ")) - ("p" "pi" ("__\n)(" "π")) - ("P" "Pi" ("__\n||" "Π")) - ("p-" "varpi" ("_\nw" "__\nω")) - ("r" "rho" ("/O" "ρ")) - ("r-" "varrho" ("/O\n~~" "ρ\n~~")) - ("s" "sigma" ("o~" "σ")) - ("S" "Sigma" ("\\-+\n >\n/-+" "Σ")) - ("s-" "varsigma" "(~~ \n>") - ("t" "tau" ("__\n(" "τ")) - ("u" "upsilon" ("~v" "υ")) - ("y" "upsilon" ("~v" "υ")) - ("U" "Upsilon" ("~Y~" "Υ")) - ("Y" "Upsilon" ("~Y~" "Υ")) - ("ph" "phi" (" /\n(/)\n/" "φ")) - ("Ph" "Phi" (" _\n(|)\n ~" "Φ")) - ("ph-" "varphi" "\\O\n|") - ("c" "chi" ("x" "χ")) - ("ps" "psi" ("\\|/\\n |" "ψ")) - ("Ps" "Psi" (" ~\n\\|/\\n |" "Ψ")) - ("o" "omega" ("w" "ω")) - ("w" "omega" ("w" "ω")) - ("O" "Omega" ("(~)\n~ ~" "Ω")) - ("W" "Omega" ("(~)\n~ ~" "Ω")) - ("f" "foo") - ) + (append + '(("a" "alpha" ("a" "α")) + ("b" "beta" ("|>\n|>\n|" "β")) + ("g" "gamma" ("~r" "γ")) + ("G" "Gamma" ("|~" "Γ")) + ("d" "delta" ("<~\n<>" "δ")) + ("D" "Delta" ("/\\\n~~" "Δ")) + ("e" "epsilon" "<\n<~") + ("e-" "varepsilon" ("(\n(~" "_ε")) + ("z" "zeta" ("(~\n >" "ζ")) + ("et" "eta" ("n\n/" "η")) + ("th" "theta" ("8" "θ")) + ("Th" "Theta" ("(8)" "Θ")) + ("th-" "vartheta" ("-8" "_θ")) + ("i" "iota" ("i\n\\_/" "ι")) + ("k" "kappa" ("k" "κ")) + ("l" "lambda" ("\\n/\\" "λ")) + ("L" "Lambda" ("/\\" "Λ")) + ("m" "mu" (" u_\n/" "μ")) + ("n" "nu" ("|/" "ν")) + ("x" "xi" ("E\n >" "ξ")) + ("X" "Xi" ("---\n -\n---" "Ξ")) + ("p" "pi" ("__\n)(" "π")) + ("P" "Pi" ("__\n||" "Π")) + ("p-" "varpi" ("__\n/(" "_π")) + ("r" "rho" ("/O" "ρ")) + ("r-" "varrho" ("/O\n~~" "ρ\n~~")) + ("s" "sigma" ("o~" "σ")) + ("S" "Sigma" ("\\-+\n >\n/-+" "Σ")) + ("s-" "varsigma" "/~~ \n /") + ("t" "tau" ("__\n(" "τ")) + ("u" "upsilon" ("~v" "υ")) + ("y" "upsilon" ("~v" "υ")) + ("U" "Upsilon" ("~Y~" "Υ")) + ("Y" "Upsilon" ("~Y~" "Υ")) + ("ph" "phi" (" /\n(/)\n/" "φ")) + ("Ph" "Phi" (" _\n(|)\n ~" "Φ")) + ("ph-" "varphi" "\\O\n|") + ("c" "chi" ("x" "χ")) + ("ps" "psi" ("\\|/\\n |" "ψ")) + ("Ps" "Psi" (" ~\n\\|/\\n |" "Ψ")) + ("o" "omega" ("w" "ω")) + ("w" "omega" ("w" "ω")) + ("O" "Omega" ("(~)\n~ ~" "Ω")) + ("W" "Omega" ("(~)\n~ ~" "Ω")) + ("f" "foo")) + (if YaTeX-use-AMS-LaTeX + '( + ("G-" "varGamma" ("/~" "_Γ")) + ("D-" "varDelta" ("/|\n~~" "_Δ")) + ("Th-" "varTheta" ("/8/" "_Θ")) + ("L-" "varLambda" ("/|" "_Λ")) + ("X-" "varXi" (" --\n -\n-- " "_Ξ")) + ("S-" "varSigma" (" \\-+\n >\n/-+" "_Σ")) + ("U-" "varUpsilon" ("~~Y~" "_Υ")) + ("Ph-" "varPhi" (" _\n(|)\n~" "_Φ")) + ("Ps-" "varPsi" (" ~\n\\//\\n /" "Ψ")) + ("O-" "varOmega" ("/~/\n~ ~" "_Ω"))))) "Default LaTeX-math-command alist.") (defvar YaTeX-greek-key-alist-private nil @@ -453,7 +465,7 @@ ;;; ;;YaTeX math-mode functions ;;; -;;;###autoload from yatex.el +;;;###autoload (defun YaTeX-toggle-math-mode (&optional arg) (interactive "P") (or (memq 'YaTeX-math-mode mode-line-format) nil @@ -522,7 +534,8 @@ ;; "equation*" "cases" "flalign" "flalign*" ;; "alignat*" "xalignat" "xalignat*" "xxalignat" "xxalignat*" YaTeX-math-begin-list - ))) + ) + YaTeX-math-other-env-list)) (let*((p (point)) (nest 0) me0 r firstp dollar (delim (concat YaTeX-sectioning-regexp "\\|^$\\|^\C-l")) (boundary @@ -660,7 +673,6 @@ (kill-buffer YaTeX-math-menu-buffer)) command))) -; (defun YaTeX-math-show-image (image &optional exit-char) "Momentarily display IMAGE at the beginning of the next line; erase it on the next keystroke. The window is recentered if necessary
--- a/yatexpkg.el Fri Dec 26 01:06:32 2014 +0900 +++ b/yatexpkg.el Sun Sep 17 10:25:38 2017 +0859 @@ -1,7 +1,7 @@ -;;; yatexpkg.el --- YaTeX package manager +;;; yatexpkg.el --- YaTeX package manager -*- coding: sjis -*- ;;; -;;; (c)2003-2014 by HIROSE, Yuuji [yuuji@yatex.org] -;;; Last modified Mon Dec 22 11:12:19 2014 on firestorm +;;; (c)2003-2017 by HIROSE, Yuuji [yuuji@yatex.org] +;;; Last modified Sun Sep 17 10:22:13 2017 on firestorm ;;; $Id$ ;;; Code: @@ -27,13 +27,17 @@ ("alltt" (env "alltt")) ("misc" (section "verbfile" "listing")) + ("verbatim" (section "verbatiminput")) ("eclbkbox" (env "breakbox")) ("supertabular" (env "supertabular")) ("amsmath" (env . YaTeX-package-ams-envs) (section "tag" "tag*")) ("amssymb" (maketitle "leqq" "geqq" "mathbb" "mathfrak" "fallingdotseq" "therefore" "because" + "varDelta" "varTheta" "varLambda" "varXi" "varPi" + "varSigma" "varUpsilon" "varPhi" "varPsi" "varOmega" "lll" "ggg")) ;very few. Please tell us! + ("mathrsfs" (section "mathscr")) ("graphicx" (section "includegraphics" "rotatebox" "scalebox" "resizebox" "reflectbox") (option . YaTeX-package-graphics-driver-alist)) @@ -50,6 +54,8 @@ ("labelcref" (same-as . "cref")) ("labelcpageref" (same-as . "cref")) ("wrapfig" (env "wrapfigure" "wraptable")) + ("setspace" (env "spacing") (section "setstretch")) + ("cases" (env "numcases" "subnumcases")) ) "Default package vs. macro list. Alists contains '(PACKAGENAME . MACROLIST)
--- a/yatexprc.el Fri Dec 26 01:06:32 2014 +0900 +++ b/yatexprc.el Sun Sep 17 10:25:38 2017 +0859 @@ -1,7 +1,7 @@ -;;; yatexprc.el --- YaTeX process handler +;;; yatexprc.el --- YaTeX process handler -*- coding: sjis -*- ;;; -;;; (c)1993-2013 by HIROSE Yuuji.[yuuji@yatex.org] -;;; Last modified Fri Dec 26 00:50:41 2014 on firestorm +;;; (c)1993-2017 by HIROSE Yuuji.[yuuji@yatex.org] +;;; Last modified Sun Sep 17 10:22:02 2017 on firestorm ;;; $Id$ ;;; Code: @@ -9,10 +9,10 @@ (require 'yatexlib) (defvar YaTeX-typeset-process nil - "Process identifier for jlatex") + "Process identifier for latex") (defvar YaTeX-typeset-buffer "*YaTeX-typesetting*" - "Process buffer for jlatex") + "Process buffer for latex") (defvar YaTeX-typeset-buffer-syntax nil "*Syntax table for typesetting buffer") @@ -59,7 +59,7 @@ (defvar YaTeX-typeset-consumption nil) (make-variable-buffer-local 'YaTeX-typeset-consumption) (defun YaTeX-typeset (command buffer &optional prcname modename ppcmd) - "Execute jlatex (or other) to LaTeX typeset." + "Execute latex command (or other) to LaTeX typeset." (interactive) (save-excursion (let ((p (point)) (window (selected-window)) execdir (cb (current-buffer)) @@ -136,9 +136,11 @@ (setq YaTeX-typeset-marker (make-marker))) (point)) (insert (format "Call `%s'\n" command)) - (if YaTeX-dos (message "Done.") + (cond + ((fboundp 'start-process) (insert " ") (set-marker (process-mark YaTeX-typeset-process) (1- (point)))) + (t (message "Done."))) (if (bolp) (forward-line -1)) ;what for? (cond (background nil) @@ -277,23 +279,41 @@ (put 'YaTeX-typeset-process 'thiscmd thiscmd))) ;; If ppcmd is active, call it. (cond + ((and ppcmd (symbolp ppcmd) (fboundp ppcmd)) + ;; If ppcmd is set and it is a function symbol, + ;; call it whenever command succeeded or not + (funcall ppcmd)) ((and ppcmd (string-match "finish" mes)) (insert (format "=======> Success! Calling %s\n" ppcmd)) - (if (symbolp ppcmd) - (funcall ppcmd) - (setq mode-name ; set process name - (concat - mode-name "+" - (substring ppcmd 0 (string-match " " ppcmd)))) + (setq mode-name ; set process name + (concat + mode-name "+" + (substring ppcmd 0 (string-match " " ppcmd)))) ; to reach here, 'start-process exists on this emacsen - (set-process-sentinel - (start-process - mode-name - pbuf ; Use this buffer twice. - shell-file-name YaTeX-shell-command-option - ppcmd) - 'YaTeX-typeset-sentinel))) - (t ;pull back original mode-name + (set-process-sentinel + (start-process + mode-name + pbuf ; Use this buffer twice. + shell-file-name YaTeX-shell-command-option + ppcmd) + 'YaTeX-typeset-sentinel)) + (t + (if (equal 0 (process-exit-status proc)) + ;; Successful typesetting done + (if (save-excursion + (re-search-backward + (concat + "^Output written on .*\\.pdf (.*page," + "\\|\\.dvi -> .*\\.pdf$") + nil t)) + ;; If PDF output log found in buffer, + ;; set next default previewer to 'pdf viewer + (put 'dvi2-command 'format 'pdf)) + ;;Confirm process buffer to be shown when error + (YaTeX-showup-buffer + pbuf 'YaTeX-showup-buffer-bottom-most) + (message "Command FAILED!")) + ;;pull back original mode-name (setq mode-name "typeset")))) (forward-char 1)) (setq YaTeX-typeset-process nil) @@ -397,8 +417,12 @@ (put 'dvi2-command 'file buffer) (put 'dvi2-command 'offset lineinfo)))) -(defvar YaTeX-use-image-preview t - "*Use or else view graphic preview image via [prefix] t e.") +(defvar YaTeX-use-image-preview "png" + "*Nil means not using image preview by [prefix] t e. +Acceptable value is one of \"jpg\" or \"png\", which specifies +format of preview image. NOTE that if your system has /usr/bin/sips +while not having convert(ImageMagick), jpeg format is automatically taken +for conversion.") (defvar YaTeX-preview-image-mode-map nil "Keymap used in YaTeX-preview-image-mode") (defun YaTeX-preview-image-mode () @@ -415,26 +439,64 @@ (define-key map "k" (lambda()(interactive) (scroll-up -1))))) (use-local-map YaTeX-preview-image-mode-map)) +(defvar YaTeX-typeset-pdf2image-chain + (cond + ((YaTeX-executable-find "pdfcrop") ;Mac OS X + (list + "pdfcrop --clip %b.pdf tmp.pdf" + (if (YaTeX-executable-find "convert") + "convert -density %d tmp.pdf %b.%f" + ;; If we use sips, specify jpeg as format + "sips -s format jpeg -s dpiWidth %d -s dpiHeight %d %b.pdf --out %b.jpg") + "rm -f tmp.pdf"))) + "*Pipe line of command as a list to create image file from PDF. +See also doc-string of YaTeX-typeset-dvi2image-chain.") + +(defvar YaTeX-typeset-dvi2image-chain + (cond + ((YaTeX-executable-find YaTeX-cmd-dvips) + (list + (format "%s -E -o %%b.eps %%b.dvi" YaTeX-cmd-dvips) + "convert -alpha off -density %d %b.eps %b.%f")) + ((and (equal YaTeX-use-image-preview "png") + (YaTeX-executable-find "dvipng")) + (list "dvipng %b.dvi"))) + "*Pipe line of command as a list to create png file from DVI or PDF. +%-notation rewritten list: + %b basename of target file(\"texput\") + %f Output format(\"png\") + %d DPI +") + +(defvar YaTeX-typeset-conv2image-chain-alist + (list (cons 'pdf YaTeX-typeset-pdf2image-chain) + (cons 'dvi YaTeX-typeset-dvi2image-chain)) + "Default alist for creating image files from DVI/PDF. +The value is generated from YaTeX-typeset-pdf2image-chain and +YaTeX-typeset-dvi2image-chain.") + (defvar YaTeX-typeset-conv2image-process nil "Process of conv2image chain") (defun YaTeX-typeset-conv2image-chain () (let*((proc (or YaTeX-typeset-process YaTeX-typeset-conv2image-process)) (prevname (process-name proc)) - (target "texput.png") + (texput "texput") + (format YaTeX-use-image-preview) + (target (concat texput "." format)) (math (get 'YaTeX-typeset-conv2image-chain 'math)) - ;(conv (format "convert -density %d - %s" (if math 250 100) target)) - ;(chain (list (format "dvips -E -o - texput|%s" conv))) - (conv (format "convert -alpha off - %s" target)) - (chain (list (format "%s -x %d -E -o - texput|%s" - ;; This function is the first evaluation code. - ;; If you find these command line does not work - ;; on your system, please tell the author - ;; which commands should be taken to achieve - ;; one-shot png previewing on your system - ;; before publishing patch on the Web. - ;; Please please please please please. - YaTeX-cmd-dvips - (if math 3000 2000) - conv))) + (dpi (get 'YaTeX-typeset-conv2image-chain 'dpi)) + (srctype (or (get 'YaTeX-typeset-conv2image-chain 'srctype) + (if (file-newer-than-file-p + (concat texput ".pdf") + (concat texput ".dvi")) + 'pdf 'dvi))) + (chain (cdr (assq srctype YaTeX-typeset-conv2image-chain-alist))) + ;; This function is the first evaluation code. + ;; If you find these command line does not work + ;; on your system, please tell the author + ;; which commands should be taken to achieve + ;; one-shot png previewing on your system + ;; before publishing patch on the Web. + ;; Please please please please please. (curproc (member prevname chain)) (w (get 'YaTeX-typeset-conv2image-chain 'win)) (pwd default-directory) @@ -447,14 +509,19 @@ (setq command (if curproc (car (cdr-safe curproc)) (car chain))) (if command - (progn - (insert (format "Calling `%s'...\n" command)) + (let ((cmdline (YaTeX-replace-formats + command + (list (cons "b" "texput") + (cons "f" format) + (cons "d" dpi))))) + (insert (format "Calling `%s'...\n" cmdline)) (set-process-sentinel (setq YaTeX-typeset-conv2image-process (start-process command (current-buffer) - shell-file-name YaTeX-shell-command-option command)) + shell-file-name YaTeX-shell-command-option + cmdline)) 'YaTeX-typeset-sentinel) (put 'YaTeX-typeset-process 'ppcmd (cons (cons (get-buffer-process (current-buffer)) @@ -466,7 +533,7 @@ ;; If direct image displaying available in running Emacs, ;; display target image into the next window in Emacs. (select-window w) - (setq foo (selected-window)) + ;(setq foo (selected-window)) (YaTeX-showup-buffer (get-buffer-create " *YaTeX-region-image*") 'YaTeX-showup-buffer-bottom-most t) @@ -478,10 +545,14 @@ (setq img (plist-get (text-properties-at (point)) 'intangible)) (YaTeX-preview-image-mode) (if img - (let ((height (cdr (image-size img)))) + (let ((height (1+ (cdr (image-size img))))) (enlarge-window (- (ceiling (min height (/ (frame-height) 2))) - (window-height)))))) + (window-height))))) + ;; Remember elapsed time, which will be threshold in onthefly-preview + (put 'YaTeX-typeset-conv2image-chain 'elapse + (YaTeX-elapsed-time + (get 'YaTeX-typeset-conv2image-chain 'start) (current-time)))) (t ;; Without direct image, display image with image viewer (YaTeX-system @@ -491,23 +562,174 @@ ) ))))) -(defun YaTeX-typeset-environment () - "Typeset current math environment" - (interactive) + +(defvar YaTeX-typeset-environment-timer nil) +(defun YaTeX-typeset-environment-timer () + "Update preview image in the +Plist: '(buf begPoint endPoint precedingChar 2precedingChar Substring time)" + (let*((plist (get 'YaTeX-typeset-environment-timer 'laststate)) + (b (nth 0 plist)) + (s (nth 1 plist)) + (e (nth 2 plist)) + (p (nth 3 plist)) + (q (nth 4 plist)) + (st (nth 5 plist)) + (tm (nth 6 plist)) + (overlay YaTeX-on-the-fly-overlay) + (thresh (* 2 (or (get 'YaTeX-typeset-conv2image-chain 'elapse) 1)))) + (cond + ;; In minibuffer, do nothing + ((minibuffer-window-active-p (selected-window)) nil) + ;; If point went out from last environment, cancel timer + ;;;((and (message "s=%d, e=%d, p=%d" s e (point)) nil)) + ((null (buffer-file-name)) nil) ;;At momentary-string-display, it's nil. + ((or (not (eq b (window-buffer (selected-window)))) + (< (point) s) + (not (overlayp overlay)) + (not (eq (overlay-buffer overlay) (current-buffer))) + (> (point) (overlay-end overlay))) + (YaTeX-typeset-environment-cancel-auto)) + ;;;((and (message "e=%d, p=%d t=%s" e (point) (current-time)) nil)) + ;; If recently called, hold + ;;; ((< (YaTeX-elapsed-time tm (current-time)) thresh) nil) + ;; If condition changed from last call, do it + ((not (string= st (YaTeX-buffer-substring s (overlay-end overlay)))) + (YaTeX-typeset-environment))))) + + +(defun YaTeX-typeset-environment-by-lmp () + (save-excursion + (let ((sw (selected-window))) + (goto-char opoint) + (latex-math-preview-expression) + (select-window sw)))) + +(defun YaTeX-typeset-environment-by-builtin () (save-excursion - (let ((math (YaTeX-in-math-mode-p))) - (cond - ((and (fboundp 'region-active-p) (region-active-p)) - nil) ;if region is active, use it - ((equal (or (YaTeX-inner-environment t) "document") "document") - (mark-paragraph)) - (t (YaTeX-mark-environment))) - (if YaTeX-use-image-preview - (let ((YaTeX-typeset-buffer (concat "*bg:" YaTeX-typeset-buffer))) - (put 'YaTeX-typeset-conv2image-chain 'math math) - (put 'YaTeX-typeset-conv2image-chain 'win (selected-window)) + (YaTeX-typeset-region 'YaTeX-typeset-conv2image-chain))) + +(defvar YaTeX-on-the-fly-math-preview-engine + (if (fboundp 'latex-math-preview-expression) + 'YaTeX-typeset-environment-by-lmp + 'YaTeX-typeset-environment-by-builtin) + "Function symbol to use math-preview. +'YaTeX-typeset-environment-by-lmp for using latex-math-preview, +'YaTeX-typeset-environment-by-builtin for using yatex-builtin.") + +(defun YaTeX-typeset-environment-1 () + (require 'yatex23) + (let*((math (YaTeX-in-math-mode-p)) + (dpi (or (YaTeX-get-builtin "IMAGEDPI") (if math "300" "200"))) + (opoint (point)) + usetimer) + (cond + ((and YaTeX-on-the-fly-overlay (overlayp YaTeX-on-the-fly-overlay) + (member YaTeX-on-the-fly-overlay (overlays-at (point)))) + ;; If current position is in on-the-fly overlay, + ;; use that region again + (setq math (get 'YaTeX-typeset-conv2image-chain 'math)) + (push-mark (overlay-start YaTeX-on-the-fly-overlay)) + (goto-char (overlay-end YaTeX-on-the-fly-overlay))) + ((YaTeX-region-active-p) + nil) ;if region is active, use it + (math (setq usetimer t) (YaTeX-mark-environment)) + ((equal (or (YaTeX-inner-environment t) "document") "document") + (mark-paragraph)) + (t (setq usetimer t) (YaTeX-mark-environment))) + (if YaTeX-use-image-preview + (let ((YaTeX-typeset-buffer (concat "*bg:" YaTeX-typeset-buffer)) + (b (region-beginning)) (e (region-end))) + (put 'YaTeX-typeset-conv2image-chain 'math math) + (put 'YaTeX-typeset-conv2image-chain 'dpi dpi) + (put 'YaTeX-typeset-conv2image-chain 'srctype nil) + (put 'YaTeX-typeset-conv2image-chain 'win (selected-window)) + (put 'YaTeX-typeset-conv2image-chain 'start (current-time)) + (put 'YaTeX-typeset-environment-timer 'laststate + (list (current-buffer) b e (preceding-char) + (char-after (- (point) 2)) + (YaTeX-buffer-substring b e) + (current-time))) + (if math (funcall YaTeX-on-the-fly-math-preview-engine) (YaTeX-typeset-region 'YaTeX-typeset-conv2image-chain)) - (YaTeX-typeset-region))))) + (if usetimer (YaTeX-typeset-environment-auto b e))) + (YaTeX-typeset-region)))) + +(defun YaTeX-typeset-environment () + "Typeset current environment or paragraph. +If region activated, use it." + (interactive) + (let ((md (match-data))) + (unwind-protect + (save-excursion + (YaTeX-typeset-environment-1)) + (store-match-data md)))) + + +(defvar YaTeX-on-the-fly-preview-interval (string-to-number "0.9") + "*Control the on-the-fly update of preview environment by an image. +Nil disables on-the-fly update. Otherwise on-the-fly update is enabled +with update interval specified by this value.") + +(defun YaTeX-typeset-environment-auto (beg end) + "Turn on on-the-fly preview-image" + (if YaTeX-typeset-environment-timer + (cancel-timer YaTeX-typeset-environment-timer)) + (if YaTeX-on-the-fly-overlay + (move-overlay YaTeX-on-the-fly-overlay beg end) + (overlay-put + (setq YaTeX-on-the-fly-overlay (make-overlay beg end)) + 'face 'YaTeX-on-the-fly-activated-face)) + (setq YaTeX-typeset-environment-timer + (run-with-idle-timer + (max (string-to-number "0.1") + (cond + ((numberp YaTeX-on-the-fly-preview-interval) + YaTeX-on-the-fly-preview-interval) + ((stringp YaTeX-on-the-fly-preview-interval) + (string-to-number YaTeX-on-the-fly-preview-interval)) + (t 1))) + t 'YaTeX-typeset-environment-timer))) + +(defun YaTeX-typeset-environment-activate-onthefly () + (if (get-text-property (point) 'onthefly) + (save-excursion + (if YaTeX-typeset-environment-timer + (progn + (cancel-timer YaTeX-typeset-environment-timer) + (setq YaTeX-typeset-environment-timer nil))) + (if (YaTeX-on-begin-end-p) + (if (or (match-beginning 1) (match-beginning 3)) ;on beginning + (goto-char (match-end 0)) + (goto-char (match-beginning 0)))) + (YaTeX-typeset-environment)))) + +(defun YaTeX-on-the-fly-cancel () + "Reset on-the-fly stickiness" + (interactive) + (YaTeX-typeset-environment-cancel-auto 'stripoff) + t) ;t for kill-* + +(defun YaTeX-typeset-environment-cancel-auto (&optional stripoff) + "Cancel typeset-environment timer." + (interactive) + (if YaTeX-typeset-environment-timer + (cancel-timer YaTeX-typeset-environment-timer)) + (setq YaTeX-typeset-environment-timer + (run-with-idle-timer + (string-to-number "0.1") + t + 'YaTeX-typeset-environment-activate-onthefly)) + (let ((ov YaTeX-on-the-fly-overlay)) + (if stripoff + (remove-text-properties (overlay-start ov) + (1- (overlay-end ov)) + '(onthefly)) + (put-text-property (overlay-start YaTeX-on-the-fly-overlay) + (1- (overlay-end YaTeX-on-the-fly-overlay)) + 'onthefly + t)) + (delete-overlay ov) + (message "On-the-fly preview deactivated"))) (defun YaTeX-typeset-buffer (&optional pp) "Typeset whole buffer. @@ -738,14 +960,15 @@ (defun YaTeX-preview-default-previewer () "Return default previewer for this document" (YaTeX-replace-format - (or (YaTeX-get-builtin "PREVIEW") - (if (eq (get 'dvi2-command 'format) 'pdf) - tex-pdfview-command - dvi2-command)) - "p" (format (cond - (YaTeX-dos "-y:%s") - (t "-paper %s")) - (YaTeX-get-paper-type)))) + (if (eq (get 'dvi2-command 'format) 'pdf) + (or (YaTeX-get-builtin "PDFVIEW") + tex-pdfview-command) + (or (YaTeX-get-builtin "PREVIEW") + dvi2-command)) + "p" (format (cond + (YaTeX-dos "-y:%s") + (t "-paper %s")) + (YaTeX-get-paper-type)))) (defun YaTeX-preview-default-main (command) "Return default preview target file" (if (get 'dvi2-command 'region) @@ -846,7 +1069,8 @@ (save-excursion (YaTeX-visit-main t) (buffer-file-name)))) (pdir (file-name-directory pf)) (bnr (substring pf 0 (string-match "\\....$" pf))) - (cf (file-relative-name (buffer-file-name) pdir)) + ;(cf (file-relative-name (buffer-file-name) pdir)) + (cf (buffer-file-name)) ;2016-01-08 (buffer (get-buffer-create " *preview-jump-line*")) (line (count-lines (point-min) (point-end-of-line))) (previewer (YaTeX-preview-default-previewer)) @@ -866,15 +1090,18 @@ ;; yet. If you find correct command line, PLEASE TELL ;; IT TO THE AUTHOR before publishing patch on the web. ;; ..PLEASE PLEASE PLEASE PLEASE PLEASE PLEASE PLEASE.. - ;; ((string-match "sumatra" previewer) ;;?? - ;; (format "%s \"%s.pdf\" -forward-search \"%s\" %d" - ;; previewer bnr cf line)) - ;; ((string-match "qpdfview" previewer) ;;?? - ;; (format "%s '%s.pdf#src:%s:%d:0'" ;if NG, tell - ;; previewer bnr cf line)) - ;; ((string-match "okular" previewer) ;;?? - ;; (format "%s '%s.pdf#src:%d' '%s'" - ;; previewer bnr line cf)) + ((string-match "sumatra" previewer) ;;?? + (format "%s \"%s.pdf\" -forward-search \"%s\" %d" + ;;Send patch to the author, please + previewer bnr cf line)) + ((string-match "qpdfview" previewer) ;;?? + (format "%s '%s.pdf#src:%s:%d:0'" + ;;Send patch to the author, please + previewer bnr cf line)) + ((string-match "okular" previewer) ;;?? + (format "%s '%s.pdf#src:%d' '%s'" + ;;Send patch to the author, please + previewer bnr line cf)) ))) (YaTeX-system cmd "jump-line" 'noask pdir))))) @@ -886,7 +1113,7 @@ t) ;for YaTeX-goto-corresponding-* nil))) - (defun YaTeX-set-virtual-error-position (file-sym line-sym) +(defun YaTeX-set-virtual-error-position (file-sym line-sym) "Replace the value of FILE-SYM, LINE-SYM by virtual error position." (cond ((and (get 'dvi2-command 'region) @@ -904,9 +1131,14 @@ (interactive) (let ((cur-buf (save-excursion (YaTeX-visit-main t) (buffer-name))) (cur-win (selected-window)) + tsb-frame-selwin b0 bound errorp error-line typeset-win error-buffer error-win) (if (null (get-buffer YaTeX-typeset-buffer)) (error "There is no typesetting buffer.")) + (and (fboundp 'selected-frame) + (setq typeset-win (get-buffer-window YaTeX-typeset-buffer t)) + (setq tsb-frame-selwin (frame-selected-window typeset-win))) + (YaTeX-showup-buffer YaTeX-typeset-buffer nil t) (if (and (markerp YaTeX-typeset-marker) (eq (marker-buffer YaTeX-typeset-marker) (current-buffer))) @@ -922,7 +1154,7 @@ (goto-char (setq b0 (match-beginning 0))) (skip-chars-forward "^0-9" (match-end 0)) (setq error-line - (string-to-int + (YaTeX-str2int (buffer-substring (point) (progn (skip-chars-forward "0-9" (match-end 0)) (point)))) @@ -930,9 +1162,23 @@ (if (or (null error-line) (equal 0 error-line)) (error "Can't detect error position.")) (YaTeX-set-virtual-error-position 'error-buffer 'error-line) + + (select-window typeset-win) + (skip-chars-backward "0-9") + (recenter (/ (window-height) 2)) + (sit-for 1) + (goto-char b0) + (and tsb-frame-selwin (select-window tsb-frame-selwin)) ;restore selwin + (setq error-win (get-buffer-window error-buffer)) (select-window cur-win) (cond + (t (goto-buffer-window error-buffer) + (if (fboundp 'raise-frame) + (let ((edit-frame (window-frame (selected-window)))) + (raise-frame edit-frame) + (select-frame edit-frame))) + ) (error-win (select-window error-win)) ((eq (get-lru-window) typeset-win) (YaTeX-switch-to-buffer error-buffer)) @@ -943,11 +1189,6 @@ (message "LaTeX %s in `%s' on line: %d." (if errorp "error" "warning") error-buffer error-line) - (select-window typeset-win) - (skip-chars-backward "0-9") - (recenter (/ (window-height) 2)) - (sit-for 1) - (goto-char b0) (select-window error-win))) (defun YaTeX-jump-error-line () @@ -962,7 +1203,7 @@ (if (eobp) (insert (this-command-keys)) (error "No line number expression.")) (goto-char (match-beginning 0)) - (setq error-line (string-to-int + (setq error-line (YaTeX-str2int (buffer-substring (match-beginning 1) (match-end 1))) error-file (expand-file-name (YaTeX-get-error-file YaTeX-current-TeX-buffer))) @@ -1024,8 +1265,11 @@ (setq s (buffer-substring (progn (forward-char 1) (point)) - (progn (skip-chars-forward "^ \n" (point-end-of-line)) - (point)))) + (if (re-search-forward + "\\.\\(tex\\|sty\\|ltx\\)\\>" nil (point-end-of-line)) + (match-end 0) + (skip-chars-forward "^ \n" (point-end-of-line)) + (point)))) (if (string= "" s) default s)))) (defun YaTeX-put-nonstopmode () @@ -1050,9 +1294,9 @@ (widen)))) (defvar YaTeX-dvi2-command-ext-alist - '(("[agx]dvi\\|dviout" . ".dvi") + '(("[agxk]dvi\\|dviout" . ".dvi") ("ghostview\\|gv" . ".ps") - ("acroread\\|xpdf\\|pdfopen\\|Preview\\|TeXShop\\|Skim\\|evince\\|mupdf\\|zathura\\|okular" . ".pdf"))) + ("acroread\\|[xk]pdf\\|pdfopen\\|Preview\\|TeXShop\\|Skim\\|evince\\|mupdf\\|zathura\\|okular" . ".pdf"))) (defun YaTeX-get-preview-file-name (&optional preview-command) "Get file name to preview by inquiring YaTeX-get-latex-command" @@ -1079,12 +1323,12 @@ strings are assumed to be the latex-command and arguments. The default value of latex-command is: tex-command FileName -and if you write \"%#!jlatex\" in the beginning of certain line. - \"jlatex \" FileName +and if you write \"%#!platex\" in the beginning of certain line. + \"platex \" FileName will be the latex-command, -and you write \"%#!jlatex main.tex\" on some line and argument SWITCH +and you write \"%#!platex main.tex\" on some line and argument SWITCH is non-nil, then - \"jlatex main.tex\" + \"platex main.tex\" will be given to the shell." (let (parent tparent magic)
--- a/yatexsec.el Fri Dec 26 01:06:32 2014 +0900 +++ b/yatexsec.el Sun Sep 17 10:25:38 2017 +0859 @@ -1,6 +1,6 @@ ;;; yatexsec.el --- YaTeX sectioning browser ;;; -;;; (c) 1994-2013 by HIROSE Yuuji [yuuji@yatex.org] +;;; (c) 1994-2017 by HIROSE Yuuji [yuuji@yatex.org] ;;; Last modified Sun Dec 21 14:16:35 2014 on firestorm ;;; $Id$ @@ -134,7 +134,7 @@ (and ln (string< "" ln) (progn (goto-char (point-min)) - (forward-line (max 0 (- (string-to-int ln) 2))) + (forward-line (max 0 (- (YaTeX-str2int ln) 2))) (and (search-forward ptn nil t) (goto-char (match-beginning 0))))) @@ -345,7 +345,7 @@ (set-buffer secbuf) (goto-char (point-max)) (while (re-search-backward pattern nil t) - (if (< ln (string-to-int (YaTeX-match-string 1))) nil + (if (< ln (YaTeX-str2int (YaTeX-match-string 1))) nil (beginning-of-line) (search-forward YaTeX-ec) (looking-at YaTeX-TeX-token-regexp)