Skip to content

Commit 2c17915

Browse files
committed
Agregué snippets para trabajar con autómatas y sus definiciones, también algunos para graficar mas cosas en tikz
1 parent 7e08c30 commit 2c17915

File tree

1 file changed

+101
-2
lines changed

1 file changed

+101
-2
lines changed

lua/snippets/tex.lua

Lines changed: 101 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,20 @@ return {
114114
)
115115
),
116116

117+
s(
118+
{ trig = ';algd', snippetType = 'autosnippet', wordTrig = false },
119+
fmt(
120+
[[
121+
\begin{{aligned}}
122+
{}
123+
\end{{aligned}}
124+
]],
125+
{
126+
i(1),
127+
}
128+
)
129+
),
130+
117131
s(
118132
{ trig = ';mat(%d+p%d+)', regTrig = true, name = 'matriz' },
119133
fmt(
@@ -165,6 +179,20 @@ return {
165179
)
166180
),
167181

182+
s(
183+
{ trig = ';automata', snippetType = 'autosnippet', wordTrig = false },
184+
fmt(
185+
[[
186+
\begin{{center}}
187+
\begin{{tikzpicture}}[automata]
188+
{}
189+
\end{{tikzpicture}}
190+
\end{{center}}
191+
]],
192+
{ i(1) }
193+
)
194+
),
195+
168196
-- NOTE: MATH
169197

170198
s(
@@ -369,7 +397,13 @@ return {
369397

370398
s({ trig = ';mid', snippetType = 'autosnippet', wordTrig = false }, { t ' \\mid ' }),
371399

372-
s({ trig = ';move', snippetType = 'autosnippet', wordTrig = false }, { t ' \\vdash ' }),
400+
s({ trig = ';move', snippetType = 'autosnippet', wordTrig = false }, { t ' \\mapsto ' }),
401+
402+
s({ trig = ';eot', snippetType = 'autosnippet', wordTrig = false }, { t ' \\dashv ' }),
403+
404+
s({ trig = ';bot', snippetType = 'autosnippet', wordTrig = false }, { t ' \\vdash ' }),
405+
406+
s({ trig = ';cpot', snippetType = 'autosnippet', wordTrig = false }, fmt(' \\mathcal{{P}}({}) ', { i(1) })),
373407

374408
-- NOTE: AUTOMATAS
375409

@@ -387,7 +421,7 @@ return {
387421
),
388422

389423
s(
390-
{ trig = ';dibnodo', snippetType = 'autosnippet' },
424+
{ trig = ';arista', snippetType = 'autosnippet' },
391425
fmt('({}) edge[{}, {}] node{{{}}} ({})', {
392426
i(1, 'nombre salida'),
393427
i(2, 'posicion texto'),
@@ -399,6 +433,56 @@ return {
399433

400434
s({ trig = ';dibujar', snippetType = 'autosnippet', wordTrig = false }, fmt('\\draw {}\n;', { i(1) })),
401435

436+
-- NOTE: DIBUJOS TIKZ
437+
438+
s(
439+
{ trig = ';flecha', snippetType = 'autosnippet' },
440+
fmt('\\draw [->, draw={}, thick] ({}) edge[{}, {}] node{{{}}} ({});', {
441+
i(1, 'color'),
442+
i(2, 'nombre salida'),
443+
i(3, 'posicion texto'),
444+
i(4, 'bend left'),
445+
i(5, 'texto flecha'),
446+
i(6, 'nombre llegada'),
447+
})
448+
),
449+
450+
s(
451+
{ trig = ';punto', snippetType = 'autosnippet' },
452+
fmt('\\node[{}, yshift={}cm, xshift={}cm] ({}) {{${}$}};', {
453+
i(1, 'posicion'),
454+
i(2, '0'),
455+
i(3, '0'),
456+
i(4, 'nombre'),
457+
i(5, 'texto'),
458+
})
459+
),
460+
461+
s(
462+
{ trig = ';grupo', snippetType = 'autosnippet' },
463+
fmt('\\node[fit={}] ({}) {{{}}};', {
464+
i(1, 'nodos'),
465+
i(2, 'nombre'),
466+
i(3, 'texto'),
467+
})
468+
),
469+
470+
s(
471+
{ trig = ';embrace', snippetType = 'autosnippet' },
472+
fmt(
473+
[[
474+
\draw [decorate, decoration={{brace, amplitude=5pt}}] ({}.north east) -- ({}.south east);
475+
\draw [decorate, decoration={{brace, amplitude=5pt, mirror}}] ({}.north west) -- ({}.south west);
476+
]],
477+
{
478+
i(1, 'grupo'),
479+
rep(1),
480+
rep(1),
481+
rep(1),
482+
}
483+
)
484+
),
485+
402486
-- NOTE: MISCELLANEOUS
403487

404488
s({ trig = ';alfa', snippetType = 'autosnippet', wordTrig = false }, { t '\\alpha' }),
@@ -448,6 +532,8 @@ return {
448532

449533
s({ trig = ';txt', snippetType = 'autosnippet', wordTrig = false }, fmt('\\text{{{}}}', { i(1) })),
450534

535+
s({ trig = ';guion', snippetType = 'autosnippet', wordTrig = false }, t '\\text{{\\textminus}}'),
536+
451537
s({ trig = ';esp', snippetType = 'autosnippet', wordTrig = false }, t '\\quad '),
452538

453539
s({ trig = ':esp', snippetType = 'autosnippet', wordTrig = false }, t '\\qquad '),
@@ -465,6 +551,17 @@ return {
465551
)
466552
),
467553

554+
s(
555+
{ trig = ';apr', snippetType = 'autosnippet', wordTrig = false },
556+
fmt(
557+
[[
558+
\\
559+
{} &:= {}
560+
]],
561+
{ i(1), i(0) }
562+
)
563+
),
564+
468565
s({ trig = ';vmod', snippetType = 'autosnippet', wordTrig = false }, fmt('\\lVert{}\\rVert', { i(1) })),
469566

470567
s({ trig = ';mod', snippetType = 'autosnippet', wordTrig = false }, fmt('\\left|{}\\right|', { i(1) })),
@@ -499,6 +596,8 @@ return {
499596

500597
s({ trig = ';aql', snippetType = 'autosnippet', wordTrig = false }, { t ' &= ' }),
501598

599+
s({ trig = ';prod', snippetType = 'autosnippet', wordTrig = false }, { t ' &:= ' }),
600+
502601
s(
503602
{ trig = ';tbox', snippetType = 'autosnippet', wordTrig = false },
504603
fmt(

0 commit comments

Comments
 (0)