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