Replies: 2 comments 3 replies
-
You should check this Quarto extension https://github.com/quarto-ext/latex-environment It will allow you to use a markdown syntax to create a LaTeX environment or a command. I believe the code above can be written this way ---
title: "Test"
filters:
- latex-environment
environments: [labeling]
commands: [item]
keep-tex: true
---
::: {.labeling options="" arguments="00000"}
[description of symbol 1]{.item options="$V_{Rd}$"}
[description of symbol 2]{.item options="$V_{Sd}$"}
[very short math symbol]{.item options="$x$"}
[very long math symbol]{.item options="$M = F d$"}
::: Not sure it is simpler than raw LaTeX, but it would compile HTML doc without missing part. |
Beta Was this translation helpful? Give feedback.
-
That's a very nice extension to keep in mind for general purpose, but you're right, it become quite verbose when defining the ::: {.labeling options="" arguments="000000000"}
[]{.item options="$V_{Rd}$"}
description of symbol 1
[]{.item options="$V_{Sd}$"}
description of symbol 2
[]{.item options="$x$"}
very short math symbol
[]{.item options="$M = F d$"}
very long math symbol
::: This way I preserve the structure of the description environment (symbol first, description in the next line) and it render correctly in the pdf, but I may lose some html compatibility. Leveraging the extension, I could also define the
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
Hello,
The Markdown/qmd syntax for
description
get translated to the\begin{description}
latex environment, i.e. in the pdf output is rendered as a bold item followed by the description, with a fixed space between them. This works best if the item is some text, but the fixed space doesn't look good with a math symbol followed by its description because the space between them is not enough (probably can be fixed with some option in the preamble), but mostly because the descriptions do not align.In order to align the descriptions, i.e. having a variable space between item and description, I could use the
labeling
environment provided also byKOMA-Script
which let you define a separator, and, more importantly, a fixed amount of space from the left margin, so that all descriptions starts aligned (i.e. the space between item and description is variable).Here a minimal example:
desc.pdf
(Note that the above variant render the same in html, it does not make any difference)
I would like to minimize the amount of raw latex in my qmd file, and write it similarly to the quarto description syntax. I propose to wrap the description into a content block like this:
this way it could be defined as its own div block, that possibly could also be handled correctly by the html render engine if the proper ad hoc class is specified.
Beta Was this translation helpful? Give feedback.
All reactions