rnoweb.snippets (2400B) - raw


      1 snippet begin "Begin/End Environments"
      2 \begin{${1:element}}
      3 ${2:contents}
      4 \end{$1}
      5 
      6 endsnippet
      7 
      8 snippet v "Import R variable in LaTeX"
      9 \Sexpr{${1:var}}
     10 endsnippet
     11 
     12 snippet eqn "Floating Equation"
     13 \begin{eqfloat}[H]
     14 \begin{align}
     15     ${3:E} &= ${4:mc^2}
     16 \end{align}
     17 cond$5
     18 \label{eqn:${2:title}}
     19 \caption{${1:A Title}}
     20 \end{eqfloat}
     21 
     22 endsnippet
     23 
     24 snippet x "Multiplication Dot"
     25 \cdot
     26 endsnippet
     27 
     28 snippet e "Scientific Notation"
     29 \cdot10^{${1:power}}
     30 endsnippet
     31 
     32 snippet cond "Conditions for Equations"
     33 \begin{conditions}
     34     ${1:V} & ${2:Definition of V}
     35 \end{conditions}
     36 endsnippet
     37 
     38 snippet R "R Code"
     39 <<label='${1:label}',echo=${2:FALSE},results='${3:asis}'>>=
     40 ${4:1+1}
     41 @
     42 endsnippet
     43 
     44 snippet csv "Import CSV in R"
     45 ${1:variable_vame} <- read.csv("${2:path/to/file}.csv",
     46 header=${3:TRUE},
     47 sep="${4:;}"
     48 )
     49 
     50 endsnippet
     51 
     52 snippet xtable "Table made from R matrix"
     53 print(
     54       xtable(${1:matrix_name},
     55              caption="${2:Title of the table}",
     56              label="tab:${3:table}",
     57              digits=matrix($6
     58                            c(
     59 `!p
     60 from time import sleep
     61 try:
     62 	col = int(t[3])-1
     63 	paragraph = ""
     64 	for i in range(int(t[4])-1):
     65 		paragraph += "                            rep(0,"+str(col)+"), <++>,\n"
     66 	paragraph += "                            rep(0,"+str(col)+"), <++>"
     67 	snip.rv = paragraph
     68 except(ValueError):
     69 	sleep(1)
     70 # paragraph = ""
     71 # paragraph = "                            rep(0,"+t[3]+"), 0,\n"
     72 # for i in range(int(t[4])-2):
     73 # 	paragraph += "                            rep(0,"+t[3]+"), <++>,\n"
     74 # paragraph += "                            rep(0,"+t[3]+"), <++>"
     75 # snip.rv = paragraph
     76 `
     77                            ),
     78                            nrow=${5:6},
     79                            ncol=${4:3},
     80                            byrow=TRUE
     81              ),
     82              table.placement="H"
     83       ),
     84       include.rownames=FALSE,
     85       table.placement="H"
     86 )
     87 
     88 endsnippet
     89 
     90 snippet img "Image"
     91 \begin{figure}[H]
     92 \begin{center}
     93 \includegraphics[scale=${1:1}]{${2:path/to/image}}
     94 \label{fig:${3/\s/_/g}}
     95 \caption{${3:A Title}}
     96 \end{center}
     97 \end{figure}
     98 endsnippet
     99 
    100 snippet b "Bold"
    101 \textbf{${1:text}}
    102 endsnippet
    103 
    104 snippet i "Italix"
    105 \textit{${1:text}}
    106 endsnippet
    107 
    108 snippet u "Underline"
    109 \uline{${1:text}}
    110 endsnippet
    111 
    112 snippet 1 "Section"
    113 \section{${1:Title}}
    114 endsnippet
    115 
    116 snippet 2 "Subsection"
    117 \subsection{${1:Title}}
    118 endsnippet
    119 
    120 snippet 3 "Subsubsection"
    121 \subsubsection{${1:Title}}
    122 endsnippet