aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2008-11-26 04:13:33 +0000
committerChong Yidong2008-11-26 04:13:33 +0000
commit3a5244ab84dbcdc28bb0d54c79a30ddc590accdd (patch)
treed3dfa5c1cdf66dee77f69c6de94848c5367c890a
parentaa5ab79aaebeeafa4eea42d12ba1413c847eaaa7 (diff)
downloademacs-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.texi165
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''
30has other major modes, each for a particular formatter. For instance, 30commands, such as @TeX{} and La@TeX{} (@pxref{TeX Mode}); HTML, SGML,
31La@TeX{} mode is used for editing La@TeX{} 31and XML (@pxref{HTML Mode}); and Groff and Nroff (@pxref{Nroff Mode}).
32@iftex 32In addition, you can edit formatted text in WYSIWYG style (``what you
33documents (@pxref{LaTeX,,La@TeX{} Mode}), 33see is what you get''), using Enriched mode (@pxref{Formatted Text}).
34@end iftex
35@ifnottex
36documents,
37@end ifnottex
38while Nroff mode is used for editing groff or nroff files.
39
40 Instead of using a text formatter, you can edit formatted text in
41WYSIWYG style (``what you see is what you get''), with Enriched mode.
42Then 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
1370also free software, like GNU Emacs. La@TeX{} is a simplified input 1358 Emacs provides special major modes for editing files written in
1371format for @TeX{}, implemented by @TeX{} macros; it comes with @TeX{}. 1359@TeX{} and its related formats. @TeX{} is a powerful text formatter
1372Sli@TeX{} is a special form of La@TeX{}.@footnote{Sli@TeX{} is 1360written by Donald Knuth; like GNU Emacs, it is free software.
1373obsoleted by the @samp{slides} document class and other alternative 1361La@TeX{} is a simplified input format for @TeX{}, implemented using
1374packages in recent La@TeX{} versions.} Doc@TeX{} (@file{.dtx}) is a 1362@TeX{} macros. Doc@TeX{} is a special file format in which the
1375special file format in which the La@TeX{} sources are written, 1363La@TeX{} sources are written, combining sources with documentation.
1376combining sources with documentation. 1364Sli@TeX{} is an obsolete special form of La@TeX{}.@footnote{It has
1377 1365been replaced by the @samp{slides} document class, which comes with
1378 Emacs has a special @TeX{} mode for editing @TeX{} input files. 1366La@TeX{}.}
1379It provides facilities for checking the balance of delimiters and for
1380invoking @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,
1384Sli@TeX{} mode, and Doc@TeX{} mode (these distinct major modes differ 1370Doc@TeX{} mode, and Sli@TeX{} mode. These distinct major modes differ
1385only slightly). They are designed for editing the four different 1371only slightly, and are designed for editing the four different
1386formats. The command @kbd{M-x tex-mode} looks at the contents of the 1372formats. Emacs selects the appropriate mode by looking at the
1387buffer to determine whether the contents appear to be either La@TeX{} 1373contents of the buffer. (This is done by the @code{tex-mode} command,
1388input, Sli@TeX{}, or Doc@TeX{} input; if so, it selects the 1374which is normally called automatically when you visit a @TeX{}-like
1389appropriate mode. If the file contents do not appear to be La@TeX{}, 1375file. @xref{Choosing Modes}.) If the contents are insufficient to
1390Sli@TeX{} or Doc@TeX{}, it selects Plain @TeX{} mode. If the contents 1376determine this, Emacs chooses the mode specified by the variable
1391are 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. 1378Emacs 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 1380latex-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
1396and @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. 1383Bib@TeX{} files. Bib@TeX{} is a tool for storing and formatting
1384bibliographic references, which is commonly used together with
1385La@TeX{}. In addition, the Ref@TeX{} package provides a minor mode
1386which can be used in conjunction with La@TeX{} mode to manage
1387bibliographic 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
1410text of the file.
1411
1412@table @kbd 1399@table @kbd
1413@item " 1400@item "
1414Insert, according to context, either @samp{``} or @samp{"} or 1401Insert, 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 1418quotations begin with @samp{``} and end with @samp{''}. For
1432editing easier under this formatting convention, @TeX{} mode overrides 1419convenience, @TeX{} mode overrides the normal meaning of the key
1433the 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
1434of single-quotes or backquotes (@code{tex-insert-quote}). To be 1421backquotes (@code{tex-insert-quote}). To be precise, it inserts
1435precise, this command inserts @samp{``} after whitespace or an open 1422@samp{``} after whitespace or an open brace, @samp{"} after a
1436brace, @samp{"} after a backslash, and @samp{''} after any other 1423backslash, and @samp{''} after any other character.
1437character. 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 1426point is either @samp{``} or @samp{''}, Emacs replaces that preceding
1440@kbd{C-q} to insert it. Also, @kbd{"} with a numeric argument always 1427text with a single @samp{"} character. You can therefore type
1441inserts that number of @samp{"} characters. You can turn off the 1428@kbd{""} to insert @samp{"}, should you ever need to do so. (You can
1442feature of @kbd{"} expansion by eliminating that binding in the local 1429also use @kbd{C-q "} to insert this character.)
1443map (@pxref{Key Bindings}). 1430
1431 To disable the @kbd{"} expansion feature, eliminate that binding in
1432the 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
1446understand the way @TeX{} math mode delimiters match. When you insert a 1435understand 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
1479purpose of checking @TeX{} syntax. However, parentheses and square 1468purpose of checking @TeX{} syntax. However, parentheses and square
1480brackets are likely to be used in text as matching delimiters and it is 1469brackets are likely to be used in text as matching delimiters, and it
1481useful for the various motion commands and automatic match display to 1470is useful for the various motion commands and automatic match display
1482work with them. 1471to 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
1488features not applicable to plain @TeX{}. 1477few 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
1758and commands for operating on tags. XML mode is actually identical to
1759SGML 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
1761is 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
1760commands to operate on tags. This section describes the special 1764 In XML, every opening tag must have an explicit closing tag. When
1761commands of these modes. (HTML mode is a slightly customized variant 1765the variable @code{sgml-xml-mode} is non-@code{nil}, the tag insertion
1762of SGML mode.) 1766commands described below always insert explicit closing tags as well.
1767When you visit a file, Emacs determines whether it is XML by examining
1768the 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
1845used as a cheap preview. 1851used 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
1850must have an explicit closing tag. When @code{sgml-xml-mode} is 1856@findex nxml-mode
1851non-@code{nil}, SGML mode and HTML mode always insert explicit 1857@cindex XML schema
1852closing tags. When you visit a file, these modes determine from the 1858 Emacs also provides a more advanced mode mode for editing XML
1853file contents whether it is XML or not, and set @code{sgml-xml-mode} 1859documents, called nXML mode (@code{nxml-mode}). nXML mode is aware of
1854accordingly, so that they do the right thing for the file in either 1860many existing XML schema, and uses them to provide completion of XML
1855case. 1861elements 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
1863Lock (@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