Skip to content

Figures and images

Caleb Waldorf edited this page Jun 14, 2022 · 6 revisions

Figures and images

Figures

Figure directive

The figure directive will create new XHTML pages for each of the figures encountered in the Markdown and add these new pages to the <type>.yml files automatically during build.

Without caption

Input

::: figure:figure-ID source:figure.jpg alt:"A short description"

With caption

Input

::: figure:figure-one source:figure.jpg alt:"Image description"
:: Figure Caption.
::

Output (inline)

<!-- START: figure:figure#figure-one; _markdown/my-project.md:6 -->

<div class="figure__small figure__small--landscape">
  <figure id="reffigure-one">
    <a href="figurefigure-one.xhtml#figure-one">
      <img src="../images/figure.jpg" alt="Image description" />
    </a>
  </figure>
</div>

Output (figures page)

<div class="figure__large figure__large--landscape">
  <figure id="figure-one">
    <div class="figure__items">

      <a href="my-project.xhtml#reffigure-one">
        <img class="landscape" alt="Image description" src="../images/figure.jpg" />
      </a>
      <div class="figcaption">
        <p class="small"> Figure Caption.
        </p>
      </div>

    </div>
  </figure>
</div>

Figure-inline directive

The figure-inline will render a full-size image directly in the HTML without creating a link to the figures section of the publication.

Input

::: figure-inline:figure-one source:figure.jpg alt:"Image description"
:: Figure Caption.
::

Output

<div class="figure__large figure__inline figure__inline--landscape">
  <figure id="figure-one">
    <div class="figure__items">


      <img class="landscape" alt="Image description" src="../images/figure.jpg" />

      <div class="figcaption">
        <p class="small"> Figure Caption.
        </p>
      </div>

    </div>
  </figure>
</div>

Full-bleed images

A full-bleed image stretches the entire width and height of the browser for the Reader and Web builds and can be added by adding the figure__fullbleed class to the image.

The default-theme-serif and default-theme-sans themes contain CSS to style full-bleed images in the Reader and Web builds. Custom CSS can be added to treat full-bleed images for the remaining builds.

Input

::: figure-inline:figure-one source:figure.jpg classes:figure__fullbleed

Output

<div class="figure__large figure__inline figure__inline--landscape figure__fullbleed">
  <figure id="figure-one">
    <div class="figure__items">


      <img class="fullbleed" alt="figure.jpg" src="../images/figure.jpg" />

      <div class="figcaption">
        <p class="small"></p>
      </div>

    </div>
  </figure>
</div>

Including images via Markdown

If you don't wish to use the figure or figure-inline directive, you can use the default Markdown syntax. Images must be added to the project/_images directory.

Input

![Figure Title](../images/figure.jpg)

Output

<p><img src="../images/figure.jpg" alt="Figure Title" /></p>
Clone this wiki locally