-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
\copyright, \textregistered, \textcircled support #1073
Conversation
@edemaine can you post what it looks like for |
Here's the current state for http://localhost:7936/?text=%5Cbegin%7Bmatrix%7D%0A%5Ccopyright%5Csmall%5Ccopyright%5Cfootnotesize%5Ccopyright%5Ctiny%5Ccopyright%5C%5C%0A%5Ccopyright_%7B%5Ccopyright_%7B%5Ccopyright%7D%7D%0A%5Cend%7Bmatrix%7D%0A : It looks like $$
\begin{matrix}
x\rlap{x} & \small x\rlap{x} & \footnotesize x\rlap{x} & \tiny x\rlap{x} \\
x\rlap{x} & \scriptstyle x\rlap{x} & \scriptscriptstyle x\rlap{x} \\
x\rlap{x} & _{x\rlap{x}} & _{_{x\rlap{x}}} \\
\end{matrix}
$$ Here's KaTeX's rendering: (sorry, I'm on Windows right now, so fonts aren't loading) Incidentally, LaTeX does some weird stuff with resized copyrights. Here's the first example: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure the best way to deal with the font size issues. Finding an appropriate glyph for the \copyright
symbol might be easier in the short term. Another option might be to implement \mathchoice
and then tweak the definition for each style.
Codecov Report
@@ Coverage Diff @@
## master #1073 +/- ##
=========================================
- Coverage 83.83% 83.8% -0.04%
=========================================
Files 61 61
Lines 3971 3982 +11
Branches 659 662 +3
=========================================
+ Hits 3329 3337 +8
- Misses 543 546 +3
Partials 99 99
Continue to review full report at Codecov.
|
I revisited this, implementing an actual \copyright_{\copyright_{\copyright}} \small \copyright \tiny \copyright This should be good to go, unless someone knows better terminology for this type of accent. Oh, also need to add tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for seeing this through.
defineMacro("\\textcopyright", "\\textcircled{c}"); | ||
defineMacro("\\copyright", | ||
"\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"); | ||
defineMacro("\\textregistered", "\\textcircled{\\scriptsize R}"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yay for macros
width: 0; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wish we store more props directly on the domTree
nodes we create so that we don't have all of this extra data hanging out in this file. No action required.
@@ -684,6 +684,7 @@ defineSymbol(text, main, accent, "\u02da", "\\r"); // ring above | |||
defineSymbol(text, main, accent, "\u02c7", "\\v"); // caron | |||
defineSymbol(text, main, accent, "\u00a8", '\\"'); // diaresis | |||
defineSymbol(text, main, accent, "\u02dd", "\\H"); // double acute | |||
defineSymbol(text, main, accent, "\u25ef", "\\textcircled"); // \bigcirc glyph |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, this is just an alias.
This seems to work at regular size and
\small
, but not e.g. in subscript. Suggestions welcome.Based on discussions with @kevinbarabash in KaTeX/katex-fonts#9