mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
Ajout de \binom pour afficher les coefficients binomiaux (#250)
This commit is contained in:
@@ -190,7 +190,12 @@ Layout TexParser::popCommand() {
|
||||
return popOverrightarrowCommand();
|
||||
}
|
||||
}
|
||||
|
||||
if (strncmp(k_binomCommand, m_text, strlen(k_binomCommand)) == 0) {
|
||||
if (isCommandEnded(*(m_text + strlen(k_binomCommand)))) {
|
||||
m_text += strlen(k_binomCommand);
|
||||
return popBinomCommand();
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < k_NumberOfSymbols; i++) {
|
||||
if (strncmp(k_SymbolsCommands[i], m_text, strlen(k_SymbolsCommands[i])) == 0) {
|
||||
if (isCommandEnded(*(m_text + strlen(k_SymbolsCommands[i])))) {
|
||||
@@ -264,6 +269,13 @@ Layout TexParser::popOverrightarrowCommand() {
|
||||
return VectorLayout::Builder(popBlock());
|
||||
}
|
||||
|
||||
Layout TexParser::popBinomCommand() {
|
||||
Layout numerator = popBlock();
|
||||
Layout denominator = popBlock();
|
||||
BinomialCoefficientLayout b = BinomialCoefficientLayout::Builder(numerator, denominator);
|
||||
return b;
|
||||
}
|
||||
|
||||
Layout TexParser::popSymbolCommand(int SymbolIndex) {
|
||||
uint32_t codePoint = k_SymbolsCodePoints[SymbolIndex];
|
||||
return CodePointLayout::Builder(codePoint);
|
||||
@@ -273,4 +285,4 @@ inline bool TexParser::isCommandEnded(char c) const {
|
||||
return !(c >= 'a' && c <= 'z') && !(c >= 'A' && c <= 'Z');
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user