mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-05 19:28:39 +00:00
Implicit \color, explicitly grouped \textcolor (#619)
This commit is contained in:
committed by
Kevin Barabash
parent
ad0abbd4e9
commit
25dde7f841
@@ -23,9 +23,9 @@ const ParseNode = parseData.ParseNode;
|
||||
* - "color": An html color, like "#abc" or "blue"
|
||||
* - "original": The same type as the environment that the
|
||||
* function being parsed is in (e.g. used for the
|
||||
* bodies of functions like \color where the first
|
||||
* argument is special and the second argument is
|
||||
* parsed normally)
|
||||
* bodies of functions like \textcolor where the
|
||||
* first argument is special and the second
|
||||
* argument is parsed normally)
|
||||
* Other possible types (probably shouldn't be used)
|
||||
* - "text": Text-like (e.g. \text)
|
||||
* - "math": Normal math
|
||||
@@ -151,7 +151,7 @@ defineFunction([
|
||||
});
|
||||
|
||||
// A two-argument custom color
|
||||
defineFunction("\\color", {
|
||||
defineFunction("\\textcolor", {
|
||||
numArgs: 2,
|
||||
allowedInText: true,
|
||||
greediness: 3,
|
||||
@@ -166,6 +166,14 @@ defineFunction("\\color", {
|
||||
};
|
||||
});
|
||||
|
||||
// \color is handled in Parser.js's parseImplicitGroup
|
||||
defineFunction("\\color", {
|
||||
numArgs: 1,
|
||||
allowedInText: true,
|
||||
greediness: 3,
|
||||
argTypes: ["color"],
|
||||
}, null);
|
||||
|
||||
// An overline
|
||||
defineFunction("\\overline", {
|
||||
numArgs: 1,
|
||||
|
Reference in New Issue
Block a user