blob: 2e28cf5b5c6d3e001f3811fd10041968daceb3dc [file] [log] [blame]
<!DOCTYPE html>
<html>
<!-- Created by Texinfo 6.8dev+dev, http://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- This manual is for GNU Texinfo (version 6.8dev, 23 February 2022),
a documentation system that can produce both online information and a
printed manual from a single source using semantic markup.
Copyright (C) 1988, 1990-1993, 1995-1999, 2001-2022 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with no
Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
Texts. A copy of the license is included in the section entitled
"GNU Free Documentation License". -->
<title>texinfo-format commands (GNU Texinfo 6.8dev)</title>
<meta name="description" content="texinfo-format commands (GNU Texinfo 6.8dev)">
<meta name="keywords" content="texinfo-format commands (GNU Texinfo 6.8dev)">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="texi2any">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link href="index.html" rel="start" title="Top">
<link href="Command-and-Variable-Index.html" rel="index" title="Command and Variable Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Creating-an-Info-File.html" rel="up" title="Creating an Info File">
<link href="Batch-Formatting.html" rel="next" title="Batch Formatting">
<link href="makeinfo-in-Emacs.html" rel="prev" title="makeinfo in Emacs">
<style type="text/css">
<!--
a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
kbd.kbd {font-style: oblique}
span:hover a.copiable-link {visibility: visible}
-->
</style>
</head>
<body lang="en">
<div class="subsection-level-extent" id="texinfo_002dformat-commands">
<div class="nav-panel">
<p>
Next: <a href="Batch-Formatting.html" accesskey="n" rel="next">Batch Formatting</a>, Previous: <a href="makeinfo-in-Emacs.html" accesskey="p" rel="prev">Running <code class="code">makeinfo</code> Within Emacs</a>, Up: <a href="Creating-an-Info-File.html" accesskey="u" rel="up">Creating an Info File</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Command-and-Variable-Index.html" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<h4 class="subsection" id="The-texinfo_002dformat_2026-Commands">20.1.3 The <code class="code">texinfo-format&hellip;</code> Commands</h4>
<p>In GNU Emacs in Texinfo mode, you can format part or all of a Texinfo
file with the <code class="code">texinfo-format-region</code> command. This formats the
current region and displays the formatted text in a temporary buffer
called &lsquo;<samp class="samp">*Info Region*</samp>&rsquo;.
</p>
<p>Similarly, you can format a buffer with the
<code class="code">texinfo-format-buffer</code> command. This command creates a new
buffer and generates the Info file in it. Typing <kbd class="kbd">C-x C-s</kbd> will
save the Info file under the name specified by the
<code class="code">@setfilename</code> line which must be near the beginning of the
Texinfo file.
</p>
<dl class="table">
<dt id='index-texinfo_002dformat_002dregion'><span><kbd class="kbd">C-c C-e C-r</kbd><a class="copiable-link" href='#index-texinfo_002dformat_002dregion'> &para;</a></span></dt>
<dt><kbd class="kbd"><code class="code">texinfo-format-region</code></kbd></dt>
<dd><p>Format the current region for Info.
</p>
</dd>
<dt id='index-texinfo_002dformat_002dbuffer'><span><kbd class="kbd">C-c C-e C-b</kbd><a class="copiable-link" href='#index-texinfo_002dformat_002dbuffer'> &para;</a></span></dt>
<dt><kbd class="kbd"><code class="code">texinfo-format-buffer</code></kbd></dt>
<dd><p>Format the current buffer for Info.
</p></dd>
</dl>
<p>The <code class="code">texinfo-format-region</code> and <code class="code">texinfo-format-buffer</code>
commands provide you with some error checking, and other functions can
provide you with further help in finding formatting errors. These
procedures are described in an appendix; see <a class="ref" href="Catching-Mistakes.html">Catching Mistakes</a>.
However, the <code class="code">makeinfo</code> program provides better error checking
(see <a class="pxref" href="makeinfo-in-Emacs.html">Running <code class="code">makeinfo</code> Within Emacs</a>).
</p>
<p>A peculiarity of the <code class="code">texinfo-format-buffer</code> and
<code class="code">texinfo-format-region</code> commands is that they do not indent (nor
fill) paragraphs that contain <code class="code">@w</code> or <code class="code">@*</code> commands.
</p>
</div>
</body>
</html>