diff --git a/docs/yatex.ref b/docs/yatex.ref index 72da127..f9bcef3 100644 --- a/docs/yatex.ref +++ b/docs/yatex.ref @@ -141,7 +141,7 @@ �����܂������s ESC RET �u���܂������s�v�� tabular, array, itemize, enumerate, list, - description �‹��łŗL���ł��B + description �‹��ŗL���ł��B �L���Y�� yuuji@ae.keio.ac.jp diff --git a/docs/yatexe.tex b/docs/yatexe.tex index 03d3e27..08cb1f6 100644 --- a/docs/yatexe.tex +++ b/docs/yatexe.tex @@ -25,25 +25,25 @@ @cindex YaTeX @menu -* What is YaTeX?:: -* Main features:: -* Installation:: -* Typesetting:: -* %# notation:: -* Completion:: -* Local dictionaries:: -* Commenting out:: -* Cursor jump:: -* Changing and Deleting:: -* Filling an item:: -* Updation of @code{\includeonly}:: -* What column?:: -* Intelligent newline:: -* Online help:: -* Cooperation with other packages:: -* Customizations:: -* Etcetera:: -* Copying:: +* What is YaTeX?:: Introduction +* Main features:: What YaTeX can do +* Installation:: Guide to install +* Typesetting:: Call typesetting processes +* %# notation:: Quick notation of controlling YaTeX +* Completion:: Input LaTeX commands with completion +* Local dictionaries:: Directory dependent completion +* Commenting out:: Commenting/uncommenting text +* Cursor jump:: Jumping to related position +* Changing and Deleting:: Changing/deleting certain unit of text +* Filling:: Filling an item or paragraph +* Updation of @code{\includeonly}:: Maintaining @code{\includeonly} +* What column?:: Column position guide in tabular +* Intelligent newline:: Guess requisites of new line +* Online help:: On-line documentation of LaTeX +* Cooperation with other packages:: Work well with gmhist, min-out +* Customizations:: How to breed `Wild Bird' +* Etcetera:: YaTeX is acquisitive. +* Copying:: Redistribution --- The Detailed Node Listing --- @@ -265,7 +265,13 @@ @end example @noindent -anywhere in the source text. And if you split the source text and +anywhere in the source text. This is useful for changing +typesetter. + +@node Splitting input files, Static region for typesetting, Changing typesetter, %# notation +@comment node-name, next, previous, up + + And if you split the source text and edit subfile that should be included from main text. @example @@ -285,13 +291,14 @@ Note that YaTeX assumes the component before the last period of the last word in this line as base name of the main La@TeX{} source. - Here are the restrictions on splitting sources. + To make best use of the feature of inter-file jumping by +@kbd{[prefix] g} (see @ref{Cursor jump}), take described below into +consideration. @itemize -@item All the file name should be different. @item You can put split texts in sub directory, but not in sub directory of sub directory. -@item In the main text,specify the file with relative path name +@item 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. @item In a sub-text, write @code{%#!latex main.tex} even if @file{main.tex} @@ -864,12 +871,14 @@ minibuffer, YaTeX asks you with the following prompt; @example - `foo' is not in table. Register into: U)serTable L)ocal N)one + `foo' is not in table. Register into: U)serDic L)ocalDic N)one D)iscad @end example @noindent -In this menu, typing `u' updates your `user dictionary', `l' updates your -local dictionary, and `n' updates no dictionary and throws the word away. +In this menu, typing @kbd{u} updates your `user dictionary', @kbd{l} +updates your local dictionary, @kbd{n} updates only on-memory dictionary +which go through only current Emacs session, and @kbd{d} updates no +dictionary and throws the new word away. If you find this switching feature meaningless and bothersome, put the next expression into your @file{~/.emacs} @@ -948,6 +957,8 @@ @cindex cursor jump @cindex prefix g +@section Jump to corresponding object + Typing @table @kbd @@ -970,14 +981,27 @@ On a @code{\begin},@code{\end} line, typing @kbd{[prefix] g} moves the cursor to the corresponding @code{\end},@code{\begin} line, if its partner -really exists. The behaviour on the line @code{%#BEGIN} and @code{%#END} +really exists. The behavior on the line @code{%#BEGIN} and @code{%#END} are the same. Note that if the correspondent of @code{label/ref} or -@code{cite/bibitem} exists in another file, that file have to be opend to +@code{cite/bibitem} exists in another file, that file have to be opened to make a round trip between references by @kbd{[prefix] g}. If you type @code{[prefix] g} on the line of @code{\include@{chap1@}}, typically in the main text, YaTeX switches buffer to @file{chap1.tex}. -The key strokes below work to the contrary. Typing + +@table @kbd +@item [prefix] 4 g + @dots{} go to corresponding object in other window +@end table + +@noindent +do the same job as @kbd{[prefix] g} except it's done in other window. +Note that this function doesn't work on @code{begin/end}, +@code{%#BEGIN/%#END} pairs because it is meaningless. + +@section Jump to main file + + Typing @table @kbd @item [prefix] ^ @@ -991,6 +1015,8 @@ in a sub text switch the buffer to the main text specified by @code{%#!} notation. +@section Other jumping features + And these are the functions which work on the current La@TeX{} environment: @@ -1006,7 +1032,7 @@ @cindex M-C-e @cindex M-C-@@ -@node Changing and Deleting, Filling an item, Cursor jump, Top +@node Changing and Deleting, Filling, Cursor jump, Top @comment node-name, next, previous, up @chapter Changing and Deleting @@ -1084,13 +1110,16 @@ ~(cursor) @end example -@node Filling an item, Updation of @code{\includeonly}, Changing and Deleting, Top +@node Filling, Updation of @code{\includeonly}, Changing and Deleting, Top @comment node-name, next, previous, up -@chapter Filling an item +@chapter Filling +@cindex filling + +@section Filling an item @cindex filling an item @cindex prefix i - To fill a term (sentence) of @code{\item}, type + To fill a term (descriptive sentences) of @code{\item}, type @table @kbd @item [prefix] i @@ -1102,7 +1131,7 @@ YaTeX uses the value of the variable @code{YaTeX-item-regexp} as the regular expression to search item header in itemize environment. -If you make a newcommand to itemize terms(eg. @code{\underlineitem}), put +If you make a newcommand to itemize terms(e.g. @code{\underlineitem}), put @lisp (setq YaTeX-item-regexp @@ -1114,7 +1143,42 @@ for Emacs-Lisp, name a newcommand for `itemize' beginning with @code{\item} such as @code{\itembf}, not @code{\bfitem}. -@node Updation of @code{\includeonly}, What column?, Filling an item, Top + This function -- YaTeX-fill-item -- reformats the @code{\item} into +`hang-indented' style. When you separate the topic word and its +description, use @kbd{M-q} instead. For example: + +@example +Hang indentation: + > + >\item[foo] `foo' is the typical word for describing an + > arbitrarily written.... + +Normal indentation: + > + > \item bar + > + > When the word `for' is used as an arbitrarily word, `bar' + > is bound to follow it. +@end example + + Note that the indent depth of the @code{\item} and its descriptive +paragraph are the same in latter case. If you want to use different +depth, invoke fill-paragraph at the beginning of non-whitespace +character(see below). + +@section Filling paragraph +@cindex Filling paragraph +@cindex M-q + + Fill-paragraph is little bit adapted for La@TeX{} sources. It retains from +filling in certain environments where formatting leads to a disaster such +as verbatim, tabular, or so. And it protects @code{\verb} expressions +from being folded (The variable @code{YaTeX-verb-regexp} controls this). +Besides, putting cursor on the first occurrence of non-whitespace +character on a line changes the fill-prefix temporarily to the depth of +the line. + +@node Updation of @code{\includeonly}, What column?, Filling, Top @comment node-name, next, previous, up @chapter Updation of @code{\includeonly} @cindex includeonly @@ -1448,6 +1512,11 @@ Regexp of La@TeX{} itemization command (@code{"\\\\(sub\\)*item"}) @end defvar +@defvar YaTeX-verb-regexp + Regexp of La@TeX{} verb command family. Omit \\\\. + (@code{"verb\\*?\\|path"}) +@end defvar + @defvar YaTeX-nervous T for using local dictionary (@code{t}) @end defvar @@ -1475,6 +1544,12 @@ Switch math-mode automatically(@code{t}) @end defvar +@defvar YaTeX-math-key-list-private + User defined alist, math-mode-prefix vs completion alist + used in image completion(@code{nil}). See @file{yatexmth.el} + for the information about how to define a completion alist. +@end defvar + @defvar YaTeX-default-pop-window-height Initial height of typesetting buffer when one-window. Number for the lines of the buffer, numerical string for @@ -1624,7 +1699,7 @@ concatenating `YaTeX::' and section-type command, is called automatically with an integer argument which indicates which argument of section-type command is being read. Thus the add-in should determine the -job refering the value of its argument. +job referring the value of its argument. @menu * Defining `option add-in':: @@ -1718,13 +1793,13 @@ @itemx [A] Base prompt, X-axis prompt, Y-axis prompt (each optional) @itemx [D] - Read the coodinates with the prompt ``BasePrompt X-axisPrompt:'' for + 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 @code{Dimention}, @code{X}, +of ``(X,Y)''. The default prompts are @code{Dimension}, @code{X}, @code{Y} respectively. @item [F] -YaTeX:check-comletion-type +YaTeX:check-completion-type @itemx [A] One of the symbols: 'begin, 'section, or 'maketitle @itemx [D] @@ -1831,9 +1906,9 @@ @item Position read positional option (like [htbp]) @item Coord. -read coodinates +read coordinates @item Quit -quit from genarating +quit from generating @end table Since (A) is the optional argument to specify the location of included @@ -1930,7 +2005,7 @@ @subsection Contribution If you get your own pretty function and you let it be in public, please -steel yourself in the happy atomospher and do not send me the function. +steel yourself in the happy atmosphere and do not send me the function. I do know it is not fine because it is generated by yatexgen:-p. @node Etcetera, Copying, Customizations, Top @@ -1944,6 +2019,8 @@ use completion in order to enrich your dictionary, and you will also find `Wild Bird' growing suitable for your La@TeX{} style. + The package name `Wild Bird' is the English translation of Japanese +title `Yachou', which is a trick on words of Japanese. @node Copying, , Etcetera, Top @comment node-name, next, previous, up diff --git a/docs/yatexj.tex b/docs/yatexj.tex index db0f922..112bcda 100644 --- a/docs/yatexj.tex +++ b/docs/yatexj.tex @@ -24,23 +24,74 @@ * Intro:: �͂��߂� * Main features:: ��ȋ@�\ * Installation:: �C���X�g�[�� -* Invocation:: �O���R�}���h�̋N�� +* Invocation:: �v���Z�X�N�� * %#notation :: %#�L�@ * Completion:: �⊮���� * Local dictionary:: ���[�J������ * Commenting out:: �R�����g�A�E�g * Cursor jump:: �J�[�\���W�����v -* Modifying/Deleting:: �ύX/�폜 -* Filling item:: item�̌����� -* Includeonly:: �����includeonly -* What column:: �����͂ǂ�? +* Modifying/Deleting:: LaTeX�R�}���h�̕ύX/�폜 +* Filling:: ������ +* Includeonly:: ����� includeonly +* What column:: �J�����ʒu�K�C�h * Intelligent newline:: ���܂������s -* Online help:: �I�����C���w���v +* Online help:: LaTeX�I�����C���w���v * Cooperation with other packages:: ���p�b�P�[�W�Ƃ̘A�g * Customizations:: �J�X�^�}�C�Y * Etc:: ���̑� * Copying:: ��舵�� * Concept Index:: ���� + + --- The Detailed Node Listing --- + +latex�R�}���h�N�� + +* Calling typesetter:: �^�C�v�Z�b�^�N�� +* Print out:: �v�����g�A�E�g�p�R�}���h�̋N�� + +%#�L�@ + +* Changing typesetter:: �^�C�v�Z�b�g�p�R�}���h�̕ύX +* Splitting input files:: ���̓t�@�C������ +* Fix region for typesetting:: �̈�̌Œ� +* lpr format:: �v�����g�A�E�g�R�}���h�p�t�H�[�}�b�g +* Editing %# notation:: %#�L�@�̕ҏW + +�⊮���� + +* begin�^�⊮:: +* section�^�⊮:: +* large�^�⊮:: +* maketitle�^�⊮:: +* Arbitrary completion:: �����⊮ +* end�⊮:: +* Accent mark completion:: �A�N�Z���g�L���⊮ +* Image completion:: �����L���C���[�W�⊮ +* Greek letter completion:: �M���V�������⊮ + +section�^�⊮ + +* 2�ˆȏ�̈������Ƃ� section�^�R�}���h:: +* Enclose region-type command:: +* Recursive completion:: �ċA�⊮ +* view-sectioning:: �Z�N�V������؂�̃A�E�g���C���\�� + +�ύX/�폜 + +* Changing LaTeX command:: La@TeX{} �R�}���h�̕ύX +* Killing LaTeX command:: La@TeX{} �R�}���h�̍폜 + +�J�X�^�}�C�Y + +* Lisp variables:: lisp �ϐ� +* Add-in functions:: �t���֐�(�A�h�C���֐�) + +lisp �ϐ� + +* All customizable variables:: �J�X�^�}�C�Y�ϐ��ꗗ +* Sample definitions:: �J�X�^�}�C�Y�ϐ��ݒ�� +* Hook variables:: hook�ϐ� +* Hook file:: hook�p�t�@�C�� @end menu @node Intro, Main features, Top, Top @@ -233,7 +284,7 @@ @cindex �N������R�}���h��ς���[���Ƃ����邱�܂�Ƃ�������] @example - %#!jlatex-ntt example + %#!jlatex-ntt @end example NTT jTeX �ƁAASCII jTeX ���g�����������悤�ȏꍇ�ɕ֗��ł��傤�B @@ -267,12 +318,12 @@ �Ȃ��A���̍s�̍Ō�̒P��̃s���I�h�ȑO���u���C���t�@�C���v�̃x�[�X �l�[���ł���Ɖ��肵�܂�(���2�‚̏ꍇ�ǂ����@file{main})�B - ���̓t�@�C���������ɂ͎��̂��Ƃɒ��ӂ��ĉ������B + @kbd{[prefix] g} (@ref{Cursor jump}�Q��) �ł� +�t�@�C���ԃW�����v��L���ɋ@�\�����邽�߁A���̓t�@�C���������ɂ͎��̂��Ƃ� +���ӂ��ĉ������B @enumerate @item -�����ɕҏW����t�@�C���Q�̖��O�͏d���̂Ȃ��悤�ɂ���B -@item �T�u�f�B���N�g��������āA���̒��ɃT�u�t�@�C����u�����Ƃ͂ł��邪 �T�u�f�B���N�g���̃T�u�f�B���N�g���ɂ͒u���Ȃ��B @item @@ -904,7 +955,6 @@ @chapter ���[�J������ @cindex ���[�J������[�남���邵����] @cindex .yatexrc -@cindex �ςȒP��[�ւ�Ȃ���] �⊮���͗p�̌��͎O��ނ̎�������\������Ă��܂��B��‚� @file{yatex.el}�ɑg�ݍ��܂ꂽ�u�W�������v�A������‚̓��[�U���l�I�ɏ�p @@ -915,13 +965,14 @@ ���܂��B @example - `foo' is not in table. Register into: U)serTable L)ocal N)one + `foo' is not in table. Register into: U)serDic L)ocalDic N)one D)iscard @end example @noindent �Ƃ����v�����v�g�ɑ΂��A@kbd{u}�Ɠ�����Ɓu���[�U�����v���A@kbd{l}�Ɠ����� -�ƃ��[�J���������X�V���邱�ƂɂȂ�A@kbd{n}�Ɠ�����ƐV���ȒP����w�K���� -�Ɏ̂Ă邱�ƂɂȂ�܂��B +�ƃ��[�J���������X�V���A@kbd{n}�Ɠ�����Ǝ����t�@�C���͍X�V�������݂�Emacs +�Z�b�V�����̂ݗL���ȒP��Ƃ��A@kbd{d}�Ɠ�����ƐV���ȒP����w�K�����Ɏ̂� +�邱�ƂɂȂ�܂��B �����A���[�J�������̋@�\�͂��炸�A�S�ă��[�U�����̍X�V�݂̂ł悢�ƌ����� ���ɂ�@file{~/.emacs}�ȂǂŁA @@ -934,6 +985,11 @@ @noindent �Ƃ��ĉ������B +@cindex �ςȒP��[�ւ�Ȃ���] + �����A�Ԃ̊Ԉ�������̂ȂǁA�ςȒP�ꂪ�w�K����Ă��܂����ꍇ�� + + + @node Commenting out, Cursor jump, Local dictionary, Top @comment node-name, next, previous, up @chapter �R�����g�A�E�g @@ -1004,6 +1060,8 @@ @cindex �J�[�\���W�����v[�������邵����] @cindex prefix g +@section �Ή��I�u�W�F�N�g�ւ̃W�����v + �������̂��낢��ȏꏊ�� @table @kbd @@ -1028,11 +1086,24 @@ �Ȃ��ꍇ�̓G���[�ɂȂ�܂��B�܂�����́A�̈�Œ�̂��߂� @code{%#BEGIN} �� @code{%#END} �̃y�A�ɑ΂��Ă����l�ɓ��삵�܂��B�Ȃ��A@code{label/ref}�� @code{cite/bibitem}�Ή�������̂��ʃt�@�C���ɂ��鎞�́A�W�����v��ƂȂ�t�@ -�C�����I�[�v������Ă��Ȃ���΂Ȃ�܂���B -@xref{%#�L�@} +�C�����I�[�v������Ă��Ȃ���΂Ȃ�܂���B@xref{%#�L�@} +���C���� .tex �t�@�C���� @code{\include{chap1}} �ȂǂɃJ�[�\�������킹�A +@kbd{[prefix] g} �������ƁA@file{chap1.tex} �ɃW�����v���܂��B - ���C���� .tex �t�@�C���� @code{\include{chap1}} �ȂǂɃJ�[�\�������킹�A -@kbd{[prefix] g} �������ƁA@file{chap1.tex} �ɃW�����v���܂��B�܂��A +�܂��A + +@table @kbd +@item [prefix] 4 g + @dots{} �ʃE�B���h�E�őΉ��I�u�W�F�N�g�ɃW�����v +@end table + +@noindent +�������ƁA�Ή�����I�u�W�F�N�g�ւ̃W�����v��ʃE�B���h�E�ōs���܂��B�������A +���̋@�\�� @code{begin/end}, @code{%#BEGIN/%#END} �Ԃ̃W�����v�ɑ΂��Ă� +(�Ӗ����Ȃ��Ǝv����̂�)�@�\���Ȃ��̂Œ��ӂ��Ă��������B + +@section ���C���t�@�C���ւ̃W�����v + @file{chap1.tex}�̂悤�ȃT�u�t�@�C���ŁA @table @kbd @@ -1045,7 +1116,11 @@ @noindent �������ƁA���C���t�@�C���̕ҏW�o�b�t�@�ɐؑւ��܂��B�����A���C���t�@�C���� �I�[�v�����Ă��Ȃ��ꍇ�́A�J�����g�f�B���N�g������T���Ď����I�ɃI�[�v���� -�܂��B����Ɍ��݂̊‹���P�ʂƂ��ċ@�\����R�}���h�Ɉȉ��̂��̂�����܂��B +�܂��B + +@section �‹���P�ʂƂ����W�����v + +����Ɍ��݂̊‹���P�ʂƂ��ċ@�\����R�}���h�Ɉȉ��̂��̂�����܂��B @cindex �‹��̐擪��[���񂫂悤�̂���Ƃ���] @cindex �‹��̖�����[���񂫂悤�̂܂‚Ђ�] @@ -1067,7 +1142,7 @@ -@node Modifying/Deleting, Filling item, Cursor jump, Top +@node Modifying/Deleting, Filling, Cursor jump, Top @comment node-name, next, previous, up @chapter �ύX/�폜 @cindex �ύX/�폜[�ւ񂱂�/��������] @@ -1149,10 +1224,13 @@ ��(�J�[�\���ʒu) @end example -@node Filling item, Includeonly, Modifying/Deleting, Top +@node Filling, Includeonly, Modifying/Deleting, Top @comment node-name, next, previous, up -@chapter item�̌����� -@cindex item�̌�����[item�̂������낦] +@chapter ������ +@cindex ������[�������낦] + +@section item�̌����� +@cindex item�Ȃǂ̌�����[item�ȂƂ̂������낦] @cindex prefix i itemize �‹����ɂ���@code{\item}�̍���(����)�������s�ɓn��ꍇ�ɁA�� @@ -1184,7 +1262,40 @@ ���̕ϐ��̎w��̎d�����悭������Ȃ��ꍇ�́A�Ǝ��̍��ڗ񋓃R�}���h�̖��O�� @code{@code{"\item"}�Ŏn�܂���̂ɂ��ĉ�����(�Ⴆ��"\itembf"})�B -@node Includeonly, What column, Filling item, Top + @kbd{[prefix] i} �ł�@code{\item} ���u�n���O�C���f���g�v�ɐ��`���܂��B�� +��@code{\item}�Ƃ��̐����p�p���O���t��؂藣�����͒ʏ�� +@kbd{M-q}(���̃��[�h�ł�fill-paragraph�����蓖�Ă��Ă���)���g���Ă����� +���B(�‚܂�ȉ��̂悤�ȏꍇ:) + +@example +�n���O�C���f���g: + >\item[�ق��ق�] �p��ł́A���ɈӖ��̂Ȃ��P��� `foo' �ł���킵�� + > �����A����̓��{��łƂ�������P�ꂪ�u�ق��ق��v + > �ł��B +�ʏ�C���f���g: + > \item �ւ�ւ� + > + > �u�ق��ق��v���ł���߂��P��Ƃ��Ďg�������ɁA��2�̂ł���߂� + > �P��Ƃ��āu�ւ�ւ�v���g���邱�Ƃ������悤�ł��B +@end example + + ��̒ʏ�C���f���g�̏ꍇ�A�����p���O���t�̃C���f���g�� \item �Ɠ����[�� +�Ƃ���K�v������܂��B�������A@kbd{M-q}���s�̍ŏ��̔�󔒕����̈ʒu�ʼn��� +���Ƃɂ��[����ς��邱�Ƃ��ł��܂�(��q)�B + +@section �p���O���t�̌����� +@cindex �p���O���t�̌�����[�͂炭��ӂ̂������낦] +@cindex M-q + + �p���O���t�̌�����(fill)�́A��{�I�ɒʏ�ʂ�@�\���܂����Averbatim�‹���A +tabular�‹��Ȃnj�����������ƔߎS�ȏ󋵂ɂȂ�悤�Ȋ‹����ł͋@�\���܂���B +�܂��A\verb �Ŋ����Ă�����̂͌����čs��������܂���(�ϐ� +@code{YaTeX-verb-regexp} �Ő���) )�B����ɁA�ꎞ�I�ɃC���f���g�̐[����ς� +�Ă���ӏ��ł́A���̃C���f���g�̐擪��@kbd{M-q}���������Ƃɂ�� +fill-prefix �����������ύX���Ȃ��Č��������ł��܂��B + + +@node Includeonly, What column, Filling, Top @comment node-name, next, previous, up @chapter �����includeonly @cindex �����includeonly[���‚Ă�includeonly] @@ -1441,7 +1552,11 @@ @end defvar @defvar YaTeX-item-regexp -item�̌������̎��ɗp����Aitem�̐��K�\��(@code{"\\\\item"}) +item�̌������̎��ɗp����Aitem�̐��K�\��(@code{"\\\\(sub\\)*item"}) +@end defvar + +@defvar YaTeX-verb-regexp +verb�R�}���h�̐��K�\���B�擪��\\\\�͂‚��Ȃ�(@code{"verb\\*?\\|path"}) @end defvar @defvar tex-command @@ -1534,7 +1649,13 @@ @end defvar @defvar YaTeX-auto-math-mode -�������[�h�̐؂�ւ��������I�ɍs���B(@code{nil}) +�������[�h�̐؂�ւ��������I�ɍs���B(@code{t}) +@end defvar + +@defvar YaTeX-math-key-list-private + �����C���[�W�⊮�ŗp���� (�v���t�B�N�X�L�[ . �Ή��⊮�e�[�u��) �� + alist(@code{nil})�B�⊮�e�[�u���̏������ɂ‚��Ă� + @file{yatexmth.el}���Q�ƁB @end defvar @defvar YaTeX-default-pop-window-height @@ -1651,11 +1772,11 @@ �{�v���O�����̓t���[�\�t�g�E�F�A�ł��B�{�v���O�������g�p���Đ����������� �錋�ʂɑ΂��Ă���҂͐ӔC�𕉂�Ȃ����ƂƂ��܂��B�]�ړ��Ɋւ��Ă͐������� ���܂���B�펯�I�Ɉ����Ă��������B�܂��A�g�p���Ă���|�����C���ł��m�点�� -�������ƁA��҂͊��ŃT�|�[�g�ɗ�ނ��Ƃł��傤(�ق�Ƃ�)�B +�������ƁA��҂͊��ŃT�|�[�g�ɗ�ނ��Ƃł��傤�B ���A��]�A�o�O�񍐁A���z���͊��}�������܂��B -�A���� pcs39334@@asciinet.or.jp �܂��́A -yuuji@@ae.keio.ac.jp�܂�(1995�N3������)�B +�A���� yuuji@@ae.keio.ac.jp �܂��́A +pcs39334@@asciinet.or.jp �܂�(1995�N3������)�B �d�l�́A�\���Ȃ��m����(�C�������)�ύX����܂�:-p�B diff --git a/help/YATEXHLP.eng b/help/YATEXHLP.eng new file mode 100644 index 0000000..a400830 --- /dev/null +++ b/help/YATEXHLP.eng @@ -0,0 +1,1360 @@ +textfloatsep +\addtolength{\textfloatsep}{LENGTH} +Length between the text and, float of the top or bottom of page + +floatsep +\addtolength{\floatsep}{LENGTH} +Length between two floats + +oddsidemargin +\setlength{\oddsidemargin}{LENGTH} +�E�y�[�W�̍��[����1�C���`(2.54cm)�̐��Ɩ{���̋��� + +pagestyle +\pagestyle{�X�^�C��} +�o�̓y�[�W�̃w�b�_�ƃt�b�^�̃X�^�C�������߂�B�X�^�C���ɂ͈ȉ��̂��̂�����: +plain �W���X�^�C��. �t�b�^�Ƀy�[�W�ԍ������‚���. +empty �w�b�_�ɂ��t�b�^�ɂ������o�͂��Ȃ�. +headings �w�b�_�ɃZ�N�V�����ɉ��������o���ƃy�[�W�ԍ����‚� + �t�b�^�ɂ͉����o�͂��Ȃ�. +myheadings headings�̃X�^�C���ŁA�w�b�_�̏��� \markbpth �� + \markright �Ŏw��ł���. + +thispagestyle +\thispagestyle{�X�^�C��} +���݂̃y�[�W�����̃X�^�C�������肷��B + +pagenumbering +\pagenumbering{�X�^�C��} +�y�[�W�ԍ��̃X�^�C�������߂�B�X�^�C���ɂ͈ȉ��̂��̂�����: +arabic �A���r�A���� +alph �������̉p�� +Alph �啶���̉p�� +roman �������̃��[�}���� +Roman �啶���̃��[�}���� + +shortstack +\shortstack[�ꏊ]{�d�˂�\\�\������\\���e} +{}���̓��e��\\�ŋ�؂�ꂽ�P�ʖ��ɐςݏd�˂ĕ\������B +[�ꏊ]�́Al(����)�Ac(�Z���^�����O)�Ar(�E��)�̂����ꂩ�B + +newlength +\newlength{NAME} +NAME�Ƃ��������R�}���h��V���ɐ錾����B + +addtolength +\addtolength{�����R�}���h}{���l} +��1�����̒������2�Ɉ����̐��l�𑫂��B +��\�I�ȃX�^�C���p�����[�^�ɂ‚��Ă� \setlength �̍����Q�Ƃ���B + +setlength +\setlength{�����R�}���h}{���l} +��1�����̒������2�Ɉ����̐��l�ɐݒ肷��B +��\�I�ȃX�^�C���p�����[�^�͈ȉ��̒ʂ�: +(�X�^�C���p�����[�^�̕ύX�̓v���A���u���ōs������) +\evensidemargin \footheight \footskip \headheight +\headsep \marginparsep \marginparwidth \oddsidemargin +\textheight \textwidth \topmargin \topskip +\parindent \baselineskip \baselinestretch \parskip +\columnsep \columnseprule \mathindent + +settowidth{\NAME}{TEXT} +\hbox{TEXT}�̏o�͌��ʂƓ������ɒ���\NAME ���Z�b�g����B + +evensidemargin +\setlength{\evensidemargin}{LENGTH} +���y�[�W�̍��[����1�C���`(2.54cm)�̐��Ɩ{���̋��� + +footheight +\setlength{\footheight}{LENGTH} +�t�b�^�̍��� + +footskip +\setlength{\footskip}{LENGTH} +�{���̔��̉��[�ƃt�b�^�̋��� + +headheight +\addtolength{\headheight}{LENGTH} +�w�b�_�̍��� + +headsep +\setlength{\headsep}{LENGTH} +�w�b�_�Ɩ{���̊Ԋu + +marginparsep +\addtolength{\marginparsep}{LENGTH} +�T���Ɩ{���̊Ԋu + +marginparwidth +\addtolength{\marginparwidth}{LENGTH} +�T���̕� + +oddsidemargin +\addtolength{\oddsidemargin}{LENGTH} +�E�y�[�W�̍��[����1�C���`(2.54cm)�̐��Ɩ{���̋��� + +textheight +\addtolength{\textheight}{LENGTH} +�{���̍��� + +textwidth +\addtolength{\textwidth}{LENGTH} +�{���̕� + +topmargin +\addtolength{\topmargin}{LENGTH} +�y�[�W��[����1�C���`�̐��ƃw�b�_�̋��� + +topskip +\addtolength{\topskip}{LENGTH} +�{���̔��̏�[�ƈ�s�ڂ̃e�L�X�g�Ƃ̊Ԋu + +parindent +\setlength{\parindent}{LENGTH} +\parindent �i���̐擪�̎�������. + +linewidth +\addtolength{\linewidth}{LENGTH} +\linewidth �s�̕�. + +baselineskip +\addtolength{baselineskip}{LENGTH} +\baselineskip �s�̃x�[�X���C���Ԃ̍Œ���̍���. + +baselinestretch +\renewcommand{baselinestretch}{1.5} +\baselinestretch \baselineskip �ɏ悸��W��. (default=1) +(* \setlength�Ȃǂł͂Ȃ��A\renewcommand�ōĒ�`����B) + +parskip +\addtolength{\parskip}{LENGTH} +\parskip �i���O�̐����X�y�[�X. + +columnsep +\addtolength{\columnsep}{LENGTH} +\columnsep 2�i�g�݂̎��̒i�Ԃ̕�. + +columnseprule +\addtolength{\columnseprule}{LENGTH} +��i�g�̎��̒i�Ԃ̌r���̑���. + +columnwidth +\addtolength{\columnwidth}{LENGTH} +��i�g�̎��ɂ� (\textwidth - \columnsep)/2 +�����łȂ����́A\textwidth + + +columnseprule +\addtolength{columnseprule}{LENGTH} +\columnseprule 2�i�g�݂̎��̒i�Ԃ̌r���̕�. (default=0pt) + +mathindent +\addtolength{mathindent}{LENGTH} +\mathindent �X�^�C���I�v�V������ fleqn ���w�肵���ꍇ�́A + ���}�[�W������̐����̎�������. + +LaTeX +\LaTeX +\LaTeX �̃��S��\���B\LaTeX �̒�`�͈ȉ��̒ʂ�B +\def\LaTeX{{\rm L\kern-.36em\raise.3ex\hbox{\sc a}\kern-.15em + T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}} + +fragile +** LaTeX�p�� ** +�����ɂ���ēW�J���ʂ��ς��悤�ȃR�}���h�������B +���̋t�� robust �ȃR�}���h�B + +robust +** LaTeX�p�� ** +�W�J���ʂ���ɕς��Ȃ��悤�ȃR�}���h�������B +�t�H���g/�T�C�Y�w��q�A�����R�}���h�A�������[�h���Ɏg�������̃R�}���h�� +robust�ȃR�}���h�B +(maketitle�^�R�}���h�̂����I�v�V����������S���Ƃ�Ȃ����̂ƍl���ėǂ�) + +protect +\protect�ufragile�ȃR�}���h�v +�����ɂ���Č��ʂ��ς��悤�ȃR�}���h���ufragile�ȃR�}���h�v�ƌ����B +����A���������낢��ȉӏ��ŎQ�Ƃ����R�}���h���u�������������R�}���h +�ƌ����B����� chapter �� caption �Ȃǖڎ��Ȃǂ���Q�Ƃ����������Ƃ�� +�̂�Atabular/array �‹��� @ �\�����Y������B + +���āA�����́u�������������R�}���h�v�̈����Ɂufragile�ȃR�}���h�v�� +�^���鎞��(fragile�ȃR�}���h�̒��O��)�g���̂� \protect �ł���B�ȉ��͓T +�^�I�ȗ��p��ł���B + +\newcommand{\thissystem}[1]{YaTeX version #1} +\chapter{\protect \thissystem{1.50}�ɂ‚���} + +newcommand +\newcommand{\�R�}���h��}[�����̐�]{��`} +�u�R�}���h���v���u�����̐��v�‚̈��������u��`�v�ł���}�N���Ƃ��Ē�` +����B��`����n�Ԗڂ̈����� #n �Ƃ��ĎQ�Ƃ���B + \newcommand{\foo}[1]{\underline{#1}} +�Ƃ���� \foo{bar} �� \underline{bar} �ƓW�J�����B���������ăt�H���g�w +��q���܂ޏꍇnewcommand��{}�ɂ‚��āA + \newcommand{\foo}[1]{\bf #1} +�Ƃ���� \foo{bar} ���e�L�X�g���� \bf bar �ƓW�J����Ă��܂��̂ŁA + \newcommand{\foo}[1]{{\bf #1}} +�Ƃ��Ȃ���΂Ȃ�Ȃ��B + + �u�R�}���h���v�̃}�N�������ɒ�`����Ă���ꍇ�̓G���[�ƂȂ�B�Ē�`�� +��ꍇ�́A\renewcommand���g���B + +renewcommand +\renewcommand{\�R�}���h��}[�����̐�]{��`} +���ɒ�`����Ă���R�}���h��ʂ̓��e�ōĒ�`����B +�ȉ��� \newcommand �̐����B + + +newenvironment +\newenvironment{�‹���}[�����̐�]{��`1}{��`2} +�V���Ȋ‹����`����B +\begin{�‹���}�̎��̓W�J���e���u��`1�v��\end{�‹���}�̎��̓W�J���e�� +�u��`2�v�ɋL�q����B + \newcommand{\�‹���}{��`1} \def{\end�‹���}{��`2} +�Ɠ��l�B + +renewenvironment +\renewenvironment{�‹���}[�����̐�]{��`1}{��`2} +���ɒ�`����Ă���u�‹����v��ʂ̓��e�ōĒ�`����B +�ȉ��́A\newenvironment�̐����B + + + +typeout +\typeout{���b�Z�[�W} +�^�C�v�Z�b�g���Ɂu���b�Z�[�W�v��[���ɏo�͂���B + +typein +\typein{���b�Z�[�W} \typein[\�}�N��]{���b�Z�[�W} +�^�C�v�Z�b�g���Ɂu���b�Z�[�W�v���v�����v�g�ɏo���A���͂������ʂ����s����B +���̏����ł́A�u\�}�N���v����͂������̂ɒ�`����B + +par +\par +�i���̋�؂�̖���������B��s�Ɠ����B + +everypar +\everypar +RTFM + +nopagebreak +\nopagebreak[i] (i = 0,1,2,3,4) +���ł�����i�ŗ}������([i]���ȗ������4)�B + +pagebreak +\pagebreak[i] (i = 0,1,2,3,4) +���ł�����i�ő���([i]���ȗ������4)�B + +linebreak +\linebreak[i] (i = 0,1,2,3,4) +���s������i�ő���([i]���ȗ������4)�B + +nolinebreak +\nolinebreak[i] (i = 0,1,2,3,4) +���s������i�ŗ}������([i]���ȗ������4)�B + +samepage +\samepage +���ł��֎~����B +RTFM + +obeycr +\obeycr + �� \\. �ɒ�`����B��\restorecr + +restorecr +\restorecr +\obeycr�ŕύX�����̒�`�����ɖ߂��B + +\ +\\ \\[����] +(�C�ӂ̏ꏊ��)���s����B�i�����ł́A\newline �Ɠ����B +�I�v�V����������[����]���w�肷��ƁA���̍s�Ƃ̊Ԋu�� +\vspace{LENGTH}�ɂ���Ċm�ۂ���B + +addvspace +\addvspace{�X�L�b�v} +�c�����̊Ԋu�Ɂu�X�L�b�v�v�̒l�𑫂��B������ +\addvspace{S1} \addvspace{S2} �ƕ����̒l�𓯎��Ɏw�肵�Ă� +\addvspace{S1,S2�̂����傫���ق�} �Ɠ��l�ɂȂ�B + +vspace +\vspace{�Ԋu} \vspace*{�Ԋu} +���������Ɂu�Ԋu�v�Ԃ�̃X�y�[�X�𑫂��B +\vspace* �͂ǂ�ȏꏊ�ł��X�y�[�X�𑫂����A\vspace �̓y�[�W�̐擪�� +�����ł͂͂��炩�Ȃ��B + +vspace* +\vspace{�Ԋu} \vspace*{�Ԋu} +���������Ɂu�Ԋu�v�Ԃ�̃X�y�[�X�𑫂��B +\vspace* �͂ǂ�ȏꏊ�ł��X�y�[�X�𑫂����A\vspace �̓y�[�W�̐擪�� +�����ł͂͂��炩�Ȃ��B + +hspace +\hspace{�Ԋu} \hspace*{�Ԋu} +���������Ɂu�Ԋu�v�Ԃ�̃X�y�[�X�𑫂��B +\hspace* �͂ǂ�ȏꏊ�ł��X�y�[�X�𑫂����A\hspace �͍s�̐擪�▖���ł� +�͂��炩�Ȃ��B + +hspace* +\hspace{�Ԋu} \hspace*{�Ԋu} +���������Ɂu�Ԋu�v�Ԃ�̃X�y�[�X�𑫂��B +\hspace* �͂ǂ�ȏꏊ�ł��X�y�[�X�𑫂����A\hspace �͍s�̐擪�▖���ł� +�͂��炩�Ȃ��B + +smallskip +\smallskip +���������ɏ����ȊԊu���󂯂�B +\def\smallskip{\vspace\smallskipamount} + +medskip +\medskip +���������ɒ����炢�̊Ԋu���󂯂�B +\def\medskip{\vspace\medskipamount} + +bigskip +\bigskip +���������ɑ傫�ȊԊu���󂯂�B +\def\bigskip{\vspace\bigskipamount} + +, +\, +�����X�y�[�X���󂯂�B�i�����[�h�ALR���[�h�A�������[�h������ł����p�B +�N�H�[�g�̒��ɃN�H�[�g�������Ƃ��Ȃǂɗp����B +��: ``\,`Foo', he said.'' +�������[�h�Ŏg����X�y�[�X�ɂ͈ȉ��̂��̂�����: + \: �����L�� + \! ���ŋ��� + \; �L�� + +: +$\:$ +�����L���X�y�[�X�B�������[�h�̂݁B + +! +$\!$ +�������̃X�y�[�X�B�������[�h�̂݁B + +; +$\;$ +�L���X�y�[�X�B�������[�h�̂݁B + +@whilenum +\@whilenum TEST \do {BODY} +���̕ӂ��Ƃ� + +nofiles +\nofiles +�v���A���u���Ő錾����ƁA.aux, .idx, .lof, .lot, .toc �t�@�C���̍쐬�� +�}�������B + +includeonly +\includeonly{sub1} \includeonly{sub1,sub3} +\include{}�œǂݍ��ރt�@�C���̂����A���ۂɓǂݍ��ݏ���������̂��w�肷��B +(.tex�͏ȗ���) +\includeonly�̈������X�g�ɂȂ��t�@�C���͂܂�������������Ȃ��A�܂��͑O�� +�ȑO�ɏ�������Ă���ꍇ��������S���ύX���Ȃ����̂Ƃ��Ĉ�����B + +include +\include{FILE} +\clearpage \input{FILE} \clearpage +�Ɠ����͂��炫������B + +input +\input{FILE} +FILE.tex �������ɂ��邩�̂悤�ɏ����𑱂���B + +setcounter +\setcounter{FOO}{VAL} +�J�E���^FOO�̒l��VAL�ɐݒ肷��B + +addtocounter +\addtocounter{FOO}{VAL} +�J�E���^FOO�̒l��VAL��������B + +newcounter +\newcounter{COUNTER}[OLDCTR] +�V�����J�E���^COUNTER��ݒ肷��B +�I�v�V��������[OLDCTR]���w�肷��ƁA�����̃J�E���^OLDCTR�̒l�� +\stepcounter �������� \addtocounter �ŕύX����邽�т�COUNTER�̒l�����Z�b +�g�����B + +value +\value{COUNTER} +COUNTER�̒l��Ԃ��B\protect ��O�u���Ă͂Ȃ�Ȃ��B + +stepcounter +\stepcounter{FOO} +�J�E���^FOO�̒l���C���N�������g����BFOO�ɏ]���J�E���^������΂������� +�Z�b�g����B + +refstepcounter +\refstepcounter{FOO} +�J�E���^FOO�̒l���C���N�������g����BFOO�ɏ]���J�E���^������΂������� +�Z�b�g����B\stepcounter�Ƃ̈Ⴂ�́A\refstepcounter{FOO} �̒���� +\label{hoge} ���������ꍇ�ɁA\ref{hoge} �̒l�� \value{FOO} �����‚悤�� +�u\ref�l�v��ݒ肷�邱�Ƃł���B + +arabic +\arabic{COUNTER} +�A���r�A������COUNTER�̒l���o�́B + +roman +\roman{COUNTER} +�������̃��[�}������COUNTER�̒l���o�́B + +Roman +\Roman{COUNTER} +�啶���̃��[�}������COUNTER�̒l���o�́B + +alph +\alph{COUNTER} +�������̉p����COUNTER�̒l���o�́B + +Alph +\Alph{COUNTER} +�啶���̉p����COUNTER�̒l���o�́B + +fnsymbol +\fnsymbol{COUNTER} +�r���V���{��(1 = *, 2 = \dagger, ...) ��COUNTER�̒l���o�́B�������[�h�̂݁B + +label +\label{LABEL} +���x��LABEL�̒l�����̎��́u\ref�l�v�ɐݒ肷��B +���̒l�́A\ref{LABEL}�ɂ���ĎQ�Ƃ����B�܂�\pageref{LABEL}�ɂ�� +\label{LABEL}�̑��݂���y�[�W�ԍ����Q�Ƃ����B +�u\ref�l�v�Ƃ� \section �Ȃǂ̃Z�N�V�����R�}���h�Aenumerate�‹��ł� +\item �R�}���h�Atheorem�‹��Ȃǂɂ���Đݒ肳���l�ł���B�Ⴆ�΁A +enumerate�‹����� \item �̒���ł͂���item�̔ԍ����u\ref�l�v�ƂȂ�A +�����ɂ��� \label{LABEL} ��item�̔ԍ���LABEL�ɃZ�b�g����B + +ref +\ref{LABEL} +\label{LABEL}�Őݒ肵��LABEL�̒l���Q�Ƃ���B +�{�����Őݒ肳�ꂽ���x���ɂ������Ă̓y�[�W�ԍ����A +�}�\���Őݒ肳�ꂽ���x���͐}�\�ԍ����A +enumerate���ꂽitem�Őݒ肳�ꂽ���x���ɂ������ẮAitem�ԍ����Ԃ����B + +pageref +pageref{LABEL} +\label{LABEL}�̑��݂���y�[�W�ԍ����Q�Ƃ���B + +( +\( ���� \) +����������g�ށB +\begin{math} ���� \end{math} +�Ɠ��l�B\( ����� \)�� fragile. + +) +\( x^2 = 4 \) +����������g�ށB +\begin{math} ���� \end{math} +�Ɠ��l�B\( ����� \)�� fragile. + +[ +�f�B�X�v���C������g�ށB +\[ ���� \] +\begin{displaymath} ���� \end{displaymath} +�Ɠ��l�B\[ ����� \]�� fragile. + +) +\[ ���� \] +�f�B�X�v���C������g�ށB +\begin{displaymath} ���� \end{displaymath} +�Ɠ��l�B\[ ����� \]�� fragile. + +equation +\begin{equation} ���� \end{equation} +�ԍ��‚��̐�����displaymath�‹��őg�ށB + +eqnarray +\begin{eqnarray} �������̕��� \end{eqnarray} +�������̕��т�3�‚̌��ɐ������ďo�͂���B3�‚̌���&�L���ɂ���āA +�u���� & ���s���� & �E�Ӂv�̂悤�ɋ�؂���B�Ⴆ�Έȉ��̂悤�ɂ���B +\begin{eqnarray} + 3x + 2y & = & 4 \\ + x - 4y & = & -5 +\end{eqnarray} +eqnarray* �‹��͐����ԍ����o�͂��Ȃ��ق���eqnarray�‹��Ɠ����ł���B + +eqnarray* +\begin{eqnarray*} �������̕��� \end{eqnarray*} +�����ԍ����o�͂��Ȃ��ق���eqnarray�‹��Ɠ����ł���B + +frac +\frac{���q}{����} + ���q +------ �̂悤�ȕ����`����g�ށB{���q \over ����} �Ɠ����B + ���� + +sqrt +\sqrt[N]{��} +�u���v��N�捪������킷�����B[N]���ȗ�����ƕ������B + +lefteqn +\lefteqn{��} +�f�B�X�v���C�������[�h�ɂ����āA�u���v�����[���ł���Ƃ݂Ȃ��āA���񂹂� +��B���Ƃ���eqnarray�‹��ɂ����āA���ӂ������Ȃ��Ă��܂��ꍇ�ɁA�s�� +�܂��ނ��߂ɗ��p����B +\begin{eqnarray} + \lefteqn{a_1 + a_2 + \cdots + a_n =} \\ + & & a_1 + b_1 + \cdots + z_1 + \\ + & & b_2 + c+2 + \cdost + z_2 +\end{eqnarray} + +center +\begin{center} ���e \end{center} +�u���e�v�𒆉��񂹂���B�e�s��\\�ɂ���ĉ��s�ʒu���w�肷��B +�� \centering + +flushright +\begin{flushright} ���e \end{flushright} +�u���e�v���E�񂹂���B�e�s��\\�ɂ���ĉ��s�ʒu���w�肷��B +�� \raggedright + +flushleft +\begin{flushleft} ���e \end{flushleft} +�u���e�v�����񂹂���B�e�s��\\�ɂ���ĉ��s�ʒu���w�肷��Ƃ��̈ʒu�ʼn��s +���邪�A�w�肵�Ȃ��ƓK���ȍs���̂Ƃ���ʼn��s���Ă����B +�� \raggedleft + +centering +\centering +�i�����Z���^�����O���đg�ł���B +���Ƃ��� table�‹��Afigura�‹��̐擪�Ő錾����Ɗ‹��̏I��܂ł��Z���^�� +���O���đg�ށB + +raggedright +\raggedright +�i�����E�񂹂��đg�ł���B + +raggedleft +\raggedleft +�i�������񂹂��đg�ł���B + +raggedbottom +\raggedbottom +�g�ł��鎞�Ɋe�y�[�W�̍����ɑ����̂��ꂪ�����Ă����e����B +�v���A���u���Ŏw�肷��B +��\flushbottom + +flushbottom +\flushbottom +�g�ł��鎞�Ɋe�y�[�W�̍����𐳊m�ɂ��낦��B +�v���A���u���Ŏw�肷��B +��\raggedbottom + +sloppy +\sloppy +\sloppy ���w�肷��ƁA�e�s��K���E�}�[�W���Ő܂�Ԃ�����ɁA +�P��Ԃ̋󔒂��ڂɌ���B +��\fussy + +fussy +\fussy +�ʏ�̑g�ŋK���ɖ߂�B +��\sloppy + +sloppypar +\begin{sloppypar} �i�� \end{sloppypar} +�i���� \sloppy �őg�ށB +��\sloppy + +verbatim +\begin{verbatim} ... \end{verbatim} +The verbatim environment uses the fixed-width \tt font, turns blanks into +spaces, starts a new line for each carrige return (or sequence of +consecutive carriage returns), and interprets EVERY character literally. +I.e., all special characters \, {, $, etc. are \catcode'd to 'other'. + +verbatim* +\begin{verbatim*} ... \end{verbatim*} + + +The verbatim* environment is the same, except that spaces +print as the TeXbook's space character instead of as blank spaces. + +list +\begin{list}{�f�t�H���g���x��}{���`�p�����[�^} ... \end{list} +���X�g�‹��ɓ���B���X�g�‹��ł� \item �Ŏw�肳�ꂽ�e���ڂ����̎����� +�ŗ񋓂���B��1�����ɂ� \item �̃I�v�V���������̃��x�����ȗ����ꂽ���̃f +�t�H���g���x�����w�肵�A��2�����ɂ͊eitem��u�����ɏ��������p�����[�^ +���w�肷��B +��: +\begin{list}% + {$\diamond$} + {\addtolength{\leftmargin}{4em}} + \item ��1�����ɂ�\verb|\item| �ɃI�v�V�����������‚��Ȃ��������ɂӂ�A + �f�t�H���g�̃��x����^����B + \item ��2�����ɂ͊eitem��u�����ɏ��������p�����[�^��^����B + \item[*] �̂悤�ɃI�v�V�����������‚���Ƃ��ꂪ���x���ƂȂ�B +\end{list} + + list�‹��̑̍ق𐧌䂷��ϐ��ɂ͈ȉ��̂��̂�����(���ʓ��͊���l)�B +��������: + + +list�‹��̑̍ق𐧌䂷��ϐ� +\labelwidth item�̃��x���̕� +\labelsep ���x���̉E�[�ƍŏ��̃A�C�e���̃e�L�X�g�Ƃ̊Ԋu +\leftmargin list�‹����ł̍��}�[�W�� +\rightmargin ���E�}�[�W�� (0pt) +\itemindent item�̒��O�ɉ�������C���f���g�� (0pt) +\linewidth ��s�̕� +\listparindent �e�p���O���t�̐擪�̃C���f���g(������\item�̕t���Ă���� + ���̃p���O���t������)(0pt) + +��������: +\topsep list�‹��ɓ���O�̃p���O���t�ƍŏ���item�Ƃ̊Ԋu +\partopsep list�‹��ŐV�����p���O���t���͂��߂鎞��\topsep�ɉ����� + ���t���I�ȊԊu +\itemsep �A������item�ǂ����̊Ԋu +\parsep ��‚�item���ł̃p���O���t�ǂ����̊Ԋu + + +itemize +\begin{itemize} \item �A�C�e��1 ... \item �A�C�e��n \end{itemize} +���ڂ�񋓂��邽�߂̊‹��B +�ő�4�‚܂Ńl�X�g�ł���B +�e���x����item�̓��ɂ‚��L���́A\labelitemi, \labelitemii, +\labelitemiii, \labelitemiv �Ő��䂳���B + +itemize�‹��̑̍ق𐧌䂷��ϐ��ɂ͈ȉ��̂��̂�����B + + + +enumerate +\begin{enumerate} \item �A�C�e��1 ... \item �A�C�e��n \end{enumerate} +���ڂ�ԍ��‚��ŗ񋓂��邽�߂̊‹��B +�ő�4�‚܂Ńl�X�g�ł���B +�e���x����item�̓��ɂ‚��ԍ��́Aenumi, enumii, enumiii, enumiv +���ێ����Ă��āA�eitem�̃��x���́A\labelenumi, ..., \labelenumiv +�Ő��������B�܂��A\p@enumN\theenumN �� \ref�l��ݒ肷��B +(N�̓��x���̐[���B\ref�l�ɂ‚��Ă�\ref�̐������Q�Ƃ���) +���Ƃ��� +\def\theenumii{\alph{enumii}} +\def\p@enumii{\theenumi\theenumii} +\def\labelenumii{(\theenumii)} +�Ƃ���� \ref�l�� 3a �Ȃǂ̂悤�ɐݒ肳���B + +enumerate�‹��̑̍ق𐧌䂷��ϐ��ɂ͈ȉ��̂��̂�����B + + +item +\item \item[LABEL] +itemize, enumerate, description �‹��Ȃǂō��ڂ��J�n����B +[LABEL]���w�肷��ƃ��x���Ƃ���LABEL���o�͂���B + +description +\begin{description} \item[���o���P��] ���� ... \end{description} +[���o���P��]�����o���Ƃ��� + +subitem +\subitem ���� +�T�u�A�C�e�����`�B + +subsubitem +\subsubitem ���� +�T�u�T�u�A�C�e�����`�B + +makebox +\makebox[WID][POS]{�I�u�W�F�N�g} \makebox(X,Y)[POS]{�I�u�W�F�N�g} +��1�̏����ł́A�I�u�W�F�N�g��WID�Ŏw�肵�����Ƃ��āA\hbox ���� +POS�Ŏw�肵���ꏊ�ɔz�u����BPOS��l���w�肷��ƍ��񂹁Ar���w�肷��ƉE�񂹁A +�����w�肵�Ȃ��ƃZ���^�����O�����B +��2�̏����ł́Apicuture�‹��ő傫��(X,Y)��(\unitlength����Ƃ���) +\hbox �ɃI�u�W�F�N�g��z�u����B�z�u�ʒuPOS�͑�1�̏����Ɠ��l�B + +mbox +\mbox{�I�u�W�F�N�g} +\makebox{�I�u�W�F�N�g}�Ɠ����B + +newsavebox +\newsavebox{\CMD} +�V�K�̃{�b�N�X�ۑ��p�R�}���h���`����B\CMD�� \savebox �R�}���h�� +�{�b�N�X��ۑ����邽�߂Ɏg���B\newsavebox�Ő錾�����R�}���h���� +��ɃO���[�o���ƂȂ�B + +savebox +\savebox{\CMD}{�e�L�X�g} +�{�b�N�X��g�ޓ��e�ł���u�e�L�X�g�v�̌��ʂ�\CMD�ɕۑ�����B +�u�e�L�X�g�v�� \makebox �ւ̈����ƑS�������ł��邪�A�u�e�L�X�g�v�� +�����������ʂ͂��̏�ɕ\���͂��Ȃ��B\usebox{\CMD}�ɂ�菈�������{�b�N�X +���u�����B + +sbox +\sbox{\CMD}{�e�L�X�g} +\savebox�Ɠ����Bsbox��robust, savebox��fragile + +framebox +\framebox{�I�u�W�F�N�g} +�u�I�u�W�F�N�g�v�ɘg���‚���\makebox�Ɠ��l�̏���������B +�g�̐��̑����� \framerule�A�I�u�W�F�N�g�Ƃ̊Ԋu�� \framesep �Ō��܂�B�� +����picture�‹��� \framebox(X,Y){�I�u�W�F�N�g}�Ƃ����ꍇ�́Apicture�‹� +�p�̐��̑����ɏ]���A�O�g�ƃI�u�W�F�N�g�Ƃ̊Ԋu�͋󂯂��Ȃ��B + +fbox +\fbox{�I�u�W�F�N�g} +\framebox{�I�u�W�F�N�g}�Ɠ����B +\fbox��robust, \framebox��fragile + +parbox +\parbox[POS]{WIDTH}{TEXT} +TEXT��WIDTh�̕��őg��Ń{�b�N�X���쐬����B�{�b�N�X�̈ʒu��POS�ɂ���� +c : �Z���^�����O(�f�t�H���g) +b : �{�b�N�X�̈�ԉ��̐������e�L�X�g�̃��C���ɍ��� +t : �{�b�N�X�̈�ԏ�̐������e�L�X�g�̃��C���ɍ��� +�̂悤�Ɍ��߂���B\parbox�ł̓p�����[�^���ȉ��̂悤�Ƀ��Z�b�g�����B + +\parskip = 0pt +\linewidth = \hsize +\@totalleftmargin = 0pt +\leftskip = 0pt +\rightskip = 0pt +\@rightskip = 0pt +\parfillskip = 0pt plus 1fil +\lineskip = \normallineskip +\baselineskip = \normalbaselineskip + +minipage +\begin{minipage}[pos]{WIDTH} TEXT \end{minipage} +\parbox �Ƃقړ��lWIDTH�̕���TEXT���{�b�N�X�Ƃ��đg�ށB�{�b�N�X�̈ʒu�� +POS�ɂ���� +c : �Z���^�����O(�f�t�H���g) +b : �{�b�N�X�̈�ԉ��̐������e�L�X�g�̃��C���ɍ��� +t : �{�b�N�X�̈�ԏ�̐������e�L�X�g�̃��C���ɍ��� +�̂悤�Ɍ��߂���B +parbox�ƈႢ�ATEXT�͒ʏ�̃p���O���t�Ƃ��đg�܂��B + +rule +\rule[RAISED]{WIDTH}{HEIGHT} +�� WIDTH x ���� HEIGHT �̌r�������BRAISED���w�肳�ꂽ�ꍇ�A���̕����� +��ɏグ����B + +underline +\underline{TEXT} +TEXT�ɉ������‚��ĕ\���B + +raisebox +\raisebox{DISTANCE}[HEIGHT][DEPTH]{BOX} +BOX��DISTANCE�����グ�đg�ށB +HEIGHT, DEPTH ���w�肷��ƁATeX���猩��BOX�́u�����v�Ɓu�[���v +(��:�����̗p��ɂ‚��Ă�TeXBook�Ȃǂ��Q�Ƃ̂���) +�� HEIGHT, DEPTH �Ɏw�肷��B + +tabbing +\begin{tabbing} \= text1.1 \= text1.2 \\ \> text2.1 \> text2.2 \end{tabbing} +���������s���‹������(����q�s��)�B�Ⴆ�΁A +\begin{tabbing} + \= ����1 \hspace*{2em} \= ����2 \hspace*{3em} \= ����3 \\ + \> ����� \> �ɂق� \> �Ƃ��� \+ \\ + \> �ʂ�� \> �킩�� \\ + \> ���ꂻ \- \\ + \> �‚˂� \> ��ނ� \> ��̂� +\end{tabbing} +���tabbing�‹��͈ȉ��̂悤��3�‚̃^�u�ʒu�őg�܂��B + (1�Ԗ�) (2�Ԗ�) (3�Ԗ�) + ����� �ɂق� �Ƃ��� + �ʂ�� ������ + ���ꂻ + �‚˂� ��ނ� ��̂� + \2em/ \3em/ +tabbing�‹��ɂ�����^�u�ʒu����R�}���h�͈ȉ��̒ʂ�(n��1����): +\= n�Ԗڂ̃^�u�ʒu�����݈ʒu�ɐݒ肵�^�u�J�E���^(n)��1�i�߂� +\\ ���s���ă^�u�J�E���^�����Z�b�g����(n=1) +\> �ʒu��n�Ԗڂ̃^�u�ʒu�ɐݒ肵�A�J�E���^��1�i�߂� +\+ ���̍s�̃^�u�J�E���^�̏����l��1������ \+ \\ �Ƃ���Ǝ��̍s�̍ŏ� + �� \> ��2�Ԗڂ̃^�u�ʒu������. \+ �𕡐������Ƃ��̐������^�u�J�E + ���^�̏����l�������� +\- \+�Ƃ͋t�ɁA���̍s�̃^�u�J�E���^�̏����l����1���� +\< ��‘O�̃^�u�J�E���^�ɖ߂��Ă��̃^�u�ʒu���Z�b�g. �s���̂� +\' \'�ȍ~��ʏ�̃^�u�ʒu��� \tabbingsep �������E�񂹂��ďo�� +\` \`�ȍ~�̃e�L�X�g�����ׂĉE�񂹂��ďo�� +\pushtabs ����܂ŗp���Ă����^�u�X�g�b�v�ʒu��S��push +\poptabs ����܂ŗp���Ă����^�u�X�g�b�v�ʒu��S��pop. \pushtabs �� + \poptabs �͕K���΂ɂȂ��Ă��Ȃ���΂Ȃ�Ȃ�. ����q�� +\aX X�� = �� ' �� ` tabbing�‹��łȂ��ʏ�̃A�N�Z���g�� + \a= \a' \a` �ŕ\�킷 +\kill ���ݍs�̃e�L�X�g�͏o�͂����^�u�ݒ肾�����߂��� + +array +\begin{array}{PREAMBLE} C1 & C2 & .. & Cn \\ D1 ... \end{array} +Make a mathematical array. Useful to make matrix. +See the help of `tabular' for detailed description. + +tabular +\begin{tabular}[OPT]{PREAMBLE} C1 & C2 & .. & Cn \\ D1 ... \end{tabular} +Make tabular. +[[OPT]] +[t] Align the top of tabular to the line. +[b] Align the bottom of tabular to the line. +[[PREAMBLE]] + l,r,c : indicate where entry is to be placed. + | : for vertical rule + @{EXP} : inserts the text EXP in every column. \arraycolsep or \tabcolsep + spacing is suppressed. + *{N}{PRE} : equivalent to writing N copies of PRE in the preamble. PRE + may contain *{N'}{EXP'} expressions. + p{LEN} : makes entry in parbox of width LEN. + +[[Usable commands in array, tabular environment]] +\multicolumn + +\vline + +\hline + +\cline{i-j} + +\extracolsep{W} + + + +See below as sample. + +\LaTeX Expression Printed image +\begin{array}{ccr} + x+y+z & a_1 & 1 \\ x+y+z a1 1 + x+z & a_2 & 21 \\ x+z a2 21 + y & a_3 & 321 y a3 321 +\end{array} + +\[ \left( + \begin{array}{cccc} + a_{11} & a_{12} & \dots & a_{1n} \\ / a11 a12 ... a1n \ + a_{21} & a_{22} & \dots & a_{2n} \\ | a21 a22 ... a2n | + \vdots & \vdots & \ddots& \vdots \\ | : : \. : | + a_{n1} & a_{n2} & \dots & a_{nn} \ an1 an2 ..: ann / + \end{array} +\right)\] + +\right(, \left) or \right{, left} or \right[, \left] or \right|, \left| +can enclose whole of array environment by parentheses, braces, brackets, +norm respectively. The number of `\right's and `\left's should be the +same, but the type of parentheses don't have to match like +\right( \left]. `\right.' produces the invisible parenthesis. + +\[ Ans. \cdots \left\{ / + \begin{array}{ccc} | x = 5 + x & = & 5 \\ Ans. ...< + y & = & 3 | y = 3 + \end{array} \right. \] \ + +Here are the style parameters for the tabular environment. +\arraycolsep : half the width separating columns in an array environment +\tabcolsep : half the width separating columns in a tabular environment +\arrayrulewidth : width of rules +\doublerulesep : space between adjacent rules in array or tabular +\arraystretch : line spacing in array and tabular environments is done by + placing a strut in every row of height and depth + \arraystretch times the height and depth of the strut + produced by an ordinary \strut commmand. + +Tabular environment cannot spread across pages. `supertabular.sty' +allow this. + +tabular* +\begin{tabular*}{��}{�v���A���u��} ... \end{tabular*} +Make tabular environment with specifying its width. +To fill this width, use \extracolsep{} of preamble as below: +\begin{tabular*}{10em}[b]{|c@{\extracolsep{\fill}}|c|c|} + \hline + a & b & c \\ \hline + 1 & 2 & 3 +\end{tabular*} +See also tabular. + +multicolumn +\multicolumn{N}{FORMAT}{ITEM} +In tabular environment, +replaces the next N column items by +ITEM, formatted according to FORMAT. FORMAT should contain at most +one l,r or c. If it contains none, then ITEM is ignored. + +vline +\vline +In tabular environment, +draws a vertical line the height of the current row. May +appear in an array element entry. + + +hline +\hline +In tabular environment draws a horizontal line between rows. Must +appear either before the first entry (to appear above the first row) or +right after a \\ command. If followed by another \hline, then adds a +\vskip of \doublerulesep. + +cline +\cline{i-j} +In tabular environment, +draws horizontal lines between rows covering columns +i through j, inclusive. Multiple commands may follow +one another to provide lines covering several disjoint +columns + +extracolsep +\extracolsep{W} +for use inside an @ in the preamble. Causes a WIDTH +space to be added between columns for the rest of the +columns. This is in addition to the ordinary intercolumn +space. + +picture +\begin{picture}(WIDTH,HEIGHT)(X,Y) ..contents.. \end{picture} +The picture environment allows you to create just about any kind of +picture you want containing text, lines, arrows and circles. You tell +LaTeX where to put things in the picture by specifying their +coordinates. A coordinate is a number that may have a decimal point +and a minus sign - a number like 5, 2.3 or -3.1416. A coordinate +specifies a length in multiples of the unit length \unitlength, so if +\unitlength has been set to 1cm, then the coordinate 2.54 specifies a +length of 2.54 centimeters. You can change the value of \unitlength +anywhere you want, using the \setlength command, but strange things +will happen if you try changing it inside the picture environment. + +A position is a pair of coordinates, such as (2.4,-5), specifying the +point with x-coordinate 2.4 and y-coordinate -5. Coordinates are +specified in the usual way with respect to an origin, which is +normally at the lower-left corner of the picture. Note that when a +position appears as an argument, it is not enclosed in braces; the +parentheses serve to delimit the argument. + +The picture environment has one mandatory argument, which is a +position. It specifies the size of the picture. The environment +produces a rectangular box with width and height determined by this +argument's x- and y-coordinates. + +The picture environment also has an optional position argument, +following the size argument, that can change the origin. (Unlike +ordinary optional arguments, this argument is not contained in square +brackets.) The optional argument gives the coordinates of the point at +the lower-left corner of the picture (thereby determining the origin). +For example, if \unitlength has been set to 1mm, the command + +\begin{picture}(100,200)(10,20) + +produces a picture of width 100 millimeters and height 200 +millimeters, whose lower-left corner is the point (10,20) and whose +upper-right corner is therefore the point (110,220). When you first +draw a picture, you will omit the optional argument, leaving the +origin at the lower-left corner. If you then want to modify your +picture by shifting everything, you just add the appropriate optional +argument. + +The environment's mandatory argument determines the nominal size of +the picture. This need bear no relation to how large the picture +really is; LaTeX will happily allow you to put things outside the +picture, or even off the page. The picture's nominal size is used by +TeX in determining how much room to leave for it. + +Everything that appears in a picture is drawn by the \put command. The +command + +\put (11.3,-.3){...} + +puts the object specified by "..." in the picture, with its reference +point at coordinates (11.3,-.3). The reference points for various +objects will be described below. + +The \put command creates an LR box. You can put anything in the text +argument of the \put command that you'd put into the argument of an +\mbox and related commands. When you do this, the reference point +will be the lower left corner of the box. + +Picture environment is obsolete I thinks, so show only commands. + +[[COMMANDS]] +\put(X,Y){OBJECT} +\multiput(X,Y)(dX,dY){REPEAT}{OBJECT} +[[OBJECTS]] +\makebox(X,Y)[POS]{TEXT} +\framebox(X,Y)[POS]{TEXT} +\dashbox(X,Y)[POS]{TEXT} +(POS = l, r, b, t) +\line(dX,dY){HorizontalLength} +\vector(dX,dY){HorizontalLength} (arrow) +(dX,dY = +-1, +-2, ..., +-6) +\shortstack[POS]{FIRST\\SECOND\\THIRD...} +\circle{DIAMETER} +\circle*{DIAMETER} (Filled circle) +(Maximum diameters are 40pt, 15pt) +\oval(Dia-X,DiaY)[POS] (Oval POS = l, r, t, b) +\frame{OBJECT} +\thinlines, \thicklines (choose line thickness) +\linethickness{THICKNESS} + +newtheorem +\newtheorem{NAME}{TEXT}[COUNTER] \newtheorem{NAME}[OLDNAME]{TEXT} +This defines the environment NAME to be just as one would expect a +theorem environment to be, except that it prints ``TEXT'' instead of +``Theorem''. + +If OLDNAME is given, then environments NAME and OLDNAME use the same +counter, so using a NAME environment advances the number of the next +NAME environment, and vice-versa. + +If COUNTER is given, then environment NAME is numbered within COUNTER. +E.g., if COUNTER = subsection, then the first NAME in subsection 7.2 +is numbered TEXT 7.2.1. + +The way NAME environments are numbered can be changed by redefining +\theNAME. + +title +\title{TITLE} +Define the title of the document. + +author +\author{AUTHOR} +Declare the author of the document. + +date +\date{DATE} +Define the date of document which is used by \maketitle. +Omitting DATE produces current date. + +thanks +\thanks{FOOTNOTE} +Output a footnote in title page. + +maketitle +\maketitle +Output a title. Should be written in document environment. +Here are the constituents of title page. +\title{TITLE} +\author{AUTHOR} +\date{DATE} (If DATE omitted, output the date of typesetting) +\thanks{NOTE} (Output a thanks message or the post of the author) + +part +\part{TITLE} +Start a new part whose title is TITLE. + + +chapter +\chapter{TITLE} +Start a chapter whose title is TITLE. +Sectioning commands: +\part Part ? +\chapter Chapter ? (not available in `article.sty') +\section ? +\subsection ?.? +\subsubsection ?.?.? +\paragraph *** +\subparagraph === + +section +\section{TITLE} +Start a section whose title is TITLE. + + +subsection +\subsection{TITLE} +Start a subsection whose title is TITLE. + + +subsubsection +\subsubsection{TITLE} +Start a paragraph whose title is TITLE. + + +paragraph +\paragraph{TITLE} +Start a paragraph whose title is TITLE. + + +appendix +\appendix +Declare the beginning of appendix. +Change the numbering fashion to appendix oriented. + +contentsline +\contentsline{TYPE}{ENTRY}{PAGE} +\contentsline{subsection}{\makebox{30pt}[r]{1.4.3} Gnats and Gnus}{22} +Macro to produce a TYPE entry in a table of contents, etc. +It will appear in the .TOC or other file. For example, +The entry for subsection 1.4.3 in the table of contents might +be produced by: +\contentsline{subsection}{\makebox{30pt}[r]{1.4.3} Gnats and Gnus}{22} +The \protect command causes command sequences to be written +without expanding them. + +addcontentsline +\addcontentsline{TABLE}{TYPE}{ENTRY} +User command for adding his own entry to a table of contents, etc. +It adds the entry + \contentsline{TYPE}{ENTRY}{page} +to the .TABLE file. + +addtocontents +\addtocontents{TABLE}{TEXT} +Adds TEXT to the .TABLE file, with no page number. + +index +\index{INDEX} +Create an entry of index. + + +glossary +\glossary{STRING} +Create an entry of glossary. + +makeindex +\makeindex +Writes \indexentry to .idx file. +Should be in preamble. + +makeglossary +\makeglossary +Writes \glossaryentry to .glo file. +Should be in preamble. + +bibliography +\bibliography{FILE1,FILE2, ... ,FILEn} +Specifies the bibdata files. + +bibliographystyle +\bibliographystyle{STYLE} +Style of numbering of bibliographies. +plain nomal +unsrt without sortingg +alpha gives tag like "Foo94" +abbrv omit the first name of author, publishing month, book title + +thebibliography +\begin{thebibliography} \bibitem{ITEM},... \end{thebibliography} +The thebibliography environment is a list environment. To save the +use of an extra counter, it should use enumiv as the item counter. +Instead of using \item, items in the bibliography are produced by the +\bibitem command. +--- + + +bibitem +\bibitem{NAME} \bibitem[LABEL]{NAME} +Produces a numbered (as [1], [2],...) entry cited as NAME. +Second form produces an entry labeled by LABEL and cited as NAME. + +thefootnote +In usual LaTeX style, produces the footnote number. +If footnotes are to be numbered within pages, then the +document style file must include an \@addtoreset command +to cause the footnote counter to be reset when the page +counter is stepped. This is not a good idea, though, +because the counter will not always be reset in time +to ensure that the first footnote on a page is footnote +number one. + +footnote +\footnote{NOTE} or \footnote[NUM]{NOTE} +User command to insert a footnote. +In second form, insert a footnote numbered +NUM, where NUM is a number -- 1, 2, +etc. For example, if footnotes are numbered +*, **, etc. within pages, then \footnote[2]{...} +produces footnote '**'. This command does not +step the footnote counter. +(fragile) + +footnotemark +\footnotemark[NUM] +Command to produce just the footnote mark in +the text, but no footnote. With no argument, +it steps the footnote counter before generating +the mark. + +footnotetext +\footnotetext[NUM]{TEXT} +Command to produce the footnote but no mark. +\footnote is equivalent to \footnotemark \footnotetext . + +footnotesize +{\footnotesize ...} +Size-changing command for footnotes. + +footnotesep +\footnotesep +The height of a strut placed at the beginning of every footnote. + +footnoterule +\footnoterule +Macro to draw the rule separating footnotes from text. +It is executed right after a \vspace of \skip\footins. +It should take zero vertical space--i.e., it should to +a negative skip to compensate for any positive space +it occupies. (See PLAIN.TEX.) + +documentstyle +\documentstyle[OPTION1,OPTION2, ... ,OPTIONn]{STYLE} +The user starts his file with the command as above +which saves the OPTION's and \input's the file STYLE.STY. + +verb +\verb#CONTENTS# +The command \verb produces in-line verbatim text, where the argument +is delimited by any pair of characters. E.g., \verb #...# takes +'...' as its argument, and sets it verbatim in \tt font. + +The *-variants of these commands is the same, except that spaces +print as the TeXbook's space character instead of as blank spaces. + +styleparameter +�܂��󂵂Ă��Ȃ��X�^�C���p�����[�^�B + +topfigrule +\topfigrule +Command to place rule (or whatever) between floats +at top of page and text. Executed in inner vertical +mode right before the \textfloatsep skip separating +the floats from the text. Must occupy zero vertical +space. (See \footnoterule.) + +botfigrule +\setlength{\botfigrule}{LENGTH} +Same as \topfigrule, but put after the \textfloatsep +skip separating text from the floats at bottom of page. + +intextsep +\setlength{\intextsep}{LENGTH} +Space left on top and bottom of an in-text float. + +newpage +\newpage +Advance to a new page. +\clearpage Output the unfinished table of images, if any, + and clear page. +\cleardoublepage Same as \clearpage except that when spread style + (such as book), start a new page with odd page. +\newpage Finish current column when twocolumn. + +clearpage +\clearpage + + +cleardoublepage +\cleardoublepage + + +length + +Here are the available units of length in TeX. +cm centi meter +em width of `M' +ex height of `x' +in inch (=2.54cm) +mm mi.li meter +pc pica(=12pt) +pt point (72.27pt=1 inch) +\fill Freely extendable length whose normal length is 0 +\stretch{X} X-times as long as \fill + +stretch +\stretch{X} + + +twocolumn +\twocolumn[STRING] +Clear page and start two-column typesetting. +Optional argument [STRING] specifies the page-acrossing title. +->onecolumn + +onecolumn +\onecolumn +Clear page and start one-column typesetting. +->twocolumn + +topnewpage +\topnewpage{BOX} +Begin a new page and create the parbox-ed BOX whose width is \textwidth. +This is useful to make a page-acrossing title in a twocolumn page. + +YaTeX +(setq auto-mode-alist (cons '("\\.tex$" . yatex-mode) auto-mode-alist)) +�����炭���Ȃ������g���Ă��邱�̃��[�h�B +LaTeX�������I�Ɏg�����߂̑����̋@�\�𐷂荞��ł��܂��B + +�y�����ɂ‚��āz +yatex.el�Ȃǃv���O�������w�����́u��Ă����v�A�V�X�e�����w�����́u�₿�� +���v�Ɠǂ݂܂��B + +�y�ӎ��z +�ȉ��̕��X�̌䋦�͂𒸂��܂����B�����Ɋ��Ӑ\���グ�܂��B + +(���s��) +���P������(��B��) + Bibtex�N���Atypeset process �� kill�A�G���[�ӏ��̐��������� + �̗v�]���̑��𒸂��܂����B + +�X���G������(�A�����c) + �^�C�v�Z�b�g�o�b�t�@�ł̎��s�p���Alpq, bibtex�N���A�̈�w��^�C + �v�Z�b�g��̃v���r���[�Ώۃt�@�C���̃f�t�H���g�l�̕ύX�A + describe-mode�A\verb �̕⊮�̗v�]�Averbatim�‹���\verb�̒��ɂ��� + \begin{}, \end{} �𐔂��Ȃ��悤�ɂ���v�]�A�Ȃǂ𒸂��܂����B + +�΍�T�B����(�x�m��) + YaTeX-get-error-file �̃o�O���|�[�g�Ȃǂ𒸂��܂����B + +Bayard����(asciinet) + min-out�Ƃ̘A�W�̕s��̕񍐂𒸂��܂����B + +�j���񂳂�(asciinet) + ms-dos�ŗL�̐ݒ�Ɋւ���o�O���|�[�g�𒸂��܂����B + +sa2c����(asciinet) + Mule�p�̃p�b�`�𒸂��܂����B + +�j�쒼�Ȃ���(�}�g��) + �����؂�Ȃ��o�O���|�[�g�Ɨv�]�𒸂��܂����B�܂�Vz�ւ̈ڐA�łł� + �� laitex(����) ���쐬����܂����B + +�O���P�Y����(�c����) + �J�����ʂ̓��͎��̏����̃��[�h�����̃A�C�f�A�𒸂��܂����B + +���됒����(�c����) + begin�^�⊮�̓����ɕ������������ꍇ�������C���f���g���Ăق��� + �Ƃ����v�]�𒸂��܂����B + +�c�������Y����(�c����) + �^�C�v�Z�b�g���ɖ��Z�[�u��Ԃ̊֘A�t�@�C�����Z�[�u���ė~�����Ƃ� + ���v�]�𒸂��܂����B + +bauer����(asciinet) + �A�N�Z���g�⊮�̗v�]�ƃA�N�Z���g�L���̋K���̏�񓙂𒸂��܂����B + +���X�؂��낤����(asciinet) + �����‹��̏����Ɋւ��鑽�l�ȃA�C�f�A�A�E�B���h�E�I�������Ɋւ��� + ���[�U�C���^�t�F�[�X�̑@�ׂȉ��P�ĂȂǂ𒸂��܂����B + +Deslar����(asciinet) + byte-compile�֌W�̃o�O�񍐂Ȃǂ𒸂��܂����B + +tadf����(asciinet) + Demacs�ł̃v���Z�X�N�����̃C���^�t�F�[�X�̕s��̕񍐂Ȃǂ𒸂� + �܂����B + +�ق�܂����邳��(asciinet) + �p���O���t���E��LaTeX�p�ɐݒ肵�Ȃ����v�]�Ȃǂ𒸂��܂����B + +TUSK����(asciinet) + Texinfo�h�L�������g(����)���쐬���Ē����܂����B + +���c�a�炳��(asciinet) + dviout�N�����̍H�v�̈āA�~�j�o�b�t�@�œǂݍ��ނ��̂̃q�X�g���� + ����A�C�f�A�̂������������������A�w���v�t�@�C���̍��ڂ̒񋟂��� + �Ē����܂����B + +kanbai-an����(asciinet) + ���{����̓��[�h����֐��̃o�O�𒼂��p�b�`�Ȃǂ𒸂��܂����B + + +yatex + + diff --git a/help/YATEXHLP.jp b/help/YATEXHLP.jp index 5a140af..1d8b57c 100644 --- a/help/YATEXHLP.jp +++ b/help/YATEXHLP.jp @@ -1023,15 +1023,40 @@ index \index{INDEX} -�܂������ĂȂ��B +�����̃G���g�����`����B + +-------------------------------------------------------------------- + glossary \glossary{STRING} -�܂������ĂȂ��B +�p��W�̃G���g�����`����B makeindex \makeindex \indexentry�œo�^����Ă��鍀�ڂ� .idx �t�@�C���ɏ������ށB +�v���A���u���Ŏw�肷��B + +-------------------------------------------------------------------- + + +makeglossary +\makeglossary +\glossaryentry�œo�^����Ă��鍀�ڂ� .glo �t�@�C���ɏ������ށB +�v���A���u���Ŏw�肷��B + +�����̍��� + +(1)\documentstyle��makeidx�I�v�V������^���A�v���A���u���� \makeindex + �������A�����𐶐�����ꏊ�� \printindex �������B +(2)�{���� \index{�����ƂȂ�P��} �𖄂ߍ��ށB +(3)��x(�܂��͓�x)�^�C�v�Z�b�g����B +(4).idx�t�@�C�����ł���̂ł��̃t�@�C���� makeindex �ɂ�����B +(5).ind�t�@�C�����ł���̂ł�����x�^�C�v�Z�b�g���ďo���オ��B + +** \index�̋L�@ ** +���{������̂܂� \index{����} �Ɠ��ꂽ�̂ł͂������������Ƀ\�[�g����Ȃ��B +�����ŁA�ǂ݂�@�ŋ�؂��� \index{����@����} �̂悤�ɓ����B bibliography \bibliography{FILE1,FILE2, ... ,FILEn} @@ -1106,9 +1131,14 @@ % mode right before the \textfloatsep skip separating % the floats from the text. Must occupy zero vertical % space. (See \footnoterule.) -% \botfigrule : Same as \topfigrule, but put after the \textfloatsep -% skip separating text from the floats at bottom of page. -% \intextsep : Space left on top and bottom of an in-text float. +botfigrule +\setlength{\botfigrule}{����} +Same as \topfigrule, but put after the \textfloatsep +skip separating text from the floats at bottom of page. + +intextsep +\setlength{\intextsep}{����} +�������t���[�g�̏㉺�Ɏc���ꂽ�󔒂̒��� newpage diff --git a/yatex.el b/yatex.el index 0e5f213..f84388d 100644 --- a/yatex.el +++ b/yatex.el Binary files differ diff --git a/yatex.new b/yatex.new index a17d297..f469ad4 100644 --- a/yatex.new +++ b/yatex.new @@ -1,11 +1,32 @@ What's new in YaTeX yatex.el �e�o�[�W�����̕ύX�_�ɂ‚��� +1.55 {}�̏�� [prefix] k �������ɒ��O�̃R�}���h�� maketitle �^������ + �����Ă���� {} �̂�(�t�H���g�w��q������΂����)�������悤�ɂ����B + �V�P����͎��ɁAN)one ��I�ԂƁA����Emacs�ł̂ݗL���ɂ���悤�� + ���A�⊮�e�[�u���������t�@�C�����X�V���Ȃ� D)iscard ��V�݁B + ?�v�����v�g���o���Ă���^�C�v�Z�b�^��kill���鎞�� x �R�}���h�𑗂� + �ďI������ .aux �t�@�C���̔j����h���悤�ɂ����B + Emacs19�Ń^�C�v�Z�b�g���e�t�@�C���𕷂������ɃJ�����g�o�b�t�@�� + �e�t�@�C���ɂȂ��Ă��܂��̂���������B + �e�q�t�@�C���ԃW�����v�ŕ� frame �ւ̃W�����v���T�|�[�g(Emacs19)�B + \include{child} ��� [prefix] g ���� child.tex �ɔ�� child.tex + �ɐe�t�@�C���w��(%#!jlatex parent)���Ȃ����̓W�����v���t�@�C���� + �e�t�@�C���Ƃ݂Ȃ��悤�ɂ����B + \input{} �Ƀt���p�X�������Ă��鎞�� [prefix] g ���”\�ɂ����B + �����ҏW����t�@�C���̖��O�̏d�����������B + [prefix] i �� \item fill �̏C���B + �G���[�W�����v�� dired ���N�����鎖������o�O���C���B + Emacs-19�ł��~�j�o�b�t�@����ǂݍ��ނ��̂̎�ʖ��Ƀq�X�g���𕪂� + �Ď��‚悤�ɂ���(���܂ł� Emacs18+gmhist �̂ݗL��)�B + maketitle �^�R�}���h���͒���̃X�y�[�X�͓���Ȃ��悤�ɂ����B + itemize �‹�����TAB�� \subitem �̃C���f���g�̐[����ς����B + 1.54 section �^�R�}���h�̈����̃f�t�H���g�̓��͂ɂ͒ʏ�̕�������͂� �s���悤�ɂ��A�ϐ� user-article-table ��p�~�����B����ɂ�� + ~/.yatexrc �ɔC�ӂ� elisp �����Ă����Ă������Ȃ��悤�ɂȂ����B Emacs-19(Mule2) �ł̃f�t�H���g�̃w���v�t�@�C���̊i�[�ꏊ��etc�f�B ���N�g������Asite-lisp �f�B���N�g���ɕύX����(����!!)�B - ~/.yatexrc �ɔC�ӂ� elisp �����Ă����Ă������Ȃ��悤�ɂȂ����B documentstyle �̃A�h�C���֐����[�������A�X�^�C���I�v�V������X�^ �C���̊w�K���s���悤�ɂ����B ���[�U�������V�P��̓��͂Ɠ����ɍX�V����悤�ɂ��Akill-emacs �� diff --git a/yatex19.el b/yatex19.el index 7556c9b..da63c53 100644 --- a/yatex19.el +++ b/yatex19.el @@ -1,7 +1,7 @@ ;;; -*- Emacs-Lisp -*- ;;; YaTeX facilities for Emacs 19 ;;; (c )1994 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp] -;;; Last modified Mon Nov 21 21:52:16 1994 on figaro +;;; Last modified Mon Dec 19 02:55:36 1994 on VFR ;;; $Id$ ;;; �Ƃ肠���� hilit19 ���g���Ă��鎞�ɐF���t���悤�ɂ��� @@ -205,7 +205,10 @@ ;; Highlightening ;; ���[�J���ȃ}�N����ǂݍ��񂾌� redraw ����� ;; ���[�J���}�N���� keyword �Ƃ��Č��点��(keyword����܂������ȁc)�B -(defvar YaTeX-hilit-pattern-adjustment +(defvar YaTeX-hilit-patterns-alist nil + "*Hiliting pattern alist for LaTeX text. +Default value is equal to latex-mode's one.") +(defvar YaTeX-hilit-pattern-adjustment-default (list ;;\def �� define �Ȃ񂾂��� new* �� define �ł��傤�B '("\\\\\\(re\\)?new\\(environment\\|command\\){" "}" define) @@ -215,17 +218,26 @@ (concat "\\\\\\(" YaTeX-sectioning-regexp "\\){") "}" 'sectioning) ;;eqnarray �Ȃǂ̐����‹��������ĂȂ��݂����c - '("\\\\begin{\\(eqnarray\\*?\\)\\|\\(equation\\*?\\)}" - "\\\\end{\\(eqnarray\\*?\\)\\|\\(equation\\*?\\)}" + '("\\\\begin{\\(eqnarray\\*?\\|equation\\*?\\)}" + "\\\\end{\\(eqnarray\\*?\\|equation\\*?\\)}" formula)) "Adjustment for hilit19's LaTeX hilit pattern.") +(defvar YaTeX-hilit-pattern-adjustment-private nil + "*Private variable, same purpose as YaTeX-hilit-pattern-adjustment-default.") (defvar YaTeX-hilit-sectioning-face - '(yellow/dodgerblue yellow/cornflowerblue)) + '(yellow/dodgerblue yellow/cornflowerblue) + "*Hilightening face for sectioning unit. '(FaceForLight FaceForDark)") (defvar YaTeX-hilit-singlecmd-face - '(slateblue2 aquamarine)) + '(slateblue2 aquamarine) + "*Hilightening face for maketitle type. '(FaceForLight FaceForDark)") (defun YaTeX-19-collect-macro () (cond ((and (featurep 'hilit19) (fboundp 'hilit-translate)) + (or YaTeX-hilit-patterns-alist + (let ((alist (cdr (assq 'latex-mode hilit-patterns-alist)))) + (setcar (assoc "\\\\item\\(\\[[^]]*\\]\\)?" alist) + (concat YaTeX-item-regexp "\\b\\(\\[[^]]*\\]\\)?")) + (setq YaTeX-hilit-patterns-alist alist))) (let ((get-face (function (lambda (table) @@ -242,8 +254,9 @@ (cons (cons 'yatex-mode (append - YaTeX-hilit-pattern-adjustment - (cdr (assq 'latex-mode hilit-patterns-alist)) + YaTeX-hilit-pattern-adjustment-private + YaTeX-hilit-pattern-adjustment-default + YaTeX-hilit-patterns-alist (list (list (concat "\\\\\\(" @@ -259,7 +272,7 @@ (function (lambda (s) (regexp-quote (car s)))) (append user-singlecmd-table tmp-singlecmd-table) "\\|") - "\\)") + "\\)\\b") 0 'macro)))) hilit-patterns-alist))))) (YaTeX-19-collect-macro) diff --git a/yatexadd.el b/yatexadd.el index 200bd53..5e51852 100644 --- a/yatexadd.el +++ b/yatexadd.el @@ -1,8 +1,8 @@ ;;; -*- Emacs-Lisp -*- ;;; YaTeX add-in functions. -;;; yatexadd.el rev.9 +;;; yatexadd.el rev.11 ;;; (c )1991-1994 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp] -;;; Last modified Sat Nov 12 07:03:15 1994 on VFR +;;; Last modified Mon Dec 19 03:07:01 1994 on landcruiser ;;; $Id$ ;;; @@ -176,19 +176,47 @@ (YaTeX:read-coordinates "Dimension")) ) +(defvar YaTeX-minibuffer-quick-map nil) +(if YaTeX-minibuffer-quick-map nil + (setq YaTeX-minibuffer-quick-map + (copy-keymap minibuffer-local-completion-map)) + (let ((ch (1+ ? ))) + (while (< ch 127) + (define-key YaTeX-minibuffer-quick-map (char-to-string ch) + 'YaTeX-minibuffer-quick-complete) + (setq ch (1+ ch))))) + +(defvar YaTeX:left-right-delimiters + '(("(" . ")") (")" . "(") ("[" . "]") ("]" . "[") + ("\\{" . "\\}") ("\\}" . "\\{") ("|") ("\\|") + ("\\lfloor" . "\\rfloor") ("\\lceil" . "\\rceil") + ("\\langle" . "\\rangle") ("/") (".") + ("\\rfloor" . "\\rfloor") ("\\rceil" . "\\lceil") + ("\\rangle" . "\\langle") ("\\backslash") + ("\\uparrow") ("\\downarrow") ("\\updownarrow") ("\\Updownarrow")) + "TeX math delimiter, which can be completed after \\right or \\left.") + +(defvar YaTeX:left-right-default nil "Default string of YaTeX:right.") + (defun YaTeX:left () - (let (c) - (while (not (string-match - (progn (message "Which parenthesis? One of [{(|)}]: ") - (setq c (regexp-quote (char-to-string (read-char))))) - "[{(|)}]"))) - (setq single-command "right") - (cond - ((string-match c "[(|)]") c) - (t (concat "\\" c)))) -) + (let ((minibuffer-completion-table YaTeX:left-right-delimiters) + delimiter (leftp (string= single-command "left"))) + (setq delimiter + (read-from-minibuffer + (format "Delimiter%s: " + (if YaTeX:left-right-default + (format "(default=`%s')" YaTeX:left-right-default) + "(SPC for menu)")) + nil YaTeX-minibuffer-quick-map)) + (if (string= "" delimiter) (setq delimiter YaTeX:left-right-default)) + (setq single-command (if leftp "right" "left") + YaTeX:left-right-default + (or (cdr (assoc delimiter YaTeX:left-right-delimiters)) delimiter)) + delimiter)) + (fset 'YaTeX:right 'YaTeX:left) + (defun YaTeX:read-coordinates (&optional mes varX varY) (concat "(" @@ -487,7 +515,7 @@ (if (> argc 0) (insert (format "[%d]" argc))) (if (and (stringp command) (string< "" command) - (y-or-n-p "Update user completion table?")) + (y-or-n-p "Update dictionary?")) (cond ((= argc 0) (YaTeX-update-table @@ -515,6 +543,8 @@ "Page style: " '(("plain") ("empty") ("headings") ("myheadings") ("normal") nil)) ) +(fset 'YaTeX::thispagestyle 'YaTeX::pagestyle) + ;; ; completion for the arguments of \pagenumbering ;; @@ -570,6 +600,7 @@ "*User definable alist of local style parameters.") (defvar YaTeX:length-history nil "Holds history of length.") +(put 'YaTeX:length-history 'no-default t) (defun YaTeX::setlength (&optional argp) "YaTeX add-in function for arguments of \\setlength." (cond @@ -583,8 +614,7 @@ nil nil "\\") ) ((equal 2 argp) - (let ((minibuffer-history-symbol 'YaTeX:length-history)) - (read-string "Length: ")))) + (read-string-with-history "Length: " nil 'YaTeX:length-history))) ) (fset 'YaTeX::addtolength 'YaTeX::setlength) @@ -670,7 +700,7 @@ (minibuffer-completion-table dt) (opt (read-from-minibuffer "Style options ([opt1,opt2,...]): " - nil YaTeX-minibuffer-completion-map)) + nil YaTeX-minibuffer-completion-map nil)) (substr opt) o) (if (string< "" opt) (progn @@ -689,9 +719,10 @@ ""))) (defun YaTeX::documentstyle (&optional argp) - "YaTeX add-in function for arguments of \\socumentstyle." + "YaTeX add-in function for arguments of \\documentstyle." (cond ((equal argp 1) + (setq env-name "document") (let ((sname (YaTeX-cplread-with-learning (format "Documentstyle (default %s): " diff --git a/yatexgen.el b/yatexgen.el index 0279555..e4b7583 100644 --- a/yatexgen.el +++ b/yatexgen.el @@ -1,8 +1,8 @@ ;;; -*- Emacs-Lisp -*- ;;; YaTeX add-in function generator. -;;; yatexgen.el rev.3 +;;; yatexgen.el rev.4 ;;; (c )1991-1994 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp] -;;; Last modified Thu Nov 17 03:54:56 1994 on VFR +;;; Last modified Sun Dec 11 05:38:35 1994 on VFR ;;; $Id$ (require 'yatex) @@ -469,7 +469,7 @@ (concat "(read-file-name \"" (read-string (if nth (format "Prompt for argument#%d: " nth) "Prompt: ")) - ": \" nil nil t \"\")\n") + ": \" "" nil t \"\")\n") ) (defun YaTeX-generate-create-read-oneof (&optional nth readpos) (concat diff --git a/yatexlib.el b/yatexlib.el index 52e5eba..b6e94bf 100644 --- a/yatexlib.el +++ b/yatexlib.el @@ -2,7 +2,7 @@ ;;; YaTeX library of general functions. ;;; yatexlib.el ;;; (c )1994 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp] -;;; Last modified Thu Nov 24 02:20:45 1994 on VFR +;;; Last modified Wed Dec 21 05:58:06 1994 on landcruiser ;;; $Id$ ;;;###autoload @@ -47,15 +47,15 @@ Optional second arg SETBUF t make use set-buffer instead of switch-to-buffer." (interactive "Fswitch to file: ") (let (buf) - (if (setq buf (get-buffer (file-name-nondirectory file))) + (if (setq buf (get-file-buffer file)) (progn (funcall (if setbuf 'set-buffer 'switch-to-buffer) - (file-name-nondirectory file)) + (get-file-buffer file)) buf) (if (file-exists-p file) - (funcall - (if setbuf 'find-file-noselect 'find-file) - file) + (or ;find-file returns nil but set current-buffer... + (funcall (if setbuf 'find-file-noselect 'find-file) file) + (current-buffer)) (message "%s was not found in this directory." file) nil))) ) @@ -64,8 +64,8 @@ (defun YaTeX-switch-to-buffer-other-window (file) "Switch to buffer if buffer exists, find file if not." (interactive "Fswitch to file: ") - (if (get-buffer (file-name-nondirectory file)) - (progn (switch-to-buffer-other-window file) t) + (if (get-file-buffer file) + (progn (switch-to-buffer-other-window (get-file-buffer file)) t) (if (file-exists-p file) (progn (find-file-other-window file) t) (message "%s was not found in this directory." file) @@ -128,19 +128,7 @@ (get-buffer-window buffer)) (progn (if select - (cond - (YaTeX-emacs-19 - (let ((frame (window-frame (get-buffer-window buffer t)))) - (select-frame frame) - (focus-frame frame) - (set-mouse-position frame 0 0) - (raise-frame frame) - (select-window (get-buffer-window buffer)) - (if (and (featurep 'windows) - (win:frame-window frame)) - (win:adjust-window)))) - (t - (select-window (get-buffer-window buffer))))) + (goto-buffer-window buffer)) t)) (let ((window (selected-window)) (wlist (YaTeX-window-list)) win w (x 0)) @@ -167,18 +155,7 @@ ((and YaTeX-emacs-19 (get-buffer-window buffer t)) nil) ;if found in other frame (YaTeX-default-pop-window-height - (split-window - (selected-window) - (max - (min - (- (screen-height) - (if (numberp YaTeX-default-pop-window-height) - (+ YaTeX-default-pop-window-height 2) - (/ (* (screen-height) - (string-to-int YaTeX-default-pop-window-height)) - 100))) - (- (screen-height) window-min-height 1)) - window-min-height)) + (split-window-calculate-height YaTeX-default-pop-window-height) (pop-to-buffer buffer) (or select (select-window window))) (t nil))) @@ -186,6 +163,27 @@ ) ;;;###autoload +(defun split-window-calculate-height (height) + "Split current window wight specified HEIGHT. +If HEIGHT is number, make new window that has HEIGHT lines. +If HEIGHT is string, make new window that occupy HEIGT % of screen height. +Otherwise split window conventionally." + (if (one-window-p) + (split-window + (selected-window) + (max + (min + (- (screen-height) + (if (numberp YaTeX-default-pop-window-height) + (+ YaTeX-default-pop-window-height 2) + (/ (* (screen-height) + (string-to-int YaTeX-default-pop-window-height)) + 100))) + (- (screen-height) window-min-height 1)) + window-min-height))) +) + +;;;###autoload (defun YaTeX-window-list () (let*((curw (selected-window)) (win curw) (wlist (list curw))) (while (not (eq curw (setq win (next-window win)))) @@ -215,11 +213,20 @@ ;;;###autoload (defun YaTeX-minibuffer-complete () "Complete in minibuffer. -If the symbol 'delim is bound and is string, its value is assumed to be + If the symbol 'delim is bound and is string, its value is assumed to be the character class of delimiters. Completion will be performed on -the last field separated by those delimiters." +the last field separated by those delimiters. + If the symbol 'quick is bound and is 't, when the try-completion results +in t, exit minibuffer immediately." (interactive) - (let (beg word compl (md (match-data))) + (let ((md (match-data)) beg word compl + (quick (and (boundp 'quick) (eq quick t))) + (displist ;function to display completion-list + (function + (lambda () + (with-output-to-temp-buffer "*Completions*" + (display-completion-list + (all-completions word minibuffer-completion-table))))))) (setq beg (if (and (boundp 'delim) (stringp delim)) (save-excursion (skip-chars-backward (concat "^" delim)) @@ -229,31 +236,117 @@ compl (try-completion word minibuffer-completion-table)) (cond ((eq compl t) - (let ((p (point)) (max (point-max))) - (goto-char max) - (insert " [Sole completion]") - (goto-char p) - (sit-for 1) - (delete-region max (point-max)) - (goto-char p))) + (if quick (exit-minibuffer) + (let ((p (point)) (max (point-max))) + (unwind-protect + (progn + (goto-char max) + (insert " [Sole completion]") + (goto-char p) + (sit-for 1)) + (delete-region max (point-max)) + (goto-char p))))) ((eq compl nil) (ding) (save-excursion (let (p) - (goto-char (setq p (point-max))) - (insert " [No match]") - (goto-char p) - (sit-for 2) - (delete-region p (point-max))))) + (unwind-protect + (progn + (goto-char (setq p (point-max))) + (insert " [No match]") + (goto-char p) + (sit-for 2)) + (delete-region p (point-max)))))) ((string= compl word) - (with-output-to-temp-buffer "*Completions*" - (display-completion-list - (all-completions word minibuffer-completion-table)))) + (funcall displist)) (t (delete-region beg (point-max)) - (insert compl)) - ) + (insert compl) + (if quick + (if (eq (try-completion compl minibuffer-completion-table) t) + (exit-minibuffer) + (funcall displist))))) (store-match-data md)) ) +(defun YaTeX-minibuffer-quick-complete () + "Set 'quick to 't and call YaTeX-minibuffer-complete. +See documentation of YaTeX-minibuffer-complete." + (interactive) + (let ((quick t)) + (self-insert-command 1) + (YaTeX-minibuffer-complete))) + +(defun foreach-buffers (pattern job) + "For each buffer which matches with PATTERN, do JOB." + (let ((list (buffer-list))) + (save-excursion + (while list + (set-buffer (car list)) + (if (or (and (stringp pattern) + (buffer-file-name) + (string-match pattern (buffer-file-name))) + (and (symbolp pattern) major-mode (eq major-mode pattern))) + (eval job)) + (setq list (cdr list))))) +) + +(defun goto-buffer-window (buffer) + "Select window which is bound to BUFFER. +If no such window exist, switch to buffer BUFFER." + (if (stringp buffer) + (setq buffer (or (get-file-buffer buffer) (get-buffer buffer)))) + (if (get-buffer buffer) + (cond + ((get-buffer-window buffer) + (select-window (get-buffer-window buffer))) + ((and YaTeX-emacs-19 (get-buffer-window buffer t)) + (let*((win (get-buffer-window buffer t)) + (frame (window-frame win))) + (select-frame frame) + (raise-frame frame) + (focus-frame frame) + (select-window win) + (set-mouse-position frame 0 0) + (and (featurep 'windows) (fboundp 'win:adjust-window) + (win:adjust-window)))) + (t (switch-to-buffer buffer)))) +) + +;; Here starts the functions which support gmhist-vs-Emacs19 compatible +;; reading with history. +;;;###autoload +(defun completing-read-with-history + (prompt table &optional predicate must-match initial hsym) + "Completing read with general history: gmhist, Emacs-19." + (let ((minibuffer-history + (or (symbol-value hsym) + (and (boundp 'minibuffer-history) minibuffer-history))) + (minibuffer-history-symbol (or hsym 'minibuffer-history))) + (prog1 + (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)) + (if (and YaTeX-emacs-19 hsym) (set hsym minibuffer-history))))) + +;;;###autoload +(defun read-from-minibuffer-with-history (prompt &optional init map read hsym) + "Read from minibuffer with general history: gmhist, Emacs-19." + (cond + (YaTeX-emacs-19 + (read-from-minibuffer prompt init map read hsym)) + (t + (let ((minibuffer-history-symbol hsym)) + (read-from-minibuffer prompt init map read))))) + +;;;###autoload +(defun read-string-with-history (prompt &optional init hsym) + "Read string with history: gmhist(Emacs-18) and Emacs-19." + (cond + (YaTeX-emacs-19 + (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)))) (provide 'yatexlib) diff --git a/yatexmth.el b/yatexmth.el index f723652..9e875af 100644 --- a/yatexmth.el +++ b/yatexmth.el @@ -2,7 +2,7 @@ ;;; YaTeX math-mode-specific functions. ;;; yatexmth.el rev.2 ;;; (c )1993-1994 by HIROSE Yuuji [yuuji@ae.keio.ac.jp] -;;; Last modified Tue Oct 11 22:57:43 1994 on figaro +;;; Last modified Fri Dec 2 17:03:30 1994 on VFR ;;; $Id$ ;;; [Customization guide] @@ -42,7 +42,7 @@ ;;; ("'" . Other-List-if-any))) ;;; ;;; Put these expressions into your ~/.emacs, and you can use this -;;; completion in the YaTeX-math-mode. +;;; completion in the math-mode. ;;; ;;; And you can add your favorite completion sequences to the ;;; default completion list invoked with `;', by defining those lists @@ -81,8 +81,8 @@ ;;; '(("," . YaTeX-math-funcs-list) ;;; ("'" . �ق��ɒ�`�������V���[�Y������΁c))) ;;; -;;; ������ ~/.emacs �ɏ����Ă����΁A�쒹�� math-mode �Ŏ�����p�� -;;; �C���[�W�⊮�����p�ł��܂��B +;;; ������ ~/.emacs �ɏ����Ă����΁Amath-mode �Ŏ�����p�̃C���[�W +;;; �⊮�����p�ł��܂��B (defvar YaTeX-jisold (and (boundp 'dos-machine-type) @@ -378,6 +378,10 @@ (list 'nth 1 list)) (defvar YaTeX-math-cmd-regexp (concat (regexp-quote YaTeX-ec) "[A-z]")) +(defvar YaTeX-math-verbatim-environments + '("alltt") + "*List of environments in which LaTeX math mode is disabled. +This value is appended with YaTeX-verbatim-environments.") ;;; ;;YaTeX math-mode functions @@ -438,12 +442,14 @@ "If current position is supposed to be in LaTeX-math-mode, return t." (or (YaTeX-quick-in-environment-p '("math" "eqnarray" "equation" "eqnarray*" "displaymath")) - (let ((p (point)) (nest 0) me0 + (let*((p (point)) (nest 0) me0 + (delim (concat YaTeX-sectioning-regexp + "\\|^%\\|^$\\|^\C-l")) (boundary (save-excursion - (if (looking-at YaTeX-paragraph-delimiter) + (if (looking-at delim) (goto-char (max (point-min) (1- (point))))) - (re-search-backward YaTeX-paragraph-delimiter nil 1) + (re-search-backward delim nil 1) (point)))) (save-excursion (cond @@ -455,7 +461,7 @@ "\\([()]\\|[][]\\)") boundary t)) (setq me0 (match-end 0)) (if (or (YaTeX-on-comment-p) - (YaTeX-quick-in-environment-p "verbatim")) nil + (YaTeX-literal-p)) nil (if (or (= (char-after (1- me0)) ?\)) (= (char-after (1- me0)) ?\])) (setq nest (1+ nest)) @@ -464,11 +470,18 @@ (if (< nest 0) (throw 'open t)))) t) (t (catch 'dollar - (while (search-backward "$" boundary t) + (while ;(search-backward "$" boundary t);little bit fast. + (YaTeX-re-search-active-backward ;;;;;; Too slow??? + "\\$" YaTeX-comment-prefix boundary t) (cond ((equal (char-after (1- (point))) ?$) ; $$ equation $$ (backward-char 1) (setq nest (1+ nest))) + ((let ((YaTeX-verbatim-environments + (append YaTeX-math-verbatim-environments + YaTeX-verbatim-environments))) + (YaTeX-literal-p)) + nil) ((and (equal (char-after (1- (point))) ?\\ ) (not (equal (char-after (- (point) 3)) ?\\ ))) nil) ;\$ @@ -583,8 +596,9 @@ (setq result (catch 'complete (if (and (not force) - (or (and (not YaTeX-auto-math-mode) (not YaTeX-math-mode)) - (not (YaTeX-in-math-mode-p)))) + (if YaTeX-auto-math-mode + (not (YaTeX-in-math-mode-p)) + (not YaTeX-math-mode))) (throw 'complete 'escape));this tag should be exit, but... (while t (message "Sequence(TAB for menu): %s" key) diff --git a/yatexprc.el b/yatexprc.el index 5b328cd..7ee18da 100644 --- a/yatexprc.el +++ b/yatexprc.el @@ -1,709 +1,727 @@ -;;; -*- Emacs-Lisp -*- -;;; YaTeX process handler. -;;; yatexprc.el -;;; (c )1993-1994 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp] -;;; Last modified Fri Nov 25 03:31:46 1994 on VFR -;;; $Id$ - -(require 'yatex) - -(defvar YaTeX-typeset-process nil - "Process identifier for jlatex" -) -(defvar YaTeX-typeset-buffer "*YaTeX-typesetting*" - "Process buffer for jlatex") - -(defvar YaTeX-typeset-buffer-syntax nil - "*Syntax table for typesetting buffer") - -(defvar YaTeX-current-TeX-buffer nil - "Keeps the buffer on which recently typeset run.") - -(defvar YaTeX-shell-command-option - (or (and (boundp 'shell-command-option) shell-command-option) - (if YaTeX-dos "/c" "-c")) - "Shell option for command execution.") - -(if YaTeX-typeset-buffer-syntax nil - (setq YaTeX-typeset-buffer-syntax - (make-syntax-table (standard-syntax-table))) - (modify-syntax-entry ?\{ "w" YaTeX-typeset-buffer-syntax) - (modify-syntax-entry ?\} "w" YaTeX-typeset-buffer-syntax) - (modify-syntax-entry ?\[ "w" YaTeX-typeset-buffer-syntax) - (modify-syntax-entry ?\] "w" YaTeX-typeset-buffer-syntax) -) - -(defun YaTeX-typeset (command buffer) - "Execute jlatex (or other) to LaTeX typeset." - (interactive) - (save-excursion - (let ((p (point)) (window (selected-window)) execdir) - (if (and YaTeX-typeset-process - (eq (process-status YaTeX-typeset-process) 'run)) - ;; if tex command is halting. - (YaTeX-kill-typeset-process YaTeX-typeset-process)) - (YaTeX-visit-main t);;execution directory - (setq execdir default-directory) - ;;Select lower-most window if there are more than 2 windows and - ;;typeset buffer not seen. - (YaTeX-showup-buffer - buffer (function (lambda (x) (nth 3 (window-edges x))))) - (set-buffer (get-buffer-create buffer)) - (setq default-directory execdir) - (cd execdir) - (erase-buffer) - (cond - (YaTeX-dos ;if MS-DOS - (YaTeX-put-nonstopmode) - (call-process - shell-file-name nil buffer nil YaTeX-shell-command-option command) - (YaTeX-remove-nonstopmode)) - (t ;if UNIX - (set-process-buffer - (setq YaTeX-typeset-process - (start-process "LaTeX" buffer shell-file-name - YaTeX-shell-command-option command)) - (get-buffer buffer)) - (set-process-sentinel YaTeX-typeset-process 'YaTeX-typeset-sentinel))) - (message (format "Calling `%s'..." command)) - (setq YaTeX-current-TeX-buffer (buffer-name)) - (use-local-map YaTeX-typesetting-mode-map) - (set-syntax-table YaTeX-typeset-buffer-syntax) - (setq mode-name "typeset") - (if YaTeX-typeset-process ; if process is running (maybe on UNIX) - (cond ((boundp 'MULE) - (set-current-process-coding-system - YaTeX-latex-message-code YaTeX-coding-system)) - ((boundp 'NEMACS) - (set-kanji-process-code YaTeX-latex-message-code)))) - (if YaTeX-dos (message "Done.") - (insert " ") - (set-marker (process-mark YaTeX-typeset-process) (1- (point)))) - (if (bolp) (forward-line -1)) ;what for? - (if YaTeX-emacs-19 - (let ((win (get-buffer-window buffer t)) owin) - (select-frame (window-frame win)) - (setq owin (selected-window)) - (select-window win) - (goto-char (point-max)) - (recenter -1) - (select-window owin)) - (select-window (get-buffer-window buffer)) - (goto-char (point-max)) - (recenter -1)) - (select-window window))) -) - -(defun YaTeX-typeset-sentinel (proc mes) - (cond ((null (buffer-name (process-buffer proc))) - ;; buffer killed - (set-process-buffer proc nil)) - ((memq (process-status proc) '(signal exit)) - (let* ((obuf (current-buffer)) (pbuf (process-buffer proc)) - (pwin (get-buffer-window pbuf)) - (owin (selected-window)) win) - ;; save-excursion isn't the right thing if - ;; process-buffer is current-buffer - (unwind-protect - (progn - ;; Write something in *typesetting* and hack its mode line - (if pwin - (select-window pwin) - (set-buffer pbuf)) - ;;(YaTeX-showup-buffer pbuf nil t) - (goto-char (point-max)) - (if pwin (recenter -3)) - (insert ?\n "latex typesetting " mes) - (forward-char -1) - (insert " at " (substring (current-time-string) 0 -5) "\n") - (forward-char 1) - (setq mode-line-process - (concat ": " - (symbol-name (process-status proc)))) - (message "latex typesetting %s." - (if (eq (process-status proc) 'exit) - "done" "ceased")) - ;; If buffer and mode line shows that the process - ;; is dead, we can delete it now. Otherwise it - ;; will stay around until M-x list-processes. - (delete-process proc) - ) - (setq YaTeX-typesetting-process nil) - ;; Force mode line redisplay soon - (set-buffer-modified-p (buffer-modified-p)) - ) - (select-window owin) - (set-buffer obuf)))) -) - -(defvar YaTeX-texput-file "texput.tex" - "*File name for temporary file of typeset-region." -) - -(defun YaTeX-typeset-region () - "Paste the region to the file `texput.tex' and execute jlatex (or other) -to LaTeX typeset. The region is specified by the rule: - (1)If keyword `%#BEGIN' is found in the upper direction from (point). - (1-1)if the keyword `%#END' is found after `%#BEGIN', - ->Assume the text between `%#BEGIN' and `%#END' as region. - (1-2)if the keyword `%#END' is not found anywhere after `%#BEGIN', - ->Assume the text after `%#BEGIN' as region. - (2)If no `%#BEGIN' usage is found before the (point), - ->Assume the text between current (point) and (mark) as region. -DON'T forget to eliminate the `%#BEGIN/%#END' notation after editing -operation to the region." - (interactive) - (save-excursion - (let* - ((end "") typeout ;Type out message that tells the method of cutting. - (cmd (concat (YaTeX-get-latex-command nil) " " YaTeX-texput-file)) - (buffer (current-buffer)) opoint preamble (subpreamble "") main - (hilit-auto-highlight nil) ;for Emacs19 with hilit19 - reg-begin reg-end) - - (save-excursion - (if (search-backward "%#BEGIN" nil t) - (progn - (setq typeout "--- Region from BEGIN to " - end "the end of the buffer ---" - reg-begin (match-end 0)) - (if (search-forward "%#END" nil t) - (setq reg-end (match-beginning 0) - end "END ---") - (setq reg-end (point-max)))) - (setq typeout "=== Region from (point) to (mark) ===") - (setq reg-begin (point) reg-end (mark))) - (goto-char (point-min)) - (while (search-forward "%#REQUIRE" nil t) - (setq subpreamble - (concat subpreamble - (cond - ((eolp) - (buffer-substring - (match-beginning 0) - (point-beginning-of-line))) - (t (buffer-substring - (match-end 0) - (point-end-of-line)))) - "\n")) - (goto-char (match-end 0)))) - (YaTeX-visit-main t) - (setq main (current-buffer)) - (setq opoint (point)) - (goto-char (point-min)) - (setq - preamble - (if (re-search-forward "^[ ]*\\\\begin.*{document}" nil t) - (buffer-substring (point-min) (match-end 0)) - (concat "\\documentstyle{" YaTeX-default-document-style "}\n" - "\\begin{document}"))) - (goto-char opoint) - ;;(set-buffer buffer) ;for clarity - (set-buffer (find-file-noselect YaTeX-texput-file)) - ;;(find-file YaTeX-texput-file) - (erase-buffer) - (if YaTeX-need-nonstop - (insert "\\nonstopmode{}\n")) - (insert preamble "\n" subpreamble "\n") - (insert-buffer-substring buffer reg-begin reg-end) - (insert "\\typeout{" typeout end "}\n") ;Notice the selected method. - (insert "\n\\end{document}\n") - (basic-save-buffer) - (kill-buffer (current-buffer)) - (set-buffer main) ;return to parent file or itself. - (YaTeX-typeset cmd YaTeX-typeset-buffer) - (switch-to-buffer buffer) ;for Emacs-19 - (put 'dvi2-command 'region t))) -) - -(defun YaTeX-typeset-buffer () - "Typeset whole buffer. If %#! usage says other buffer is main text, -visit main buffer to confirm if its includeonly list contains current -buffer's file. And if it doesn't contain editing text, ask user which -action wants to be done, A:Add list, R:Replace list, %:comment-out list." - (interactive) - (YaTeX-save-buffers) - (let*((me (substring (buffer-name) 0 (rindex (buffer-name) ?.))) - (mydir (file-name-directory (buffer-file-name))) - (cmd (YaTeX-get-latex-command t))) - (if (YaTeX-main-file-p) nil - (save-excursion - (YaTeX-visit-main t) ;search into main buffer - (save-excursion - (push-mark (point) t) - (goto-char (point-min)) - (if (and (re-search-forward "^[ ]*\\\\begin{document}" nil t) - (re-search-backward "^[ ]*\\\\includeonly{" nil t)) - (let* - ((b (progn (skip-chars-forward "^{") (point))) - (e (progn (skip-chars-forward "^}") (1+ (point)))) - (s (buffer-substring b e)) c - (pardir (file-name-directory (buffer-file-name)))) - (if (string-match (concat "[{,/]" me "[,}]") s) - nil ; Nothing to do when it's already in includeonly. - (ding) - (switch-to-buffer (current-buffer));Display this buffer. - (setq - me ;;Rewrite my name(me) to contain sub directory name. - (concat - (if (string-match pardir mydir) ;if mydir is child of main - (substring mydir (length pardir)) ;cut absolute path - mydir) ;else concat absolute path name. - me)) - (message - "`%s' is not in \\includeonly. A)dd R)eplace %%)comment? " - me) - (setq c (read-char)) - (cond - ((= c ?a) - (goto-char (1+ b)) - (insert me (if (string= s "{}") "" ","))) - ((= c ?r) - (delete-region (1+ b) (1- e)) (insert me)) - ((= c ?%) - (beginning-of-line) (insert "%")) - (t nil)) - (basic-save-buffer)))) - (exchange-point-and-mark)) - )) - (YaTeX-typeset cmd YaTeX-typeset-buffer) - (put 'dvi2-command 'region nil)) -) - -(defvar YaTeX-call-command-history nil - "Holds history list of YaTeX-call-command-on-file.") -(put 'YaTeX-call-command-history 'no-default t) -(defun YaTeX-call-command-on-file (base-cmd buffer) - (YaTeX-save-buffers) - (YaTeX-typeset - (let ((minibufer-history-symbol 'YaTeX-call-command-history)) - (read-string "Call command: " - (concat base-cmd " " (YaTeX-get-preview-file-name)))) - buffer) -) - -(defun YaTeX-bibtex-buffer (cmd) - "Pass the bibliography data of editing file to bibtex." - (interactive) - (YaTeX-save-buffers) - (YaTeX-call-command-on-file cmd "*YaTeX-bibtex*" ) -) - -(defun YaTeX-kill-typeset-process (proc) - "Kill process PROC after sending signal to PROC. -PROC should be process identifier." - (cond - (YaTeX-dos - (error "MS-DOS can't have concurrent process.")) - ((or (null proc) (not (eq (process-status proc) 'run))) - (error "No typesetting process.")) - (t (interrupt-process proc) - (delete-process proc))) -) - -(defun YaTeX-system (command buffer) - "Execute some command on buffer. Not a official function." - (save-excursion - (YaTeX-showup-buffer - buffer (function (lambda (x) (nth 3 (window-edges x))))) - (set-buffer (get-buffer-create buffer)) - (erase-buffer) - (if YaTeX-dos - (call-process - shell-file-name nil buffer nil YaTeX-shell-command-option command) - (set-process-buffer - (start-process - "system" buffer shell-file-name YaTeX-shell-command-option command) - (get-buffer buffer)))) -) - -(defvar YaTeX-preview-command-history nil - "Holds minibuffer history of preview command.") -(put 'YaTeX-preview-command-history 'no-default t) -(defvar YaTeX-preview-file-history nil - "Holds minibuffer history of file to preview.") -(put 'YaTeX-preview-file-history 'no-default t) -(defun YaTeX-preview (preview-command preview-file) - "Execute xdvi (or other) to tex-preview." - (interactive - (list - (let ((minibuffer-history-symbol 'YaTeX-preview-command-history)) - (read-string "Preview command: " dvi2-command)) - (let ((minibuffer-history-symbol 'YaTeX-preview-file-history)) - (read-string "Preview file[.dvi]: " - (if (get 'dvi2-command 'region) - (substring YaTeX-texput-file - 0 (rindex YaTeX-texput-file ?.)) - (YaTeX-get-preview-file-name)) - )))) - (setq dvi2-command preview-command) ;`dvi2command' is buffer local - (save-excursion - (YaTeX-visit-main t) - (let ((pbuffer "*dvi-preview*") (dir default-directory)) - (YaTeX-showup-buffer - pbuffer (function (lambda (x) (nth 3 (window-edges x))))) - (set-buffer (get-buffer-create pbuffer)) - (erase-buffer) - (setq default-directory dir) ;for 18 - (cd dir) ;for 19 - (cond - (YaTeX-dos ;if MS-DOS - (send-string-to-terminal "\e[2J\e[>5h") ;CLS & hide cursor - (call-process shell-file-name "con" "*dvi-preview*" nil - YaTeX-shell-command-option preview-command preview-file) - (send-string-to-terminal "\e[>5l") ;show cursor - (redraw-display)) - (t ;if UNIX - (set-process-buffer - (start-process "preview" "*dvi-preview*" shell-file-name - YaTeX-shell-command-option - (concat preview-command " " preview-file)) - (get-buffer pbuffer)) - (message - (concat "Starting " preview-command - " to preview " preview-file)))))) -) - -(defun YaTeX-prev-error () - "Visit previous typeset error. - To avoid making confliction of line numbers by editing, jump to -error or warning lines in reverse order." - (interactive) - (let ((cur-buf (buffer-name)) (cur-win (selected-window)) - error-line typeset-win error-buffer error-win) - (if (null (get-buffer YaTeX-typeset-buffer)) - (error "There is no typesetting buffer.")) - (YaTeX-showup-buffer YaTeX-typeset-buffer nil t) - (setq typeset-win (selected-window)) - (if (re-search-backward - (concat "\\(" latex-error-regexp "\\)\\|\\(" - latex-warning-regexp "\\)") - nil t) - nil - (select-window cur-win) - (error "No more erros on %s" cur-buf)) - (goto-char (match-beginning 0)) - (skip-chars-forward "^0-9" (match-end 0)) - (setq error-line - (string-to-int - (buffer-substring - (point) - (progn (skip-chars-forward "0-9" (match-end 0)) (point)))) - error-buffer (YaTeX-get-error-file cur-buf) - error-win (get-buffer-window error-buffer)) - (if (or (null error-line) (equal 0 error-line)) - (error "Can't detect error position.")) - (select-window cur-win) - (cond - (error-win (select-window error-win)) - ((eq (get-lru-window) typeset-win) - (YaTeX-switch-to-buffer error-buffer)) - (t (select-window (get-lru-window)) - (YaTeX-switch-to-buffer error-buffer))) - (setq error-win (selected-window)) - (goto-line error-line) - (message "LaTeX %s in `%s' on line: %d." - (if (match-beginning 1) "error" "warning") - error-buffer error-line) - (select-window typeset-win) - (skip-chars-backward "0-9") - (recenter (/ (window-height) 2)) - (sit-for 3) - (goto-char (match-beginning 0)) - (select-window error-win)) -) - -(defun YaTeX-jump-error-line () - "Jump to corresponding line on latex command's error message." - (interactive) - (let (error-line error-file error-buf) - (save-excursion - (beginning-of-line) - (setq error-line (re-search-forward "l[ ines]*\\.?\\([1-9][0-9]*\\)" - (point-end-of-line) t))) - (if (null error-line) - (if (eobp) (insert (this-command-keys)) - (error "No line number expression.")) - (goto-char (match-beginning 0)) - (setq error-line (string-to-int - (buffer-substring (match-beginning 1) (match-end 1))) - error-file (YaTeX-get-error-file YaTeX-current-TeX-buffer) - error-buf (YaTeX-switch-to-buffer error-file t)) - (if (null error-buf) - (error "`%s' is not found in this directory." error-file)) - (YaTeX-showup-buffer error-buf nil t) - (goto-line error-line))) -) - -(defun YaTeX-send-string () - "Send string to current typeset process." - (interactive) - (if (and (eq (process-status YaTeX-typeset-process) 'run) - (>= (point) (process-mark YaTeX-typeset-process))) - (let ((b (process-mark YaTeX-typeset-process)) - (e (point-end-of-line))) - (goto-char b) - (skip-chars-forward " \t" e) - (setq b (point)) - (process-send-string - YaTeX-typeset-process (concat (buffer-substring b e) "\n")) - (goto-char e) - (insert "\n") - (set-marker (process-mark YaTeX-typeset-process) (point)) - (insert " ")) - (ding)) -) - -(defun YaTeX-view-error () - (interactive) - (if (null (get-buffer YaTeX-typeset-buffer)) - (message "No typeset buffer found.") - (let ((win (selected-window))) - (YaTeX-showup-buffer YaTeX-typeset-buffer nil t) - ;; Next 3 lines are obsolete because YaTeX-typesetting-buffer is - ;; automatically scrolled up at typesetting. - ;;(goto-char (point-max)) - ;;(forward-line -1) - ;;(recenter -1) - (select-window win))) -) - -(defun YaTeX-get-error-file (default) - "Get current processing file from typesetting log." - (save-excursion - (let(s) - (condition-case () (up-list -1) - (error - (let ((list 0) found) - (while - (and (<= list 0) (not found) - (re-search-backward "\\((\\)\\|\\()\\)" nil t)) - (if (equal (match-beginning 0) (match-beginning 2)) ;close paren. - (setq list (1- list)) ;open paren - (setq list (1+ list)) - (if (= list 1) - (if (looking-at "\\([^,{}%]+\.\\)tex\\|sty") - (setq found t) - (setq list (1- list))))))))) - (setq s - (buffer-substring - (progn (forward-char 1) (point)) - (progn (skip-chars-forward "-A-Za-z0-9_/\.\\" (point-end-of-line)) - (point)))) - (if (string= "" s) default s))) -) - -(defun YaTeX-put-nonstopmode () - (if YaTeX-need-nonstop - (if (re-search-backward "\\\\nonstopmode{}" (point-min) t) - nil ;if already written in text then do nothing - (save-excursion - (YaTeX-visit-main t) - (goto-char (point-min)) - (insert "\\nonstopmode{}%_YaTeX_%\n"))) - ) -) - -(defun YaTeX-remove-nonstopmode () - (if YaTeX-need-nonstop ;for speed - (save-excursion - (YaTeX-visit-main t) - (goto-char (point-min)) - (forward-line 1) - (narrow-to-region (point-min) (point)) - (goto-char (point-min)) - (delete-matching-lines "^\\\\nonstopmode\\{\\}%_YaTeX_%$") - (widen))) -) - -(defun YaTeX-get-preview-file-name () - "Get file name to preview by inquiring YaTeX-get-latex-command" - (let* ((latex-cmd (YaTeX-get-latex-command t)) - (rin (rindex latex-cmd ? )) - (fname (if (> rin -1) (substring latex-cmd (1+ rin)) "")) - (period)) - (if (string= fname "") - (setq fname (substring (file-name-nondirectory - (buffer-file-name)) - 0 -4)) - (setq period (rindex fname ?.)) - (setq fname (substring fname 0 (if (eq -1 period) nil period))) - )) -) - -(defun YaTeX-get-latex-command (&optional switch) - "Specify the latex-command name and its argument. -If there is a line which begins with string: \"%#!\", the following -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 -will be the latex-command, -and you write \"%#!jlatex main.tex\" on some line and argument SWITCH -is non-nil, then - \"jlatex main.tex\" - -will be given to the shell." - (let (magic command target) - (setq parent - (cond - (YaTeX-parent-file YaTeX-parent-file) - (t (save-excursion - (YaTeX-visit-main t) - (file-name-nondirectory (buffer-file-name))))) - magic (YaTeX-get-builtin "!")) - (cond - (magic - (cond - (switch (if (string-match "\\s " magic) magic - (concat magic " " parent))) - (t (concat (substring magic 0 (string-match "\\s " magic)) " ")))) - (t (concat tex-command " " (if switch parent))))) -) - -(defvar YaTeX-lpr-command-history nil - "Holds command line history of YaTeX-lpr.") -(put 'YaTeX-lpr-command-history 'no-default t) -(defun YaTeX-lpr (arg) - "Print out. If prefix arg ARG is non nil, call print driver without -page range description." - (interactive "P") - (let*((cmd (or (YaTeX-get-builtin "LPR") dviprint-command-format)) - from to (lbuffer "*dvi-printing*")) - (setq - cmd - (YaTeX-replace-format - cmd "f" - (if (or arg (not (string-match "%f" cmd))) - "" - (YaTeX-replace-format - dviprint-from-format - "b" - (if (string= - (setq from (read-string "From page(default 1): ")) "") - "1" from)))) - ) - (setq - cmd - (YaTeX-replace-format - cmd "t" - (if (or arg (not (string-match "%t" cmd)) - (string= - (setq to (read-string "To page(default none): ")) "")) - "" - (YaTeX-replace-format dviprint-to-format "e" to))) - ) - (setq cmd - (let ((minibuffer-history-symbol 'YaTeX-lpr-command-history)) - (read-string "Edit command line: " - (format cmd (YaTeX-get-preview-file-name))))) - (save-excursion - (YaTeX-visit-main t) ;;change execution directory - (YaTeX-showup-buffer - lbuffer (function (lambda (x) (nth 3 (window-edges x))))) - (set-buffer (get-buffer-create lbuffer)) - (erase-buffer) - (cond - (YaTeX-dos - (call-process shell-file-name "con" "*dvi-printing*" nil - YaTeX-shell-command-option cmd)) - (t - (set-process-buffer - (start-process "print" "*dvi-printing*" shell-file-name - YaTeX-shell-command-option cmd) - (get-buffer lbuffer)) - (message "Starting printing command: %s..." cmd))) - )) -) - -(defun YaTeX-main-file-p () - "Return if current buffer is main LaTeX source." - (cond - ((YaTeX-get-builtin "!") - (string-match (YaTeX-guess-parent (YaTeX-get-builtin "!")) (buffer-name))) - (t - (save-excursion - (let ((latex-main-id (concat "^\\s *" YaTeX-ec-regexp "documentstyle"))) - (or (re-search-backward latex-main-id nil t) - (re-search-forward latex-main-id nil t)))))) -) - -(defun YaTeX-visit-main (&optional setbuf) - "Switch buffer to main LaTeX source. -Use set-buffer instead of switch-to-buffer if the optional second argument -SETBUF is t(Use it only from Emacs-Lisp program)." - (interactive) - (let (b-in main-file) - (if (setq b-in (YaTeX-get-builtin "!")) - (setq main-file (YaTeX-guess-parent b-in))) - (if YaTeX-parent-file - (setq main-file ;;(get-file-buffer YaTeX-parent-file) - YaTeX-parent-file)) - (if (YaTeX-main-file-p) - (if (interactive-p) (message "I think this is main LaTeX source.") nil) - (cond - ((and (interactive-p) main-file (get-buffer-window main-file)) - (select-window (get-buffer-window main-file))) - ((and main-file (YaTeX-switch-to-buffer main-file setbuf))) - ((and main-file - (file-exists-p (setq main-file (concat "../" main-file))) - (y-or-n-p (concat (expand-file-name main-file) - " is main file?:"))) - (YaTeX-switch-to-buffer main-file setbuf)) - (t (setq main-file (read-file-name "Enter your main text: " nil nil 1)) - (setq YaTeX-parent-file main-file) - (find-file main-file)) - ))) - nil -) - - -(defun YaTeX-guess-parent (command-line) - (setq command-line - (if (string-match ".*\\s " command-line) - (substring command-line (match-end 0)) - (file-name-nondirectory (buffer-file-name))) - command-line - (concat (if (string-match "\\(.*\\)\\." command-line) - (substring command-line (match-beginning 1) (match-end 1)) - command-line) - ".tex")) -) - -(defun YaTeX-visit-main-other-window () - "Switch to buffer main LaTeX source in other window." - (interactive) - (if (YaTeX-main-file-p) (message "I think this is main LaTeX source.") - (YaTeX-switch-to-buffer-other-window - (concat (YaTeX-get-preview-file-name) ".tex"))) -) - -(defun YaTeX-get-builtin (key) - "Read source built-in command of %# usage." - (save-excursion - (goto-char (point-min)) - (if (and (re-search-forward - (concat "^" (regexp-quote (concat "%#" key))) nil t) - (not (eolp))) - (buffer-substring - (progn (skip-chars-forward " " (point-end-of-line))(point)) - (point-end-of-line)) - nil)) -) - -(defun YaTeX-save-buffers () - "Save buffers which is in yatex-mode." - (basic-save-buffer) - (save-excursion - (mapcar '(lambda (buf) - (set-buffer buf) - (if (and (buffer-file-name buf) - (eq major-mode 'yatex-mode) - (buffer-modified-p buf) - (y-or-n-p (format "Save %s" (buffer-name buf)))) - (save-buffer buf))) - (buffer-list))) -) - -(provide 'yatexprc) +;;; -*- Emacs-Lisp -*- +;;; YaTeX process handler. +;;; yatexprc.el +;;; (c )1993-1994 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp] +;;; Last modified Wed Dec 14 16:58:15 1994 on 98fa +;;; $Id$ + +(require 'yatex) + +(defvar YaTeX-typeset-process nil + "Process identifier for jlatex" +) +(defvar YaTeX-typeset-buffer "*YaTeX-typesetting*" + "Process buffer for jlatex") + +(defvar YaTeX-typeset-buffer-syntax nil + "*Syntax table for typesetting buffer") + +(defvar YaTeX-current-TeX-buffer nil + "Keeps the buffer on which recently typeset run.") + +(defvar YaTeX-shell-command-option + (or (and (boundp 'shell-command-option) shell-command-option) + (if YaTeX-dos "/c" "-c")) + "Shell option for command execution.") + +(if YaTeX-typeset-buffer-syntax nil + (setq YaTeX-typeset-buffer-syntax + (make-syntax-table (standard-syntax-table))) + (modify-syntax-entry ?\{ "w" YaTeX-typeset-buffer-syntax) + (modify-syntax-entry ?\} "w" YaTeX-typeset-buffer-syntax) + (modify-syntax-entry ?\[ "w" YaTeX-typeset-buffer-syntax) + (modify-syntax-entry ?\] "w" YaTeX-typeset-buffer-syntax) +) + +(defun YaTeX-typeset (command buffer) + "Execute jlatex (or other) to LaTeX typeset." + (interactive) + (save-excursion + (let ((p (point)) (window (selected-window)) execdir (cb (current-buffer))) + (if (and YaTeX-typeset-process + (eq (process-status YaTeX-typeset-process) 'run)) + ;; if tex command is halting. + (YaTeX-kill-typeset-process YaTeX-typeset-process)) + (YaTeX-visit-main t) ;;execution directory + (setq execdir default-directory) + ;;Select lower-most window if there are more than 2 windows and + ;;typeset buffer not seen. + (YaTeX-showup-buffer + buffer (function (lambda (x) (nth 3 (window-edges x))))) + (set-buffer (get-buffer-create buffer)) + (setq default-directory execdir) + (cd execdir) + (erase-buffer) + (cond + (YaTeX-dos ;if MS-DOS + (YaTeX-put-nonstopmode) + (call-process + shell-file-name nil buffer nil YaTeX-shell-command-option command) + (YaTeX-remove-nonstopmode)) + (t ;if UNIX + (set-process-buffer + (setq YaTeX-typeset-process + (start-process "LaTeX" buffer shell-file-name + YaTeX-shell-command-option command)) + (get-buffer buffer)) + (set-process-sentinel YaTeX-typeset-process 'YaTeX-typeset-sentinel))) + (message (format "Calling `%s'..." command)) + (setq YaTeX-current-TeX-buffer (buffer-name)) + (use-local-map YaTeX-typesetting-mode-map) + (set-syntax-table YaTeX-typeset-buffer-syntax) + (setq mode-name "typeset") + (if YaTeX-typeset-process ; if process is running (maybe on UNIX) + (cond ((boundp 'MULE) + (set-current-process-coding-system + YaTeX-latex-message-code YaTeX-coding-system)) + ((boundp 'NEMACS) + (set-kanji-process-code YaTeX-latex-message-code)))) + (if YaTeX-dos (message "Done.") + (insert " ") + (set-marker (process-mark YaTeX-typeset-process) (1- (point)))) + (if (bolp) (forward-line -1)) ;what for? + (if (and YaTeX-emacs-19 window-system) + (let ((win (get-buffer-window buffer t)) owin) + (select-frame (window-frame win)) + (setq owin (selected-window)) + (select-window win) + (goto-char (point-max)) + (recenter -1) + (select-window owin)) + (select-window (get-buffer-window buffer)) + (goto-char (point-max)) + (recenter -1)) + (select-window window) + (switch-to-buffer cb))) +) + +(defun YaTeX-typeset-sentinel (proc mes) + (cond ((null (buffer-name (process-buffer proc))) + ;; buffer killed + (set-process-buffer proc nil)) + ((memq (process-status proc) '(signal exit)) + (let* ((obuf (current-buffer)) (pbuf (process-buffer proc)) + (pwin (get-buffer-window pbuf)) + (owin (selected-window)) win) + ;; save-excursion isn't the right thing if + ;; process-buffer is current-buffer + (unwind-protect + (progn + ;; Write something in *typesetting* and hack its mode line + (if pwin + (select-window pwin) + (set-buffer pbuf)) + ;;(YaTeX-showup-buffer pbuf nil t) + (goto-char (point-max)) + (if pwin (recenter -3)) + (insert ?\n "latex typesetting " mes) + (forward-char -1) + (insert " at " (substring (current-time-string) 0 -5) "\n") + (forward-char 1) + (setq mode-line-process + (concat ": " + (symbol-name (process-status proc)))) + (message "latex typesetting %s." + (if (eq (process-status proc) 'exit) + "done" "ceased")) + ;; If buffer and mode line shows that the process + ;; is dead, we can delete it now. Otherwise it + ;; will stay around until M-x list-processes. + (delete-process proc) + ) + (setq YaTeX-typeset-process nil) + ;; Force mode line redisplay soon + (set-buffer-modified-p (buffer-modified-p)) + ) + (select-window owin) + (set-buffer obuf)))) +) + +(defvar YaTeX-texput-file "texput.tex" + "*File name for temporary file of typeset-region." +) + +(defun YaTeX-typeset-region () + "Paste the region to the file `texput.tex' and execute jlatex (or other) +to LaTeX typeset. The region is specified by the rule: + (1)If keyword `%#BEGIN' is found in the upper direction from (point). + (1-1)if the keyword `%#END' is found after `%#BEGIN', + ->Assume the text between `%#BEGIN' and `%#END' as region. + (1-2)if the keyword `%#END' is not found anywhere after `%#BEGIN', + ->Assume the text after `%#BEGIN' as region. + (2)If no `%#BEGIN' usage is found before the (point), + ->Assume the text between current (point) and (mark) as region. +DON'T forget to eliminate the `%#BEGIN/%#END' notation after editing +operation to the region." + (interactive) + (save-excursion + (let* + ((end "") typeout ;Type out message that tells the method of cutting. + (texput YaTeX-texput-file) + (cmd (concat (YaTeX-get-latex-command nil) " " texput)) + (buffer (current-buffer)) opoint preamble (subpreamble "") main + (hilit-auto-highlight nil) ;for Emacs19 with hilit19 + reg-begin reg-end) + + (save-excursion + (if (search-backward "%#BEGIN" nil t) + (progn + (setq typeout "--- Region from BEGIN to " + end "the end of the buffer ---" + reg-begin (match-end 0)) + (if (search-forward "%#END" nil t) + (setq reg-end (match-beginning 0) + end "END ---") + (setq reg-end (point-max)))) + (setq typeout "=== Region from (point) to (mark) ===") + (setq reg-begin (point) reg-end (mark))) + (goto-char (point-min)) + (while (search-forward "%#REQUIRE" nil t) + (setq subpreamble + (concat subpreamble + (cond + ((eolp) + (buffer-substring + (match-beginning 0) + (point-beginning-of-line))) + (t (buffer-substring + (match-end 0) + (point-end-of-line)))) + "\n")) + (goto-char (match-end 0)))) + (YaTeX-visit-main t) + (setq main (current-buffer)) + (setq opoint (point)) + (goto-char (point-min)) + (setq + preamble + (if (re-search-forward "^[ ]*\\\\begin.*{document}" nil t) + (buffer-substring (point-min) (match-end 0)) + (concat "\\documentstyle{" YaTeX-default-document-style "}\n" + "\\begin{document}"))) + (goto-char opoint) + ;;(set-buffer buffer) ;for clarity + (set-buffer (find-file-noselect texput)) + ;;(find-file YaTeX-texput-file) + (erase-buffer) + (if YaTeX-need-nonstop + (insert "\\nonstopmode{}\n")) + (insert preamble "\n" subpreamble "\n") + (insert-buffer-substring buffer reg-begin reg-end) + (insert "\\typeout{" typeout end "}\n") ;Notice the selected method. + (insert "\n\\end{document}\n") + (basic-save-buffer) + (kill-buffer (current-buffer)) + (set-buffer main) ;return to parent file or itself. + (YaTeX-typeset cmd YaTeX-typeset-buffer) + (switch-to-buffer buffer) ;for Emacs-19 + (put 'dvi2-command 'region t))) +) + +(defun YaTeX-typeset-buffer () + "Typeset whole buffer. If %#! usage says other buffer is main text, +visit main buffer to confirm if its includeonly list contains current +buffer's file. And if it doesn't contain editing text, ask user which +action wants to be done, A:Add list, R:Replace list, %:comment-out list." + (interactive) + (YaTeX-save-buffers) + (let*((me (substring (buffer-name) 0 (rindex (buffer-name) ?.))) + (mydir (file-name-directory (buffer-file-name))) + (cmd (YaTeX-get-latex-command t)) (cb (current-buffer))) + (if (YaTeX-main-file-p) nil + (save-excursion + (YaTeX-visit-main t) ;search into main buffer + (save-excursion + (push-mark (point) t) + (goto-char (point-min)) + (if (and (re-search-forward "^[ ]*\\\\begin{document}" nil t) + (re-search-backward "^[ ]*\\\\includeonly{" nil t)) + (let* + ((b (progn (skip-chars-forward "^{") (point))) + (e (progn (skip-chars-forward "^}") (1+ (point)))) + (s (buffer-substring b e)) c + (pardir (file-name-directory (buffer-file-name)))) + (if (string-match (concat "[{,/]" me "[,}]") s) + nil ; Nothing to do when it's already in includeonly. + (ding) + (switch-to-buffer (current-buffer));Display this buffer. + (setq + me ;;Rewrite my name(me) to contain sub directory name. + (concat + (if (string-match pardir mydir) ;if mydir is child of main + (substring mydir (length pardir)) ;cut absolute path + mydir) ;else concat absolute path name. + me)) + (message + "`%s' is not in \\includeonly. A)dd R)eplace %%)comment? " + me) + (setq c (read-char)) + (cond + ((= c ?a) + (goto-char (1+ b)) + (insert me (if (string= s "{}") "" ","))) + ((= c ?r) + (delete-region (1+ b) (1- e)) (insert me)) + ((= c ?%) + (beginning-of-line) (insert "%")) + (t nil)) + (basic-save-buffer)))) + (exchange-point-and-mark))) + (switch-to-buffer cb)) ;for 19 + (YaTeX-typeset cmd YaTeX-typeset-buffer) + (put 'dvi2-command 'region nil)) +) + +(defvar YaTeX-call-command-history nil + "Holds history list of YaTeX-call-command-on-file.") +(put 'YaTeX-call-command-history 'no-default t) +(defun YaTeX-call-command-on-file (base-cmd buffer) + (YaTeX-save-buffers) + (YaTeX-typeset + (read-string-with-history + "Call command: " + (concat base-cmd " " (YaTeX-get-preview-file-name)) + 'YaTeX-call-command-history) + buffer) +) + +(defun YaTeX-bibtex-buffer (cmd) + "Pass the bibliography data of editing file to bibtex." + (interactive) + (YaTeX-save-buffers) + (YaTeX-call-command-on-file cmd "*YaTeX-bibtex*" ) +) + +(defun YaTeX-kill-typeset-process (proc) + "Kill process PROC after sending signal to PROC. +PROC should be process identifier." + (cond + (YaTeX-dos + (error "MS-DOS can't have concurrent process.")) + ((or (null proc) (not (eq (process-status proc) 'run))) + (message "Typesetting process is not running.")) + (t + (save-excursion + (set-buffer (process-buffer proc)) + (save-excursion + (goto-char (point-max)) + (beginning-of-line) + (if (looking-at "\\? +$") + (let ((mp (point-max))) + (process-send-string proc "x\n") + (while (= mp (point-max)) (sit-for 1)))))) + (if (eq (process-status proc) 'run) + (progn + (interrupt-process proc) + (delete-process proc))))) +) + +(defun YaTeX-system (command buffer) + "Execute some command on buffer. Not a official function." + (save-excursion + (YaTeX-showup-buffer + buffer (function (lambda (x) (nth 3 (window-edges x))))) + (set-buffer (get-buffer-create buffer)) + (erase-buffer) + (if YaTeX-dos + (call-process + shell-file-name nil buffer nil YaTeX-shell-command-option command) + (set-process-buffer + (start-process + "system" buffer shell-file-name YaTeX-shell-command-option command) + (get-buffer buffer)))) +) + +(defvar YaTeX-preview-command-history nil + "Holds minibuffer history of preview command.") +(put 'YaTeX-preview-command-history 'no-default t) +(defvar YaTeX-preview-file-history nil + "Holds minibuffer history of file to preview.") +(put 'YaTeX-preview-file-history 'no-default t) +(defun YaTeX-preview (preview-command preview-file) + "Execute xdvi (or other) to tex-preview." + (interactive + (list + (read-string-with-history + "Preview command: " dvi2-command 'YaTeX-preview-command-history) + (read-string-with-history + "Preview file[.dvi]: " + (if (get 'dvi2-command 'region) + (substring YaTeX-texput-file + 0 (rindex YaTeX-texput-file ?.)) + (YaTeX-get-preview-file-name)) + 'YaTeX-preview-file-history))) + (setq dvi2-command preview-command) ;`dvi2command' is buffer local + (save-excursion + (YaTeX-visit-main t) + (let ((pbuffer "*dvi-preview*") (dir default-directory)) + (YaTeX-showup-buffer + pbuffer (function (lambda (x) (nth 3 (window-edges x))))) + (set-buffer (get-buffer-create pbuffer)) + (erase-buffer) + (setq default-directory dir) ;for 18 + (cd dir) ;for 19 + (cond + (YaTeX-dos ;if MS-DOS + (send-string-to-terminal "\e[2J\e[>5h") ;CLS & hide cursor + (call-process shell-file-name "con" "*dvi-preview*" nil + YaTeX-shell-command-option preview-command preview-file) + (send-string-to-terminal "\e[>5l") ;show cursor + (redraw-display)) + (t ;if UNIX + (set-process-buffer + (start-process "preview" "*dvi-preview*" shell-file-name + YaTeX-shell-command-option + (concat preview-command " " preview-file)) + (get-buffer pbuffer)) + (message + (concat "Starting " preview-command + " to preview " preview-file)))))) +) + +(defun YaTeX-prev-error () + "Visit previous typeset error. + To avoid making confliction of line numbers by editing, jump to +error or warning lines in reverse order." + (interactive) + (let ((cur-buf (buffer-name)) (cur-win (selected-window)) + error-line typeset-win error-buffer error-win) + (if (null (get-buffer YaTeX-typeset-buffer)) + (error "There is no typesetting buffer.")) + (YaTeX-showup-buffer YaTeX-typeset-buffer nil t) + (setq typeset-win (selected-window)) + (if (re-search-backward + (concat "\\(" latex-error-regexp "\\)\\|\\(" + latex-warning-regexp "\\)") + nil t) + nil + (select-window cur-win) + (error "No more erros on %s" cur-buf)) + (goto-char (match-beginning 0)) + (skip-chars-forward "^0-9" (match-end 0)) + (setq error-line + (string-to-int + (buffer-substring + (point) + (progn (skip-chars-forward "0-9" (match-end 0)) (point)))) + error-buffer (YaTeX-get-error-file cur-buf) + error-win (get-buffer-window error-buffer)) + (if (or (null error-line) (equal 0 error-line)) + (error "Can't detect error position.")) + (select-window cur-win) + (cond + (error-win (select-window error-win)) + ((eq (get-lru-window) typeset-win) + (YaTeX-switch-to-buffer error-buffer)) + (t (select-window (get-lru-window)) + (YaTeX-switch-to-buffer error-buffer))) + (setq error-win (selected-window)) + (goto-line error-line) + (message "LaTeX %s in `%s' on line: %d." + (if (match-beginning 1) "error" "warning") + error-buffer error-line) + (select-window typeset-win) + (skip-chars-backward "0-9") + (recenter (/ (window-height) 2)) + (sit-for 3) + (goto-char (match-beginning 0)) + (select-window error-win)) +) + +(defun YaTeX-jump-error-line () + "Jump to corresponding line on latex command's error message." + (interactive) + (let (error-line error-file error-buf) + (save-excursion + (beginning-of-line) + (setq error-line (re-search-forward "l[ ines]*\\.?\\([1-9][0-9]*\\)" + (point-end-of-line) t))) + (if (null error-line) + (if (eobp) (insert (this-command-keys)) + (error "No line number expression.")) + (goto-char (match-beginning 0)) + (setq error-line (string-to-int + (buffer-substring (match-beginning 1) (match-end 1))) + error-file (YaTeX-get-error-file YaTeX-current-TeX-buffer) + error-buf (YaTeX-switch-to-buffer error-file t)) + (if (null error-buf) + (error "`%s' is not found in this directory." error-file)) + (YaTeX-showup-buffer error-buf nil t) + (goto-line error-line))) +) + +(defun YaTeX-send-string () + "Send string to current typeset process." + (interactive) + (if (and (eq (process-status YaTeX-typeset-process) 'run) + (>= (point) (process-mark YaTeX-typeset-process))) + (let ((b (process-mark YaTeX-typeset-process)) + (e (point-end-of-line))) + (goto-char b) + (skip-chars-forward " \t" e) + (setq b (point)) + (process-send-string + YaTeX-typeset-process (concat (buffer-substring b e) "\n")) + (goto-char e) + (insert "\n") + (set-marker (process-mark YaTeX-typeset-process) (point)) + (insert " ")) + (ding)) +) + +(defun YaTeX-view-error () + (interactive) + (if (null (get-buffer YaTeX-typeset-buffer)) + (message "No typeset buffer found.") + (let ((win (selected-window))) + (YaTeX-showup-buffer YaTeX-typeset-buffer nil t) + ;; Next 3 lines are obsolete because YaTeX-typesetting-buffer is + ;; automatically scrolled up at typesetting. + ;;(goto-char (point-max)) + ;;(forward-line -1) + ;;(recenter -1) + (select-window win))) +) + +(defun YaTeX-get-error-file (default) + "Get current processing file from typesetting log." + (save-excursion + (let(s) + (condition-case () (up-list -1) + (error + (let ((list 0) found) + (while + (and (<= list 0) (not found) + (re-search-backward "\\((\\)\\|\\()\\)" nil t)) + (if (equal (match-beginning 0) (match-beginning 2)) ;close paren. + (setq list (1- list)) ;open paren + (setq list (1+ list)) + (if (= list 1) + (if (looking-at "\\([^,{}%]+\.\\)tex\\|sty") + (setq found t) + (setq list (1- list))))))))) + (setq s + (buffer-substring + (progn (forward-char 1) (point)) + (progn (skip-chars-forward "^ \n" (point-end-of-line)) + (point)))) + (if (string= "" s) default s))) +) + +(defun YaTeX-put-nonstopmode () + (if YaTeX-need-nonstop + (if (re-search-backward "\\\\nonstopmode{}" (point-min) t) + nil ;if already written in text then do nothing + (save-excursion + (YaTeX-visit-main t) + (goto-char (point-min)) + (insert "\\nonstopmode{}%_YaTeX_%\n"))) + ) +) + +(defun YaTeX-remove-nonstopmode () + (if YaTeX-need-nonstop ;for speed + (save-excursion + (YaTeX-visit-main t) + (goto-char (point-min)) + (forward-line 1) + (narrow-to-region (point-min) (point)) + (goto-char (point-min)) + (delete-matching-lines "^\\\\nonstopmode\\{\\}%_YaTeX_%$") + (widen))) +) + +(defun YaTeX-get-preview-file-name () + "Get file name to preview by inquiring YaTeX-get-latex-command" + (let* ((latex-cmd (YaTeX-get-latex-command t)) + (rin (rindex latex-cmd ? )) + (fname (if (> rin -1) (substring latex-cmd (1+ rin)) "")) + (period)) + (if (string= fname "") + (setq fname (substring (file-name-nondirectory + (buffer-file-name)) + 0 -4)) + (setq period (rindex fname ?.)) + (setq fname (substring fname 0 (if (eq -1 period) nil period))) + )) +) + +(defun YaTeX-get-latex-command (&optional switch) + "Specify the latex-command name and its argument. +If there is a line which begins with string: \"%#!\", the following +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 +will be the latex-command, +and you write \"%#!jlatex main.tex\" on some line and argument SWITCH +is non-nil, then + \"jlatex main.tex\" + +will be given to the shell." + (let (magic command target) + (setq parent + (cond + (YaTeX-parent-file YaTeX-parent-file) + (t (save-excursion + (YaTeX-visit-main t) + (file-name-nondirectory (buffer-file-name))))) + magic (YaTeX-get-builtin "!")) + (cond + (magic + (cond + (switch (if (string-match "\\s " magic) magic + (concat magic " " parent))) + (t (concat (substring magic 0 (string-match "\\s " magic)) " ")))) + (t (concat tex-command " " (if switch parent))))) +) + +(defvar YaTeX-lpr-command-history nil + "Holds command line history of YaTeX-lpr.") +(put 'YaTeX-lpr-command-history 'no-default t) +(defun YaTeX-lpr (arg) + "Print out. If prefix arg ARG is non nil, call print driver without +page range description." + (interactive "P") + (let*((cmd (or (YaTeX-get-builtin "LPR") dviprint-command-format)) + from to (lbuffer "*dvi-printing*")) + (setq + cmd + (YaTeX-replace-format + cmd "f" + (if (or arg (not (string-match "%f" cmd))) + "" + (YaTeX-replace-format + dviprint-from-format + "b" + (if (string= + (setq from (read-string "From page(default 1): ")) "") + "1" from)))) + ) + (setq + cmd + (YaTeX-replace-format + cmd "t" + (if (or arg (not (string-match "%t" cmd)) + (string= + (setq to (read-string "To page(default none): ")) "")) + "" + (YaTeX-replace-format dviprint-to-format "e" to))) + ) + (setq cmd + (read-string-with-history + "Edit command line: " + (format cmd (YaTeX-get-preview-file-name)) + 'YaTeX-lpr-command-history)) + (save-excursion + (YaTeX-visit-main t) ;;change execution directory + (YaTeX-showup-buffer + lbuffer (function (lambda (x) (nth 3 (window-edges x))))) + (set-buffer (get-buffer-create lbuffer)) + (erase-buffer) + (cond + (YaTeX-dos + (call-process shell-file-name "con" "*dvi-printing*" nil + YaTeX-shell-command-option cmd)) + (t + (set-process-buffer + (start-process "print" "*dvi-printing*" shell-file-name + YaTeX-shell-command-option cmd) + (get-buffer lbuffer)) + (message "Starting printing command: %s..." cmd))) + )) +) + +(defun YaTeX-main-file-p () + "Return if current buffer is main LaTeX source." + (cond + ((YaTeX-get-builtin "!") + (string-match (YaTeX-guess-parent (YaTeX-get-builtin "!")) (buffer-name))) + (t + (save-excursion + (let ((latex-main-id (concat "^\\s *" YaTeX-ec-regexp "documentstyle"))) + (or (re-search-backward latex-main-id nil t) + (re-search-forward latex-main-id nil t)))))) +) + +(defun YaTeX-visit-main (&optional setbuf) + "Switch buffer to main LaTeX source. +Use set-buffer instead of switch-to-buffer if the optional second argument +SETBUF is t(Use it only from Emacs-Lisp program)." + (interactive "P") + (if (and (interactive-p) setbuf) (setq YaTeX-parent-file nil)) + (let (b-in main-file) + (if (setq b-in (YaTeX-get-builtin "!")) + (setq main-file (YaTeX-guess-parent b-in))) + (if YaTeX-parent-file + (setq main-file ;;(get-file-buffer YaTeX-parent-file) + YaTeX-parent-file)) + (if (YaTeX-main-file-p) + (if (interactive-p) (message "I think this is main LaTeX source.") nil) + (cond + ((and (interactive-p) main-file (get-file-buffer main-file)) + (goto-buffer-window main-file)) + ((and main-file (YaTeX-switch-to-buffer main-file setbuf))) + ((and main-file + (file-exists-p (setq main-file (concat "../" main-file))) + (y-or-n-p (concat (expand-file-name main-file) + " is main file?:"))) + (setq YaTeX-parent-file main-file) + (YaTeX-switch-to-buffer main-file setbuf)) + (t (setq main-file (read-file-name "Enter your main text: " nil nil 1)) + (setq YaTeX-parent-file main-file) + (YaTeX-switch-to-buffer main-file setbuf)) + ))) + nil +) + + +(defun YaTeX-guess-parent (command-line) + (setq command-line + (if (string-match ".*\\s " command-line) + (substring command-line (match-end 0)) + (file-name-nondirectory (buffer-file-name))) + command-line + (concat (if (string-match "\\(.*\\)\\." command-line) + (substring command-line (match-beginning 1) (match-end 1)) + command-line) + ".tex")) +) + +(defun YaTeX-visit-main-other-window () + "Switch to buffer main LaTeX source in other window." + (interactive) + (if (YaTeX-main-file-p) (message "I think this is main LaTeX source.") + (YaTeX-switch-to-buffer-other-window + (concat (YaTeX-get-preview-file-name) ".tex"))) +) + +(defun YaTeX-get-builtin (key) + "Read source built-in command of %# usage." + (save-excursion + (goto-char (point-min)) + (if (and (re-search-forward + (concat "^" (regexp-quote (concat "%#" key))) nil t) + (not (eolp))) + (buffer-substring + (progn (skip-chars-forward " " (point-end-of-line))(point)) + (point-end-of-line)) + nil)) +) + +(defun YaTeX-save-buffers () + "Save buffers which is in yatex-mode." + (basic-save-buffer) + (save-excursion + (mapcar '(lambda (buf) + (set-buffer buf) + (if (and (buffer-file-name buf) + (eq major-mode 'yatex-mode) + (buffer-modified-p buf) + (y-or-n-p (format "Save %s" (buffer-name buf)))) + (save-buffer buf))) + (buffer-list))) +) + +(provide 'yatexprc)