This is an old revision of the document!
Tables and figures
This is a tweaked version of the Plugin Caption.
You can give captions to the following items:
- tables
- figures
- image box
The syntax is as follows:
Tables
<table label-of-table> <caption>Give you caption here and it will be numbered automatically</caption> ^ table head 1 ^ table head 2 ^ table head 3 ^ table head 4 ^ | table cell 1 | table cell 2 | table cell 3 | table cell 4 | | table cell 5 | table cell 6 | table cell 7 | table cell 8 | </table>
label-of-tableshould be a unique id to identify the table by the coding system, and it could not contain spaces in it.- The above code could be inserted in the tool bar directly so you don't have to type it manually
How the above code looks like in reality:
| table head 1 | table head 2 | table head 3 | table head 4 |
|---|---|---|---|
| table cell 1 | table cell 2 | table cell 3 | table cell 4 |
| table cell 5 | table cell 6 | table cell 7 | table cell 8 |
Figures
<figure label-of-figure>
<caption>Give you caption here and it will be numbered automatically</caption>
{{ :wiki:dokuwiki-128.png |Dokuwiki logo}}
</figure>
label-of-figureshould be a unique id to identify the figure by the coding system, and it could not contain spaces in it.- The above code could be inserted in the tool bar directly so you don't have to type it manually
How it looks like in work:
The picture could be replaced by a chart or plot if required, for example:
<figure pie-chart-1>
<caption>Caption for the pie chart</caption>
<c3>
// some comment
data: {
columns: [
['data1', 30], /* more comment */
['data2', 120],
],
type : 'pie',
}
</c3>
</figure>
// some comment
data: {
columns: [
['data1', 30], /* more comment */
['data2', 120],
],
type : 'pie',
}
</c3>
Image box
Occasionally you may need to include a image box in the page but does not want it to look like a figure. In this case, you may just use an image box.
<imagebox label-of-imagebox>
{{ :wiki:dokuwiki-128.png |Dokuwiki logo}}
<caption>This is an image box</caption>
</imagebox>
label-of-imageboxshould be a unique id to identify the image box by the coding system, and it could not contain spaces in it.- The above code could be inserted in the tool bar directly so you don't have to type it manually
- All image boxes are 200px in width and will be arranged to the right of the page on screen larger than 576 pixels in width
How it looks like in work (see Image ##REF:label-of-imagebox##):
<imagebox label-of-imagebox>
<caption>This is a image box</caption>
</imagebox>
Reference
What if I need to refer to a table/figure/image box in the text?
We may have noticed in the image box section that there's a link to the image box. A table/figure/image box could be referred to in text by its label like this:
For more ideas, please see Table {{ref>label-of-table}}.
How it works in reality:
For more ideas, please see Table 1.