diff options
| author | Chong Yidong | 2008-11-26 04:13:33 +0000 |
|---|---|---|
| committer | Chong Yidong | 2008-11-26 04:13:33 +0000 |
| commit | 3a5244ab84dbcdc28bb0d54c79a30ddc590accdd (patch) | |
| tree | d3dfa5c1cdf66dee77f69c6de94848c5367c890a | |
| parent | aa5ab79aaebeeafa4eea42d12ba1413c847eaaa7 (diff) | |
| download | emacs-3a5244ab84dbcdc28bb0d54c79a30ddc590accdd.tar.gz emacs-3a5244ab84dbcdc28bb0d54c79a30ddc590accdd.zip | |
(Text): Simplify description of markup languages.
(TeX Mode): Simplify introduction. Mention BibTeX mode.
(TeX Editing): Note that `""' inserts one `"' character.
(HTML Mode): Note in the introduction that XML mode is an alias for
SGML mode. Mention nXML mode.
| -rw-r--r-- | doc/emacs/text.texi | 165 |
1 files changed, 87 insertions, 78 deletions
diff --git a/doc/emacs/text.texi b/doc/emacs/text.texi index 46ee01855ee..ee1c6be7fd5 100644 --- a/doc/emacs/text.texi +++ b/doc/emacs/text.texi | |||
| @@ -26,23 +26,11 @@ structure. | |||
| 26 | @xref{Outline Mode}. | 26 | @xref{Outline Mode}. |
| 27 | @end iftex | 27 | @end iftex |
| 28 | 28 | ||
| 29 | For text which contains embedded commands for text formatters, Emacs | 29 | Emacs has other major modes for text which contains ``embedded'' |
| 30 | has other major modes, each for a particular formatter. For instance, | 30 | commands, such as @TeX{} and La@TeX{} (@pxref{TeX Mode}); HTML, SGML, |
| 31 | La@TeX{} mode is used for editing La@TeX{} | 31 | and XML (@pxref{HTML Mode}); and Groff and Nroff (@pxref{Nroff Mode}). |
| 32 | @iftex | 32 | In addition, you can edit formatted text in WYSIWYG style (``what you |
| 33 | documents (@pxref{LaTeX,,La@TeX{} Mode}), | 33 | see is what you get''), using Enriched mode (@pxref{Formatted Text}). |
| 34 | @end iftex | ||
| 35 | @ifnottex | ||
| 36 | documents, | ||
| 37 | @end ifnottex | ||
| 38 | while Nroff mode is used for editing groff or nroff files. | ||
| 39 | |||
| 40 | Instead of using a text formatter, you can edit formatted text in | ||
| 41 | WYSIWYG style (``what you see is what you get''), with Enriched mode. | ||
| 42 | Then the formatting appears on the screen in Emacs while you edit. | ||
| 43 | @iftex | ||
| 44 | @xref{Formatted Text}. | ||
| 45 | @end iftex | ||
| 46 | 34 | ||
| 47 | @cindex ASCII art | 35 | @cindex ASCII art |
| 48 | If you need to edit pictures made out of text characters (commonly | 36 | If you need to edit pictures made out of text characters (commonly |
| @@ -1365,36 +1353,38 @@ automatically by putting this in your @file{.emacs} file: | |||
| 1365 | @findex latex-mode | 1353 | @findex latex-mode |
| 1366 | @findex slitex-mode | 1354 | @findex slitex-mode |
| 1367 | @findex doctex-mode | 1355 | @findex doctex-mode |
| 1368 | 1356 | @findex bibtex-mode | |
| 1369 | @TeX{} is a powerful text formatter written by Donald Knuth; it is | 1357 | |
| 1370 | also free software, like GNU Emacs. La@TeX{} is a simplified input | 1358 | Emacs provides special major modes for editing files written in |
| 1371 | format for @TeX{}, implemented by @TeX{} macros; it comes with @TeX{}. | 1359 | @TeX{} and its related formats. @TeX{} is a powerful text formatter |
| 1372 | Sli@TeX{} is a special form of La@TeX{}.@footnote{Sli@TeX{} is | 1360 | written by Donald Knuth; like GNU Emacs, it is free software. |
| 1373 | obsoleted by the @samp{slides} document class and other alternative | 1361 | La@TeX{} is a simplified input format for @TeX{}, implemented using |
| 1374 | packages in recent La@TeX{} versions.} Doc@TeX{} (@file{.dtx}) is a | 1362 | @TeX{} macros. Doc@TeX{} is a special file format in which the |
| 1375 | special file format in which the La@TeX{} sources are written, | 1363 | La@TeX{} sources are written, combining sources with documentation. |
| 1376 | combining sources with documentation. | 1364 | Sli@TeX{} is an obsolete special form of La@TeX{}.@footnote{It has |
| 1377 | 1365 | been replaced by the @samp{slides} document class, which comes with | |
| 1378 | Emacs has a special @TeX{} mode for editing @TeX{} input files. | 1366 | La@TeX{}.} |
| 1379 | It provides facilities for checking the balance of delimiters and for | ||
| 1380 | invoking @TeX{} on all or part of the file. | ||
| 1381 | 1367 | ||
| 1382 | @vindex tex-default-mode | 1368 | @vindex tex-default-mode |
| 1383 | @TeX{} mode has four variants: Plain @TeX{} mode, La@TeX{} mode, | 1369 | @TeX{} mode has four variants: Plain @TeX{} mode, La@TeX{} mode, |
| 1384 | Sli@TeX{} mode, and Doc@TeX{} mode (these distinct major modes differ | 1370 | Doc@TeX{} mode, and Sli@TeX{} mode. These distinct major modes differ |
| 1385 | only slightly). They are designed for editing the four different | 1371 | only slightly, and are designed for editing the four different |
| 1386 | formats. The command @kbd{M-x tex-mode} looks at the contents of the | 1372 | formats. Emacs selects the appropriate mode by looking at the |
| 1387 | buffer to determine whether the contents appear to be either La@TeX{} | 1373 | contents of the buffer. (This is done by the @code{tex-mode} command, |
| 1388 | input, Sli@TeX{}, or Doc@TeX{} input; if so, it selects the | 1374 | which is normally called automatically when you visit a @TeX{}-like |
| 1389 | appropriate mode. If the file contents do not appear to be La@TeX{}, | 1375 | file. @xref{Choosing Modes}.) If the contents are insufficient to |
| 1390 | Sli@TeX{} or Doc@TeX{}, it selects Plain @TeX{} mode. If the contents | 1376 | determine this, Emacs chooses the mode specified by the variable |
| 1391 | are insufficient to determine this, the variable | 1377 | @code{tex-default-mode}; its default value is @code{latex-mode}. If |
| 1392 | @code{tex-default-mode} controls which mode is used. | 1378 | Emacs does not guess right, you can select the correct variant of |
| 1393 | 1379 | @TeX{} mode using the command @kbd{M-x plain-tex-mode}, @kbd{M-x | |
| 1394 | When @kbd{M-x tex-mode} does not guess right, you can use the commands | 1380 | latex-mode}, @kbd{M-x slitex-mode}, or @kbd{doctex-mode}. |
| 1395 | @kbd{M-x plain-tex-mode}, @kbd{M-x latex-mode}, @kbd{M-x slitex-mode}, | 1381 | |
| 1396 | and @kbd{doctex-mode} to select explicitly the particular variants of | 1382 | Emacs also provides Bib@TeX{} mode, a major mode for editing |
| 1397 | @TeX{} mode. | 1383 | Bib@TeX{} files. Bib@TeX{} is a tool for storing and formatting |
| 1384 | bibliographic references, which is commonly used together with | ||
| 1385 | La@TeX{}. In addition, the Ref@TeX{} package provides a minor mode | ||
| 1386 | which can be used in conjunction with La@TeX{} mode to manage | ||
| 1387 | bibliographic references. @inforef{Top,, reftex}. | ||
| 1398 | 1388 | ||
| 1399 | @menu | 1389 | @menu |
| 1400 | * Editing: TeX Editing. Special commands for editing in TeX mode. | 1390 | * Editing: TeX Editing. Special commands for editing in TeX mode. |
| @@ -1406,9 +1396,6 @@ and @kbd{doctex-mode} to select explicitly the particular variants of | |||
| 1406 | @node TeX Editing | 1396 | @node TeX Editing |
| 1407 | @subsection @TeX{} Editing Commands | 1397 | @subsection @TeX{} Editing Commands |
| 1408 | 1398 | ||
| 1409 | Here are the special commands provided in @TeX{} mode for editing the | ||
| 1410 | text of the file. | ||
| 1411 | |||
| 1412 | @table @kbd | 1399 | @table @kbd |
| 1413 | @item " | 1400 | @item " |
| 1414 | Insert, according to context, either @samp{``} or @samp{"} or | 1401 | Insert, according to context, either @samp{``} or @samp{"} or |
| @@ -1427,20 +1414,22 @@ Move forward past the next unmatched close brace (@code{up-list}). | |||
| 1427 | 1414 | ||
| 1428 | @findex tex-insert-quote | 1415 | @findex tex-insert-quote |
| 1429 | @kindex " @r{(@TeX{} mode)} | 1416 | @kindex " @r{(@TeX{} mode)} |
| 1430 | In @TeX{}, the character @samp{"} is not normally used; we use | 1417 | In @TeX{}, the character @samp{"} is not normally used; instead, |
| 1431 | @samp{``} to start a quotation and @samp{''} to end one. To make | 1418 | quotations begin with @samp{``} and end with @samp{''}. For |
| 1432 | editing easier under this formatting convention, @TeX{} mode overrides | 1419 | convenience, @TeX{} mode overrides the normal meaning of the key |
| 1433 | the normal meaning of the key @kbd{"} with a command that inserts a pair | 1420 | @kbd{"} with a command that inserts a pair of single-quotes or |
| 1434 | of single-quotes or backquotes (@code{tex-insert-quote}). To be | 1421 | backquotes (@code{tex-insert-quote}). To be precise, it inserts |
| 1435 | precise, this command inserts @samp{``} after whitespace or an open | 1422 | @samp{``} after whitespace or an open brace, @samp{"} after a |
| 1436 | brace, @samp{"} after a backslash, and @samp{''} after any other | 1423 | backslash, and @samp{''} after any other character. |
| 1437 | character. | 1424 | |
| 1438 | 1425 | As a special exception, if you type @kbd{"} when the text before | |
| 1439 | If you need the character @samp{"} itself in unusual contexts, use | 1426 | point is either @samp{``} or @samp{''}, Emacs replaces that preceding |
| 1440 | @kbd{C-q} to insert it. Also, @kbd{"} with a numeric argument always | 1427 | text with a single @samp{"} character. You can therefore type |
| 1441 | inserts that number of @samp{"} characters. You can turn off the | 1428 | @kbd{""} to insert @samp{"}, should you ever need to do so. (You can |
| 1442 | feature of @kbd{"} expansion by eliminating that binding in the local | 1429 | also use @kbd{C-q "} to insert this character.) |
| 1443 | map (@pxref{Key Bindings}). | 1430 | |
| 1431 | To disable the @kbd{"} expansion feature, eliminate that binding in | ||
| 1432 | the local map (@pxref{Key Bindings}). | ||
| 1444 | 1433 | ||
| 1445 | In @TeX{} mode, @samp{$} has a special syntax code which attempts to | 1434 | In @TeX{} mode, @samp{$} has a special syntax code which attempts to |
| 1446 | understand the way @TeX{} math mode delimiters match. When you insert a | 1435 | understand the way @TeX{} math mode delimiters match. When you insert a |
| @@ -1477,15 +1466,15 @@ that buffer to go to a particular mismatch. | |||
| 1477 | Note that Emacs commands count square brackets and parentheses in | 1466 | Note that Emacs commands count square brackets and parentheses in |
| 1478 | @TeX{} mode, not just braces. This is not strictly correct for the | 1467 | @TeX{} mode, not just braces. This is not strictly correct for the |
| 1479 | purpose of checking @TeX{} syntax. However, parentheses and square | 1468 | purpose of checking @TeX{} syntax. However, parentheses and square |
| 1480 | brackets are likely to be used in text as matching delimiters and it is | 1469 | brackets are likely to be used in text as matching delimiters, and it |
| 1481 | useful for the various motion commands and automatic match display to | 1470 | is useful for the various motion commands and automatic match display |
| 1482 | work with them. | 1471 | to work with them. |
| 1483 | 1472 | ||
| 1484 | @node LaTeX Editing | 1473 | @node LaTeX Editing |
| 1485 | @subsection La@TeX{} Editing Commands | 1474 | @subsection La@TeX{} Editing Commands |
| 1486 | 1475 | ||
| 1487 | La@TeX{} mode, and its variant, Sli@TeX{} mode, provide a few extra | 1476 | La@TeX{} mode (and its obsolete variant, Sli@TeX{} mode) provide a |
| 1488 | features not applicable to plain @TeX{}. | 1477 | few extra features not applicable to plain @TeX{}: |
| 1489 | 1478 | ||
| 1490 | @table @kbd | 1479 | @table @kbd |
| 1491 | @item C-c C-o | 1480 | @item C-c C-o |
| @@ -1755,11 +1744,28 @@ Ref@TeX{}. @inforef{Top,, reftex}. | |||
| 1755 | 1744 | ||
| 1756 | @node HTML Mode | 1745 | @node HTML Mode |
| 1757 | @section SGML, XML, and HTML Modes | 1746 | @section SGML, XML, and HTML Modes |
| 1747 | @cindex SGML mode | ||
| 1748 | @cindex HTML mode | ||
| 1749 | @cindex XML mode | ||
| 1750 | @cindex mode, SGML | ||
| 1751 | @cindex mode, HTML | ||
| 1752 | @cindex mode, XML | ||
| 1753 | @findex sgml-mode | ||
| 1754 | @findex html-mode | ||
| 1755 | @findex xml-mode | ||
| 1756 | |||
| 1757 | The major modes for SGML, XML, and HTML provide indentation support | ||
| 1758 | and commands for operating on tags. XML mode is actually identical to | ||
| 1759 | SGML mode (to be precise, @code{xml-mode} is an alias for | ||
| 1760 | @code{sgml-mode}), because XML is a strict subset of SGML. HTML mode | ||
| 1761 | is a slightly customized variant of SGML mode. | ||
| 1758 | 1762 | ||
| 1759 | The major modes for SGML and HTML include indentation support and | 1763 | @vindex sgml-xml-mode |
| 1760 | commands to operate on tags. This section describes the special | 1764 | In XML, every opening tag must have an explicit closing tag. When |
| 1761 | commands of these modes. (HTML mode is a slightly customized variant | 1765 | the variable @code{sgml-xml-mode} is non-@code{nil}, the tag insertion |
| 1762 | of SGML mode.) | 1766 | commands described below always insert explicit closing tags as well. |
| 1767 | When you visit a file, Emacs determines whether it is XML by examining | ||
| 1768 | the file contents, and sets @code{sgml-xml-mode} accordingly. | ||
| 1763 | 1769 | ||
| 1764 | @table @kbd | 1770 | @table @kbd |
| 1765 | @item C-c C-n | 1771 | @item C-c C-n |
| @@ -1845,14 +1851,17 @@ Toggle the visibility of existing tags in the buffer. This can be | |||
| 1845 | used as a cheap preview. | 1851 | used as a cheap preview. |
| 1846 | @end table | 1852 | @end table |
| 1847 | 1853 | ||
| 1848 | @vindex sgml-xml-mode | 1854 | @cindex nXML mode |
| 1849 | SGML mode and HTML mode support XML also. In XML, every opening tag | 1855 | @cindex mode, nXML |
| 1850 | must have an explicit closing tag. When @code{sgml-xml-mode} is | 1856 | @findex nxml-mode |
| 1851 | non-@code{nil}, SGML mode and HTML mode always insert explicit | 1857 | @cindex XML schema |
| 1852 | closing tags. When you visit a file, these modes determine from the | 1858 | Emacs also provides a more advanced mode mode for editing XML |
| 1853 | file contents whether it is XML or not, and set @code{sgml-xml-mode} | 1859 | documents, called nXML mode (@code{nxml-mode}). nXML mode is aware of |
| 1854 | accordingly, so that they do the right thing for the file in either | 1860 | many existing XML schema, and uses them to provide completion of XML |
| 1855 | case. | 1861 | elements via @kbd{C-@key{RET}} or @kbd{M-@key{TAB}}, as well as |
| 1862 | ``on-the-fly'' validation of XML, with errors highlighted via Font | ||
| 1863 | Lock (@pxref{Font Lock}). It is described in its own manual. | ||
| 1864 | @xref{Top, nXML Mode,,nxml-mode, nXML Mode}. | ||
| 1856 | 1865 | ||
| 1857 | @node Nroff Mode | 1866 | @node Nroff Mode |
| 1858 | @section Nroff Mode | 1867 | @section Nroff Mode |