mirror of
https://github.com/typst/typst
synced 2025-05-14 04:56:26 +08:00
mention typewriter font in LaTeX guide
This commit is contained in:
parent
c4d7faf527
commit
25ad4f7d41
@ -76,14 +76,16 @@ Here is a list of common markup commands used in LaTeX and their Typst
|
|||||||
equivalents. You can also check out the [full syntax cheat sheet]($syntax).
|
equivalents. You can also check out the [full syntax cheat sheet]($syntax).
|
||||||
|
|
||||||
| Element | LaTeX | Typst | See |
|
| Element | LaTeX | Typst | See |
|
||||||
|:-----------------|:--------------------------|:-----------------------|:-----------|
|
|:-----------------------|:--------------------------|:-----------------------|:-----------|
|
||||||
| Strong emphasis | `\textbf{strong}` | `[*strong*]` | [`strong`] |
|
| Strong emphasis | `\textbf{strong}` | `[*strong*]` | [`strong`] |
|
||||||
| Emphasis | `\emph{emphasis}` | `[_emphasis_]` | [`emph`] |
|
| Emphasis | `\emph{emphasis}` | `[_emphasis_]` | [`emph`] |
|
||||||
| Monospace / code | `\texttt{print(1)}` | ``[`print(1)`]`` | [`raw`] |
|
|
||||||
| Link | `\url{https://typst.app}` | `[https://typst.app/]` | [`link`] |
|
| Link | `\url{https://typst.app}` | `[https://typst.app/]` | [`link`] |
|
||||||
| Label | `\label{intro}` | `[<intro>]` | [`label`] |
|
| Label | `\label{intro}` | `[<intro>]` | [`label`] |
|
||||||
| Reference | `\ref{intro}` | `[@intro]` | [`ref`] |
|
| Reference | `\ref{intro}` | `[@intro]` | [`ref`] |
|
||||||
| Citation | `\cite{humphrey97}` | `[@humphrey97]` | [`cite`] |
|
| Citation | `\cite{humphrey97}` | `[@humphrey97]` | [`cite`] |
|
||||||
|
| Verbatim / code | `\verb|print(f"{x}")|`, `verbatim` / `listing` environments | ``[`print(f"{x}")`]`` | [`raw`] |
|
||||||
|
| Monospace / typewriter | `\texttt{mono}` | ``[`mono`]`` or `text` function | [`raw`], [`text`] |
|
||||||
|
| Verbatim | `verbatim` environment | ``[`#typst-code()`]`` | [`raw`] |
|
||||||
| Bullet list | `itemize` environment | `[- List]` | [`list`] |
|
| Bullet list | `itemize` environment | `[- List]` | [`list`] |
|
||||||
| Numbered list | `enumerate` environment | `[+ List]` | [`enum`] |
|
| Numbered list | `enumerate` environment | `[+ List]` | [`enum`] |
|
||||||
| Term list | `description` environment | `[/ Term: List]` | [`terms`] |
|
| Term list | `description` environment | `[/ Term: List]` | [`terms`] |
|
||||||
@ -121,6 +123,16 @@ To get a [numbered list]($enum) (`enumerate`) instead, use a `+` instead of the
|
|||||||
hyphen. For a [term list]($terms) (`description`), write `[/ Term: Description]`
|
hyphen. For a [term list]($terms) (`description`), write `[/ Term: Description]`
|
||||||
instead.
|
instead.
|
||||||
|
|
||||||
|
Regarding the usage of monospace fonts (also known as "typewriter" font style
|
||||||
|
in LaTeX), it should be noted that using [`raw`] such as in
|
||||||
|
``[`monospace`]`` (where you'd use `\texttt{monospace}` in LaTeX) works for
|
||||||
|
most cases where you only have simple text. If you need to use formatting, such
|
||||||
|
as in `\texttt{monospace \textbf{bold}}`, you will need to replicate its look by
|
||||||
|
switch to changing the text font to a monospace font with
|
||||||
|
`#text(font: "DejaVu Sans Mono", size: 0.8em)[monospace *bold*]`, for example,
|
||||||
|
since `raw` only supports verbatim (unformatted) text. See its documentation
|
||||||
|
for more details.
|
||||||
|
|
||||||
## How do I use a command? { #commands }
|
## How do I use a command? { #commands }
|
||||||
LaTeX heavily relies on commands (prefixed by backslashes). It uses these
|
LaTeX heavily relies on commands (prefixed by backslashes). It uses these
|
||||||
_macros_ to affect the typesetting process and to insert and manipulate content.
|
_macros_ to affect the typesetting process and to insert and manipulate content.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user