File: generate_latex_symbols_table.jl

package info (click to toggle)
vim-julia 0.0~git20240525.7946ce3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,172 kB
  • sloc: lisp: 222; makefile: 4
file content (17 lines) | stat: -rw-r--r-- 725 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/env julia

const filename = "julia_latex_symbols"
const funcname = "get_dict"

open("$filename.vim","w") do f
    println(f, "\" This file is autogenerated from the script '$(basename(Base.source_path()))'")
    println(f, "\" The symbols are based on Julia version $VERSION\n")
    println(f, "scriptencoding utf-8\n")
    println(f, "function! $filename#$funcname()\n",
               "  return {\n",
               "    \\ ",
               join([string("'", latex, "': '", unicode, "'") for (latex,unicode) in sort!(vcat(collect(REPL.REPLCompletions.latex_symbols),collect(REPL.REPLCompletions.emoji_symbols)), by=x->x[2])],
                    ",\n    \\ "),
               "}")
    println(f, "endfunction")
end