Floating Elements - Mandarancio/scidown GitHub Wiki
SciDown support a variety of floating elements:
- Figure
- Table
- Listing
- Equation
Inside of the floating elements the user can insert any standard markdown code inside the floating sections. It is also possible to give an id to the floating sections to then reference to them. Moreover some of the floating blocks support as well captioning.
To add a caption (optionally) simply use @caption(Your caption)
.
Figure
The figure block support id
and captioning
and is defined as:
@figure(id)
USER CODE
@caption(caption text)
@/
If you do not need the id
you can simply use @figure
or @figure()
.
Example code:
@figure

@caption(This is a picture the *Falcon Heavy* rocket.)
@/
HTML rendered:
Table
The table floating block has the same property of the figure. To open the table floating section the syntax is simple: @table
or @table(id)
.
Example code:
@table
|Col. 1|Col. 2|Col. 3|
|:-----|:-----|:-----|
|A |B |C |
|D |E |F |
|G |H |I |
@caption(A simple table)
@/
HTML rendered:
Listing
Listing works as the previous two, the syntax is @listing
or @listing(id)
.
Example code:
@listing
```c
int main(int argc, char** argv)
{
printf("hello world\n");
return 0;
}
```
@caption(Some lines of code)
@/
HTML rendered:
Equation
It's possible to add numbered equation that will be rendered using javascript library such as katex or as mathjax. The scidown
binary inject katex
library to the html output, but when used as library is up to you what to inject.
The equation however do not support captioning, the syntax is the following: @equation
or @equation(id)
.
Example code:
@equation
\vec{x} = \sum_{i=1}^{N} 2^{-n}
@/
HTML rendered: