JezK
Edit File: Using-texinfo_002dshow_002dstructure.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <!-- Created by GNU Texinfo 6.8, https://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.8, 8 June 2021), 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-2021 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>Using texinfo-show-structure (GNU Texinfo 6.8)</title> <meta name="description" content="Using texinfo-show-structure (GNU Texinfo 6.8)"> <meta name="keywords" content="Using texinfo-show-structure (GNU Texinfo 6.8)"> <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="Catching-Mistakes.html" rel="up" title="Catching Mistakes"> <link href="Using-occur.html" rel="next" title="Using occur"> <link href="Debugging-with-TeX.html" rel="prev" title="Debugging with TeX"> <style type="text/css"> <!-- a.copiable-anchor {visibility: hidden; text-decoration: none; line-height: 0em} a.summary-letter {text-decoration: none} blockquote.indentedblock {margin-right: 0em} div.display {margin-left: 3.2em} div.example {margin-left: 3.2em} kbd {font-style: oblique} pre.display {font-family: inherit} pre.format {font-family: inherit} pre.menu-comment {font-family: serif} pre.menu-preformatted {font-family: serif} span.nolinebreak {white-space: nowrap} span.roman {font-family: initial; font-weight: normal} span.sansserif {font-family: sans-serif; font-weight: normal} span:hover a.copiable-anchor {visibility: visible} ul.no-bullet {list-style: none} --> </style> </head> <body lang="en"> <div class="section" id="Using-texinfo_002dshow_002dstructure"> <div class="header"> <p> Next: <a href="Using-occur.html" accesskey="n" rel="next">Using <code>occur</code></a>, Previous: <a href="Debugging-with-TeX.html" accesskey="p" rel="prev">Debugging with TeX</a>, Up: <a href="Catching-Mistakes.html" accesskey="u" rel="up">Catching Mistakes</a> [<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> <span id="Using-texinfo_002dshow_002dstructure-1"></span><h4 class="subsection">D.9.4 Using <code>texinfo-show-structure</code></h4> <span id="index-Showing-the-structure-of-a-file"></span> <span id="index-texinfo_002dshow_002dstructure-1"></span> <p>It is not always easy to keep track of the nodes, chapters, sections, and subsections of a Texinfo file. This is especially true if you are revising or adding to a Texinfo file that someone else has written. </p> <p>In GNU Emacs, in Texinfo mode, the <code>texinfo-show-structure</code> command lists all the lines that begin with the @-commands that specify the structure: <code>@chapter</code>, <code>@section</code>, <code>@appendix</code>, and so on. With an argument (<kbd><span class="nolinebreak">C-u</span></kbd><!-- /@w --> as prefix argument, if interactive), the command also shows the <code>@node</code> lines. The <code>texinfo-show-structure</code> command is bound to <kbd>C-c C-s</kbd> in Texinfo mode, by default. </p> <p>The lines are displayed in a buffer called the ‘<samp>*Occur*</samp>’ buffer, indented by hierarchical level. For example, here is a part of what was produced by running <code>texinfo-show-structure</code> on this manual: </p> <div class="example"> <pre class="example">Lines matching "^@\\(chapter \\|sect\\|subs\\|subh\\| unnum\\|major\\|chapheading \\|heading \\|appendix\\)" in buffer texinfo.texi. … 4177:@chapter Nodes 4198: @heading Two Paths 4231: @section Node and Menu Illustration 4337: @section The @code{@@node} Command 4393: @subheading Choosing Node and Pointer Names 4417: @subsection How to Write a @code{@@node} Line 4469: @subsection @code{@@node} Line Tips … </pre></div> <p>This says that lines 4337, 4393, and 4417 of <samp>texinfo.texi</samp> begin with the <code>@section</code>, <code>@subheading</code>, and <code>@subsection</code> commands respectively. If you move your cursor into the ‘<samp>*Occur*</samp>’ window, you can position the cursor over one of the lines and use the <kbd>C-c C-c</kbd> command (<code>occur-mode-goto-occurrence</code>), to jump to the corresponding spot in the Texinfo file. See <a data-manual="emacs" href="../emacs/Other-Repeating-Search.html#Other-Repeating-Search">Using Occur</a> in <cite>The GNU Emacs Manual</cite>, for more information about <code>occur-mode-goto-occurrence</code>. </p> <p>The first line in the ‘<samp>*Occur*</samp>’ window describes the <em>regular expression</em> specified by <var>texinfo-heading-pattern</var>. This regular expression is the pattern that <code>texinfo-show-structure</code> looks for. See <a data-manual="emacs" href="../emacs/Regexps.html#Regexps">Using Regular Expressions</a> in <cite>The GNU Emacs Manual</cite>, for more information. </p> <p>When you invoke the <code>texinfo-show-structure</code> command, Emacs will display the structure of the whole buffer. If you want to see the structure of just a part of the buffer, of one chapter, for example, use the <kbd>C-x n n</kbd> (<code>narrow-to-region</code>) command to mark the region. (See <a data-manual="emacs" href="../emacs/Narrowing.html#Narrowing">Narrowing</a> in <cite>The GNU Emacs Manual</cite>.) This is how the example used above was generated. (To see the whole buffer again, use <kbd>C-x n w</kbd> (<code>widen</code>).) </p> <p>If you call <code>texinfo-show-structure</code> with a prefix argument by typing <kbd><span class="nolinebreak">C-u</span> <span class="nolinebreak">C-c</span> <span class="nolinebreak">C-s</span></kbd><!-- /@w -->, it will list lines beginning with <code>@node</code> as well as the lines beginning with the @-sign commands for <code>@chapter</code>, <code>@section</code>, and the like. </p> <p>You can remind yourself of the structure of a Texinfo file by looking at the list in the ‘<samp>*Occur*</samp>’ window; and if you have mis-named a node or left out a section, you can correct the mistake. </p> </div> <hr> <div class="header"> <p> Next: <a href="Using-occur.html">Using <code>occur</code></a>, Previous: <a href="Debugging-with-TeX.html">Debugging with TeX</a>, Up: <a href="Catching-Mistakes.html">Catching Mistakes</a> [<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> </body> </html>