tex.js 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. ace.define("ace/snippets/tex",[], function(require, exports, module) {
  2. "use strict";
  3. exports.snippetText = "#PREAMBLE\n\
  4. #newcommand\n\
  5. snippet nc\n\
  6. \\newcommand{\\${1:cmd}}[${2:opt}]{${3:realcmd}}${4}\n\
  7. #usepackage\n\
  8. snippet up\n\
  9. \\usepackage[${1:[options}]{${2:package}}\n\
  10. #newunicodechar\n\
  11. snippet nuc\n\
  12. \\newunicodechar{${1}}{${2:\\ensuremath}${3:tex-substitute}}}\n\
  13. #DeclareMathOperator\n\
  14. snippet dmo\n\
  15. \\DeclareMathOperator{${1}}{${2}}\n\
  16. \n\
  17. #DOCUMENT\n\
  18. # \\begin{}...\\end{}\n\
  19. snippet begin\n\
  20. \\begin{${1:env}}\n\
  21. ${2}\n\
  22. \\end{$1}\n\
  23. # Tabular\n\
  24. snippet tab\n\
  25. \\begin{${1:tabular}}{${2:c}}\n\
  26. ${3}\n\
  27. \\end{$1}\n\
  28. snippet thm\n\
  29. \\begin[${1:author}]{${2:thm}}\n\
  30. ${3}\n\
  31. \\end{$1}\n\
  32. snippet center\n\
  33. \\begin{center}\n\
  34. ${1}\n\
  35. \\end{center}\n\
  36. # Align(ed)\n\
  37. snippet ali\n\
  38. \\begin{align${1:ed}}\n\
  39. ${2}\n\
  40. \\end{align$1}\n\
  41. # Gather(ed)\n\
  42. snippet gat\n\
  43. \\begin{gather${1:ed}}\n\
  44. ${2}\n\
  45. \\end{gather$1}\n\
  46. # Equation\n\
  47. snippet eq\n\
  48. \\begin{equation}\n\
  49. ${1}\n\
  50. \\end{equation}\n\
  51. # Equation\n\
  52. snippet eq*\n\
  53. \\begin{equation*}\n\
  54. ${1}\n\
  55. \\end{equation*}\n\
  56. # Unnumbered Equation\n\
  57. snippet \\\n\
  58. \\[\n\
  59. ${1}\n\
  60. \\]\n\
  61. # Enumerate\n\
  62. snippet enum\n\
  63. \\begin{enumerate}\n\
  64. \\item ${1}\n\
  65. \\end{enumerate}\n\
  66. # Itemize\n\
  67. snippet itemize\n\
  68. \\begin{itemize}\n\
  69. \\item ${1}\n\
  70. \\end{itemize}\n\
  71. # Description\n\
  72. snippet desc\n\
  73. \\begin{description}\n\
  74. \\item[${1}] ${2}\n\
  75. \\end{description}\n\
  76. # Matrix\n\
  77. snippet mat\n\
  78. \\begin{${1:p/b/v/V/B/small}matrix}\n\
  79. ${2}\n\
  80. \\end{$1matrix}\n\
  81. # Cases\n\
  82. snippet cas\n\
  83. \\begin{cases}\n\
  84. ${1:equation}, &\\text{ if }${2:case}\\\\\n\
  85. ${3}\n\
  86. \\end{cases}\n\
  87. # Split\n\
  88. snippet spl\n\
  89. \\begin{split}\n\
  90. ${1}\n\
  91. \\end{split}\n\
  92. # Part\n\
  93. snippet part\n\
  94. \\part{${1:part name}} % (fold)\n\
  95. \\label{prt:${2:$1}}\n\
  96. ${3}\n\
  97. % part $2 (end)\n\
  98. # Chapter\n\
  99. snippet cha\n\
  100. \\chapter{${1:chapter name}}\n\
  101. \\label{cha:${2:$1}}\n\
  102. ${3}\n\
  103. # Section\n\
  104. snippet sec\n\
  105. \\section{${1:section name}}\n\
  106. \\label{sec:${2:$1}}\n\
  107. ${3}\n\
  108. # Sub Section\n\
  109. snippet sub\n\
  110. \\subsection{${1:subsection name}}\n\
  111. \\label{sub:${2:$1}}\n\
  112. ${3}\n\
  113. # Sub Sub Section\n\
  114. snippet subs\n\
  115. \\subsubsection{${1:subsubsection name}}\n\
  116. \\label{ssub:${2:$1}}\n\
  117. ${3}\n\
  118. # Paragraph\n\
  119. snippet par\n\
  120. \\paragraph{${1:paragraph name}}\n\
  121. \\label{par:${2:$1}}\n\
  122. ${3}\n\
  123. # Sub Paragraph\n\
  124. snippet subp\n\
  125. \\subparagraph{${1:subparagraph name}}\n\
  126. \\label{subp:${2:$1}}\n\
  127. ${3}\n\
  128. #References\n\
  129. snippet itd\n\
  130. \\item[${1:description}] ${2:item}\n\
  131. snippet figure\n\
  132. ${1:Figure}~\\ref{${2:fig:}}${3}\n\
  133. snippet table\n\
  134. ${1:Table}~\\ref{${2:tab:}}${3}\n\
  135. snippet listing\n\
  136. ${1:Listing}~\\ref{${2:list}}${3}\n\
  137. snippet section\n\
  138. ${1:Section}~\\ref{${2:sec:}}${3}\n\
  139. snippet page\n\
  140. ${1:page}~\\pageref{${2}}${3}\n\
  141. snippet index\n\
  142. \\index{${1:index}}${2}\n\
  143. #Citations\n\
  144. snippet cite\n\
  145. \\cite[${1}]{${2}}${3}\n\
  146. snippet fcite\n\
  147. \\footcite[${1}]{${2}}${3}\n\
  148. #Formating text: italic, bold, underline, small capital, emphase ..\n\
  149. snippet it\n\
  150. \\textit{${1:text}}\n\
  151. snippet bf\n\
  152. \\textbf{${1:text}}\n\
  153. snippet under\n\
  154. \\underline{${1:text}}\n\
  155. snippet emp\n\
  156. \\emph{${1:text}}\n\
  157. snippet sc\n\
  158. \\textsc{${1:text}}\n\
  159. #Choosing font\n\
  160. snippet sf\n\
  161. \\textsf{${1:text}}\n\
  162. snippet rm\n\
  163. \\textrm{${1:text}}\n\
  164. snippet tt\n\
  165. \\texttt{${1:text}}\n\
  166. #misc\n\
  167. snippet ft\n\
  168. \\footnote{${1:text}}\n\
  169. snippet fig\n\
  170. \\begin{figure}\n\
  171. \\begin{center}\n\
  172. \\includegraphics[scale=${1}]{Figures/${2}}\n\
  173. \\end{center}\n\
  174. \\caption{${3}}\n\
  175. \\label{fig:${4}}\n\
  176. \\end{figure}\n\
  177. snippet tikz\n\
  178. \\begin{figure}\n\
  179. \\begin{center}\n\
  180. \\begin{tikzpicture}[scale=${1:1}]\n\
  181. ${2}\n\
  182. \\end{tikzpicture}\n\
  183. \\end{center}\n\
  184. \\caption{${3}}\n\
  185. \\label{fig:${4}}\n\
  186. \\end{figure}\n\
  187. #math\n\
  188. snippet stackrel\n\
  189. \\stackrel{${1:above}}{${2:below}} ${3}\n\
  190. snippet frac\n\
  191. \\frac{${1:num}}{${2:denom}}\n\
  192. snippet sum\n\
  193. \\sum^{${1:n}}_{${2:i=1}}{${3}}";
  194. exports.scope = "tex";
  195. });
  196. (function() {
  197. ace.require(["ace/snippets/tex"], function(m) {
  198. if (typeof module == "object" && typeof exports == "object" && module) {
  199. module.exports = m;
  200. }
  201. });
  202. })();