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