summaryrefslogtreecommitdiff
path: root/.config/nvim/UltiSnips/rnoweb.snippets
blob: 4a52697b76e8350a2097495d176ca0fefbcc6b6c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
snippet \ "Begin/End Environments"
\begin{${1:element}}
${2:contents}
\end{$1}

endsnippet

snippet v "Import R variable in LaTeX"
\Sexpr{${1:var}}
endsnippet

snippet eqn "Floating Equation"
\begin{eqfloat}[H]
\begin{align}
    ${3:E} &= ${4:mc^2}
\end{align}
cond$5
\label{eqn:${2:title}}
\caption{${1:A Title}}
\end{eqfloat}

endsnippet

snippet x "Multiplication Dot"
\cdot
endsnippet

snippet e "Scientific Notation"
\cdot10^{${1:power}}
endsnippet

snippet cond "Conditions for Equations"
\begin{conditions}
    ${1:V} & ${2:Definition of V}
\end{conditions}
endsnippet

snippet R "R Code"
<<label='${1:label}',echo=${2:FALSE},results='${3:asis}'>>=
${4:1+1}
@
endsnippet

snippet csv "Import CSV in R"
${1:variable_vame} <- read.csv("${2:path/to/file}.csv",
header=${3:TRUE},
sep="${4:;}"
)

endsnippet

snippet xtable "Table made from R matrix"
print(
      xtable(${1:matrix_name},
             caption="${2:Title of the table}",
             label="tab:${3:table}",
             digits=matrix($6
                           c(
`!p
from time import sleep
try:
	col = int(t[3])-1
	paragraph = ""
	for i in range(int(t[4])-1):
		paragraph += "                            rep(0,"+str(col)+"), <++>,\n"
	paragraph += "                            rep(0,"+str(col)+"), <++>"
	snip.rv = paragraph
except(ValueError):
	sleep(1)
# paragraph = ""
# paragraph = "                            rep(0,"+t[3]+"), 0,\n"
# for i in range(int(t[4])-2):
# 	paragraph += "                            rep(0,"+t[3]+"), <++>,\n"
# paragraph += "                            rep(0,"+t[3]+"), <++>"
# snip.rv = paragraph
`
                           ),
                           nrow=${5:6},
                           ncol=${4:3},
                           byrow=TRUE
             ),
             table.placement="H"
      ),
      include.rownames=FALSE,
      table.placement="H"
)

endsnippet

snippet img "Image"
\begin{figure}[H]
\begin{center}
\includegraphics[scale=${1:1}]{${2:path/to/image}}
\label{fig:${3/\s/_/g}}
\caption{${3:A Title}}
\end{center}
\end{figure}
endsnippet

snippet b "Bold"
\textbf{${1:text}}
endsnippet

snippet i "Italix"
\textit{${1:text}}
endsnippet

snippet u "Underline"
\uline{${1:text}}
endsnippet

snippet 1 "Section"
\section{${1:Title}}
endsnippet

snippet 2 "Subsection"
\subsection{${1:Title}}
endsnippet

snippet 3 "Subsubsection"
\subsubsection{${1:Title}}
endsnippet