Skip to content

Commit d5e8fcc

Browse files
Sample Article: update graphics samples with width options
1 parent 49946b4 commit d5e8fcc

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed
7.12 KB
Loading

examples/sample-article/sample-article.xml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3276,6 +3276,23 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
32763276
<image source="images/nz-landscape.jpg" width="80%"/>
32773277
</figure>
32783278

3279+
<p>Images that are given a <attr>width</attr> (always as a percentage) are scaled to that percentage of their container. Images without a <attr>width</attr> will be rendered at their natural size if possible and as large as possible if not. This can be seen in these three renderings of the same screenshot:</p>
3280+
3281+
<figure>
3282+
<caption>A new folder with <c>width="100%"</c></caption>
3283+
<image source="images/new-folder-screenshot.png" width="100%"/>
3284+
</figure>
3285+
3286+
<figure>
3287+
<caption>A new folder with <c>width="50%"</c></caption>
3288+
<image source="images/new-folder-screenshot.png" width="50%"/>
3289+
</figure>
3290+
3291+
<figure>
3292+
<caption>A new folder with no <attr>width</attr></caption>
3293+
<image source="images/new-folder-screenshot.png"/>
3294+
</figure>
3295+
32793296
<p>If you have existing images that are vector graphics, then PDF format works best for <latex/> output and SVG format works best for HTML. The utility <c>pdf2svg</c> works well for converting PDF to SVG. In this case, specify your source as a filename, but leave off the file extension, and the appropriate version will be used for the current output format.</p>
32803297

32813298
<p>The image below is provided from a PDF file in <latex/> output, and was converted to an SVG for use with the HTML output. It has been explicitly scaled to a width of 65% of the text width.</p>
@@ -3317,7 +3334,7 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
33173334

33183335
<figure>
33193336
<caption>Solution to a differential equation</caption>
3320-
<image width="60%">
3337+
<image>
33213338
<prefigure label="prefigure-diffeq"
33223339
xmlns="https://prefigure.org">
33233340
<diagram dimensions="(300,300)" margins="5">
@@ -3345,7 +3362,7 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
33453362

33463363
<p>This next diagram employs some <latex/> macros that are defined in the usual way in <tag>docinfo</tag> and are employed to produce the names of some vectors in the labels. The blue line is colored blue by a global <prefigure/> declaration, also in <tag>docinfo</tag>.</p>
33473364

3348-
<image width="60%">
3365+
<image>
33493366
<prefigure label="prefigure-projection"
33503367
xmlns="https://prefigure.org">
33513368
<diagram dimensions="(300,300)" margins="5">
@@ -3388,7 +3405,7 @@ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
33883405

33893406
<p>The next <prefigure/> diagram is authored with annotations, arranged in a hierarchy of increasing refinement and detail. Each identified graphical component will read its annotation and show it on the screen below the diagram. When a reader clicks on the image, a high-level summary will be read using the author-provided annotation. The down and up arrow keys enable a reader to explore the diagram in more or less detail while the right and left arrow keys reveal features at the same level of detail. When the focus is on the graph, pressing "O" will produce a sonification of the graph.</p>
33903407

3391-
<image width="60%">
3408+
<image>
33923409
<prefigure label="prefigure-tangent"
33933410
xmlns="https://prefigure.org">
33943411
<diagram dimensions="(300,300)" margins="5">

0 commit comments

Comments
 (0)