-
Notifications
You must be signed in to change notification settings - Fork 26
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
Percent (%) symbol is being rendered in italics in the HTML SRS #3748
Comments
Is |
Looking at the following code: Drasil/code/drasil-printers/lib/Language/Drasil/Printing/AST.hs Lines 9 to 16 in 21ff358
There doesn't seem to be an explicit modulus operator, just percent (labeled |
It seems weird to me that |
I would imagine that a |
To my knowledge, units are rendered as expressions; thus, it would still be italicized. All of the printers wrap expressions in some sort or italics or in-line equation wrappers. To add on to the original issue, I investigated the problem further. For printing, the
Here is the Drasil/code/drasil-printers/lib/Language/Drasil/Printing/AST.hs Lines 28 to 46 in 864e138
This Drasil/code/drasil-printers/lib/Language/Drasil/Printing/AST.hs Lines 50 to 58 in 864e138
Thus, when printing, since the top level data type is a Two possible solutions I thought of were:
|
@BilalM04 you got my attention with "units are rendered as expressions; thus, it would still be italicized". The problem you are discussing is actually deeper than just the percent symbol. I wonder if this is a chance to fix our rendering of units in Drasil? According to SI rules, units should NOT be in italics. This rule can be seen in the NIST checklist item 6. Some of the units in Drasil are not in italics, while others are. For instance, in the double pendulum example, We should stop rendering units in italics. I think that is the bigger picture problem to try to solve. If we stop using italics, then it fixes the percentage symbol, and everything else that is currently wrong. 😄 If we can fix this, we should add it to our list of successes in Drasil. (When we do this we should also fix the spelling of cosmetic in the current example benefit.) I grade many SRS documents in my grad course every year and students struggle with the rule that units are not in italics. It is just too fiddly a detail for must people to keep track of consistently. We are currently doing the thing where it is wrong everywhere, but when we fix it, it will be right everywhere. 😄 |
@smiths and I discussed the rendering of units in italics in meeting #3791, I will reiterate the discussion here. The reason For certain expressions, it uses straight HTML, otherwise, it delegates to the TeX functions. Here is the code for rendering expressions in HTML: Drasil/code/drasil-printers/lib/Language/Drasil/HTML/Print.hs Lines 158 to 178 in 864e138
Additionally, all expressions in HTML are wrapped in an
This issue in HTML can be solved by using TeX for all expressions and removing the Now, regarding the issue for LaTeX/PDF. The problem with italicization is actually not present in the LaTeX/PDF SRS. After comparing the rendered |
Thank you for the summary @BilalM04. We talked about doing an experiment to see the performance hit for rending all units inside |
@smiths, using LaTeX for all expressions will actually fix the percentage issue as well. Please see the last paragraph of #3748 (comment). To add on, here is the comparison: The symbol on the left is |
I conducted an experiment to evaluate the performance between the existing HTML SRS and an alternative HTML SRS, where all expressions are rendered using Mathjax LaTeX. The tests were executed locally on the Brave browser (Chromium based), on a laptop operating on battery power (unplugged). The rendering of assets like images were excluded from the local tests (as they were not in the path), which resulted in quicker performance times than those anticipated in a hosted environment. Additionally, I have a decently powerful processor (Intel® Core™ i7-13700H), which further influenced the test results. I think caching is disabled in these tests. NOTE: tests are run on the Projectile SRS. Current Generated HTML SRS (LOCAL)Full TeX Expressions HTML SRS (LOCAL)Current Generated HTML SRS (HOSTED)For reference, here is the performance stats for the hosted HTML SRS, which currently uses a mix of HTML and Mathjax for expressions. It is the same SRS as the first test, however it is the one hosted on the website rather than run locally. |
Fantastic data! All of these numbers are kind of large, i.e. more than 1s. Adding 300ms between current and full TeX is noticeable. I'm wondering why the Scripting time is so large -- is it all MathJAX or do we have more scripting? |
Some of my thoughts:
|
This is a really impressive analysis. It is great that it is based on data and the @balacij has theories that we can explore. My personal preference is to not get distracted too much by this at this time. I think there are other issues that are more important at the moment. Having said that, we could use this as a case study to highlight the benefits of Drasil. I'm fairly sure that if we improve the loading time of one webpage, we'll improve the loading time of all of them. Explaining the process of making this improvement would give us another anecdote to promote Drasil. |
The percent (
%
) symbol is being rendered in italics in the HTML SRS, when it should not be.HTML:
%
is wrapped in an<em></em>
tag. For example:Drasil/code/stable/dblpend/SRS/HTML/DblPend_SRS.html
Line 2374 in 21ff358
From briefly looking at the Drasil code, it seems that
%
is defined as an operator, thus it is printed as an expression.The text was updated successfully, but these errors were encountered: