Text elements¶
General things on how the text and links are handled.
Text formatting¶
**bold**
*italic*
``inline code``
**bold**
_italic_
`inline code`
Footnotes¶
Headings¶
=========
Heading 1
=========
Heading 2
=========
Heading 3
---------
Heading 4
^^^^^^^^^
Heading 5
~~~~~~~~~
Heading 6
*********
# Heading 1
## Heading 2
### Heading 3
#### Heading 4
##### Heading 5
###### Heading 6
Images¶
Images can be added either with the figure directive or the image directive (with figure you can also add a caption):
.. image:: path-relative-to-current-file/image.jpg/png
:width: 200px
:height: 100px
:scale: 50 %
:alt: alternate text
:align: right
.. figure:: path-relative-to-current-file/image.jpg/png
:<options>:
This will be the caption
See also
rST primer section on images and figures.
```{image} path-relative-to-current-file/image.jpg/png
:<options>:
```
```{figure} path-relative-to-current-file/image.jpg/png
:<options>:
This will be the caption
...You can add more text (and even other text elements) that
will be included in the space of the figure.
```
Note
See MyST documentation on figures and images for all the options.
Links¶
This is a link to an external webpage:
`link text <https://www.yambo-code.eu>`__
Attention
Notice the double underscore __ at the end. This is needed to get an anonymous hyperlink reference avoid errors (see here).
[link text](https://www.yambo-code.eu)
To insert a cross reference to another page/section/paragraph of the wiki, do like this:
:ref:`link text <unique-label>`
[link text](#unique-label)
Here unique-label is the explicit target that has to be placed before the element that the link is pointing to. In rST the explicit target is .. _unique-label:; for MD there are different ways to create an explicit target, for example placing (unique-label)= before an heading when the target is an heading.
Important
Always create explicit targets. Do not rely on implicit targets because they can break easily.
Finally, note that while in MD it is easy to format the link text (for example making it bold or inline code), this is not possible in rST.
Tables¶
+------------------------+------------+----------+----------+
| Header row, column 1 | Header 2 | Header 3 | Header 4 |
| (header rows optional) | | | |
+========================+============+==========+==========+
| body row 1, column 1 | column 2 | column 3 | column 4 |
+------------------------+------------+----------+----------+
| body row 2 | Cells may span columns. |
+------------------------+------------+---------------------+
| body row 3 | Cells may | - Table cells |
+------------------------+ span rows. | - contain |
| body row 4 | | - body elements. |
+------------------------+------------+----------+----------+
| body row 5 | Cells may also be | |
| | empty: ``-->`` | |
+------------------------+-----------------------+----------+
+------+-----------+------------+--------+------+------+
| Type | .. centered:: -payload- | crcL | crcH |
+======+===========+============+========+======+======+
| Type | subType | obj/access | -data- | crcL | crcH |
+------+-----------+------------+--------+------+------+
| foo | bar |
| --- | --- |
| baz | bim |
| left | center | right |
| :--- | :----: | ----: |
| a | b | c |
For more table options in MD provided by MyST Parser see here.