-
-
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
Support <, >, | and many \text... commands in text mode #684
Conversation
@edemaine I'm confused about |
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.
There are couple more alias that could be added:
\textsterling
(alias of\pounds
)\textregistered
(alias of\circledR
)
src/symbols.js
Outdated
defineSymbol(math, main, textord, "\u2021", "\\ddag"); | ||
defineSymbol(text, main, textord, "\u2021", "\\ddag"); |
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.
may as well add \textdagger
and \textdaggerdbl
as well.
Added. Also noticed that |
@edemaine it looks like the change to |
Indeed, |
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.
Sorry for the delay in this. Requesting a TODO be added and then this will be ready to merge.
src/symbols.js
Outdated
defineSymbol(math, main, textord, "\u00b0", "\\degree"); | ||
defineSymbol(text, main, textord, "\u00b0", "\\degree"); | ||
defineSymbol(math, main, mathord, "\u00a3", "\\pounds"); | ||
defineSymbol(math, main, mathord, "\u00a3", "\\mathsterling"); | ||
defineSymbol(text, main, mathord, "\u00a3", "\\pounds"); | ||
defineSymbol(text, main, mathord, "\u00a3", "\\textsterling"); |
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.
You mentioned that $\text{\pounds}$
generates a textord, should \text{\textsterling}
do the same? Can you add a TODO
so that people aren't confused by the use of mathord
s in text mode later on?
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.
Added. Although I found this discussion where @xymostech suggests that maybe we should move away from mathord vs. textord, and rather just specify which font to use. It seems LaTeX has a notion of "mathord" but no notion of "textord" (at least I've never seen one in debugging output)?
Should be good to go now. Someday, a more thorough symbol review wouldn't hurt, but this should help! (Also rebased.) |
Add long-form aliases for various text symbols * \textgreater is an alias for > in text mode * \textless is an alias for < in text mode * \textbar is an alias for | in text mode * \textdollar is an alias for \$ in text mode * \textunderscore is an alias for \_ in text mode * \textbraceleft is an alias for \{ in text mode * \textbraceright is an alias for \} in text mode * \textless is an alias for < in text mode * \textgreater is an alias for > in text mode * \textbar is an alias for | in text mode * \textbardbl is an alias for \| in text mode * \textendash is an alias for -- in text mode * \textemdash is an alias for --- in text mode * \textquoteleft is an alias for ` in text mode * \textquoteright is an alias for ' in text mode * \textquotedblleft is an alias for `` in text mode * \textquotedblright is an alias for '' in text mode * \textdagger is an alias for \dag in text mode * \textdaggerdbl is an alias for \ddag in text mode * \textsterling is an alias for \pounds in text mode * \dag, \ddag work in text mode * \circledR, \checkmark, \pounds work in text mode too * Extend Symbols1 test to test \pounds and \textdollar in \text * Add note about \pounds in text vs. math mode
LGTM. Thanks! |
This started as a fix to #662, which reported lack of
<
and>
support in text mode. As suggested, I mapped them to regular<
and>
characters as if\usepackage[T1]{fontenc}
is in effect. This seems like the preferred behavior (unless you're typing in Spanish or another language that uses upside-down symbols... but then perhaps better to use Unicode symbols).I also noticed that
|
wasn't working in text mode, but was supposed to, so I added that. These are one-line changes.I then implemented
\textless
,\textgreater
,\textbar
as aliases to these symbols.I then started going through this symbol list to see what other characters were missing. I added support for
\textdollar
,\textunderscore
,\textbraceleft
,\textbraceright
,\textbardbl
,\textendash
,\textemdash
,\textquote(dbl)(left/right)
as aliases to existing symbols. I didn't attempt to add the other text symbols, though that might be good for a future project...