1
Fork 0

Port more abbreviations to miros

This commit is contained in:
prescientmoon 2024-10-13 08:00:44 +02:00
parent 35bc79265c
commit 3c99db8650
Signed by: prescientmoon
SSH key fingerprint: SHA256:WFp/cO76nbarETAoQcQXuV+0h7XJsEsOCI0UsyPIy6U
8 changed files with 107 additions and 197 deletions

View file

@ -491,18 +491,18 @@
}, },
"locked": { "locked": {
"dir": "pkgs/firefox-addons", "dir": "pkgs/firefox-addons",
"lastModified": 1723521794, "lastModified": 1728792245,
"narHash": "sha256-mmcakr+6z7/SDg+e2p1TYQorjYvUzWqG2KUIsmikARM=", "narHash": "sha256-u3DIFQ26jtO9kgxSXMVYYdjSF8VArR0jA0N7ns1wWoo=",
"ref": "refs/heads/master", "ref": "refs/heads/master",
"rev": "abafaabfa893ac432bae898a8652bc4a83c49d27", "rev": "8064396aa8c2491dcecbedf9c71140936f032056",
"revCount": 3727, "revCount": 3842,
"type": "git", "type": "git",
"url": "https://gitlab.com/rycee/nur-expressions?dir=pkgs/firefox-addons" "url": "https://gitlab.com/rycee/nur-expressions"
}, },
"original": { "original": {
"dir": "pkgs/firefox-addons", "dir": "pkgs/firefox-addons",
"type": "git", "type": "git",
"url": "https://gitlab.com/rycee/nur-expressions?dir=pkgs/firefox-addons" "url": "https://gitlab.com/rycee/nur-expressions"
} }
}, },
"flake-compat": { "flake-compat": {
@ -1274,11 +1274,11 @@
"purifix": "purifix" "purifix": "purifix"
}, },
"locked": { "locked": {
"lastModified": 1728771451, "lastModified": 1728796450,
"narHash": "sha256-WazYd0cPY7FqDanOfyMf9qiciSj2wEL8NJ1sV8LV4Rs=", "narHash": "sha256-16AGyN4HddZXQFaxYZjPVYxSd4b2pKJ7wUwiNgHHXQs=",
"owner": "prescientmoon", "owner": "prescientmoon",
"repo": "miros", "repo": "miros",
"rev": "2e49f31f22855d1428ab693cf7d0e25b839dce28", "rev": "21e1332cc763049e27f6597967b3ac2f73fa7599",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -1,95 +1 @@
local A = require("my.abbreviations")
local scrap = require("scrap")
require("my.abbreviations.math").setup()
vim.opt.conceallevel = 0 vim.opt.conceallevel = 0
local abbreviations = {
-- Other fancy symvols
{ "tmat", "^T" }, -- Transpose of a matrix
{ "cmat", "^*" }, -- Conjugate of a matrix
{ "sneg", "^C" }, -- Set complement
{ "ortco", "^\\bot" }, -- Orthogonal complement
{ "sinter", "^\\circ" }, -- Interior of a set
{ "nuls", "\\varnothing" },
-- Basic commands
{ "mangle", "\\measuredangle" },
{ "aangle", "\\angle" },
{ "sdiff", "\\setminus" },
{ "sst", "\\subset" },
{ "spt", "\\supset" },
{ "sseq", "\\subseteq" },
{ "speq", "\\supseteq" },
{ "ccan", "\\cancel" },
{ "com", "\\circ" },
{ "mul", "\\cdot" },
{ "smul", "\\times" },
{ "card", "\\#" },
{ "div", "\\|" },
{ "ndiv", "\\not\\|\\:" },
{ "perp", "\\perp" },
{ "cdots", "\\cdots" }, -- center dots
{ "ldots", "\\ldots" }, -- low dots
{ "cldots", ",\\ldots," }, -- comma, low dots
{ "frac", "\\frac" }, -- fraction
{ "lim", "\\lim" }, -- Limit
{ "sup", "\\sup" }, -- supremum
{ "limsup", "\\lim\\sup" }, -- Limit of the supremum
{ "cal", "\\mathcal" }, -- Limit of the supremum
}
local abolishAbbreviations = {
-- {{{ Set symbols
-- - nats => naturals
-- - ints => integers
-- - rats => rationals
-- - irats => irationals
-- - rrea => reals
-- - comp => complex
-- - ppri => primes
-- - ffie => fields
{
"{nats,ints,rats,irats,rrea,comp,ppri,ffie}",
"\\mathbb\\{{N,Z,Q,I,R,C,P,F}\\}",
options = A.no_capitalization,
},
-- }}}
-- {{{ Graph theory
-- Graph theory function syntax:
-- gt[function]{graph}{modifier}
-- - function:
-- - basic functions: e/E/v/G/L
-- - k => connectivity
-- - a => size of the biggest stable set
-- - w => size of the biggest clique
-- - d => biggest degree
-- - c{target}{kind} => {target} {kind} chromatic number
-- - target:
-- - vertices by default
-- - e => edges
-- - kind:
-- - normal by default
-- - l => list
-- - graph:
-- - G by default
-- - s/x/y/h => S/X/Y/H
-- - modifier:
-- - a => '
-- - 1/2 => _k
{
"gt{{e,E,v,V,L},k,a,w,d,md{,e},c{,e}{,l}}{,s,h,x,y}{,a,1,2}",
"{{},\\kappa,\\alpha,\\omega,\\Delta,\\delta{,'},\\chi{,'}{,_l}}({G,S,H,X,Y}{,',_1,_2})",
options = A.no_capitalization,
},
-- }}}
}
local expanded = scrap.expand_many(abolishAbbreviations)
-- Last I checked this contained 1229 abbreviations
-- print(#abbreviations + #expanded)
A.manyLocalAbbr(abbreviations)
A.manyLocalAbbr(expanded)

View file

@ -1,2 +1 @@
require("my.abbreviations.math").setup()
require("my.abbreviations.unicode").setup() require("my.abbreviations.unicode").setup()

View file

@ -1,39 +0,0 @@
local A = require("my.abbreviations")
local scrap = require("scrap")
local M = {}
local function nocap(d)
d.options = A.no_capitalization
return d
end
M.words = {
-- {{{ Linear algebra
{ "rref", "reduced row echalon form" },
{ "eg{va,ve,p}{,s}", "eigen{value,vector,pair}{}" },
{ "mx{,s}", "matri{x,ces}" },
{ "dete{,s}", "determinant{}" },
{ "ort{n,g}", "orto{normal,gonal}" },
{ "l{in,de}", "linearly {independent,dependent}" },
{ "lcon{,s}", "linear combination{}" },
{ "vst{,s}", "vector space{}" }, -- text vector space
nocap({ "rizz", "Riesz vector" }), -- 💀
-- }}}
-- {{{ Differential equations
-- Note: we must add the space inside the {} in order for capitalization to work!
{
"{{s,o,l},}deq{s,}",
"{{scalar,ordinary,linear} ,}differential equation{}",
},
-- }}}
-- {{{ Graph theory
{ "vx{,s}", "vert{ex,ices}" },
{ "edg{,s}", "edge{}" },
-- }}}
}
function M.setup()
A.manyGlobalAbbr(scrap.expand_many(M.words))
end
return M

View file

@ -1,23 +1,36 @@
block !word block auto !word
for s <- @⟨,s⟩ block capitalize
abbr bcla by contradiction let's assume
abbr wlg without loss of generality
abbr tits that is to say,
abbr wpbd we will prove the statement in both directions.
abbr itf it then follows
block for who <- @⟨which,this⟩
for b <- @⟨b,B⟩ for what <- @⟨means,implies⟩
for w <- @⟨w,W⟩ abbr @⟨@who:ww,tt⟩@⟨@what:m,i⟩ @who @what
for t <- @⟨w,W⟩
abbr stam statement
abbr cox counterexample
abbr lcon linear combination
abbr vst vector space
abbr @b⋄cla @b⋄y contradiction let's assume abbr vx vertex
abbr @w⋄lg @w⋄ithout loss of generality abbr mx matrix
abbr @t⋄its @t⋄hat is to say, abbr vertexs vertices
abbr @w⋄pbd @w⋄e will prove the statement in both directions. abbr matrixs matrices
abbr stam@s statement@s
abbr cex@s counterexample@s
for who <- @⟨which, this⟩
for what <- @⟨means, implies⟩
abbr @who@what @⟨@who:which,this⟩@⟨@what:means,implies⟩
for kind <- @⟨parts,substitution⟩ for kind <- @⟨parts,substitution⟩
abbr ib@⟨@kind:p,s⟩ integration by @kind abbr ib@⟨@kind:p,s⟩ integration by @kind
for kind <- @⟨independent,dependent⟩
abbr l@⟨@kind:ind,de⟩ linearly @kind
for kind <- @⟨value,vector,pair⟩
abbr eg@⟨@kind:va,ve,p⟩ eigen@kind
for kind <- @⟨orthogonal,orthonormal⟩
abbr @⟨@kind:ortg,ortn⟩ @kind
for kind <- @⟨scalar,ordinary,linear,⟩
abbr @⟨@kind:s,o,l,⟩deq @kind differential equation

View file

@ -1,3 +1,6 @@
block text
import common/math-phrases
for thmenv <- @⟨theorem,lemma,exercise,definition,corollary,example⟩ for thmenv <- @⟨theorem,lemma,exercise,definition,corollary,example⟩
for thmprefix <- @⟨@thmenv:thm,lem,exe,def,cor,exa⟩ for thmprefix <- @⟨@thmenv:thm,lem,exe,def,cor,exa⟩
@ -164,51 +167,75 @@ block math
⟩}}$0 ⟩}}$0
block auto block auto
for constkind <- @⟨default,shortened⟩ block word
for constant <- @⟨@constkind: for constkind <- @⟨default,shortened⟩
@⟨star,delta,Delta,pi,tau,psi,phi,rho,sigma,alpha,beta,theta,gamma,omega,Omega,half,ordop,land,lor⟩, for constant <- @⟨@constkind:
@⟨lam,eps,iinf⟩ @⟨star,delta,Delta,pi,tau,psi,phi,rho,sigma,alpha,beta,theta,gamma,omega,Omega,half,ordop,land,lor⟩,
@⟨lam,eps,iinf⟩
for expansion <- @⟨@constkind:
@constant, for expansion <- @⟨@constkind:
@⟨@constant:lambda,epsilon,ifty⟩ @constant,
@⟨@constant:lambda,epsilon,ifty⟩
for operator <- @⟨,e,s⟩ for operator <- @⟨,e,s⟩
string @operator@constant string @operator@constant
snip @⟨@operator:,^,_⟩\\@expansion snip @⟨@operator:,^,_⟩\\@expansion
abbr niinf -\ifty abbr niinf -\ifty
abbr eniinf ^{-\ifty} abbr eniinf ^{-\ifty}
abbr sniinf _{-\ifty} abbr sniinf _{-\ifty}
abbr frl \forall abbr frl \forall
abbr exs \exists abbr exs \exists
abbr iin \in
abbr nin \not\in
abbr ccup \cup
abbr ccap \cap
abbr nope \bot
abbr yee \top
abbr nlnl \pm abbr card \#
abbr vsm \vecspace abbr ccap \cap
abbr oball \ball abbr ccup \cup
abbr iin \in
abbr nin \not\in
abbr nuls \varnothing
abbr ortco ^\bot
abbr sdiff \setminus
abbr sinter ^\circ
abbr smul \times
abbr speq \supseteq
abbr spt \supset
abbr sseq \subseteq
abbr sst \subset
for noperator <- @⟨ordop,land,lor,equiv,pmod⟩ abbr nope \bot
abbr @noperator \\@noperator abbr yee \top
for operator <- @⟨overline,hat,bar,abs,norm,prob,diprod,sin,cos,sqrt,ln,lrb,zmod,gen,diam,prob⟩ abbr ccan \cancel
string @operator abbr com \circ
snip \\@operator$|1⟨{$1}, $0⟩ abbr limsup \lim\sup
abbr mangle \measuredangle
abbr mul \cdot
abbr nlnl \pm
abbr oball \ball
abbr vsm \vecspace
for bioperator <- @⟨iprod,frac,binom,dist⟩ abbr bb \mathbb
string @bioperator abbr cal \mathcal
snip \\@bioperator$|1⟨ $1,{$1}⟩$|2⟨ $2,{$2}⟩ $0
string set for set <- @⟨N,Z,Q,I,R,C,P,F⟩
desc Create a set by escaping the brackets abbr @⟨@set:nats,ints,rats,irats,rrea,comp,ppri,ffie⟩ \mathbb @set
snip \{$1\}
for noperator <- @⟨ordop,land,lor,equiv,pmod,ldots,cdots,perp,lim,angle,sup⟩
abbr @noperator \\@noperator
for operator <- @⟨overline,hat,bar,abs,norm,prob,diprod,sin,cos,sqrt,ln,lrb,zmod,gen,diam,prob⟩
string @operator
snip \\@operator$|1⟨{$1}, $0⟩
for bioperator <- @⟨iprod,frac,binom,dist⟩
string @bioperator
snip \\@bioperator$|1⟨ $1,{$1}⟩$|2⟨ $2,{$2}⟩ $0
string set
desc Create a set by escaping the brackets
snip \{$1\}
pattern (.*)e@⟨t(%a),(%d)⟩ pattern (.*)e@⟨t(%a),(%d)⟩
name auto exponent name auto exponent
@ -246,6 +273,7 @@ block math
abbr .inv ^{-1} abbr .inv ^{-1}
abbr .neg _- abbr .neg _-
abbr .pos _+ abbr .pos _+
abbr .t ^T
for limtarget <- @⟨anything,zero,infinity,negative infinity⟩ for limtarget <- @⟨anything,zero,infinity,negative infinity⟩
for prefix <- @⟨@limtarget:,z,i,n⟩ for prefix <- @⟨@limtarget:,z,i,n⟩

View file

@ -1,3 +1,5 @@
import common/math-phrases
block auto start block auto start
for thmenv <- @⟨lemma,theorem,corollary,definition⟩ for thmenv <- @⟨lemma,theorem,corollary,definition⟩
string @thmenv string @thmenv

View file

@ -22,6 +22,7 @@
comments = [ comments = [
"youtube" "youtube"
"reddit" "reddit"
]; ];
save_player_pos = true; save_player_pos = true;
automatic_instance_redirect = true; automatic_instance_redirect = true;