Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Add dddot for math_ml
diff --git lib/math_ml/latex.rb lib/math_ml/latex.rb
index b3cc470..ac4fea3 100644
--- lib/math_ml/latex.rb
+++ lib/math_ml/latex.rb
@@ -702,7 +702,7 @@ EOS
module BuiltinCommands
OVERS = {'hat'=>'circ', 'breve'=>'smile', 'grave'=>'grave',
- 'acute'=>'acute', 'dot'=>'sdot', 'ddot'=>'nldr', 'tilde'=>'tilde',
+ 'acute'=>'acute', 'dot'=>'sdot', 'ddot'=>'nldr', 'dddot'=>'mldr', 'tilde'=>'tilde',
'bar'=>'macr', 'vec'=>'rightarrow', 'check'=>'vee', 'widehat'=>'circ',
'overline'=>'macr', 'widetilde'=>'tilde', 'overbrace'=>'OverBrace'}
UNDERS = {'underbrace'=>'UnderBrace', 'underline'=>'macr'}
@@ -710,8 +710,8 @@ EOS
def initialize
add_commands("\\"=>:backslash)
add_commands("entity", "stackrel", "frac", "sqrt", "mbox")
- add_multi_command(:hat_etc, 'hat', 'breve', 'grave', 'acute', 'dot', 'ddot', 'tilde', 'bar', 'vec', 'check', 'widehat', 'overline', 'widetilde', 'overbrace')
- add_multi_command(:underbrace_etc, 'underbrace', 'underline')
+ add_multi_command(:hat_etc, *OVERS.keys)
+ add_multi_command(:underbrace_etc, *UNDERS.keys)
add_multi_command(:quad_etc, " ", "quad", "qquad", ",", ":", ";", "!")
add_multi_command(:it_etc, "it", "rm", "bf")
add_multi_command(:mathit_etc, "mathit", "mathrm", "mathbf", "bm", "mathbb", "mathscr", "mathfrak")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment