quarto-dev / quarto-dev/quarto-cli

Customize the html output of theorem div

Open
#317 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

crossref enhancement themes
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Description

There are some minor issues of the html output of theorem div. I am using quarto v0.3.114 on mac os.

A minimal example:

::: {#thm-line}

The equation of any straight line, called a linear equation, can be 
written as: $y=ax+b$.

A second par.

:::

See @thm-line.

::: {#thm-line2}

A second theorem.

:::

HTML output:
image

In the example above:

(1) Sometimes the theorem body begins in a new paragraph (as in Theorem 2), sometimes just following the theorem tag (as in Theorem 1). Not sure whether this is a design choice or not, but it might be better to let the body just follow the theorem tag for consistency.

(2) It's hard to tell the scope of the theorem body. For example, in theorem 1 "A second par" is part of the body, while "See theorem 1" is not.
A possible fix is to put the whole theorem in a box environment. From my experience, many math blogs do that (eg, Terry Tao's blog). Another fix is to italicize the whole theorem/lemma/etc as LaTeX does.

I personally prefer the first fix (i.e., box). A con of the italicize approach is that users may not be able to use the markdown syntax ** for emphasis once the whole texts are italicized. LaTeX solves this problem by using the \emph command, which produces normal texts for emphasis in a italicized environment.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the minimal Markdown example in the issue and inspect how Quarto renders the theorem divs in HTML. Compare the two paragraph behaviors and determine the intended body boundary and presentation, including whether a box or italicized style is required; done means the example has consistent, clearly scoped theorem output.

Written by the indexing model from the issue text.

Assessment

Tech stack
html, markdown
Domain
content, web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.