Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Special typesetting of formulas #103

Open
hartig opened this issue Jun 21, 2023 · 9 comments
Open

Special typesetting of formulas #103

hartig opened this issue Jun 21, 2023 · 9 comments
Labels
spec:editorial Minor change in the specification (markup, typo, informative text; class 1 or 2)

Comments

@hartig
Copy link
Contributor

hartig commented Jun 21, 2023

As suggested by @TallTed, formulas and mathematical functions should be typeset in a way that looks different from the regular text. Quoting @TallTed's comment:

Is there another tag that should be used? Or another class to apply to such code tags, similar to what @afs mentioned for sparql code highlighting?

Formulas and mathematical functions that are written up in textbooks on these and related subjects are not generally printed using body text (nor, admittedly, monospaced/typewriter) styles. I have hopes we can come close with what we produce.

Related to this issue, and captured as #102, is that the symbols used for variables in such formulas should be marked up using <var> (or |) .

@hartig
Copy link
Contributor Author

hartig commented Jun 22, 2023

Here is my take on the following questions.

Is there another tag that should be used? Or another class to apply to such code tags, similar to what @afs mentioned for sparql code highlighting?

I would not use <code> tags because formulas and mathematical functions are not code. As there does not seem to exist a special HTML tag for marking up math content, I would simply use <span> with a specific CSS class that renders the content to look slightly different from the regular text.

@gkellogg
Copy link
Member

gkellogg commented Jun 22, 2023

Have you considered using the math Elment the ReSpec? https://developer.mozilla.org/en-US/docs/Web/MathML/Element/math#

I often use the var element for variables, which may get you part of the way there.

@TallTed
Copy link
Member

TallTed commented Jun 22, 2023

var definitely helps.

At first blush, <math> looks like the right direction from there, but I'm concerned that this may require a lot more complex MathML markup. Does anyone here have experience using MathML in such a simplistic way as I think we're contemplating? Is it really as simple as adding a leading <math display="block"> or <math display="inline">, and a trailing </math>?

@afs
Copy link
Contributor

afs commented Jun 22, 2023

Could we have some concrete displaying HTML please? (not sure what github tech allows easy raw HTML without interference).

@Tpt
Copy link
Contributor

Tpt commented Jun 22, 2023

Sadly Github does not seems to support Mathml in comments. Here is a getting started on MDN.

@TallTed
Copy link
Member

TallTed commented Jun 22, 2023

Ugh. The compatibility table claims Chrome 109+ support MathML, but the <mfrac> sample displays as 1 3 in my Version 114.0.5735.133 (Official Build) (x86_64). I think that means <math> is a lose.

@hartig
Copy link
Contributor Author

hartig commented Jun 29, 2023

I want to suggest to postpone taking action on this issue here until #105 #106 #107 and #94 are addressed. Each of these issues touches on parts that contain formulas and, thus, PRs for these issues would likely cause merge conflicts with a PR for the issue here.

@afs
Copy link
Contributor

afs commented Jun 29, 2023

Please include SPARQL-specific CSS classes when the changes do happen. It isolates the docs from browser and reSpec defaults if we need to have specific control.

@gkellogg
Copy link
Member

On a recent semantics call, it was noted that the formula presentation in Notation3 Semantics was something that could be emulated. However, this makes use of a JavaScript library to perform runtime rendering of text spans. Ultimately, this results in Unicode styled with CSS, so the presentation can be emulated at some cost to developers.

Another thing to consider would be to use such a package, but have it run as part of the document load event, similar to how examples are marked up so that the styled HTML is rendered during the ReSpec run.

@pfps pfps added the spec:editorial Minor change in the specification (markup, typo, informative text; class 1 or 2) label Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
spec:editorial Minor change in the specification (markup, typo, informative text; class 1 or 2)
Projects
None yet
Development

No branches or pull requests

6 participants