BussproofsMappings.ts 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*************************************************************
  2. *
  3. * Copyright (c) 2018-2022 The MathJax Consortium
  4. *
  5. * Licensed under the Apache License, Version 2.0 (the "License");
  6. * you may not use this file except in compliance with the License.
  7. * You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. */
  17. /**
  18. * @fileoverview Mappings for TeX parsing for Bussproofs package commands.
  19. *
  20. * @author v.sorge@mathjax.org (Volker Sorge)
  21. */
  22. import BussproofsMethods from './BussproofsMethods.js';
  23. import ParseMethods from '../ParseMethods.js';
  24. import {CommandMap, EnvironmentMap} from '../SymbolMap.js';
  25. /**
  26. * Macros for bussproofs etc.
  27. */
  28. new CommandMap('Bussproofs-macros', {
  29. AxiomC: 'Axiom',
  30. UnaryInfC: ['Inference', 1],
  31. BinaryInfC: ['Inference', 2],
  32. TrinaryInfC: ['Inference', 3],
  33. QuaternaryInfC: ['Inference', 4],
  34. QuinaryInfC: ['Inference', 5],
  35. RightLabel: ['Label', 'right'],
  36. LeftLabel: ['Label', 'left'],
  37. // Abbreviations are automatically enabled
  38. AXC: 'Axiom',
  39. UIC: ['Inference', 1],
  40. BIC: ['Inference', 2],
  41. TIC: ['Inference', 3],
  42. RL: ['Label', 'right'],
  43. LL: ['Label', 'left'],
  44. noLine: ['SetLine', 'none', false],
  45. singleLine: ['SetLine', 'solid', false],
  46. solidLine: ['SetLine', 'solid', false],
  47. dashedLine: ['SetLine', 'dashed', false],
  48. // Not yet implemented in CSS!
  49. // doubleLine: ['SetLine', 'double', false],
  50. // dottedLine: ['SetLine', 'dotted', false],
  51. alwaysNoLine: ['SetLine', 'none', true],
  52. alwaysSingleLine: ['SetLine', 'solid', true],
  53. alwaysSolidLine: ['SetLine', 'solid', true],
  54. alwaysDashedLine: ['SetLine', 'dashed', true],
  55. // Not yet implemented in CSS!
  56. // alwaysDoubleLine: ['SetLine', 'double', true],
  57. // alwaysDottedLine: ['SetLine', 'dotted', true],
  58. rootAtTop: ['RootAtTop', true],
  59. alwaysRootAtTop: ['RootAtTop', true],
  60. rootAtBottom: ['RootAtTop', false],
  61. alwaysRootAtBottom: ['RootAtTop', false],
  62. // TODO: always commands should be persistent.
  63. fCenter: 'FCenter',
  64. Axiom: 'AxiomF',
  65. UnaryInf: ['InferenceF', 1],
  66. BinaryInf: ['InferenceF', 2],
  67. TrinaryInf: ['InferenceF', 3],
  68. QuaternaryInf: ['InferenceF', 4],
  69. QuinaryInf: ['InferenceF', 5]
  70. }, BussproofsMethods);
  71. new EnvironmentMap('Bussproofs-environments', ParseMethods.environment, {
  72. prooftree: ['Prooftree', null, false]
  73. }, BussproofsMethods);