# HG changeset patch # User HIROSE Yuuji # Date 1420554135 -32400 # Node ID 04ee01ddb7ab11401bd281b7b0262f421db8ae25 # Parent 8d17b1902bddb91567dd13ea1f0d88e46d733dc2 Simplify installation step. Update Q&A. diff -r 8d17b1902bdd -r 04ee01ddb7ab docs/qanda --- a/docs/qanda Tue Jan 06 23:20:53 2015 +0900 +++ b/docs/qanda Tue Jan 06 23:22:15 2015 +0900 @@ -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なの? だっせー。 diff -r 8d17b1902bdd -r 04ee01ddb7ab docs/qanda.eng --- a/docs/qanda.eng Tue Jan 06 23:20:53 2015 +0900 +++ b/docs/qanda.eng Tue Jan 06 23:22:15 2015 +0900 @@ -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 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 diff -r 8d17b1902bdd -r 04ee01ddb7ab install --- a/install Tue Jan 06 23:20:53 2015 +0900 +++ b/install Tue Jan 06 23:22:15 2015 +0900 @@ -3,30 +3,25 @@ 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 exec the next command. -続いて makefile を編集し、 +First, take a look at makefile to confirm or modify EMACS= and PREFIX= +lines and exec the next command. +このディレクトリにある makefile の EMACS= と PREFIX= の行を確認し、 +必要なら修正した後に以下のコマンドを起動してください。 % make install (or "sudo make install") -でインストールを行ってください。 +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 +に足してください。 + + % make show-init + +After copying output from make command to your ~/.emacs, you will be able to +use yatex-mode for *.tex files. +以上で、初期設定は終わりです。 + Without installing to default-dir, you can use yatex by adding the elisp obtained by below to ~/.emacs. @@ -36,36 +31,6 @@ % make show-init2 -If `make install' fails, do as follows; -もし `make install' でうまく行かない時は下記のように手動でインストール -を行ってください。 - -First, copy `*.el' to suitable directory. -最初に、野鳥の emacs-lisp ファイル群を適当なディレクトリにコピーします。 - -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) - - -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 ファイルの中身を追加します。 - -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 がロードできず、正常にコンパ -イルできません。うまくいかない場合はバイトコンパイルしなくて構いません。 - - About yahtml / yahtmlについて ***************************** diff -r 8d17b1902bdd -r 04ee01ddb7ab makefile --- a/makefile Tue Jan 06 23:20:53 2015 +0900 +++ b/makefile Tue Jan 06 23:22:15 2015 +0900 @@ -135,11 +135,12 @@ done show-init: - @printf '%s\n%s\n%s\n%s\n' \ + @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}\")" + "(add-to-list 'load-path \"${LISPDIR}\")" \ + "(setq YaTeX-help-file \"${LISPDIR}/help/YATEXHLP.eng\")" @printf '(setq tex-command "%s")%s\n' \ `CMDS='platex pdflatex ptex2pdf lualatex' DFLT=latex \ make search-cmd` diff -r 8d17b1902bdd -r 04ee01ddb7ab yatex.new --- a/yatex.new Tue Jan 06 23:20:53 2015 +0900 +++ b/yatex.new Tue Jan 06 23:22:15 2015 +0900 @@ -3,7 +3,7 @@ 1.79 === yatex === 数式環境など特定環境内の [prefix] t e で On-the-fly preview 発動。 - YaTeX-help-file のデフォルト位置を site-lisp/yatex/help に変更。 + YaTeX-help-file のデフォルト位置を site-lisp/yatex/help/ に変更。 ...