8. Examples

Examples are not all that difficult. Here is one:
<example id="c-example"><title>A C example</title>
   <programlisting>
   #include &lt;stdio.h&gt;
   main() {
      printf("Hello world\n");
   }
   </programlisting>
</example>

Here is what it looks like parsed:

Example 1. A C example

1    #include <stdio.h>
2    main() {
3       printf("Hello world\n");
4    }

Notice that in this case the lines on the example are numbered. This is because we used the <programlisting> tag instead of the <screen> tag. We'll cover this in more detail when we get to the Programlisting and Screens section. This is a feature we enabled using the newbiedoc-html.dsl custom stylesheet. If you didn't render your document using the custom stylesheet you won't get the line numbers. You don't need the line numbers but if it is something you want to help with your presentation. Check out the Using the custom stylesheets section and then the Programlisting and Screens section for how to use those tags properly.