Slightly improve tables in syntax.md (#4151)

This commit is contained in:
Malo 2024-05-16 19:17:10 +02:00 committed by Laurenz
parent 573a2db4be
commit ba1ae1c9a2

View File

@ -35,7 +35,7 @@ below lists all markup that is available and links to the best place to learn
more about their syntax and usage. more about their syntax and usage.
| Name | Example | See | | Name | Example | See |
| ------------------ | ------------------------ | ---------------------------- | | ------------------ | ---------------------------- | ------------------------ |
| Paragraph break | Blank line | [`parbreak`] | | Paragraph break | Blank line | [`parbreak`] |
| Strong emphasis | `[*strong*]` | [`strong`] | | Strong emphasis | `[*strong*]` | [`strong`] |
| Emphasis | `[_emphasis_]` | [`emph`] | | Emphasis | `[_emphasis_]` | [`emph`] |
@ -50,10 +50,10 @@ more about their syntax and usage.
| Math | `[$x^2$]` | [Math]($category/math) | | Math | `[$x^2$]` | [Math]($category/math) |
| Line break | `[\]` | [`linebreak`] | | Line break | `[\]` | [`linebreak`] |
| Smart quote | `['single' or "double"]` | [`smartquote`] | | Smart quote | `['single' or "double"]` | [`smartquote`] |
| Symbol shorthand | `[~, ---]` | [Symbols]($category/symbols/sym) | | Symbol shorthand | `[~]`, `[---]` | [Symbols]($category/symbols/sym) |
| Code expression | `[#rect(width: 1cm)]` | [Scripting]($scripting/#expressions) | | Code expression | `[#rect(width: 1cm)]` | [Scripting]($scripting/#expressions) |
| Character escape | `[Tweet at us \#ad]` | [Below](#escapes) | | Character escape | `[Tweet at us \#ad]` | [Below](#escapes) |
| Comment | `[/* block */, // line]` | [Below](#comments) | | Comment | `[/* block */]`, `[// line]` | [Below](#comments) |
## Math mode { #math } ## Math mode { #math }
Math mode is a special markup mode that is used to typeset mathematical Math mode is a special markup mode that is used to typeset mathematical
@ -75,7 +75,7 @@ follows:
| Variable access | `[$#x$, $pi$]` | [Math]($category/math) | | Variable access | `[$#x$, $pi$]` | [Math]($category/math) |
| Field access | `[$arrow.r.long$]` | [Scripting]($scripting/#fields) | | Field access | `[$arrow.r.long$]` | [Scripting]($scripting/#fields) |
| Implied multiplication | `[$x y$]` | [Math]($category/math) | | Implied multiplication | `[$x y$]` | [Math]($category/math) |
| Symbol shorthand | `[$->, !=$]` | [Symbols]($category/symbols/sym) | | Symbol shorthand | `[$->$]`, `[$!=$]` | [Symbols]($category/symbols/sym) |
| Text/string in math | `[$a "is natural"$]` | [Math]($category/math) | | Text/string in math | `[$a "is natural"$]` | [Math]($category/math) |
| Math function call | `[$floor(x)$]` | [Math]($category/math) | | Math function call | `[$floor(x)$]` | [Math]($category/math) |
| Code expression | `[$#rect(width: 1cm)$]` | [Scripting]($scripting/#expressions) | | Code expression | `[$#rect(width: 1cm)$]` | [Scripting]($scripting/#expressions) |
@ -91,11 +91,11 @@ a table listing all syntax that is available in code mode:
| ------------------------ | ----------------------------- | ---------------------------------- | | ------------------------ | ----------------------------- | ---------------------------------- |
| None | `{none}` | [`none`] | | None | `{none}` | [`none`] |
| Auto | `{auto}` | [`auto`] | | Auto | `{auto}` | [`auto`] |
| Boolean | `{false, true}` | [`bool`] | | Boolean | `{false}`, `{true}` | [`bool`] |
| Integer | `{10, 0xff}` | [`int`] | | Integer | `{10}`, `{0xff}` | [`int`] |
| Floating-point number | `{3.14, 1e5}` | [`float`] | | Floating-point number | `{3.14}`, `{1e5}` | [`float`] |
| Length | `{2pt, 3mm, 1em, ..}` | [`length`] | | Length | `{2pt}`, `{3mm}`, `{1em}`, .. | [`length`] |
| Angle | `{90deg, 1rad}` | [`angle`] | | Angle | `{90deg}`, `{1rad}` | [`angle`] |
| Fraction | `{2fr}` | [`fraction`] | | Fraction | `{2fr}` | [`fraction`] |
| Ratio | `{50%}` | [`ratio`] | | Ratio | `{50%}` | [`ratio`] |
| String | `{"hello"}` | [`str`] | | String | `{"hello"}` | [`str`] |
@ -132,7 +132,7 @@ a table listing all syntax that is available in code mode:
| Include module | `{include "bar.typ"}` | [Scripting]($scripting/#modules) | | Include module | `{include "bar.typ"}` | [Scripting]($scripting/#modules) |
| Import module | `{import "bar.typ"}` | [Scripting]($scripting/#modules) | | Import module | `{import "bar.typ"}` | [Scripting]($scripting/#modules) |
| Import items from module | `{import "bar.typ": a, b, c}` | [Scripting]($scripting/#modules) | | Import items from module | `{import "bar.typ": a, b, c}` | [Scripting]($scripting/#modules) |
| Comment | `[/* block */, // line]` | [Below](#comments) | | Comment | `{/* block */}`, `{// line}` | [Below](#comments) |
## Comments ## Comments
Comments are ignored by Typst and will not be included in the output. This is Comments are ignored by Typst and will not be included in the output. This is