Skip to content

Commit

Permalink
Change mentions of "caption" wrt to listings
Browse files Browse the repository at this point in the history
  • Loading branch information
ascholerChemeketa committed Nov 21, 2024
1 parent 6ad0b1a commit 9bd8285
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions doc/guide/author/topics.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3442,7 +3442,7 @@ displayed line, and there are no <c>\\</c>s. Use <c>\amp</c> to mark the alignm

<p>A <tag>console</tag> is a transcript of an interactive session in a terminal or console at a command-line. It is a sequence of the following elements, in this order, possibly repeated many times as a group: <tag>input</tag>, and <tag>output</tag>. The <tag>output</tag> is optional. The content of these two elements is treated as verbatim text (see <xref ref="overview-verbatim-literal"/>), subject to all the exceptions for exceptional characters (see <xref ref="overview-exceptional-characters"/>). A <attr>prompt</attr> attribute on the <tag>input</tag> can be supplied to provide a system prompt distinct from the actual commands. The default prompt is a dollar sign followed by a space. If it is more convenient <attr>prompt</attr> may be supplied on the <tag>console</tag>, to be used in each enclosed <tag>input</tag>. If you do not want any prompts at all, just use an empty value for <attr>prompt</attr>.</p>

<p>A <tag>program</tag> or <tag>console</tag> may be wrapped in a <tag>listing</tag>, see <xref ref="topic-listing"/>. This will behave similar to a <tag>figure</tag>, with the <tag>caption</tag> displayed below, and a number assigned. So, in particular, if your program or console is important enough to cross-reference, it is an enclosing <tag>listing</tag> that serves as the target.</p>
<p>A <tag>program</tag> or <tag>console</tag> may be wrapped in a <tag>listing</tag>, see <xref ref="topic-listing"/>. This will behave similar to a <tag>figure</tag>, with the <tag>title</tag> displayed above, and a number assigned. So, in particular, if your program or console is important enough to cross-reference, it is an enclosing <tag>listing</tag> that serves as the target.</p>

<p>The <attr>language</attr> attribute may be used to get some degree of language-specific syntax highlighting and/or interactive behavior. We will eventually provide a table of attribute values here. They are always lowercase, and a good first guess is likely to succeed.</p>

Expand Down Expand Up @@ -3921,7 +3921,7 @@ displayed line, and there are no <c>\\</c>s. Use <c>\amp</c> to mark the alignm

<section xml:id="topic-listing">
<title>Program Listings</title>
<p>A <tag>listing</tag> is really a specialized type of <tag>figure</tag>, whose purpose is to hold computer code. Just like a figure, it has a <tag>caption</tag> and <tag>title</tag> which behave identically. However, the enclosed planar content is limited to a <tag>program</tag> or <tag>console</tag> (see <xref ref="topic-program-console"/>).</p>
<p>A <tag>listing</tag> is really a specialized type of <tag>figure</tag>, whose purpose is to hold computer code. It has an optional <tag>title</tag> which is rendered above the listing. However, the enclosed planar content is limited to a <tag>program</tag> or <tag>console</tag> (see <xref ref="topic-program-console"/>).</p>
</section>

<section xml:id="topic-named-list">
Expand Down
8 changes: 4 additions & 4 deletions examples/sample-article/sample-article.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10104,7 +10104,7 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.

<p>Note that the above examples all have slightly different widths (theser are very evident in print with the frames). As 2-D atomic objects, to place them in the narrative requires the layout features of a <c>sidebyside</c> element. Then <c>width</c> and/or <c>margin</c> attributes will influence the width of the panel.</p>

<p>A <c>program</c> may also be nested inside a <c>listing</c>, which behaves similar to a <c>figure</c>. You can provide a <c>caption</c>, and the listing will be numbered along with tables and figures. This then makes it possible to cross-reference the listing, such as <xref ref="listing-c-hello" text="type-global" />. It also removes the requirement of wrapping the <c>program</c> in a <c>sidebyside</c>. For technical reasons, the three examples above will not split across a page break in PDF output, but the placement inside a <c>listing</c> will allow splits, as you should see in at least one example following.</p>
<p>A <c>program</c> may also be nested inside a <c>listing</c>, which behaves similar to a <c>figure</c>. You can provide a <c>title</c>, and the listing will be numbered along with tables and figures. This then makes it possible to cross-reference the listing, such as <xref ref="listing-c-hello" text="type-global" />. It also removes the requirement of wrapping the <c>program</c> in a <c>sidebyside</c>. For technical reasons, the three examples above will not split across a page break in PDF output, but the placement inside a <c>listing</c> will allow splits, as you should see in at least one example following.</p>

<listing xml:id="listing-c-hello">
<title>C Version of <q>Hello, World!</q></title>
Expand Down Expand Up @@ -12428,7 +12428,7 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
<li>inside a <tag>sidebyside</tag>, with size and layout configured, and inside a <tag>figure</tag></li>
<li>inside a <tag>sidebyside</tag>, with size and layout configured, with each inside a <tag>listing</tag>, earning different numbers</li>

<li>inside a <tag>figure</tag> inside a <tag>sidebyside</tag> inside a <tag>listing</tag>, with size and layout configured, with a number and caption, but now sub-numbered ((a), (b), (c),<ellipsis/>).</li>
<li>inside a <tag>figure</tag> inside a <tag>sidebyside</tag> inside a <tag>listing</tag>, with size and layout configured, with a number and title, but now sub-numbered ((a), (b), (c),<ellipsis/>).</li>
</ol>Examples of each, and more.</p>

<p>Programs can be realized in many forms, and can come from a variety of sources. See <xref ref="section-video" text="type-global"/> for tests of some of that variety. Here we are testing placement within surroundings and testing the schema for location. But we do have two videos in each test, one provided as a local file and one embedded from a service.</p>
Expand Down Expand Up @@ -12515,7 +12515,7 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
<input prompt="pi@raspberrypi ~/progs/chap02 $ "/>
</console>

<p>Two <tag>listing</tag>, with <tag>caption</tag>, and no layout control.</p>
<p>Two <tag>listing</tag>, with <tag>title</tag>, and no layout control.</p>

<listing>
<title>Hello, World! in C</title>
Expand Down Expand Up @@ -12683,7 +12683,7 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
</listing>
</sidebyside>

<p>And again, the two-panel <tag>sidebyside</tag> of <tag>listing</tag>, but now inside a <tag>figure</tag> that has a number and a caption. And then the <tag>listing</tag> are sub-numbered as (a) and (b).</p>
<p>And again, the two-panel <tag>sidebyside</tag> of <tag>listing</tag>, but now inside a <tag>figure</tag> that has a number and a title. And then the <tag>listing</tag> are sub-numbered as (a) and (b).</p>


<figure>
Expand Down

0 comments on commit 9bd8285

Please sign in to comment.