Blame
|
1 | # Figure |
||||||
| 2 | ||||||||
| 3 | [Figure Documentation](/-/help/plugins#figure) |
|||||||
| 4 | ||||||||
| 5 | The `{{Figure}}` embedding wraps a block of content (code, a table, an image) |
|||||||
| 6 | in a bordered box with an optional caption, similar to a LaTeX figure. Note |
|||||||
| 7 | the outer fence below uses **four** backticks because the content itself is a |
|||||||
| 8 | fenced code block. |
|||||||
| 9 | ||||||||
| 10 | ## A captioned code block |
|||||||
| 11 | ||||||||
| 12 | ```` |
|||||||
| 13 | {{Figure |
|||||||
| 14 | |caption=Figure 1: Hello world in Python |
|||||||
| 15 | ```python |
|||||||
| 16 | #!/usr/bin/env python |
|||||||
| 17 | print("Hello, World!") |
|||||||
| 18 | ``` |
|||||||
| 19 | }} |
|||||||
| 20 | ```` |
|||||||
| 21 | ||||||||
| 22 | {{Figure |
|||||||
| 23 | |caption=Figure 1: Hello world in Python |
|||||||
| 24 | ```python |
|||||||
| 25 | #!/usr/bin/env python |
|||||||
| 26 | print("Hello, World!") |
|||||||
| 27 | ``` |
|||||||
| 28 | }} |
|||||||
| 29 | ||||||||
| 30 | ## An image, aligned and sized |
|||||||
| 31 | ||||||||
| 32 | `align` positions the figure (`center` by default) and `width` sizes it. |
|||||||
| 33 | ||||||||
| 34 | ``` |
|||||||
| 35 | {{Figure |
|||||||
| 36 | |caption=Figure 2: An eagle-owl |
|||||||
| 37 | |align=left |
|||||||
| 38 | |width=50% |
|||||||
| 39 |  |
|||||||
| 40 | }} |
|||||||
| 41 | ``` |
|||||||
| 42 | ||||||||
| 43 | {{Figure |
|||||||
| 44 | |caption=Figure 2: An eagle-owl |
|||||||
| 45 | |align=left |
|||||||
| 46 | |width=50% |
|||||||
| 47 |  |
|||||||
| 48 | }} |
|||||||
| 49 | ||||||||
| 50 | `height` caps the content height and scrolls the overflow; `style` appends |
|||||||
| 51 | inline CSS. See the [Figure documentation](/-/help/plugins#figure) for those. |
|||||||
