yatex

annotate docs/yatexe.tex @ 72:0aaebd07dad0

Support font-lock on XEmacs-21, Emacs-20, Emacs-21. Support Emacs-21.
author yuuji
date Mon, 25 Dec 2000 10:19:28 +0000
parents 44e3a5e1e883
children f41b01fef5d6
rev   line source
yuuji@46 1 \def\lang{jp} % -*- texinfo -*-
yuuji@20 2 \input texinfo.tex
yuuji@20 3 @setfilename yatexe
yuuji@20 4 @settitle Yet Another tex-mode for Emacs
yuuji@20 5
yuuji@20 6 @iftex
yuuji@46 7 @c @syncodeindex fn cp
yuuji@72 8 @c Last modified Fri Dec 22 09:50:10 2000 on buell
yuuji@20 9 @syncodeindex vr cp
yuuji@20 10 @end iftex
yuuji@20 11
yuuji@20 12 @titlepage
yuuji@20 13 @sp 10
yuuji@20 14 @center
yuuji@20 15 @subtitle Yet Another tex-mode for emacs
yuuji@20 16 @title Wild Bird
yuuji@20 17 @subtitle // YaTeX //
yuuji@70 18 @author @copyright{} 1991-1996 by HIROSE, Yuuji [yuuji@@yatex.org]
yuuji@20 19 @end titlepage
yuuji@20 20
yuuji@20 21 @node Top, What is YaTeX?, (dir), (dir)
yuuji@20 22 @comment node-name, next, previous, up
yuuji@20 23 @cindex Demacs
yuuji@20 24 @cindex Mule
yuuji@20 25 @cindex LaTeX
yuuji@20 26 @cindex YaTeX
yuuji@20 27
yuuji@20 28 @menu
yuuji@58 29 * What is YaTeX?::
yuuji@51 30 * Main features:: What YaTeX can do
yuuji@51 31 * Installation:: Guide to install
yuuji@51 32 * Typesetting:: Call typesetting processes
yuuji@68 33 * %#notation::
yuuji@51 34 * Completion:: Input LaTeX commands with completion
yuuji@51 35 * Local dictionaries:: Directory dependent completion
yuuji@51 36 * Commenting out:: Commenting/uncommenting text
yuuji@51 37 * Cursor jump:: Jumping to related position
yuuji@51 38 * Changing and Deleting:: Changing/deleting certain unit of text
yuuji@51 39 * Filling:: Filling an item or paragraph
yuuji@53 40 * Updation of includeonly:: Free from maintaining includeonly
yuuji@59 41 * What column:: Check what table-column the cursor belong
yuuji@51 42 * Intelligent newline:: Guess requisites of new line
yuuji@51 43 * Online help:: On-line documentation of LaTeX
yuuji@53 44 * Browsing file hierarchy:: Walking through file hierarchy
yuuji@51 45 * Cooperation with other packages:: Work well with gmhist, min-out
yuuji@51 46 * Customizations:: How to breed `Wild Bird'
yuuji@51 47 * Etcetera:: YaTeX is acquisitive.
yuuji@51 48 * Copying:: Redistribution
yuuji@20 49
yuuji@20 50 --- The Detailed Node Listing ---
yuuji@20 51
yuuji@58 52 Typesetting
yuuji@58 53
yuuji@58 54 * Calling typesetter::
yuuji@58 55 * Calling previewer::
yuuji@58 56 * Printing out::
yuuji@58 57
yuuji@20 58 %# notation
yuuji@20 59
yuuji@20 60 * Changing typesetter::
yuuji@20 61 * Static region for typesetting::
yuuji@20 62 * Lpr format::
yuuji@20 63 * Editing %# notation::
yuuji@20 64
yuuji@20 65 Completion
yuuji@20 66
yuuji@20 67 * Begin-type completion::
yuuji@20 68 * Section-type completion::
yuuji@20 69 * Large-type completion::
yuuji@20 70 * Maketitle-type completion::
yuuji@20 71 * Arbitrary completion::
yuuji@20 72 * End completion::
yuuji@20 73 * Accent completion::
yuuji@20 74 * Image completion::
yuuji@20 75 * Greek letters completion::
yuuji@20 76
yuuji@20 77 Section-type completion
yuuji@20 78
yuuji@20 79 * view-sectioning::
yuuji@20 80
yuuji@68 81 Cursor jump
yuuji@68 82
yuuji@68 83 * Jump to corresponding object::
yuuji@68 84 * Invoking image processor::
yuuji@68 85 * Jump to main file::
yuuji@68 86 * Jumping around the environment::
yuuji@68 87 * Jumping to last completion position::
yuuji@68 88
yuuji@49 89 Changing and Deleting
yuuji@49 90
yuuji@68 91 * Changing LaTeX commands::
yuuji@68 92 * Killing LaTeX commands::
yuuji@49 93
yuuji@20 94 Customizations
yuuji@20 95
yuuji@20 96 * Lisp variables::
yuuji@20 97 * Add-in functions::
yuuji@49 98 * Add-in generator::
yuuji@20 99
yuuji@20 100 Lisp variables
yuuji@20 101
yuuji@20 102 * All customizable variables::
yuuji@20 103 * Sample definitions::
yuuji@20 104 * Hook variables::
yuuji@20 105 * Hook file::
yuuji@49 106
yuuji@49 107 Procedure
yuuji@49 108
yuuji@58 109 * How the add-in function works::
yuuji@49 110 * How the function is called::
yuuji@49 111 * Useful functions for creating add-in::
yuuji@49 112 * Contribution::
yuuji@49 113
yuuji@58 114 How the add-in function works
yuuji@49 115
yuuji@68 116 * Defining option-add-in::
yuuji@68 117 * Defining argument-add-in::
yuuji@20 118 @end menu
yuuji@20 119
yuuji@20 120 @node What is YaTeX?, Main features, Top, Top
yuuji@20 121 @comment node-name, next, previous, up
yuuji@20 122 @chapter What is YaTeX?
yuuji@20 123
yuuji@20 124 YaTeX automates typesetting and previewing of LaTeX and enables
yuuji@20 125 completing input of LaTeX mark-up command such as
yuuji@20 126 @code{\begin@{@}}..@code{\end@{@}}.
yuuji@20 127
yuuji@20 128 YaTeX also supports Demacs which runs on MS-DOS(386), Mule (Multi
yuuji@20 129 Language Enhancement to GNU Emacs), and latex on DOS.
yuuji@20 130
yuuji@20 131 @node Main features, Installation, What is YaTeX?, Top
yuuji@20 132 @comment node-name, next, previous, up
yuuji@20 133 @chapter Main features
yuuji@20 134
yuuji@20 135 @itemize
yuuji@46 136 @item Invocation of typesetter, previewer and related programs(@kbd{C-c t})
yuuji@20 137 @item Typesetting on static region which is independent from point
yuuji@60 138 @item Semiautomatic replacing of @code{\includeonly}
yuuji@20 139 @item Jumping to error line(@kbd{C-c '})
yuuji@20 140 @item Completing-read of La@TeX{} commands such as @code{\begin@{@}},
yuuji@20 141 @code{\section} etc.
yuuji@20 142 (@kbd{C-c b}, @kbd{C-c s}, @kbd{C-c l}, @kbd{C-c m})
yuuji@20 143 @item Enclosing text into La@TeX{} environments or commands
yuuji@20 144 (@kbd{C-u} @var{AboveKeyStrokes})
yuuji@59 145 @item Displaying the structure of text at entering sectioning commands
yuuji@59 146 @item Lump shifting of sectioning commands (@ref{view-sectioning})
yuuji@20 147 @item Learning unknown/new La@TeX{} commands for the next completion
yuuji@20 148 @item Argument reading with a guide for complicated La@TeX{} commands
yuuji@20 149 @item Generating argument-readers for new/unsupported commands(@file{yatexgen})
yuuji@20 150 @item Quick changing or deleting of La@TeX{} commands(@kbd{C-c c}, @kbd{C-c k})
yuuji@20 151 @item Jumping from and to inter-file, begin<->end, ref<->label(@kbd{C-c g})
yuuji@20 152 @item Blanket commenting out or uncommenting
yuuji@20 153 (@kbd{C-c >}, @kbd{C-c <}, @kbd{C-c ,}, @kbd{C-c .})
yuuji@20 154 @item Easy input of accent mark, math-mode's commands and Greek letters
yuuji@52 155 (@kbd{C-c a}, @kbd{;}, @kbd{:})
yuuji@20 156 @item Online help for the popular La@TeX{} commands
yuuji@58 157 (@kbd{C-c ?}, @kbd{C-c /})
yuuji@53 158 @item Document files hierarchy browser (@kbd{C-c d})
yuuji@20 159 @end itemize
yuuji@20 160
yuuji@20 161 @node Installation, Typesetting, Main features, Top
yuuji@20 162 @comment node-name, next, previous, up
yuuji@20 163 @chapter Installation
yuuji@20 164 @cindex installation
yuuji@20 165 @cindex .emacs
yuuji@20 166 @cindex auto-mode-alist
yuuji@20 167 @cindex autoload
yuuji@20 168
yuuji@20 169 Put next two expressions into your @file{~/.emacs}.
yuuji@20 170
yuuji@20 171 @lisp
yuuji@20 172 (setq auto-mode-alist
yuuji@46 173 (cons (cons "\\.tex$" 'yatex-mode) auto-mode-alist))
yuuji@20 174 (autoload 'yatex-mode "yatex" "Yet Another La@TeX{} mode" t)
yuuji@20 175 @end lisp
yuuji@20 176
yuuji@20 177 Next, add certain path name where you put files of YaTeX to your
yuuji@20 178 load-path. If you want to put them in @file{~/src/emacs}, write
yuuji@20 179
yuuji@20 180 @lisp
yuuji@20 181 (setq load-path
yuuji@20 182 (cons (expand-file-name "~/src/emacs") load-path))
yuuji@20 183 @end lisp
yuuji@20 184
yuuji@20 185 @noindent
yuuji@20 186 in your @file{~/.emacs}
yuuji@20 187
yuuji@20 188 Then, yatex-mode will be automatically loaded when you visit a
yuuji@20 189 file which has extension @file{.tex}. If yatex-mode is successfully
yuuji@20 190 loaded, mode string on mode line will be turned to "YaTeX".
yuuji@20 191
yuuji@20 192
yuuji@68 193 @node Typesetting, %#notation, Installation, Top
yuuji@20 194 @comment node-name, next, previous, up
yuuji@20 195 @chapter Typesetting
yuuji@20 196 @cindex typesetting
yuuji@20 197 @cindex previewer
yuuji@20 198 @cindex typesetter
yuuji@20 199 @cindex latex
yuuji@20 200 @cindex printing out
yuuji@20 201
yuuji@20 202 The prefix key stroke of yatex-mode is @kbd{C-c} (Press 'C' with Control
yuuji@20 203 key) by default. If you don't intend to change the prefix key stroke,
yuuji@20 204 assume all @kbd{[prefix]} as @kbd{C-c} in this document. These key
yuuji@20 205 strokes execute typeset or preview command.
yuuji@20 206
yuuji@20 207 @table @kbd
yuuji@58 208 @item [prefix] t j
yuuji@46 209 @dots{} invoke latex
yuuji@58 210 @item [prefix] t r
yuuji@46 211 @dots{} invoke latex on region
yuuji@58 212 @item [prefix] t k
yuuji@46 213 @dots{} kill current typesetting process
yuuji@58 214 @item [prefix] t b
yuuji@46 215 @dots{} invoke bibtex
yuuji@58 216 @item [prefix] t p
yuuji@46 217 @dots{} preview
yuuji@58 218 @item [prefix] t l
yuuji@46 219 @dots{} lpr dvi-file
yuuji@58 220 @item [prefix] t s
yuuji@58 221 @dots{} search current string on xdvi-remote
yuuji@20 222 @end table
yuuji@20 223
yuuji@58 224 @menu
yuuji@58 225 * Calling typesetter::
yuuji@58 226 * Calling previewer::
yuuji@58 227 * Printing out::
yuuji@58 228 @end menu
yuuji@58 229
yuuji@58 230 @node Calling typesetter, Calling previewer, Typesetting, Typesetting
yuuji@58 231 @comment node-name, next, previous, up
yuuji@68 232 @section Calling typesetter
yuuji@58 233
yuuji@58 234 Typing @kbd{[prefix] t j}, the current editing window will be divided
yuuji@58 235 horizontally when you invoke latex command, and log message of La@TeX{}
yuuji@58 236 typesetting will be displayed in the other window; called typesetting
yuuji@58 237 buffer. The typesetting buffer automatically scrolls up and traces
yuuji@58 238 La@TeX{} warnings and error messages. If you see latex stopping by an
yuuji@20 239 error, you can send string to latex in the typesetting buffer.
yuuji@20 240
yuuji@20 241 If an error stops the La@TeX{} typesetting, this key stroke will
yuuji@20 242 move the cursor to the line where La@TeX{} error is detected.
yuuji@20 243
yuuji@20 244 @table @kbd
yuuji@20 245 @item [prefix] '
yuuji@20 246 @itemx ([prefix]+single quotation)
yuuji@20 247
yuuji@46 248 @dots{} jump to the previous error or warning
yuuji@20 249 @end table
yuuji@20 250
yuuji@20 251 If you find a noticeable error, move to the typesetting buffer and move
yuuji@20 252 the cursor on the line of error message and type @kbd{SPACE} key. This
yuuji@20 253 makes the cursor move to corresponding source line.
yuuji@20 254
yuuji@20 255 Since @kbd{[prefix] tr} pastes the region into the file
yuuji@20 256 @file{texput.tex} in the current directory, you should be careful of
yuuji@20 257 overwriting. The method of specification of the region is shown in the
yuuji@68 258 section @xref{%#notation}.
yuuji@20 259
yuuji@20 260 The documentstyle for typeset-region is the same as that of editing
yuuji@20 261 file if you edit one file, and is the same as main file's if you
yuuji@20 262 edit splitting files.
yuuji@20 263
yuuji@58 264 @node Calling previewer, Printing out, Calling typesetter, Typesetting
yuuji@58 265 @comment node-name, next, previous, up
yuuji@68 266 @section Calling previewer
yuuji@58 267
yuuji@58 268 @kbd{[prefix] t p} invokes the TeX previewer. And if you are using
yuuji@58 269 xdvi-remote, which can be controled from other terminals, @kbd{[prefix] t
yuuji@58 270 s} enables you to search current string at the cursor on the running xdvi
yuuji@72 271 window.
yuuji@58 272
yuuji@58 273 @node Printing out, , Calling previewer, Typesetting
yuuji@58 274 @comment node-name, next, previous, up
yuuji@68 275 @section Printing out
yuuji@58 276
yuuji@58 277 When you type @code{[preifx] t l}, YaTeX asks you the range of
yuuji@58 278 dvi-printing by default. You can skip this by invoking it with
yuuji@58 279 universal-argument as follows:
yuuji@20 280
yuuji@20 281 @example
yuuji@49 282 C-u [prefix] tl
yuuji@20 283 @end example
yuuji@20 284
yuuji@68 285 @node %#notation, Completion, Typesetting, Top
yuuji@20 286 @comment node-name, next, previous, up
yuuji@20 287 @chapter %# notation
yuuji@20 288 @cindex %# notation
yuuji@20 289
yuuji@20 290 You can control the typesetting process by describing @code{%#}
yuuji@20 291 notations in the source text.
yuuji@20 292
yuuji@20 293 @menu
yuuji@20 294 * Changing typesetter::
yuuji@70 295 * Splitting input files::
yuuji@20 296 * Static region for typesetting::
yuuji@20 297 * Lpr format::
yuuji@20 298 * Editing %# notation::
yuuji@20 299 @end menu
yuuji@20 300
yuuji@70 301 @node Changing typesetter, Splitting input files, %#notation, %#notation
yuuji@20 302 @comment node-name, next, previous, up
yuuji@20 303 @section To change the `latex' command or to split a source text.
yuuji@20 304 @cindex typesetter
yuuji@20 305
yuuji@20 306 To change the typesetting command, write
yuuji@20 307
yuuji@20 308 @example
yuuji@46 309 %#!latex-big
yuuji@20 310 @end example
yuuji@20 311
yuuji@20 312 @noindent
yuuji@51 313 anywhere in the source text. This is useful for changing
yuuji@51 314 typesetter.
yuuji@51 315
yuuji@68 316 @node Splitting input files, Static region for typesetting, Changing typesetter, %#notation
yuuji@51 317 @comment node-name, next, previous, up
yuuji@70 318 @section Splitting input files
yuuji@51 319
yuuji@51 320 And if you split the source text and
yuuji@20 321 edit subfile that should be included from main text.
yuuji@20 322
yuuji@20 323 @example
yuuji@46 324 %#!latex main.tex
yuuji@20 325 @end example
yuuji@20 326
yuuji@20 327 @noindent
yuuji@20 328 will be helpful to execute latex on main file from sub text buffer. Since
yuuji@20 329 this command line after @kbd{%#!} will be sent to shell literally, next
yuuji@20 330 description makes it convenient to use ghostview as dvi-previewer.
yuuji@20 331
yuuji@20 332 @example
yuuji@46 333 %#!latex main ; dvi2ps main.dvi > main
yuuji@20 334 @end example
yuuji@20 335
yuuji@20 336 @noindent
yuuji@20 337 Note that YaTeX assumes the component before the last period of
yuuji@20 338 the last word in this line as base name of the main La@TeX{} source.
yuuji@20 339
yuuji@51 340 To make best use of the feature of inter-file jumping by
yuuji@51 341 @kbd{[prefix] g} (see @ref{Cursor jump}), take described below into
yuuji@51 342 consideration.
yuuji@20 343
yuuji@20 344 @itemize
yuuji@20 345 @item You can put split texts in sub directory, but not in
yuuji@20 346 sub directory of sub directory.
yuuji@51 347 @item In the main text, specify the child file name with relative path name
yuuji@70 348 such as \include@{chap1/sub@}, when you include the file in
yuuji@20 349 a sub-directory.
yuuji@20 350 @item In a sub-text, write @code{%#!latex main.tex} even if @file{main.tex}
yuuji@20 351 is in the parent directory(not %#!latex ../main.tex).
yuuji@20 352 @end itemize
yuuji@20 353
yuuji@70 354 @node Static region for typesetting, Lpr format, Splitting input files, %#notation
yuuji@20 355 @comment node-name, next, previous, up
yuuji@20 356 @section Static region
yuuji@20 357 @cindex static region
yuuji@20 358 @cindex Fixed region
yuuji@20 359
yuuji@20 360 Typeset-region by @kbd{[prefix] tr} passes the region between point and
yuuji@20 361 mark to typesetting command by default. But when you want to typeset
yuuji@20 362 static region, enclose the region by @code{%#BEGIN} and @code{%#END} as
yuuji@20 363 follows.
yuuji@20 364
yuuji@20 365 @example
yuuji@46 366 %#BEGIN
yuuji@46 367 TheRegionYouWantToTypesetManyTimes
yuuji@46 368 %#END
yuuji@20 369 @end example
yuuji@20 370
yuuji@20 371 This is the rule of deciding the region.
yuuji@20 372
yuuji@20 373 @enumerate
yuuji@20 374 @item
yuuji@20 375 If there exists %#BEGIN before point,
yuuji@20 376
yuuji@20 377 @enumerate
yuuji@20 378 @item
yuuji@20 379 If there exists %#END after %#BEGIN,
yuuji@20 380 @itemize
yuuji@20 381 @item From %#BEGIN to %#END.
yuuji@20 382 @end itemize
yuuji@20 383
yuuji@20 384 @item
yuuji@20 385 If %#END does not exist after %#BEGIN,
yuuji@20 386 @itemize
yuuji@20 387 @item From %#BEGIN to the end of buffer.
yuuji@20 388 @end itemize
yuuji@20 389 @end enumerate
yuuji@20 390
yuuji@20 391 @item
yuuji@20 392 If there does not exist %#BEGIN before point,
yuuji@20 393 @itemize
yuuji@20 394 @item Between point and mark(standard method of Emacs).
yuuji@20 395 @end itemize
yuuji@20 396 @end enumerate
yuuji@20 397
yuuji@20 398 It is useful to write @code{%#BEGIN} in the previous line of \begin and
yuuji@20 399 @code{%#END} in the next line of \@code{end} when you try complex
yuuji@20 400 environment such as `tabular' many times. It is also useful to put only
yuuji@20 401 @code{%#BEGIN} alone at the middle of very long text. Do not forget to
yuuji@20 402 erase @code{%#BEGIN} @code{%#END} pair.
yuuji@20 403
yuuji@68 404 @node Lpr format, Editing %# notation, Static region for typesetting, %#notation
yuuji@20 405 @comment node-name, next, previous, up
yuuji@20 406 @section Lpr format
yuuji@20 407 @cindex lpr format
yuuji@20 408
yuuji@20 409 Lpr format is specified by three Lisp variables. Here are the
yuuji@20 410 default values of them.
yuuji@20 411
yuuji@20 412 @table @code
yuuji@20 413 @item (1)dviprint-command-format
yuuji@46 414 @code{"dvi2ps %f %t %s | lpr"}
yuuji@20 415 @item (2)dviprint-from-format
yuuji@46 416 @code{"-f %b"}
yuuji@20 417 @item (3)dviprint-to-format
yuuji@46 418 @code{"-t %e"}
yuuji@20 419 @end table
yuuji@20 420
yuuji@20 421 On YaTeX-lpr, @code{%s} in (1) is replaced by the file name of main
yuuji@20 422 text, @code{%f} by contents of (2), %t by contents of (3). At these
yuuji@20 423 replacements, @code{%b} in (2) is also replaced by the number of beginning
yuuji@20 424 page, @code{%e} in (3) is replaced by the number of ending page. But
yuuji@20 425 @code{%f} and @code{%t} are ignored when you omit the range of print-out
yuuji@20 426 by @kbd{C-u [prefix] tl}.
yuuji@20 427
yuuji@20 428 If you want to change this lpr format temporarily, put a command
yuuji@20 429 such as follows somewhere in the text:
yuuji@20 430
yuuji@20 431 @example
yuuji@46 432 %#LPR dvi2ps %f %t %s | 4up -page 4 | texfix | lpr -Plp2
yuuji@20 433 @end example
yuuji@20 434
yuuji@20 435 And if you want YaTeX not to ask you the range of printing
yuuji@20 436 out, the next example may be helpful.
yuuji@20 437
yuuji@20 438 @example
yuuji@46 439 %#LPR dvi2ps %s | lpr
yuuji@20 440 @end example
yuuji@20 441
yuuji@68 442 @node Editing %# notation, , Lpr format, %#notation
yuuji@20 443 @comment node-name, next, previous, up
yuuji@20 444 @section Editing %# notation
yuuji@20 445
yuuji@20 446 To edit @code{%#} notation described above, type
yuuji@20 447
yuuji@20 448 @table @kbd
yuuji@20 449 @item [prefix] %
yuuji@46 450 @dots{} editing %# notation menu
yuuji@20 451 @end table
yuuji@20 452
yuuji@20 453 @noindent
yuuji@20 454 and select one of the entry of the menu as follows.
yuuji@20 455
yuuji@20 456 @example
yuuji@46 457 !)Edit-%#! B)EGIN-END-region L)Edit-%#LPR
yuuji@20 458 @end example
yuuji@20 459
yuuji@20 460 @noindent
yuuji@20 461 Type @kbd{!} to edit @code{%#!} entry, @code{b} to enclose the region with
yuuji@20 462 @code{%#BEGIN} and @code{%#END}, and @code{l} to edit @code{%#LPR} entry.
yuuji@20 463 When you type @kbd{b}, all @code{%#BEGIN} and @code{%#END} are
yuuji@20 464 automatically erased.
yuuji@20 465
yuuji@68 466 @node Completion, Local dictionaries, %#notation, Top
yuuji@20 467 @comment node-name, next, previous, up
yuuji@20 468 @chapter Completion
yuuji@20 469 @cindex completion
yuuji@20 470
yuuji@20 471 YaTeX makes it easy to input the La@TeX{} commands. There are several
yuuji@20 472 kinds of completion type, begin-type, section-type, large-type, etc...
yuuji@20 473
yuuji@20 474 @menu
yuuji@20 475 * Begin-type completion::
yuuji@20 476 * Section-type completion::
yuuji@20 477 * Large-type completion::
yuuji@20 478 * Maketitle-type completion::
yuuji@20 479 * Arbitrary completion::
yuuji@20 480 * End completion::
yuuji@20 481 * Accent completion::
yuuji@20 482 * Image completion::
yuuji@20 483 * Greek letters completion::
yuuji@20 484 @end menu
yuuji@20 485
yuuji@33 486 @node Begin-type completion, Section-type completion, Completion, Completion
yuuji@20 487 @comment node-name, next, previous, up
yuuji@20 488 @section Begin-type completion
yuuji@20 489 @cindex begin-type completion
yuuji@20 490 @cindex environment
yuuji@20 491 @cindex prefix b
yuuji@20 492
yuuji@20 493 "Begin-type completion" completes commands of @code{\begin@{env@}} ...
yuuji@20 494 @code{\end@{env@}}. All of the begin-type completions begin with this key
yuuji@20 495 sequence.
yuuji@20 496
yuuji@20 497 @table @kbd
yuuji@20 498 @item [prefix] b
yuuji@46 499 @dots{} start begin-type completion
yuuji@20 500 @end table
yuuji@20 501
yuuji@20 502 @noindent
yuuji@20 503 An additional key stroke immediately completes a frequently used
yuuji@20 504 La@TeX{} @code{\begin@{@}}...@code{\@code{end}@{@}} environment.
yuuji@20 505
yuuji@20 506 @table @kbd
yuuji@20 507 @item [prefix] b c
yuuji@46 508 @dots{} @code{\begin@{center@}...\end@{center@}}
yuuji@20 509 @item [prefix] b d
yuuji@46 510 @dots{} @code{\begin@{document@}...\end@{document@}}
yuuji@20 511 @item [prefix] b D
yuuji@46 512 @dots{} @code{\begin@{description@}...\end@{description@}}
yuuji@20 513 @item [prefix] b e
yuuji@46 514 @dots{} @code{\begin@{enumerate@}...\end@{enumerate@}}
yuuji@20 515 @item [prefix] b E
yuuji@46 516 @dots{} @code{\begin@{equation@}...\end@{equation@}}
yuuji@20 517 @item [prefix] b i
yuuji@46 518 @dots{} @code{\begin@{itemize@}...\end@{itemize@}}
yuuji@20 519 @item [prefix] b l
yuuji@46 520 @dots{} @code{\begin@{flushleft@}...\end@{flushleft@}}
yuuji@20 521 @item [prefix] b m
yuuji@46 522 @dots{} @code{\begin@{minipage@}...\end@{minipage@}}
yuuji@20 523 @item [prefix] b t
yuuji@46 524 @dots{} @code{\begin@{tabbing@}...\end@{tabbing@}}
yuuji@20 525 @item [prefix] b T
yuuji@46 526 @dots{} @code{\begin@{tabular@}...\end@{tabular@}}
yuuji@20 527 @item [prefix] b^T
yuuji@46 528 @dots{} @code{\begin@{table@}...\end@{table@}}
yuuji@20 529 @item [prefix] b p
yuuji@46 530 @dots{} @code{\begin@{picture@}...\end@{picture@}}
yuuji@20 531 @item [prefix] b q
yuuji@46 532 @dots{} @code{\begin@{quote@}...\end@{quote@}}
yuuji@20 533 @item [prefix] b Q
yuuji@46 534 @dots{} @code{\begin@{quotation@}...\end@{quotation@}}
yuuji@20 535 @item [prefix] b r
yuuji@46 536 @dots{} @code{\begin@{flushright@}...\end@{flushright@}}
yuuji@20 537 @item [prefix] b v
yuuji@46 538 @dots{} @code{\begin@{verbatim@}...\end@{verbatim@}}
yuuji@20 539 @item [prefix] b V
yuuji@46 540 @dots{} @code{\begin@{verse@}...\end@{verse@}}
yuuji@20 541 @end table
yuuji@20 542
yuuji@20 543 Any other La@TeX{} environments are made by completing-read of the
yuuji@20 544 Emacs function.
yuuji@20 545
yuuji@20 546 @table @kbd
yuuji@20 547 @item [prefix] b SPACE
yuuji@46 548 @dots{} begin-type completion
yuuji@20 549 @end table
yuuji@20 550
yuuji@20 551 @noindent
yuuji@20 552 The next message will show up in the minibuffer
yuuji@20 553
yuuji@20 554 @example
yuuji@46 555 Begin environment(default document):
yuuji@20 556 @end example
yuuji@20 557
yuuji@20 558 @noindent
yuuji@20 559 by typing @kbd{[prefix] b}. Put the wishing environment with completion
yuuji@20 560 in the minibuffer, and @code{\begin@{env@}}...\@code{\end@{env@}} will be
yuuji@20 561 inserted in the La@TeX{} source text. If the environment you want to put
yuuji@20 562 does not exist in the YaTeX completion table, it will be registered in the
yuuji@20 563 user completion table. YaTeX automatically saves the user completion
yuuji@20 564 table in the user dictionary file at exiting of emacs.
yuuji@20 565
yuuji@58 566 At the completion of certain environments, the expected initial entry will
yuuji@58 567 automatically inserted such as @code{\item} for @code{itemize}
yuuji@58 568 environment. If you don't want the entry, it can be removed by undoing.
yuuji@58 569
yuuji@20 570 If you want to enclose some paragraphs which have already been
yuuji@20 571 written, invoke the begin-type completion with changing the case
yuuji@20 572 of @kbd{b} of key sequence upper(or invoke it with universal argument
yuuji@20 573 by @kbd{C-u} prefix).
yuuji@20 574 @cindex enclose region into environment
yuuji@20 575
yuuji@20 576 The following example encloses a region with `description'
yuuji@20 577 environment.
yuuji@20 578
yuuji@20 579 @table @kbd
yuuji@20 580 @item [prefix] B D
yuuji@20 581 @itemx (or ESC 1 [prefix] b D)
yuuji@20 582 @itemx (or C-u [prefix] b D)
yuuji@20 583
yuuji@46 584 @dots{} begin-type completion for region
yuuji@20 585 @end table
yuuji@20 586
yuuji@20 587 This enclosing holds good for the completing input by @kbd{[prefix] b
yuuji@20 588 SPC}. @kbd{[prefix] B SPC} enclose a region with the environment selected
yuuji@20 589 by completing-read.
yuuji@20 590
yuuji@20 591 @node Section-type completion, Large-type completion, Begin-type completion, Completion
yuuji@20 592 @comment node-name, next, previous, up
yuuji@20 593 @section Section-type completion
yuuji@20 594 @cindex section-type completion
yuuji@20 595 @cindex prefix s
yuuji@20 596
yuuji@20 597 "Section-type completion" completes section-type commands which take an
yuuji@20 598 argument or more such as @code{\section@{foo@}}. To invoke section-type
yuuji@20 599 completion, type
yuuji@20 600
yuuji@20 601 @table @kbd
yuuji@20 602 @item [prefix] s
yuuji@46 603 @dots{} section-type completion
yuuji@20 604 @end table
yuuji@20 605
yuuji@20 606 @noindent
yuuji@20 607 then the prompt
yuuji@20 608
yuuji@20 609 @example
yuuji@46 610 (C-v for view) \???@{@} (default documentstyle):
yuuji@20 611 @end example
yuuji@20 612
yuuji@20 613 @noindent
yuuji@20 614 will show up in the minibuffer. Section-type La@TeX{} commands are
yuuji@20 615 completed by space key, and the default value is selected when you
yuuji@20 616 type nothing in the minibuffer.
yuuji@20 617
yuuji@20 618 Next,
yuuji@20 619
yuuji@20 620 @example
yuuji@46 621 \section@{???@}:
yuuji@20 622 @end example
yuuji@20 623
yuuji@20 624 @noindent
yuuji@20 625 prompts you the argument of section-type La@TeX{} command. For
yuuji@20 626 example, the following inputs
yuuji@20 627
yuuji@20 628 @example
yuuji@46 629 \???@{@} (default documentstyle): section
yuuji@70 630 \section@{???@}: Hello world.
yuuji@20 631 @end example
yuuji@20 632
yuuji@20 633 @noindent
yuuji@20 634 will insert the string
yuuji@20 635
yuuji@20 636 @example
yuuji@46 637 \section@{Hello world.@}
yuuji@20 638 @end example
yuuji@20 639
yuuji@20 640 in your La@TeX{} source. When you neglect argument such as
yuuji@20 641
yuuji@20 642 @example
yuuji@46 643 (C-v for view) \???@{@} (default section): vspace*
yuuji@46 644 \vspace*@{???@}:
yuuji@20 645 @end example
yuuji@20 646
yuuji@20 647 YaTeX puts
yuuji@20 648
yuuji@20 649 @example
yuuji@46 650 \vspace*@{@}
yuuji@20 651 @end example
yuuji@20 652
yuuji@20 653 @noindent
yuuji@20 654 and move the cursor in the braces.
yuuji@20 655
yuuji@20 656 In La@TeX{} command, there are commands which take more than one
yuuji@70 657 arguments such as @code{\addtolength@{\topmargin@}@{8mm@}}. To complete these
yuuji@20 658 commands, invoke section-type completion with universal argument as,
yuuji@20 659 @cindex number of argument
yuuji@20 660
yuuji@20 661 @example
yuuji@49 662 C-u 2 [prefix] s (or ESC 2 [prefix] s)
yuuji@20 663 @end example
yuuji@20 664
yuuji@20 665 @noindent
yuuji@20 666 and make answers in minibuffer like this.
yuuji@20 667
yuuji@20 668 @example
yuuji@46 669 (C-v for view) \???@{@} (default vspace*): addtolength
yuuji@46 670 \addtolength@{???@}: \topmargin
yuuji@46 671 Argument 2: 8mm
yuuji@20 672 @end example
yuuji@20 673
yuuji@20 674 @code{\addtolength} and the first argument @code{\topmargin} can be typed
yuuji@20 675 easily by completing read. Since YaTeX also learns the number of
yuuji@20 676 arguments of section-type command and will ask that many arguments in
yuuji@20 677 future completion, you had better tell the number of arguments to YaTeX at
yuuji@20 678 the first completion of the new word. But you can change the number of
yuuji@20 679 arguments by calling the completion with different universal argument
yuuji@20 680 again.
yuuji@20 681
yuuji@20 682
yuuji@20 683 Invoking section-type completion with @code{[Prefix] S} (Capital `S')
yuuji@20 684 includes the region as the first argument of section-type command.
yuuji@20 685
yuuji@20 686 The section/large/maketitle type completion can work at the
yuuji@20 687 prompt for the argument of other section-type completion.
yuuji@20 688 Nested La@TeX{} commands are efficiently read with the recursive
yuuji@20 689 completion by typing YaTeX's completion key sequence in the
yuuji@20 690 minibuffer.
yuuji@20 691
yuuji@20 692 @menu
yuuji@20 693 * view-sectioning::
yuuji@20 694 @end menu
yuuji@20 695
yuuji@33 696 @node view-sectioning, , Section-type completion, Section-type completion
yuuji@20 697 @comment node-name, next, previous, up
yuuji@20 698 @subsection view-sectioning
yuuji@20 699 @cindex view sectioning
yuuji@20 700 @cindex outline
yuuji@20 701
yuuji@20 702 In the minibuffer at the prompt of section-type command completion,
yuuji@20 703 typing @kbd{C-v} shows a list of sectioning commands in source text(The
yuuji@20 704 line with @code{<<--} mark is the nearest sectioning command). Then,
yuuji@20 705 default sectioning command appears in the minibuffer. You can go up/down
yuuji@20 706 sectioning command by typing @kbd{C-p}/@kbd{C-n}, can scrolls up/down the
yuuji@20 707 listing buffer by @kbd{C-v}/@kbd{M-v}, and can hide sectioning commands
yuuji@20 708 under certain level by 0 through 6. Type @kbd{?} in the minibuffer of
yuuji@20 709 sectioning prompt for more information.
yuuji@20 710
yuuji@58 711 You can generate this listing buffer (@code{*Sectioning Lines*} buffer)
yuuji@58 712 by typing
yuuji@58 713 @table @kbd
yuuji@58 714 @item M-x YaTeX-section-overview
yuuji@58 715 @dots{} Generate *Sectioning Lines* buffer
yuuji@58 716 @end table
yuuji@58 717 @cindex{Generate the listing of sectioning units}
yuuji@58 718 from the LaTeX source buffer. In this listing buffer, typing @kbd{u} on
yuuji@58 719 the sectioning command shifts up the corresponding sectioning command in
yuuji@58 720 source text and @kbd{d} shifts down. After marking lines in the listing
yuuji@58 721 buffer, typing @kbd{U} shifts up all sectioning commands in the region,
yuuji@58 722 and @kbd{U} shifts down. Here are all the key bindings of
yuuji@58 723 @code{*Sectioning Lines*} buffer.
yuuji@58 724
yuuji@58 725 @table @kbd
yuuji@58 726 @item SPC
yuuji@58 727 @dots{} Jump to corresponding source line
yuuji@58 728 @item .
yuuji@58 729 @dots{} Display corresponding source line
yuuji@58 730 @item u
yuuji@58 731 @dots{} Shift up a sectioning line
yuuji@58 732 @item d
yuuji@58 733 @dots{} Shift down a sectioning line
yuuji@58 734 @item U
yuuji@58 735 @dots{} Shift up sectioning lines in region
yuuji@58 736 @item D
yuuji@58 737 @dots{} Shift down sectioning lines in region
yuuji@68 738 @item 0@dots{}6
yuuji@58 739 @dots{} Hide sectioning commands whose level is lower than n
yuuji@58 740 @end table
yuuji@58 741
yuuji@58 742
yuuji@20 743 @node Large-type completion, Maketitle-type completion, Section-type completion, Completion
yuuji@20 744 @comment node-name, next, previous, up
yuuji@20 745 @section Large-type completion
yuuji@20 746
yuuji@20 747 "Large-type completion" inputs the font or size changing
yuuji@20 748 descriptions such as @code{@{\large @}}. When you type
yuuji@20 749
yuuji@20 750 @table @kbd
yuuji@20 751 @item [prefix] l
yuuji@46 752 @dots{} large-type completion
yuuji@20 753 @end table
yuuji@20 754
yuuji@20 755 @noindent
yuuji@20 756 the message in the minibuffer
yuuji@20 757
yuuji@20 758 @example
yuuji@46 759 @{\??? @} (default large):
yuuji@20 760 @end example
yuuji@20 761
yuuji@20 762 prompts prompts you large-type command with completing-read. There are
yuuji@20 763 TeX commands to change fonts or sizes, @code{it}, @code{huge} and so on,
yuuji@20 764 in the completion table.
yuuji@20 765
yuuji@20 766 Region-based completion is also invoked by changing the letter after
yuuji@20 767 prefix key stroke as @kbd{[prefix] L}. It encloses the region by braces
yuuji@20 768 with large-type command.
yuuji@20 769
yuuji@20 770 @node Maketitle-type completion, Arbitrary completion, Large-type completion, Completion
yuuji@20 771 @comment node-name, next, previous, up
yuuji@20 772 @section Maketitle-type completion
yuuji@20 773 @cindex maketitle-type completion
yuuji@20 774
yuuji@20 775 We call it "maketitle-type completion" which completes commands such as
yuuji@20 776 @code{\maketitle}. Take notice that maketitle-type commands take no
yuuji@20 777 arguments. Then, typing
yuuji@20 778
yuuji@20 779 @table @kbd
yuuji@20 780 @item [prefix] m
yuuji@46 781 @dots{} maketitle-type completion
yuuji@20 782 @end table
yuuji@20 783
yuuji@20 784 @noindent
yuuji@20 785 begins maketitle-completion. Above mentioned method is true for
yuuji@20 786 maketitle-completion, and there are La@TeX{} commands with no
yuuji@20 787 arguments in completion table.
yuuji@20 788
yuuji@20 789 @node Arbitrary completion, End completion, Maketitle-type completion, Completion
yuuji@20 790 @comment node-name, next, previous, up
yuuji@20 791 @section Arbitrary completion
yuuji@20 792 @cindex arbitrary completion
yuuji@20 793
yuuji@20 794 @noindent
yuuji@20 795 You can complete certain La@TeX{} command anywhere without typical
yuuji@20 796 completing method as described, by typing
yuuji@20 797
yuuji@20 798 @table @kbd
yuuji@20 799 @item [prefix] SPC
yuuji@46 800 @dots{} arbitrary completion
yuuji@20 801 @end table
yuuji@20 802
yuuji@20 803 @noindent
yuuji@20 804 after the initial string of La@TeX{} command that is preceded by @code{\}.
yuuji@20 805
yuuji@20 806 @node End completion, Accent completion, Arbitrary completion, Completion
yuuji@20 807 @comment node-name, next, previous, up
yuuji@20 808 @section End completion
yuuji@20 809 @cindex end completion
yuuji@20 810
yuuji@20 811 @noindent
yuuji@20 812 YaTeX automatically detects the opened environment and close it with
yuuji@20 813 \@code{\end@{environment@}}. Though proficient YaTeX users never fail to
yuuji@20 814 make environment with begin-type completion, some may begin an environment
yuuji@20 815 manually. In that case, type
yuuji@20 816
yuuji@20 817 @table @kbd
yuuji@20 818 @item [prefix] e
yuuji@46 819 @dots{} @code{end} completion
yuuji@20 820 @end table
yuuji@20 821
yuuji@20 822 @noindent
yuuji@20 823 at the end of the opened environment.
yuuji@20 824
yuuji@20 825 @node Accent completion, Image completion, End completion, Completion
yuuji@20 826 @comment node-name, next, previous, up
yuuji@20 827 @section Accent completion
yuuji@20 828 @cindex accent completion
yuuji@20 829
yuuji@20 830 When you want to write the European accent marks(like @code{\`@{o@}}),
yuuji@20 831
yuuji@20 832 @table @kbd
yuuji@20 833 @item [prefix] a
yuuji@46 834 @dots{} accent completion
yuuji@20 835 @end table
yuuji@20 836
yuuji@20 837 @noindent
yuuji@20 838 shows the menu
yuuji@20 839
yuuji@20 840 @example
yuuji@46 841 1:` 2:' 3:^ 4:" 5:~ 6:= 7:. u v H t c d b
yuuji@20 842 @end example
yuuji@20 843
yuuji@20 844 @noindent
yuuji@20 845 in the minibuffer. Chose one character or corresponding numeric,
yuuji@20 846 and you will see
yuuji@20 847
yuuji@20 848 @example
yuuji@70 849 \`@{@}
yuuji@20 850 @end example
yuuji@20 851
yuuji@20 852 @noindent
yuuji@20 853 in the editing buffer with the cursor positioned in braces. Type
yuuji@20 854 one more character `o' for example, then
yuuji@20 855
yuuji@20 856 @example
yuuji@70 857 \`@{o@}
yuuji@20 858 @end example
yuuji@20 859
yuuji@20 860 @noindent
yuuji@20 861 will be completed, and the cursor gets out from braces.
yuuji@20 862
yuuji@20 863 @node Image completion, Greek letters completion, Accent completion, Completion
yuuji@20 864 @comment node-name, next, previous, up
yuuji@20 865 @section Image completion of mathematical sign
yuuji@20 866 @cindex image completion
yuuji@20 867 @cindex math-mode
yuuji@20 868 @cindex sigma
yuuji@20 869 @cindex leftarrow
yuuji@20 870 @cindex ;
yuuji@20 871
yuuji@20 872 Arrow marks, sigma mark and those signs mainly used in the
yuuji@20 873 TeX's math environment are completed by key sequences which
yuuji@20 874 imitate the corresponding symbols graphically. This completion
yuuji@20 875 only works in the math environment. YaTeX automatically detects
yuuji@20 876 whether the cursor located in math environment or not, and
yuuji@52 877 change the behavior of key strokes @kbd{;} and @kbd{:}.
yuuji@20 878
yuuji@20 879 By the way, we often express the leftarrow mark by `<-' for example.
yuuji@20 880 Considering such image, you can write @code{\leftarrow} by typing @kbd{<-}
yuuji@20 881 after @kbd{;} (semicolon) as a prefix. In the same way,
yuuji@20 882 @code{\longleftarrow} (@code{<--}) is completed by typing @kbd{;<--},
yuuji@20 883 infinity mark which is imitated by @code{oo} is completed by typing
yuuji@20 884 @kbd{;oo}.
yuuji@20 885
yuuji@20 886 Here are the sample operations in YaTeX math-mode.
yuuji@20 887
yuuji@20 888 @example
yuuji@20 889 INPUT Completed La@TeX{} commands
yuuji@20 890 ; < - @code{\leftarrow}
yuuji@20 891 ; < - - @code{\longleftarrow}
yuuji@20 892 ; < - - > @code{\longleftrightarrow}
yuuji@20 893 ; o @code{\circ}
yuuji@20 894 ; o o @code{\infty}
yuuji@20 895 @end example
yuuji@20 896
yuuji@20 897 In any case, you can quit from image completion and can move
yuuji@20 898 to the next editing operation if the La@TeX{} command you want is
yuuji@20 899 shown in the buffer.
yuuji@20 900
yuuji@20 901 @code{;} itself in math-environment is inserted by @kbd{;;}. Typing
yuuji@20 902 @kbd{TAB} in the midst of image completion shows all of the La@TeX{}
yuuji@20 903 commands that start with the same name as string you previously typed in.
yuuji@20 904 In this menu buffer, press @kbd{RET} after moving the cursor (by @kbd{n},
yuuji@20 905 @kbd{p}, @kbd{b}, @kbd{f}) to insert the La@TeX{} command.
yuuji@20 906
yuuji@20 907 To know all of the completion table, type @kbd{TAB} just after @kbd{;}.
yuuji@20 908 And here is the sample menu by @kbd{TAB} after @kbd{;<}.
yuuji@20 909
yuuji@20 910 @example
yuuji@20 911 KEY LaTeX sequence sign
yuuji@20 912 < \leq <
yuuji@20 913 ~
yuuji@20 914 << \ll <<
yuuji@20 915 <- \leftarrow <-
yuuji@20 916 <= \Leftarrow <=
yuuji@20 917 @end example
yuuji@20 918
yuuji@20 919 You can define your favorite key-vs-sequence completion table in the
yuuji@20 920 Emacs-Lisp variable @code{YaTeX-math-sign-alist-private}. See also
yuuji@20 921 @file{yatexmth.el} for the information of the structure of this variable.
yuuji@20 922
yuuji@20 923 @node Greek letters completion, , Image completion, Completion
yuuji@20 924 @comment node-name, next, previous, up
yuuji@20 925 @section Greek letters completion
yuuji@20 926 @cindex Greek letters completion
yuuji@52 927 @cindex :
yuuji@20 928
yuuji@20 929 Math-mode of YaTeX provides another image completion, Greek letters
yuuji@52 930 completion in the same method. After prefix @kbd{:}, typing @kbd{a} makes
yuuji@20 931 @code{\alpha}, @kbd{b} makes @code{\beta} and @kbd{g} makes @code{\gamma}
yuuji@58 932 and so on. First, type @kbd{:TAB} to know all the correspondence of
yuuji@58 933 alphabets vs. Greek letters.
yuuji@20 934
yuuji@52 935 If you will find @kbd{;} or @kbd{:} doesn't work in correct position of
yuuji@20 936 math environment, it may be a bug of YaTeX. Please send me a bug report
yuuji@20 937 with the configuration of your text, and avoid it temporarily by typing
yuuji@52 938 @kbd{;} or @kbd{:} after universal-argument(@kbd{C-u}) which forces
yuuji@52 939 @kbd{;} and @kbd{:} to work as math-prefix.
yuuji@20 940
yuuji@49 941 @node Local dictionaries, Commenting out, Completion, Top
yuuji@49 942 @comment node-name, next, previous, up
yuuji@49 943 @chapter Local dictionaries
yuuji@49 944 @cindex local dictionaries
yuuji@49 945 @cindex nervous users
yuuji@49 946
yuuji@49 947 Tables for completion consist of three dictionaries; `standard
yuuji@49 948 dictionary' built in @file{yatex.el}, `user dictionary' for your common
yuuji@49 949 private commands, and `local dictionary' that is effective in a certain
yuuji@49 950 directory.
yuuji@49 951
yuuji@49 952 When you input the command unknown to YaTeX at a completion in the
yuuji@49 953 minibuffer, YaTeX asks you with the following prompt;
yuuji@49 954
yuuji@49 955 @example
yuuji@51 956 `foo' is not in table. Register into: U)serDic L)ocalDic N)one D)iscad
yuuji@49 957 @end example
yuuji@49 958
yuuji@49 959 @noindent
yuuji@51 960 In this menu, typing @kbd{u} updates your `user dictionary', @kbd{l}
yuuji@51 961 updates your local dictionary, @kbd{n} updates only on-memory dictionary
yuuji@51 962 which go through only current Emacs session, and @kbd{d} updates no
yuuji@51 963 dictionary and throws the new word away.
yuuji@49 964
yuuji@49 965 If you find this switching feature meaningless and bothersome, put the
yuuji@49 966 next expression into your @file{~/.emacs}
yuuji@49 967
yuuji@49 968 @lisp
yuuji@49 969 (setq YaTeX-nervous nil)
yuuji@49 970 @end lisp
yuuji@49 971
yuuji@49 972 @node Commenting out, Cursor jump, Local dictionaries, Top
yuuji@20 973 @comment node-name, next, previous, up
yuuji@20 974 @chapter Commenting out
yuuji@20 975 @cindex commenting out
yuuji@20 976 @cindex prefix >
yuuji@20 977 @cindex prefix <
yuuji@20 978 @cindex prefix ,
yuuji@20 979 @cindex prefix .
yuuji@20 980
yuuji@20 981 You may want to comment out some region.
yuuji@20 982
yuuji@20 983 @table @kbd
yuuji@20 984 @item [prefix] >
yuuji@46 985 @dots{} comment out region by %
yuuji@20 986 @item [prefix] <
yuuji@46 987 @dots{} uncomment region
yuuji@20 988 @end table
yuuji@20 989
yuuji@20 990 @noindent
yuuji@20 991 cause an operation to the region between point and mark.
yuuji@20 992
yuuji@20 993 @table @kbd
yuuji@20 994 @item [prefix] .
yuuji@46 995 @dots{} comment out current paragraph
yuuji@20 996 @item [prefix] ,
yuuji@46 997 @dots{} uncomment current paragraph
yuuji@20 998 @end table
yuuji@20 999
yuuji@20 1000 @noindent
yuuji@20 1001 comments or uncomments the paragraph where the cursor belongs.
yuuji@20 1002 This `paragraph' means the region marked by the function
yuuji@20 1003 mark-paragraph, bound to @kbd{ESC h} by default. It is NOT
yuuji@20 1004 predictable what will happen when you continuously comment out
yuuji@20 1005 some paragraph many times.
yuuji@20 1006
yuuji@20 1007 You can also comment out an environment between @code{\begin} and
yuuji@20 1008 @code{\end}, or a @code{\begin}-\@code{\end} pair themselves, by making the
yuuji@20 1009 following key strokes on the line where @code{\begin@{@}} or
yuuji@20 1010 @code{\end@{@}} exists.
yuuji@20 1011
yuuji@20 1012 @table @kbd
yuuji@20 1013 @item [prefix] >
yuuji@46 1014 @dots{} comment out from \begin to \@code{end}
yuuji@20 1015 @item [prefix] <
yuuji@46 1016 @dots{} uncomment from \begin to \@code{end}
yuuji@20 1017 @end table
yuuji@20 1018
yuuji@20 1019 @noindent
yuuji@20 1020 comment whole the contents of environment. Moreover,
yuuji@20 1021
yuuji@20 1022 @table @kbd
yuuji@20 1023 @item [prefix] .
yuuji@46 1024 @dots{} comment out \begin and \@code{end}
yuuji@20 1025 @item [prefix] ,
yuuji@46 1026 @dots{} uncomment \begin and \@code{end}
yuuji@20 1027 @end table
yuuji@20 1028
yuuji@20 1029 @noindent
yuuji@20 1030 (un)comments out only environment declaration: @code{\begin@{@}} and
yuuji@20 1031 @code{\end@{@}}. NOTE that even if you intend to comment out some region,
yuuji@20 1032 invoking @kbd{[prefix] >} on the @code{\begin},@code{\end} line decides to
yuuji@20 1033 work in `commenting out from @code{\begin} to @code{\end}' mode.
yuuji@20 1034
yuuji@20 1035
yuuji@20 1036 @node Cursor jump, Changing and Deleting, Commenting out, Top
yuuji@20 1037 @comment node-name, next, previous, up
yuuji@20 1038 @chapter Cursor jump
yuuji@20 1039 @cindex cursor jump
yuuji@20 1040 @cindex prefix g
yuuji@20 1041
yuuji@68 1042
yuuji@68 1043 @menu
yuuji@68 1044 * Jump to corresponding object::
yuuji@68 1045 * Invoking image processor::
yuuji@68 1046 * Jump to main file::
yuuji@68 1047 * Jumping around the environment::
yuuji@68 1048 * Jumping to last completion position::
yuuji@68 1049 @end menu
yuuji@68 1050
yuuji@68 1051 @node Jump to corresponding object, Invoking image processor, Cursor jump, Cursor jump
yuuji@68 1052 @comment node-name, next, previous, up
yuuji@51 1053 @section Jump to corresponding object
yuuji@51 1054
yuuji@48 1055 Typing
yuuji@20 1056
yuuji@20 1057 @table @kbd
yuuji@20 1058 @item [prefix] g
yuuji@46 1059 @dots{} go to corresponding object
yuuji@20 1060 @end table
yuuji@20 1061
yuuji@20 1062 @noindent
yuuji@48 1063 in a certain place move the cursor to the place corresponding to the
yuuji@48 1064 La@TeX{} command of last place. YaTeX recognize the followings as pairs
yuuji@48 1065 that have relation each other.
yuuji@48 1066
yuuji@49 1067 @itemize @bullet
yuuji@48 1068 @item @code{\begin@{@}} <-> @code{\end@{@}}
yuuji@48 1069 @item @code{%#BEGIN} <-> @code{%#END}
yuuji@59 1070 @item On the image-including line -> corresponding viewer or drawing tool
yuuji@48 1071 @item @code{\label@{@}} <-> @code{\ref@{@}}
yuuji@48 1072 @item @code{\include(\input)} -> included file
yuuji@48 1073 @item @code{\bibitem@{@}} <-> @code{\cite@{@}}
yuuji@49 1074 @end itemize
yuuji@48 1075
yuuji@49 1076 On a @code{\begin},@code{\end} line, typing @kbd{[prefix] g} moves the
yuuji@49 1077 cursor to the corresponding @code{\end},@code{\begin} line, if its partner
yuuji@51 1078 really exists. The behavior on the line @code{%#BEGIN} and @code{%#END}
yuuji@49 1079 are the same. Note that if the correspondent of @code{label/ref} or
yuuji@51 1080 @code{cite/bibitem} exists in another file, that file have to be opened to
yuuji@49 1081 make a round trip between references by @kbd{[prefix] g}.
yuuji@20 1082
yuuji@20 1083 If you type @code{[prefix] g} on the line of @code{\include@{chap1@}},
yuuji@48 1084 typically in the main text, YaTeX switches buffer to @file{chap1.tex}.
yuuji@51 1085
yuuji@51 1086 @table @kbd
yuuji@51 1087 @item [prefix] 4 g
yuuji@51 1088 @dots{} go to corresponding object in other window
yuuji@51 1089 @end table
yuuji@51 1090
yuuji@51 1091 @noindent
yuuji@51 1092 do the same job as @kbd{[prefix] g} except it's done in other window.
yuuji@51 1093 Note that this function doesn't work on @code{begin/end},
yuuji@51 1094 @code{%#BEGIN/%#END} pairs because it is meaningless.
yuuji@51 1095
yuuji@68 1096 @node Invoking image processor, Jump to main file, Jump to corresponding object, Cursor jump
yuuji@68 1097 @comment node-name, next, previous, up
yuuji@68 1098 @section Invoking image processor
yuuji@59 1099 @cindex{Drawing tool invocation}
yuuji@59 1100
yuuji@59 1101 `image-including line' described above means such lines as
yuuji@59 1102 @code{\epsfile@{file=foo.ps@}}. If you type @kbd{[prefix] g} on that
yuuji@59 1103 line, YaTeX automatically searches source of `foo.ps' and invokes image
yuuji@59 1104 viewer or drawing tool correspoinding to it. For example; if you draw
yuuji@59 1105 an image foo.obj with Tgif and enclose its product named foo.eps by
yuuji@59 1106 @code{\epsfile} command. Typing @kbd{[prefix] g} on @code{\epsfile} line
yuuji@59 1107 make YaTeX invoke @code{tgif foo.obj}. How a processor is choosen is as
yuuji@59 1108 follows.
yuuji@59 1109
yuuji@59 1110 @enumerate
yuuji@59 1111 @item
yuuji@59 1112 If there is an expression matching with one of the pattern
yuuji@59 1113 defined in @code{YaTeX-processed-file-regexp-alist}, extract file name
yuuji@59 1114 from regexp group surrounded by \\(\\). (Which group corresponds is
yuuji@59 1115 written in the cdr part of each list.) If no matches were found, do
yuuji@59 1116 nothing.
yuuji@59 1117 @item
yuuji@59 1118 If there is a pattern as `%PROCESSOR' which is defined in the variable
yuuji@59 1119 @code{YaTeX-file-processor-alist}, call that processor giving the
yuuji@59 1120 file name with corresponding extension.
yuuji@59 1121 @item
yuuji@59 1122 If not, check the existence of each file which is supplied the
yuuji@59 1123 extension in the cdr part of each list of
yuuji@59 1124 @code{YaTeX-file-processor-alist}. If any, call the corresponding
yuuji@59 1125 image viewer or drawing tool.
yuuji@59 1126 @end enumerate
yuuji@59 1127
yuuji@68 1128 @node Jump to main file, Jumping around the environment, Invoking image processor, Cursor jump
yuuji@68 1129 @comment node-name, next, previous, up
yuuji@51 1130 @section Jump to main file
yuuji@51 1131
yuuji@51 1132 Typing
yuuji@20 1133
yuuji@20 1134 @table @kbd
yuuji@20 1135 @item [prefix] ^
yuuji@46 1136 @dots{} visit main file
yuuji@20 1137 @item [prefix] 4^
yuuji@46 1138 @dots{} visit main file in other buffer
yuuji@20 1139 @end table
yuuji@20 1140 @cindex prefix ^
yuuji@20 1141 @cindex prefix 4 ^
yuuji@20 1142
yuuji@20 1143 in a sub text switch the buffer to the main text specified by
yuuji@20 1144 @code{%#!} notation.
yuuji@20 1145
yuuji@68 1146 @node Jumping around the environment, Jumping to last completion position, Jump to main file, Cursor jump
yuuji@68 1147 @comment node-name, next, previous, up
yuuji@68 1148 @section Jumping around the environment
yuuji@51 1149
yuuji@20 1150 And these are the functions which work on the current La@TeX{}
yuuji@20 1151 environment:
yuuji@20 1152
yuuji@20 1153 @table @kbd
yuuji@20 1154 @item M-C-a
yuuji@46 1155 @dots{} beginning of environment
yuuji@20 1156 @item M-C-e
yuuji@46 1157 @dots{} @code{end} of environment
yuuji@20 1158 @item M-C-@@
yuuji@46 1159 @dots{} mark environment
yuuji@20 1160 @end table
yuuji@20 1161 @cindex M-C-a
yuuji@20 1162 @cindex M-C-e
yuuji@20 1163 @cindex M-C-@@
yuuji@20 1164
yuuji@68 1165 @node Jumping to last completion position, , Jumping around the environment, Cursor jump
yuuji@68 1166 @comment node-name, next, previous, up
yuuji@68 1167 @section Jumping to last completion position
yuuji@68 1168
yuuji@68 1169 YaTeX always memorize the position of completion into register @code{3}.
yuuji@68 1170 So every time you make a trip to any other part of text other than you are
yuuji@68 1171 writing, you can return to the editing paragraph by calling
yuuji@68 1172 register-to-point with argument YaTeX-current-position-register, which is
yuuji@68 1173 achieved by typing @kbd{C-x j 3}(by default).
yuuji@68 1174
yuuji@51 1175 @node Changing and Deleting, Filling, Cursor jump, Top
yuuji@20 1176 @comment node-name, next, previous, up
yuuji@20 1177 @chapter Changing and Deleting
yuuji@20 1178
yuuji@20 1179 These functions are for change or deletion of La@TeX{} commands
yuuji@20 1180 already entered.
yuuji@20 1181
yuuji@20 1182 @table @kbd
yuuji@20 1183 @item [prefix] c
yuuji@46 1184 @dots{} change La@TeX{} command
yuuji@20 1185 @item [prefix] k
yuuji@46 1186 @dots{} kill La@TeX{} command
yuuji@20 1187 @end table
yuuji@20 1188 @cindex prefix c
yuuji@20 1189 @cindex prefix k
yuuji@20 1190
yuuji@49 1191 @menu
yuuji@68 1192 * Changing LaTeX commands::
yuuji@68 1193 * Killing LaTeX commands::
yuuji@49 1194 @end menu
yuuji@49 1195
yuuji@68 1196 @node Changing LaTeX commands, Killing LaTeX commands, Changing and Deleting, Changing and Deleting
yuuji@49 1197 @comment node-name, next, previous, up
yuuji@49 1198 @section Changing La@TeX{} commands
yuuji@49 1199
yuuji@49 1200 @kbd{[prefix] c} can change the various (La)@TeX{} commands. This can
yuuji@49 1201 change the followings.
yuuji@49 1202 @itemize @bullet
yuuji@49 1203 @item Environment names
yuuji@49 1204 @item Section-type commands
yuuji@49 1205 @item Argument of section-type commands
yuuji@49 1206 @item Optional parameters (enclosed by []) of section-type commands
yuuji@49 1207 @item Font/size designators
yuuji@52 1208 @item Math-mode's maketitle-type commands that can be inputted with
yuuji@52 1209 image completion
yuuji@49 1210 @end itemize
yuuji@49 1211
yuuji@49 1212 Typing @kbd{[prefix] c} on one of above objects you want to change
yuuji@49 1213 brings a suitable reading function sometimes with completion.
yuuji@49 1214 Note: If you want to change the argument of section-type command that
yuuji@49 1215 contains other La@TeX{} commands, type @kbd{[prefix] c} either of
yuuji@49 1216 surrounding braces of the argument in order to make YaTeX ignore the
yuuji@49 1217 internal La@TeX{} sequences as an object of changing. Anyway, it is
yuuji@49 1218 very difficult to know which argument position the cursor belongs because
yuuji@49 1219 the La@TeX{} commands can be nested and braces can freely emerge. So keep
yuuji@49 1220 it mind to put the cursor on a brace when you are thinking of changing a
yuuji@49 1221 complicated argument.
yuuji@49 1222
yuuji@68 1223 @node Killing LaTeX commands, , Changing LaTeX commands, Changing and Deleting
yuuji@49 1224 @comment node-name, next, previous, up
yuuji@49 1225 @section Killing La@TeX{} commands
yuuji@49 1226 @cindex Killing La@TeX{} commands
yuuji@49 1227
yuuji@49 1228 @kbd{[prefix] k} kills the La@TeX{} commands sometimes with their
yuuji@49 1229 arguments. Following table illustrates the correspondence of the invoking
yuuji@49 1230 position and what is killed.
yuuji@20 1231
yuuji@20 1232 @example
yuuji@20 1233 [Invoking position] [action]
yuuji@49 1234 \begin, \end line kill \begin,\end pairs
yuuji@49 1235 %#BEGIN, %#END line kill %#BEGIN,%#END pairs
yuuji@20 1236 on a Section-type command kill section-type command
yuuji@20 1237 on a parenthesis kill parentheses
yuuji@20 1238 @end example
yuuji@20 1239
yuuji@49 1240 Note that when killing @code{\begin, \end} or @code{%#BEGIN, %#END} pair,
yuuji@49 1241 the lines @code{\begin, \end} or @code{%#BEGIN, %#END} exist will be
yuuji@49 1242 killed entirely. So take care not to create any line that contains more
yuuji@49 1243 than one @code{\begin} or so.
yuuji@49 1244
yuuji@20 1245 While all operations above are to kill `containers' which surround some
yuuji@20 1246 text, universal argument (@kbd{C-u}) for these commands kills not only
yuuji@20 1247 `containers' but also `contents' of them. See below as a sample.
yuuji@20 1248
yuuji@20 1249 @example
yuuji@46 1250 Original text: [prefix] k C-u [prefix] k
yuuji@46 1251 Main \footnote@{note@} here. Main note here. Main here.
yuuji@20 1252 ~(cursor)
yuuji@20 1253 @end example
yuuji@20 1254
yuuji@58 1255 @node Filling, Updation of includeonly, Changing and Deleting, Top
yuuji@20 1256 @comment node-name, next, previous, up
yuuji@51 1257 @chapter Filling
yuuji@51 1258 @cindex filling
yuuji@51 1259
yuuji@51 1260 @section Filling an item
yuuji@20 1261 @cindex filling an item
yuuji@20 1262 @cindex prefix i
yuuji@20 1263
yuuji@51 1264 To fill a term (descriptive sentences) of @code{\item}, type
yuuji@20 1265
yuuji@58 1266 @c @table @kbd
yuuji@58 1267 @c @item [prefix] i
yuuji@58 1268 @c @dots{} fill item
yuuji@58 1269 @c @end table
yuuji@20 1270 @table @kbd
yuuji@58 1271 @item M-q
yuuji@46 1272 @dots{} fill item
yuuji@20 1273 @end table
yuuji@20 1274
yuuji@20 1275 @noindent
yuuji@20 1276 on that item.
yuuji@20 1277
yuuji@20 1278 YaTeX uses the value of the variable @code{YaTeX-item-regexp} as the
yuuji@20 1279 regular expression to search item header in itemize environment.
yuuji@51 1280 If you make a newcommand to itemize terms(e.g. @code{\underlineitem}), put
yuuji@20 1281
yuuji@20 1282 @lisp
yuuji@46 1283 (setq YaTeX-item-regexp
yuuji@58 1284 "\\(\\\\\\(sub\\)*item\\)\\|\\(\\\\underlineitem\\)")
yuuji@20 1285 @end lisp
yuuji@20 1286 @cindex YaTeX-item-regexp
yuuji@20 1287
yuuji@20 1288 in your @file{~/.emacs}. If you are not familiar with regular expression
yuuji@20 1289 for Emacs-Lisp, name a newcommand for `itemize' beginning with
yuuji@20 1290 @code{\item} such as @code{\itembf}, not @code{\bfitem}.
yuuji@20 1291
yuuji@58 1292 This function reformats the @code{\item} into `hang-indented' style.
yuuji@58 1293 For example:
yuuji@51 1294
yuuji@51 1295 @example
yuuji@58 1296 itemize, enumerate environment:
yuuji@51 1297 >
yuuji@51 1298 >\item[foo] `foo' is the typical word for describing an
yuuji@51 1299 > arbitrarily written....
yuuji@58 1300 description environment:
yuuji@58 1301 > \item[bar] When the word `for' is used as an arbitrarily
yuuji@58 1302 > word, `bar' is bound to follow it.
yuuji@51 1303 @end example
yuuji@51 1304
yuuji@52 1305 Note that the indent depth of an @code{\item} word and its descriptive
yuuji@51 1306 paragraph are the same in latter case. If you want to use different
yuuji@51 1307 depth, invoke fill-paragraph at the beginning of non-whitespace
yuuji@51 1308 character(see below).
yuuji@51 1309
yuuji@51 1310 @section Filling paragraph
yuuji@51 1311 @cindex Filling paragraph
yuuji@51 1312 @cindex M-q
yuuji@51 1313
yuuji@51 1314 Fill-paragraph is little bit adapted for La@TeX{} sources. It retains from
yuuji@51 1315 filling in certain environments where formatting leads to a disaster such
yuuji@51 1316 as verbatim, tabular, or so. And it protects @code{\verb} expressions
yuuji@51 1317 from being folded (The variable @code{YaTeX-verb-regexp} controls this).
yuuji@51 1318 Besides, putting cursor on the first occurrence of non-whitespace
yuuji@51 1319 character on a line changes the fill-prefix temporarily to the depth of
yuuji@51 1320 the line.
yuuji@51 1321
yuuji@59 1322 @node Updation of includeonly, What column, Filling, Top
yuuji@20 1323 @comment node-name, next, previous, up
yuuji@20 1324 @chapter Updation of @code{\includeonly}
yuuji@20 1325 @cindex includeonly
yuuji@20 1326
yuuji@20 1327 When you edit splitting source texts, the notation
yuuji@20 1328
yuuji@20 1329 @example
yuuji@46 1330 \includeonly@{CurrentEditingFileName@}
yuuji@20 1331 @end example
yuuji@20 1332
yuuji@20 1333 @noindent
yuuji@20 1334 in the main file reduces the time of typesetting. If you want
yuuji@20 1335 to hack other file a little however, you have to rewrite it to
yuuji@20 1336
yuuji@20 1337 @example
yuuji@46 1338 \includeonly@{OtherFileNameYouWantToFix@}
yuuji@20 1339 @end example
yuuji@20 1340
yuuji@20 1341 @noindent
yuuji@20 1342 in the main file. YaTeX automatically detects that the current
yuuji@20 1343 edited text is not in includeonly list and prompts you
yuuji@20 1344
yuuji@20 1345 @example
yuuji@46 1346 A)dd R)eplace %)comment?
yuuji@20 1347 @end example
yuuji@20 1348
yuuji@20 1349 in the minibuffer. Type @kbd{a} if you want to add the current file name
yuuji@20 1350 to @code{\includeonly} list, @kbd{r} to replace \@code{includeonly} list
yuuji@20 1351 by the current file, and type @kbd{%} to comment out the
yuuji@20 1352 @code{\includeonly} line.
yuuji@20 1353
yuuji@59 1354 @node What column, Intelligent newline, Updation of includeonly, Top
yuuji@20 1355 @comment node-name, next, previous, up
yuuji@20 1356 @chapter What column?
yuuji@20 1357 @cindex what column
yuuji@20 1358 @cindex complex tabular
yuuji@20 1359 @cindex prefix &
yuuji@20 1360
yuuji@20 1361 We are often get tired of finding the corresponding column in
yuuji@20 1362 large tabulars. For example,
yuuji@20 1363
yuuji@20 1364 @example
yuuji@20 1365 \begin@{tabular@}@{|c|c|c|c|c|c|c|c|@}\hline
yuuji@20 1366 Name&Position&Post No.&Addr.&Phone No.&FAX No.&
yuuji@20 1367 Home Addr.&Home Phone\\ \hline
yuuji@20 1368 Thunder Bird & 6 & 223 & LA & xxx-yyy &
yuuji@20 1369 zzz-www & Japan & 9876-54321 \\
yuuji@20 1370 & 2 & \multicolumn@{2@}@{c|@}@{Unknown@}
yuuji@20 1371 &&&(???)
yuuji@20 1372 \\ \hline
yuuji@20 1373 \end@{tabular@}
yuuji@20 1374 @end example
yuuji@20 1375
yuuji@20 1376 Suppose you have the cursor located at @code{(???)} mark, can you tell
yuuji@20 1377 which column it is belonging at once? Maybe no. In such case,
yuuji@20 1378 type
yuuji@20 1379
yuuji@20 1380 @table @kbd
yuuji@20 1381 @item [prefix] &
yuuji@46 1382 @dots{} What column
yuuji@20 1383 @end table
yuuji@20 1384
yuuji@20 1385 @noindent
yuuji@20 1386 in that position. YaTeX tells you the column header of the
yuuji@20 1387 current field. Since YaTeX assumes the first line of tabular
yuuji@20 1388 environment as a row of column headers, you can create a row of
yuuji@20 1389 virtual column headers by putting them in the first line and
yuuji@20 1390 commenting that line with @code{%}.
yuuji@20 1391
yuuji@59 1392 @node Intelligent newline, Online help, What column, Top
yuuji@28 1393 @comment node-name, next, previous, up
yuuji@28 1394 @chapter Intelligent newline
yuuji@28 1395 @cindex Intelligent newline
yuuji@28 1396 @cindex ESC RET
yuuji@28 1397 @cindex M-C-m
yuuji@28 1398
yuuji@58 1399 At the end of begin-type completion of tabular[*], array, itemize,
yuuji@58 1400 enumerate or tabbing environment, or typing
yuuji@28 1401
yuuji@28 1402 @table @kbd
yuuji@28 1403 @item ESC RET
yuuji@46 1404 @dots{} Intelligent newline
yuuji@28 1405 @end table
yuuji@28 1406
yuuji@28 1407 @noindent
yuuji@58 1408 in these environments inserts the contents corresponding to the current
yuuji@58 1409 environment in the next line. (At the begin-type completion, this
yuuji@58 1410 contents can be removed by `undo'.) In @code{tabular} environment, for
yuuji@58 1411 example, @kbd{ESC RET} inserts the certain number of @code{&} and trailing
yuuji@58 1412 @code{\\}, and @code{\hline} if other @code{\hline} is found in backward.
yuuji@58 1413 Here are the list of contents vs. environments.
yuuji@28 1414
yuuji@28 1415 @itemize
yuuji@28 1416 @item @code{tabular}, @code{tabular*}, @code{array}
yuuji@28 1417
yuuji@46 1418 Corresponding number of @code{&} and @code{\\}.
yuuji@46 1419 And @code{\hline} if needed.
yuuji@28 1420
yuuji@28 1421 @item @code{tabbing}
yuuji@28 1422
yuuji@46 1423 The same number of @code{\>} as @code{\=} in the first line.
yuuji@28 1424
yuuji@28 1425 @item @code{itemize}, @code{enumerate}, @code{description}, @code{list}
yuuji@28 1426
yuuji@46 1427 @code{\item} or @code{item[]}.
yuuji@28 1428 @end itemize
yuuji@28 1429
yuuji@28 1430 Note that since this function works seeing the contents of the first
yuuji@28 1431 line, please call this after the second line if possible.
yuuji@28 1432
yuuji@28 1433 If you want to apply these trick to other environments, @code{foo}
yuuji@28 1434 environment for example, define the function named
yuuji@28 1435 @code{YaTeX-intelligent-newline-foo} to insert corresponding contents.
yuuji@28 1436 That function will be called at the beginning of the next line after the
yuuji@28 1437 newline is inserted to the current line. Since the function
yuuji@28 1438 @code{YaTeX-indent-line} is designed to indent the current line properly,
yuuji@28 1439 calling this function before your code to insert certain contents must be
yuuji@28 1440 useful. See the definition of the function
yuuji@28 1441 @code{YaTeX-intelligent-newline-itemize} as an example.
yuuji@28 1442
yuuji@53 1443 @node Online help, Browsing file hierarchy, Intelligent newline, Top
yuuji@20 1444 @comment node-name, next, previous, up
yuuji@20 1445 @chapter Online help
yuuji@20 1446 @cindex online help
yuuji@20 1447 @cindex prefix ?
yuuji@20 1448 @cindex prefix /
yuuji@20 1449 @cindex apropos
yuuji@20 1450 @cindex keyword search
yuuji@20 1451
yuuji@20 1452 YaTeX provides you the online help with popular La@TeX{} commands.
yuuji@20 1453
yuuji@20 1454 Here are the key strokes for the online help.
yuuji@20 1455
yuuji@20 1456 @table @kbd
yuuji@20 1457 @item [prefix] ?
yuuji@46 1458 @dots{} Online help
yuuji@20 1459 @item [prefix] /
yuuji@46 1460 @dots{} Online apropos
yuuji@20 1461 @end table
yuuji@20 1462
yuuji@20 1463 @section Online help
yuuji@20 1464
yuuji@20 1465 `Online help' shows the documentation for the popular La@TeX{}
yuuji@20 1466 commands(defaults to the commands on the cursor) in the next buffer.
yuuji@20 1467 There are two help file, `global help' and `private help'. The former
yuuji@20 1468 file contains the descriptions on the standard La@TeX{} command and is
yuuji@20 1469 specified its name by variable @code{YaTeX-help-file}. Usually, the
yuuji@20 1470 global help file should be located in public space (@code{$EMACSEXECPATH}
yuuji@20 1471 by default) and should be world writable so that anyone can update it to
yuuji@20 1472 enrich its contents. The latter file contains descriptions on
yuuji@20 1473 non-standard or personal command definitions and is specified by
yuuji@20 1474 @code{YaTeX-help-file-private}. This file should be put into private
yuuji@20 1475 directory.
yuuji@20 1476
yuuji@20 1477 @section Online apropos
yuuji@20 1478
yuuji@20 1479 `Online apropos' is an equivalent of GNU Emacs's apropos. It
yuuji@20 1480 shows all the documentations that contains the keyword entered by
yuuji@20 1481 the user.
yuuji@20 1482
yuuji@20 1483 @section When no descriptions are found...
yuuji@20 1484
yuuji@20 1485 If there is no description on a command in help files, YaTeX
yuuji@20 1486 requires you to write a description on that command. If you are
yuuji@20 1487 willing to do, determine which help file to add and write the
yuuji@20 1488 description on it referring your manual of (La)TeX. Please send
yuuji@20 1489 me your additional descriptions if you describe the help on some
yuuji@20 1490 standard commands. I might want to include it in the next
yuuji@20 1491 distribution.
yuuji@20 1492
yuuji@53 1493 @node Browsing file hierarchy, Cooperation with other packages, Online help, Top
yuuji@53 1494 @comment node-name, next, previous, up
yuuji@53 1495 @chapter Browsing file hierarchy
yuuji@53 1496 @cindex hierarchy
yuuji@53 1497 @cindex browsing
yuuji@53 1498
yuuji@53 1499 When you are editing multi-file source, typing
yuuji@53 1500
yuuji@53 1501 @table @kbd
yuuji@53 1502 @item [prefix] d
yuuji@53 1503 @dots{} browse file hierarchy
yuuji@53 1504 @end table
yuuji@53 1505
yuuji@53 1506 @noindent
yuuji@53 1507 asks you the parent-most file (which may be defaulted) and displays the
yuuji@53 1508 documentation hierarchy in the next window. In this buffer, the following
yuuji@53 1509 commands are available.
yuuji@53 1510
yuuji@53 1511 @table @kbd
yuuji@53 1512 @item n
yuuji@53 1513 @dots{} move to the next line and show its contents
yuuji@53 1514 @item p
yuuji@53 1515 @dots{} move to the previous line and show its contents
yuuji@53 1516 @item N
yuuji@53 1517 @dots{} move to the next file in the same inclusion level
yuuji@53 1518 @item P
yuuji@53 1519 @dots{} move to the previous file in the same inclusion level
yuuji@53 1520 @item j
yuuji@53 1521 @dots{} move to the next line
yuuji@53 1522 @item k
yuuji@53 1523 @dots{} move to the previous line
yuuji@53 1524 @item u
yuuji@53 1525 @dots{} move to the parent file
yuuji@53 1526 @item .
yuuji@53 1527 @dots{} show the current files contents in the next window
yuuji@53 1528 @item SPC
yuuji@53 1529 @dots{} scroll up the current file window
yuuji@53 1530 @item DEL, b
yuuji@53 1531 @dots{} scroll down the current file window
yuuji@53 1532 @item <
yuuji@53 1533 @dots{} show the beginning of the current file
yuuji@53 1534 @item >
yuuji@53 1535 @dots{} show the end of the current file
yuuji@53 1536 @item >
yuuji@53 1537 @dots{} return to the previous postion after @kbd{<} or @kbd{>}
yuuji@53 1538 @item RET, g
yuuji@53 1539 @dots{} open the current file in the next window
yuuji@53 1540 @item mouse-2
yuuji@53 1541 @dots{} same as RET(available only with window system)
yuuji@53 1542 @item o
yuuji@53 1543 @dots{} other window
yuuji@53 1544 @item 1
yuuji@53 1545 @dots{} delete other windows
yuuji@53 1546 @item -
yuuji@53 1547 @dots{} shrink hierarchy buffer window
yuuji@53 1548 @item +
yuuji@53 1549 @dots{} enlarge hierarchy buffer window
yuuji@53 1550 @item ?
yuuji@53 1551 @dots{} describe mode
yuuji@53 1552 @item q
yuuji@53 1553 @dots{} quit
yuuji@53 1554 @end table
yuuji@53 1555
yuuji@53 1556 Note that operations on the file contents in the next window do not work
yuuji@53 1557 correctly when you close the corresponding file.
yuuji@53 1558
yuuji@53 1559 @node Cooperation with other packages, Customizations, Browsing file hierarchy, Top
yuuji@20 1560 @comment node-name, next, previous, up
yuuji@20 1561 @chapter Cooperation with other packages
yuuji@20 1562
yuuji@20 1563 YaTeX works better with other brilliant packages.
yuuji@20 1564
yuuji@20 1565 @section gmhist
yuuji@20 1566 @cindex gmhist
yuuji@20 1567 @cindex command history
yuuji@20 1568 @cindex minibuffer history
yuuji@20 1569
yuuji@20 1570 When you are loading @file{gmhist.el} and @file{gmhist-mh.el}, you can
yuuji@20 1571 use independent command history list at the prompt of preview command
yuuji@20 1572 (@kbd{[prefix] tp}) and print command (@kbd{[prefix] tl}). On each
yuuji@20 1573 prompt, you can enter the previous command line string repeatedly by
yuuji@20 1574 typing @kbd{M-p}.
yuuji@20 1575
yuuji@20 1576 @section min-out
yuuji@20 1577 @cindex min-out
yuuji@20 1578
yuuji@20 1579 @file{min-out}, the outline minor mode, can be used in yatex-mode
yuuji@20 1580 buffers. If you want to use it with YaTeX, please refer the
yuuji@20 1581 file @file{yatexm-o.el} as an example.
yuuji@20 1582
yuuji@20 1583 @node Customizations, Etcetera, Cooperation with other packages, Top
yuuji@20 1584 @comment node-name, next, previous, up
yuuji@20 1585 @chapter Customizations
yuuji@20 1586 @cindex customizations
yuuji@20 1587
yuuji@20 1588 You can customize YaTeX by setting Emacs-Lisp variables and by making
yuuji@20 1589 add-in functions.
yuuji@20 1590
yuuji@20 1591 @menu
yuuji@20 1592 * Lisp variables::
yuuji@20 1593 * Add-in functions::
yuuji@49 1594 * Add-in generator::
yuuji@20 1595 @end menu
yuuji@20 1596
yuuji@33 1597 @node Lisp variables, Add-in functions, Customizations, Customizations
yuuji@20 1598 @comment node-name, next, previous, up
yuuji@20 1599 @section Lisp variables
yuuji@20 1600 @cindex customizable variables
yuuji@20 1601
yuuji@60 1602 You can change the key assignments or make completion more comfortable
yuuji@60 1603 by setting the values of various variables which control the movement of
yuuji@60 1604 yatex-mode.
yuuji@20 1605
yuuji@20 1606 For example, if you want to change the prefix key stroke from @kbd{C-c}
yuuji@20 1607 to any other sequence, set YaTeX-prefix to whatever you want to use. If
yuuji@20 1608 you don't want to use the key sequence @kbd{C-c letter} which is assumed
yuuji@20 1609 to be the user reserved sequence in Emacs world, set
yuuji@20 1610 @code{YaTeX-inhibit-prefix-letter} to @code{t}, and all of the default key
yuuji@20 1611 bind of @kbd{C-c letter} will turn to the corresponding @kbd{C-c C-letter}
yuuji@20 1612 (but the region based completions that is invoked with @kbd{C-c
yuuji@20 1613 Capital-letter} remain valid, if you want to disable those bindings, set
yuuji@20 1614 that variable to 1 instead of @code{t}).
yuuji@20 1615
yuuji@20 1616 @menu
yuuji@20 1617 * All customizable variables::
yuuji@20 1618 * Sample definitions::
yuuji@20 1619 * Hook variables::
yuuji@20 1620 * Hook file::
yuuji@20 1621 @end menu
yuuji@20 1622
yuuji@33 1623 @node All customizable variables, Sample definitions, Lisp variables, Lisp variables
yuuji@20 1624 @comment node-name, next, previous, up
yuuji@20 1625 @subsection All customizable variables
yuuji@20 1626 @cindex all customizable variables
yuuji@20 1627
yuuji@20 1628 Here are the customizable variables of yatex-mode. Each value setq-ed
yuuji@20 1629 in @file{~/.emacs} is preferred and that of defined in @file{yatex.el} is
yuuji@49 1630 neglected. Parenthesized contents stands for the default value. When you
yuuji@49 1631 are to change some of these variables, see more detailed documentation of
yuuji@49 1632 the variable by @kbd{M-x describe-variable}.
yuuji@20 1633
yuuji@46 1634 @defvar YaTeX-prefix
yuuji@60 1635 Prefix key stroke (@kbd{C-c})
yuuji@46 1636 @end defvar
yuuji@20 1637
yuuji@46 1638 @defvar YaTeX-inhibit-prefix-letter
yuuji@60 1639 Change key stroke from @kbd{C-c letter} to @kbd{C-c C-letter} (@code{nil})
yuuji@46 1640 @end defvar
yuuji@20 1641
yuuji@46 1642 @defvar YaTeX-fill-prefix
yuuji@60 1643 Fill-prefix used in yatex-mode (@code{nil})
yuuji@46 1644 @end defvar
yuuji@20 1645
yuuji@46 1646 @defvar YaTeX-user-completion-table
yuuji@60 1647 Name of user dictionary where learned completion table will be stored.
yuuji@60 1648 (@code{"~/.yatexrc"})
yuuji@60 1649 @end defvar
yuuji@60 1650
yuuji@60 1651 @defvar tex-command
yuuji@60 1652 La@TeX{} typesetter command (@code{"latex"})
yuuji@60 1653 @end defvar
yuuji@60 1654
yuuji@60 1655 @defvar dvi2-command
yuuji@60 1656 Preview command (@code{"xdvi -geo +0+0 -s 4"})
yuuji@60 1657 @end defvar
yuuji@60 1658
yuuji@60 1659 @defvar dviprint-command-format
yuuji@60 1660 Command format to print dvi file (@code{"dvi2ps %f %t %s | lpr"})
yuuji@60 1661 @end defvar
yuuji@60 1662
yuuji@60 1663 @defvar dviprint-from-format
yuuji@60 1664 Start page format of above %f. %b will turn to start page (@code{"-f %b"})
yuuji@60 1665 @end defvar
yuuji@60 1666
yuuji@60 1667 @defvar dviprint-to-format
yuuji@60 1668 End page format of above %t. %e will turn to @code{end} page (@code{"-t %e"})
yuuji@60 1669 @end defvar
yuuji@60 1670
yuuji@60 1671 @defvar makeindex-command
yuuji@60 1672 Default makeindex command (@code{"makeindex"} (@code{"makeind"} on MS-DOS))
yuuji@60 1673 @end defvar
yuuji@60 1674
yuuji@60 1675 @defvar YaTeX-need-nonstop
yuuji@60 1676 Put @code{\nonstopmode@{@}} or not (@code{nil})
yuuji@60 1677 @end defvar
yuuji@60 1678
yuuji@60 1679 @defvar latex-warning-regexp
yuuji@60 1680 Regular expression of warning message latex command puts out
yuuji@60 1681 (@code{"line.* [0-9]*"})
yuuji@60 1682 @end defvar
yuuji@60 1683
yuuji@60 1684 @defvar latex-error-regexp
yuuji@60 1685 Regular expression of error message (@code{"l\\.[1-9][0-9]*"})
yuuji@60 1686 @end defvar
yuuji@60 1687
yuuji@60 1688 @defvar latex-dos-emergency-message
yuuji@60 1689 Message latex command running on DOS puts at abort (@code{"Emergency stop"})
yuuji@46 1690 @end defvar
yuuji@20 1691
yuuji@46 1692 @defvar YaTeX-item-regexp
yuuji@60 1693 Regular expression of item command (@code{"\\\\item"})
yuuji@46 1694 @end defvar
yuuji@20 1695
yuuji@51 1696 @defvar YaTeX-verb-regexp
yuuji@60 1697 Regexp of verb family. Omit \\\\. (@code{"verb\\*?\\|path"})
yuuji@51 1698 @end defvar
yuuji@51 1699
yuuji@60 1700 @defvar YaTeX-nervous
yuuji@60 1701 T for using local dictionary (@code{t})
yuuji@46 1702 @end defvar
yuuji@20 1703
yuuji@46 1704 @defvar YaTeX-sectioning-regexp
yuuji@60 1705 Regexp of La@TeX{} sectioning command
yuuji@60 1706 (@code{"\\(part\\|chapter\\*?\\|\\(sub\\)*\\(section\\|paragraph\\)\\*?\\)\\b"})
yuuji@46 1707 @end defvar
yuuji@20 1708
yuuji@46 1709 @defvar YaTeX-fill-inhibit-environments
yuuji@60 1710 Inhibit fill in these environments
yuuji@60 1711 (@code{'("tabular" "tabular*" "array" "picture" "eqnarray" "eqnarray*" "equation" "math" "displaymath" "verbatim" "verbatim*")})
yuuji@46 1712 @end defvar
yuuji@20 1713
yuuji@46 1714 @defvar YaTeX-uncomment-once
yuuji@60 1715 T for deleting all preceding @code{%} (@code{nil})
yuuji@46 1716 @end defvar
yuuji@20 1717
yuuji@46 1718 @defvar YaTeX-close-paren-always
yuuji@60 1719 T for always close all parenthesis automatically, @code{nil} for only eol
yuuji@60 1720 (@code{t})
yuuji@46 1721 @end defvar
yuuji@20 1722
yuuji@46 1723 @defvar YaTeX-auto-math-mode
yuuji@60 1724 Switch math-mode automatically (@code{t})
yuuji@46 1725 @end defvar
yuuji@20 1726
yuuji@51 1727 @defvar YaTeX-math-key-list-private
yuuji@60 1728 User defined alist, math-mode-prefix vs completion alist
yuuji@60 1729 used in image completion (@code{nil}). See @file{yatexmth.el}
yuuji@60 1730 for the information about how to define a completion alist.
yuuji@51 1731 @end defvar
yuuji@51 1732
yuuji@46 1733 @defvar YaTeX-default-pop-window-height
yuuji@60 1734 Initial height of typesetting buffer when one-window.
yuuji@60 1735 Number for the lines of the buffer, numerical string for
yuuji@60 1736 the percentage of the screen-height. @code{nil} for half height (10)
yuuji@46 1737 @end defvar
yuuji@20 1738
yuuji@46 1739 @defvar YaTeX-help-file
yuuji@60 1740 Global online help file name (@file{$EMACS/etc/YATEXHLP.jp})
yuuji@46 1741 @end defvar
yuuji@20 1742
yuuji@46 1743 @defvar YaTeX-help-file-private
yuuji@60 1744 Private online help file name (@file{"~/YATEXHLP.jp"})
yuuji@46 1745 @end defvar
yuuji@20 1746
yuuji@46 1747 @defvar YaTeX-no-begend-shortcut
yuuji@60 1748 Disable [prefix] b ?? shortcut (@code{nil)}
yuuji@46 1749 @end defvar
yuuji@20 1750
yuuji@49 1751 @defvar YaTeX-hilit-pattern-adjustment-private
yuuji@49 1752 List of the list that contain the regular expression and the symbol of
yuuji@49 1753 logical meaning of the string that matches the pattern. See also the
yuuji@49 1754 value from @code{(assq 'yatex-mode hilit-patterns-alist)} and the value of
yuuji@49 1755 @code{YaTeX-hilit-pattern-adjustment-default} (and even the document of
yuuji@49 1756 hilit19.el).
yuuji@49 1757 @end defvar
yuuji@49 1758
yuuji@49 1759 @defvar YaTeX-sectioning-level
yuuji@49 1760 Alist of LaTeX's sectioning command vs its height.
yuuji@49 1761 @end defvar
yuuji@49 1762
yuuji@53 1763 @defvar YaTeX-hierarchy-ignore-heading-regexp
yuuji@53 1764 @code{YaTeX-display-hierarchy} searches for sectioning command first, and
yuuji@53 1765 comment line secondary as a file headings. In latter case, ignore lines
yuuji@53 1766 that match with regular expression of this variable. Default value of
yuuji@53 1767 this variable is RCS header expressions and mode specifying line `-*- xxxx
yuuji@53 1768 -*'.
yuuji@53 1769 @end defvar
yuuji@53 1770
yuuji@54 1771 @defvar YaTeX-skip-default-reader
yuuji@54 1772 Non-nil for this variable skips the default argument reader of
yuuji@60 1773 section-type command when add-in function for it is not defined
yuuji@60 1774 (@code{nil})
yuuji@54 1775 @end defvar
yuuji@54 1776
yuuji@56 1777 @defvar YaTeX-create-file-prefix-g
yuuji@56 1778 When typing @kbd{prefix g} on the @code{\include} line,
yuuji@60 1779 open the target file even if the file doesn't exist (@code{nil})
yuuji@56 1780 @end defvar
yuuji@56 1781
yuuji@56 1782 @defvar YaTeX-simple-messages
yuuji@60 1783 Simplyfy messages of various completions (@code{nil})
yuuji@56 1784 @end defvar
yuuji@56 1785
yuuji@57 1786 @defvar YaTeX-hilit-sectioning-face
yuuji@57 1787 When hilit19 and yatex19 is active, YaTeX colors the sectioning commands.
yuuji@57 1788 This variable specifies the foreground and background color of
yuuji@57 1789 @code{\part} macro. The default value is @code{'(yellow/dodgerblue
yuuji@57 1790 yellow/slateblue)}. The first element of this list is for the screen when
yuuji@57 1791 @code{hilit-background-mode} is @code{'light}, and the second element is
yuuji@57 1792 for @code{'dark}. You should specify both color as `forecolor/backcolor'.
yuuji@57 1793 @end defvar
yuuji@57 1794
yuuji@57 1795 @defvar YaTeX-hilit-sectioning-attenuation-rate
yuuji@57 1796 When color mode, this variable specifies how much attenuate the color
yuuji@60 1797 density of @code{\subparagraph} compared with that of @code{\chapter}
yuuji@60 1798 (@code{'(15 40)}) See also @code{YaTeX-hilit-sectioning-face}.
yuuji@57 1799 @end defvar
yuuji@56 1800
yuuji@58 1801 @defvar YaTeX-use-AMS-LaTeX
yuuji@60 1802 If you use AMS-LaTeX, set to @code{t} (@code{nil})
yuuji@58 1803 @end defvar
yuuji@56 1804
yuuji@70 1805 @defvar YaTeX-use-LaTeX2e
yuuji@70 1806 If you use LaTeX2e, set to @code{t} (@code{nil})
yuuji@70 1807 @end defvar
yuuji@70 1808
yuuji@65 1809 @defvar YaTeX-template-file
yuuji@65 1810 File name which is automatically inserted at creation
yuuji@65 1811 (@code{~/work/template.tex})
yuuji@65 1812 @end defvar
yuuji@65 1813
yuuji@72 1814 @defvar YaTeX-search-file-from-top-directory
yuuji@72 1815 Non-nil means to search input-files from the directory where main file exists
yuuji@72 1816 (@code{t})
yuuji@72 1817 @end defvar
yuuji@72 1818
yuuji@72 1819 @defvar YaTeX-use-font-lock
yuuji@72 1820 Use font-lock to fontify buffer or not (@code{(featurep 'font-lock)}
yuuji@72 1821 @end defvar
yuuji@72 1822
yuuji@72 1823 @defvar YaTeX-use-hilit19
yuuji@72 1824 Use hilit19 to highlight buffer or not (@code{(featurep 'hilit19)}
yuuji@72 1825 @end defvar
yuuji@72 1826
yuuji@72 1827 @defvar YaTeX-use-italic-bold
yuuji@72 1828 YaTeX tries to search italic, bold fontsets or not
yuuji@72 1829 (@code{t} if Emacs-20 or later). This variable is effective only when
yuuji@72 1830 font-lock is used.
yuuji@72 1831 (@code{(featurep 'hilit19)}
yuuji@72 1832 @end defvar
yuuji@72 1833
yuuji@72 1834
yuuji@20 1835 @node Sample definitions, Hook variables, All customizable variables, Lisp variables
yuuji@20 1836 @comment node-name, next, previous, up
yuuji@20 1837 @subsection Sample definitions
yuuji@20 1838 @cindex prefix key stroke
yuuji@20 1839 @cindex fill-prefix
yuuji@20 1840
yuuji@20 1841 For instance, to change the prefix key stroke to @kbd{ESC}, and name of
yuuji@20 1842 the user dictionary @file{~/src/emacs/yatexrc}, and set @code{fill-prefix}
yuuji@20 1843 to single TAB character, add the following @code{setq} to @file{~/.emacs}.
yuuji@20 1844
yuuji@20 1845 @lisp
yuuji@46 1846 (setq YaTeX-prefix "\e"
yuuji@46 1847 YaTeX-user-completion-table "~/src/emacs/yatexrc"
yuuji@46 1848 YaTeX-fill-prefix " ")
yuuji@20 1849 @end lisp
yuuji@20 1850
yuuji@20 1851 @node Hook variables, Hook file, Sample definitions, Lisp variables
yuuji@20 1852 @comment node-name, next, previous, up
yuuji@20 1853 @subsection Hook variables
yuuji@20 1854 @cindex hook variables
yuuji@20 1855
yuuji@20 1856 More customizations will be done by the hook-function defined in
yuuji@20 1857 hook-variable @code{yatex-mode-hook}. This is useful to define a shortcut
yuuji@20 1858 key sequence to enter some environments other than @code{document} and
yuuji@20 1859 @code{enumerate} etc. The following statement defines @code{[prefix] ba}
yuuji@20 1860 to enter @code{\begin@{abstract@}} ... @code{=end@{abstract@}}
yuuji@20 1861 immediately.
yuuji@20 1862
yuuji@20 1863 @lisp
yuuji@46 1864 (setq yatex-mode-hook
yuuji@46 1865 '(lambda() (YaTeX-define-begend-key "ba" "abstract")))
yuuji@20 1866 @end lisp
yuuji@20 1867
yuuji@46 1868 You should use functions @code{YaTeX-define-key}, or
yuuji@46 1869 @code{YaTeX-define-begend-key} to define all the key sequences of
yuuji@20 1870 yatex-mode.
yuuji@20 1871
yuuji@20 1872 @node Hook file, , Hook variables, Lisp variables
yuuji@20 1873 @comment node-name, next, previous, up
yuuji@20 1874 @subsection Hook file
yuuji@20 1875 @cindex hook file
yuuji@20 1876
yuuji@58 1877 You can stuff all of YaTeX related expressions into a file named
yuuji@20 1878 @file{yatexhks.el} if you have a lot of codes. YaTeX automatically load
yuuji@20 1879 this file at the initialization of itself. Using @file{yatexhks.el}
yuuji@20 1880 makes @code{yatex-mode-load-hook} unnecessary.
yuuji@20 1881
yuuji@49 1882 @node Add-in functions, Add-in generator, Lisp variables, Customizations
yuuji@20 1883 @comment node-name, next, previous, up
yuuji@20 1884 @section Add-in functions
yuuji@20 1885 @cindex add-in functions
yuuji@49 1886 @cindex yatexadd.el
yuuji@20 1887
yuuji@20 1888 You can easily define a function to input detailed arguments
yuuji@49 1889 with completion according to La@TeX{} environments or commands.
yuuji@20 1890
yuuji@49 1891 @c @node What is add-in functions?, , Add-in functions, Add-in functions
yuuji@49 1892 @comment node-name, next, previous, up
yuuji@49 1893 @subsection What is add-in functions?
yuuji@49 1894 @cindex tabular
yuuji@49 1895
yuuji@49 1896 When you input @code{tabular} environment, don't you think ``I want
yuuji@49 1897 YaTeX to complete its argument toward my favorite one such as
yuuji@49 1898 @code{@{|c|c|c|@}}...''? Yes, you can define the function to complete
yuuji@49 1899 arguments for any environment and any La@TeX{} commands.
yuuji@49 1900
yuuji@49 1901 @subsection Procedure
yuuji@49 1902
yuuji@49 1903 Here is the procedure to define add-in functions.
yuuji@49 1904 @enumerate
yuuji@49 1905 @item
yuuji@49 1906 Define the function
yuuji@49 1907 @item
yuuji@49 1908 Put the function into @file{yatexhks.el}
yuuji@49 1909 @end enumerate
yuuji@49 1910
yuuji@49 1911 @menu
yuuji@58 1912 * How the add-in function works::
yuuji@49 1913 * How the function is called::
yuuji@49 1914 * Useful functions for creating add-in::
yuuji@49 1915 * Contribution::
yuuji@49 1916 @end menu
yuuji@49 1917
yuuji@58 1918 @node How the add-in function works, How the function is called, Add-in functions, Add-in functions
yuuji@49 1919 @comment node-name, next, previous, up
yuuji@58 1920 @subsection How the add-in function works
yuuji@49 1921
yuuji@49 1922 There are two kinds of add-in. @dfn{Option add-in} returns the
yuuji@49 1923 La@TeX{}'s optional parameters such as optional strings after
yuuji@49 1924 @code{\begin@{ENV@}}, optional strings between a section-type command
yuuji@49 1925 and its first argument, and optional strings just after type
yuuji@49 1926 maketitle-type command. The following illustrates the name of add-in
yuuji@49 1927 functions, where underlined strings are generated by add-in functions.
yuuji@49 1928
yuuji@49 1929 @display
yuuji@70 1930 \begin@{table@}[ht] (Function name: YaTeX:table)
yuuji@49 1931 ~~~~
yuuji@70 1932 \put(100,200)@{@} (Function name: YaTeX:put)
yuuji@49 1933 ~~~~~~~~~
yuuji@70 1934 \sum_@{i=0@}^@{n@} (Function name: YaTeX:sum)
yuuji@49 1935 ~~~~~~~~~~
yuuji@49 1936 @end display
yuuji@49 1937
yuuji@49 1938 Obviously, the function name is decided by concatenating the prefix
yuuji@49 1939 `YaTeX:' and La@TeX{} command's name.
yuuji@49 1940
yuuji@49 1941 Another add-in type is @dfn{argument add-in}, which completes arguments
yuuji@49 1942 for section-type commands.
yuuji@49 1943
yuuji@49 1944 @display
yuuji@70 1945 \newcommand@{\foo@}@{bar@} (Function name: YaTeX::newcommand)
yuuji@49 1946 ~~~~ ~~~
yuuji@49 1947 @end display
yuuji@49 1948
yuuji@49 1949 When the section-type command is inputted, the function named by
yuuji@49 1950 concatenating `YaTeX::' and section-type command, is called automatically
yuuji@49 1951 with an integer argument which indicates which argument of section-type
yuuji@49 1952 command is being read. Thus the add-in should determine the
yuuji@51 1953 job referring the value of its argument.
yuuji@49 1954
yuuji@49 1955 @menu
yuuji@68 1956 * Defining option-add-in::
yuuji@68 1957 * Defining argument-add-in::
yuuji@49 1958 @end menu
yuuji@49 1959
yuuji@68 1960 @node Defining option-add-in, Defining argument-add-in, How the add-in function works, How the add-in function works
yuuji@49 1961 @comment node-name, next, previous, up
yuuji@49 1962 @subsubsection Defining `option add-in'
yuuji@49 1963
yuuji@49 1964 If you want @code{@{|c|c|c|@}} for all @code{tabular} environment,
yuuji@49 1965
yuuji@49 1966 @lisp
yuuji@49 1967 (defun YaTeX:tabular ()
yuuji@70 1968 "@{|c|c|c|@}")
yuuji@49 1969 @end lisp
yuuji@49 1970
yuuji@49 1971 @noindent
yuuji@49 1972 is enough. If you want more complicated format, define as below.
yuuji@49 1973
yuuji@49 1974 @lisp
yuuji@49 1975 (defun YaTeX:tabular ()
yuuji@49 1976 "@{@@@{\\vrule width 1pt\\ @}|||@@@{\\ \\vrule width 1pt@}@}")
yuuji@49 1977 @end lisp
yuuji@49 1978
yuuji@49 1979 @noindent
yuuji@49 1980 Note that the character @code{\} must be described as @code{\\} in
yuuji@49 1981 Emacs-Lisp. The next example reads the tabular format from keyboard.
yuuji@49 1982 @lisp
yuuji@49 1983 (defun YaTeX:tabular ()
yuuji@70 1984 (concat "@{" (read-string "Rule: ") "@}"))
yuuji@49 1985 @end lisp
yuuji@49 1986
yuuji@68 1987 @node Defining argument-add-in, , Defining option-add-in, How the add-in function works
yuuji@49 1988 @comment node-name, next, previous, up
yuuji@49 1989 @subsubsection Defining `argument add-in'
yuuji@49 1990
yuuji@49 1991 This section describes how to define the add-in function for
yuuji@49 1992 @code{\newcommand}.
yuuji@49 1993
yuuji@49 1994 The first argument of @code{\newcommand} begins always with @code{\}.
yuuji@49 1995 The second argument is usually so complex that we can not edit them in the
yuuji@49 1996 minibuffer. Here is the created function considering this.
yuuji@49 1997
yuuji@49 1998 @lisp
yuuji@49 1999 (defun YaTeX::newcommand (n) ;n is argument position
yuuji@49 2000 (cond
yuuji@49 2001 ((= n 1) ;1st argument is macro name
yuuji@49 2002 (read-string "Command: " "\\")) ;initial input `\'
yuuji@49 2003 ((= n 2) "") ;do nothing when reading arg#2
yuuji@49 2004 (t nil)))
yuuji@49 2005 @end lisp
yuuji@49 2006
yuuji@49 2007 Note that when the `argument add-in' function return `nil', normal
yuuji@49 2008 argument reader will be called.
yuuji@49 2009
yuuji@58 2010 @node How the function is called, Useful functions for creating add-in, How the add-in function works, Add-in functions
yuuji@49 2011 @comment node-name, next, previous, up
yuuji@49 2012 @subsection How the function is called
yuuji@49 2013
yuuji@49 2014 YaTeX calls the add-in functions for specified begin-type, section-type,
yuuji@49 2015 and maketitle-type command, if any. `Option add-in' functions for
yuuji@49 2016 begin-type are called when @code{\begin@{ENV@}} has been inserted,
yuuji@49 2017 functions for section-type are called just before input of the first
yuuji@49 2018 argument, and functions for maketitle-type is called after maketitle-type
yuuji@49 2019 command has been inserted. `Argument add-in' functions are called at each
yuuji@49 2020 entry of arguments for section-type commands.
yuuji@49 2021
yuuji@49 2022 @node Useful functions for creating add-in, Contribution, How the function is called, Add-in functions
yuuji@49 2023 @comment node-name, next, previous, up
yuuji@49 2024 @subsection Useful functions for creating add-in
yuuji@49 2025
yuuji@49 2026 Many add-in functions for typical La@TeX{} commands are defined in
yuuji@49 2027 @file{yatexadd.el}. Those are also useful as references. Here are the
yuuji@49 2028 short descriptions on useful functions, where [F] means function, [A]
yuuji@49 2029 means arguments, [D] means description.
yuuji@49 2030
yuuji@69 2031 @table @kbd
yuuji@49 2032 @item [F]
yuuji@49 2033 YaTeX:read-position
yuuji@49 2034 @itemx [A]
yuuji@49 2035 Character list which can show up in the brackets
yuuji@49 2036 @itemx [D]
yuuji@49 2037 Return the location specifier such as `[htb]'. When
yuuji@49 2038 nothing is entered, omit [] itself. If the possible characters
yuuji@49 2039 are "htbp", call this function as
yuuji@49 2040 @code{(YaTeX:read-position "htbp")}
yuuji@49 2041
yuuji@49 2042 @item [F]
yuuji@49 2043 YaTeX:read-coordinates
yuuji@49 2044 @itemx [A]
yuuji@49 2045 Base prompt, X-axis prompt, Y-axis prompt (each optional)
yuuji@49 2046 @itemx [D]
yuuji@51 2047 Read the coordinates with the prompt ``BasePrompt X-axisPrompt:'' for
yuuji@49 2048 X-axis, ``BasePrompt Y-axisPrompt:'' for Y-axis, and return it in the form
yuuji@51 2049 of ``(X,Y)''. The default prompts are @code{Dimension}, @code{X},
yuuji@49 2050 @code{Y} respectively.
yuuji@49 2051
yuuji@49 2052 @item [F]
yuuji@51 2053 YaTeX:check-completion-type
yuuji@49 2054 @itemx [A]
yuuji@49 2055 One of the symbols: 'begin, 'section, or 'maketitle
yuuji@49 2056 @itemx [D]
yuuji@49 2057 Check the current completion type is specified one and cause error if
yuuji@49 2058 not. The variable @code{YaTeX-current-completion-type} holds the symbol
yuuji@49 2059 according to the current completion type.
yuuji@69 2060 @end table
yuuji@49 2061
yuuji@49 2062 @node Contribution, , Useful functions for creating add-in, Add-in functions
yuuji@49 2063 @comment node-name, next, previous, up
yuuji@49 2064 @subsection Contribution
yuuji@49 2065
yuuji@49 2066 If you make your own pretty function and you let it be in public, please
yuuji@49 2067 send me the function. I'm going to include it in the next release.
yuuji@49 2068
yuuji@49 2069 @node Add-in generator, , Add-in functions, Customizations
yuuji@49 2070 @comment node-name, next, previous, up
yuuji@49 2071 @section Add-in generator
yuuji@49 2072
yuuji@49 2073 First, don't forget to read the section of add-in functions @ref{Add-in
yuuji@49 2074 functions}. If you easily understand how to define them, there's no need
yuuji@49 2075 to read this section. But being not familiar with Emacs-Lisp, when you
yuuji@49 2076 don't have clear idea what to do, this section describes how to get YaTeX
yuuji@49 2077 make add-in function.
yuuji@49 2078
yuuji@49 2079 There are two methods of generation. One is for fully interactive
yuuji@49 2080 generator for beginners and another requires little knowledge of
yuuji@49 2081 Emacs-Lisp.
yuuji@49 2082
yuuji@49 2083 @subsection Generator for beginners
yuuji@49 2084 The former generator is called by
yuuji@49 2085 @center @kbd{M-x YaTeX-generate}
yuuji@49 2086
yuuji@49 2087 @noindent
yuuji@49 2088 strokes. All you have to do is follow the guidances. Defying them may cases
yuuji@49 2089 the disaster (I wonder what is it???). So when you make some mistake, it
yuuji@49 2090 is recommendable to type @kbd{C-g} and start afresh.
yuuji@49 2091
yuuji@49 2092 @subsection Simple generator
yuuji@49 2093
yuuji@49 2094 The latter generator is invoked by the next sequence.
yuuji@49 2095 @center @kbd{M-x YaTeX-generate-simple}
yuuji@49 2096 This generator can make both ``option add-in'' and ``argument add-in''
yuuji@49 2097 (@emph{refer the section add-in functions}
yuuji@68 2098 @ref{How the add-in function works}), whereas @code{YaTeX-generate}
yuuji@49 2099 cannot make ``argument addin''.
yuuji@49 2100
yuuji@49 2101 For example, assume you have the LaTeX command as follows.
yuuji@49 2102
yuuji@49 2103 @example
yuuji@70 2104 \epsinput[t](250,50)@{hoge.eps@}@{plain@}@{Picture of foo@}
yuuji@49 2105 (A) (B) (1) (2) (3)
yuuji@49 2106 (A)Optional parameter to specify the position
yuuji@49 2107 One of t(top), b(bottom), l(left), r(right)
yuuji@49 2108 (B)Maximum size of frame
yuuji@49 2109 (1)1st argument is filename of EPS file
yuuji@49 2110 (2)2nd argument indicates
yuuji@49 2111 plain do nothing
yuuji@49 2112 frame make frame around image
yuuji@49 2113 dframe make double-frame around image
yuuji@49 2114 for included EPS file.
yuuji@49 2115 (3)Caption for the picture
yuuji@49 2116 @end example
yuuji@49 2117
yuuji@49 2118 Now get start with generation. Typing @kbd{M-x YaTeX-generate-simple}
yuuji@49 2119 brings the prompt:
yuuji@49 2120 @display
yuuji@49 2121 (O)ption? (A)rgument?
yuuji@49 2122 @end display
yuuji@49 2123
yuuji@49 2124 @subsubsection Generating ``option add-in''
yuuji@49 2125 @cindex option add-in
yuuji@49 2126
yuuji@49 2127 Since (A), (B) above are optional argument, all we have to do to
yuuji@49 2128 complete them is define the option add-in for them. Let's generate the
yuuji@49 2129 function to complete (A).
yuuji@49 2130
yuuji@49 2131 @display
yuuji@49 2132 M-x YaTeX-generate-simple RET
yuuji@49 2133 epsinput RET
yuuji@49 2134 o
yuuji@49 2135 @end display
yuuji@49 2136
yuuji@49 2137 @noindent
yuuji@49 2138 Typing as above leads the next prompt.
yuuji@49 2139
yuuji@49 2140 @display
yuuji@49 2141 Read type(1): (S)tring (C)omplete (F)ile ([)option (P)osition co(O)rd. (q)uit
yuuji@49 2142 @end display
yuuji@49 2143
yuuji@49 2144 @noindent
yuuji@49 2145 This asks that ``Which type is the completion style of 1st argument?''.
yuuji@49 2146 Here are the possible completion style.
yuuji@49 2147
yuuji@49 2148 @table @code
yuuji@49 2149 @item String
yuuji@49 2150 read plain string
yuuji@49 2151 @item Complete
yuuji@49 2152 read with completion
yuuji@49 2153 @item File
yuuji@49 2154 read file name
yuuji@49 2155 @item Option
yuuji@49 2156 read optional string (if string omitted, omit [] too)
yuuji@49 2157 @item Position
yuuji@49 2158 read positional option (like [htbp])
yuuji@49 2159 @item Coord.
yuuji@51 2160 read coordinates
yuuji@49 2161 @item Quit
yuuji@51 2162 quit from generating
yuuji@49 2163 @end table
yuuji@49 2164
yuuji@49 2165 Since (A) is the optional argument to specify the location of included
yuuji@49 2166 EPS file, the completion style is @code{Position}, and the possible
yuuji@49 2167 characters are t, b, l, and r. To tell these information to generator,
yuuji@49 2168 operate as follows.
yuuji@49 2169
yuuji@49 2170 @display
yuuji@49 2171 Read type(1).... p
yuuji@49 2172 Acceptable characters: tblr RET
yuuji@49 2173 @end display
yuuji@49 2174
yuuji@49 2175 (B) is coordinate. So its completion style is coOrd. We want a prompt
yuuji@49 2176 meaning ``Maximum size'' when completion.
yuuji@49 2177
yuuji@49 2178 @display
yuuji@49 2179 Read type(2).... o
yuuji@49 2180 Prompt for coordinates: Max size RET
yuuji@49 2181 @end display
yuuji@49 2182
yuuji@49 2183 That's all for optional argument. Select quit.
yuuji@49 2184
yuuji@49 2185 @display
yuuji@49 2186 Read type(3).... q
yuuji@49 2187 @end display
yuuji@49 2188
yuuji@49 2189 Then the generated option add-in function for \epsinput will be shown in
yuuji@49 2190 the next window.
yuuji@49 2191
yuuji@49 2192 @subsubsection Generating ``argument add-in''
yuuji@49 2193 @cindex argument add-in
yuuji@49 2194
yuuji@49 2195 Next, create the argument add-in. The arguments for \epsinput are EPS
yuuji@49 2196 file name, framing style, and caption string in sequence.
yuuji@49 2197
yuuji@49 2198 @display
yuuji@49 2199 M-x YaTeX-generate-simple RET
yuuji@49 2200 epsinput RET
yuuji@49 2201 a
yuuji@49 2202 @end display
yuuji@49 2203
yuuji@49 2204 Above key strokes bring the prompt that asks the number of argument.
yuuji@49 2205 Answer it with 3.
yuuji@49 2206
yuuji@49 2207 @display
yuuji@49 2208 How many arguments?: 3 RET
yuuji@49 2209 @end display
yuuji@49 2210
yuuji@49 2211 Then the generator asks the completion style and prompt for completion.
yuuji@49 2212 Answer them. @kbd{f} for FileName and prompt string.
yuuji@49 2213
yuuji@49 2214 @display
yuuji@49 2215 Read type(1).... f
yuuji@49 2216 Prompt for argument#1 EPS file name RET
yuuji@49 2217 @end display
yuuji@49 2218
yuuji@49 2219 The second argument is one of selected symbol. So the completion type
yuuji@49 2220 is @code{Completion}.
yuuji@49 2221
yuuji@49 2222 @display
yuuji@49 2223 Read type(2).... c
yuuji@49 2224 Prompt for argument#2 Include style RET
yuuji@49 2225 @end display
yuuji@49 2226
yuuji@49 2227 Then all the candidates ready to be read. Type single RET after
yuuji@49 2228 entering all.
yuuji@49 2229
yuuji@49 2230 @display
yuuji@49 2231 Item[1](RET to exit): plain RET
yuuji@49 2232 Item[2](RET to exit): frame RET
yuuji@49 2233 Item[3](RET to exit): dframe RET
yuuji@49 2234 Item[4](RET to exit): RET
yuuji@49 2235 @end display
yuuji@49 2236
yuuji@49 2237 The following prompt asks whether the entered string must belong to
yuuji@49 2238 candidates or not. In this case, since the argument must be one of
yuuji@49 2239 @code{plain}, @code{frame}, and @code{dframe}, type @code{y}.
yuuji@49 2240
yuuji@49 2241 @display
yuuji@49 2242 Require match? (y or n) y
yuuji@49 2243 @end display
yuuji@49 2244
yuuji@49 2245 The last argument is the caption string for which any completion is
yuuji@49 2246 needed.
yuuji@49 2247
yuuji@49 2248 @display
yuuji@49 2249 Read type(3).... s
yuuji@49 2250 Prompt for argument#3 Caption RET
yuuji@49 2251 default: Figure of RET
yuuji@49 2252 @end display
yuuji@49 2253
yuuji@49 2254 Finally we'll get the argument add-in in the next window.
yuuji@49 2255
yuuji@49 2256 @subsection Contribution
yuuji@49 2257
yuuji@49 2258 If you get your own pretty function and you let it be in public, please
yuuji@51 2259 steel yourself in the happy atmosphere and do not send me the function.
yuuji@49 2260 I do know it is not fine because it is generated by yatexgen:-p.
yuuji@20 2261
yuuji@20 2262 @node Etcetera, Copying, Customizations, Top
yuuji@20 2263 @comment node-name, next, previous, up
yuuji@20 2264 @chapter Etcetera
yuuji@20 2265
yuuji@20 2266 The standard completion tables provided in @file{yatex.el} contain a
yuuji@20 2267 few La@TeX{} commands I frequently use. This is to lessen the key
yuuji@20 2268 strokes to complete entire word, because too many candidates
yuuji@20 2269 rarely used often cause too many hits. Therefore always try to
yuuji@20 2270 use completion in order to enrich your dictionary, and you will
yuuji@20 2271 also find `Wild Bird' growing suitable for your La@TeX{} style.
yuuji@20 2272
yuuji@51 2273 The package name `Wild Bird' is the English translation of Japanese
yuuji@51 2274 title `Yachou', which is a trick on words of Japanese.
yuuji@20 2275
yuuji@20 2276 @node Copying, , Etcetera, Top
yuuji@20 2277 @comment node-name, next, previous, up
yuuji@20 2278 @chapter Copying
yuuji@20 2279
yuuji@20 2280 This program is distributed as a free software. You can
yuuji@20 2281 redistribute this software freely but with NO warranty to anything
yuuji@20 2282 as a result of using this software. However, any reports and
yuuji@20 2283 suggestions are welcome as long as I feel interests in this
yuuji@70 2284 software. My possible e-mail address is `yuuji@@yatex.org'.
yuuji@72 2285 (up to Dec.2000 at least) And there is mailing list for YaTeX.
yuuji@52 2286 Although the common language is Japanese, questions in English will be
yuuji@52 2287 welcome. To join the ML, send the mail whose subject is `append' to
yuuji@72 2288 the address `yatex@@yatex.org. If you have some
yuuji@72 2289 question, please ask to `yatex-admin@@yatex.org'.
yuuji@20 2290
yuuji@20 2291 The specification of this software will be surely modified
yuuji@20 2292 (depending on my feelings) without notice :-p.
yuuji@20 2293
yuuji@20 2294
yuuji@20 2295 @flushright
yuuji@20 2296 HIROSE Yuuji
yuuji@20 2297 @end flushright
yuuji@20 2298 @bye
yuuji@20 2299
yuuji@20 2300 Local variables:
yuuji@20 2301 mode: texinfo
yuuji@20 2302 fill-prefix: nil
yuuji@20 2303 fill-column: 74
yuuji@20 2304 End: