LaTeXML-Plugin-LtxMojo
view release on metacpan or search on metacpan
lib/LaTeXML/Plugin/LtxMojo/public/js/editor/examples.js view on Meta::CPAN
function load_examples(examples) {
examples['clc'] = ["Behold: $\\int_0^\\infty x\\,dx$ is an integral"];
examples['eqn'] = ['\\section{The Lorenz Equations}',
'\\[\\begin{aligned}',
'\\dot{x} & = \\sigma(y-x) \\\\',
'\\dot{y} & = \\rho x - y - xz \\\\',
'\\dot{z} & = -\\beta z + xy',
'\\end{aligned} \\]',
'','\\section{The Cauchy-Schwarz Inequality}',
'\\[ \\left( \\sum_{k=1}^n a_k b_k \\right)^2 \\leq \\left( \\sum_{k=1}^n a_k^2 \\right) \\left( \\sum_{k=1}^n b_k^2 \\right) \\]',
'\\section{A Cross Product Formula}',
'\\[\\mathbf{V}_1 \\times \\mathbf{V}_2 = \\begin{vmatrix}',
'\\mathbf{i} & \\mathbf{j} & \\mathbf{k} \\\\',
'\\frac{\\partial X}{\\partial u} & \\frac{\\partial Y}{\\partial u} & 0 \\\\',
'\\frac{\\partial X}{\\partial v} & \\frac{\\partial Y}{\\partial v} & 0',
'\\end{vmatrix} \\]','',
'The probability of getting $\\(k\\)$ heads when flipping $\\(n\\)$ coins is: ',
'\\[P(E) = {n \\choose k} p^k (1-p)^{ n-k} \\]',
'','\\section{An Identity of Ramanujan}',
'\\[ \\frac{1}{\\Bigl(\\sqrt{\\phi \\sqrt{5}}-\\phi\\Bigr) e^{\\frac25 \\pi}} =',
'1+\\frac{e^{-2\\pi}} {1+\\frac{e^{-4\\pi}} {1+\\frac{e^{-6\\pi}}',
'{1+\\frac{e^{-8\\pi}} {1+\\ldots} } } } \\]',
'','\\section{A Rogers-Ramanujan Identity}',
'\\[ 1 + \\frac{q^2}{(1-q)}+\\frac{q^6}{(1-q)(1-q^2)}+\\cdots =',
'\\prod_{j=0}^{\\infty}\\frac{1}{(1-q^{5j+2})(1-q^{5j+3})},',
'\\quad\\quad \\text{for} |q|<1. \\]',
'','\\section{Maxwell\'s Equations}',
'\\[ \\begin{aligned}',
'\\nabla \\times \\vec{\\mathbf{B}} -\\, \\frac1c\\, \\frac{\\partial\\vec{\\mathbf{E}}}{\\partial t} & = \\frac{4\\pi}{c}\\vec{\\mathbf{j}} \\\\',
'\\nabla \\cdot \\vec{\\mathbf{E}} & = 4 \\pi \\rho \\\\',
'\\nabla \\times \\vec{\\mathbf{E}}\\, +\\, \\frac1c\\, \\frac{\\partial\\vec{\\mathbf{B}}}{\\partial t} & = \\vec{\\mathbf{0}} \\\\',
'',
'\\nabla \\cdot \\vec{\\mathbf{B}} & = 0 \\end{aligned}\\]',
'','','Source: \\url{http://www.mathjax.org/demos/tex-samples/}'].join('\n');
examples['nar'] = ['\\documentclass{amsart}',
'',
'\\newtheorem{theorem}{Theorem}[section]',
'\\newtheorem{lemma}[theorem]{Lemma}',
'',
'\\theoremstyle{definition}',
'\\newtheorem{definition}[theorem]{Definition}',
'\\newtheorem{example}[theorem]{Example}',
'\\newtheorem{xca}[theorem]{Exercise}',
'',
'\\theoremstyle{remark}',
'\\newtheorem{remark}[theorem]{Remark}',
'\\newtheorem{corollary}{Corollary}',
'\\newtheorem*{corollary*}{Corollary}',
'',
'\\numberwithin{equation}{section}',
'',
'\\begin{document}',
'\\title{Sample amsart}',
'\\author{Joe Blow}',
'\\address{Somewhere, USA}',
'\\curraddr{same as above}',
'\\email{joe@blow}',
'\\thanks{My Mommy.}',
'',
'\\author{Frank Zappa}',
'\\address{Baltimore}',
'',
'\\subjclass[2000]{Primary }',
'\\subjclass{Other stuff }',
'',
'\\keywords{ams,article,markup}',
'',
'%\\date{\\today}',
'\\date{February 14, 2013}',
'',
'\\dedicatory{To all those who went before}',
'',
'\\begin{abstract}',
'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure ...
'\\end{abstract}',
'',
'\\maketitle',
'',
'\\section{Introduction}',
'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure ...
'',
'\\begin{equation}',
' a + b,',
'\\end{equation}',
'',
'\\begin{equation}',
' c + d,',
'\\end{equation}',
'',
'\\begin{figure}',
'\\begin{centering}',
'A Figure\\\\',
'\\end{centering}',
'\\caption{A Figure}',
'\\end{figure}',
'',
'\\begin{table}',
'\\begin{centering}',
'\\begin{tabular}{r|cc}',
'Heading & Foo & Bar\\\\\\hline',
'a & $x$ & $x^2$\\\\',
'b & $y^2$ & $y$\\\\',
'\\end{tabular}\\\\',
'\\end{centering}',
'\\caption{A Table}',
'\\end{table}',
'',
'\\begin{enumerate}',
lib/LaTeXML/Plugin/LtxMojo/public/js/editor/examples.js view on Meta::CPAN
' \\item two',
' \\end{enumerate}',
'\\end{enumerate}',
'',
'\\begin{description}',
'\\item[A thing] with some descriptive text.',
'\\item[Another] Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. ...
'\\item[And yet] blah, blah. Moreover',
'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. ',
'\\end{description}',
'',
'\\section{A Math Section}',
'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.',
'',
' Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.',
'',
'\\begin{equation*}',
' a=b',
'\\end{equation*}',
'',
'\\begin{equation}',
' a=b',
'\\end{equation}',
'',
'\\begin{equation}',
'\\begin{split}',
'a &= b + c - d\\\\',
' & \\quad + e - f\\\\',
' & = g + h\\\\',
' & = i',
'\\end{split}',
'\\end{equation}',
'',
'\\begin{multline}',
'a+b+c+d+e+f\\\\',
'+i+j+k+l+m+n',
'\\end{multline}',
'',
'\\begin{gather}',
'a_1=b_1+c_1 \\\\',
'a_2=b_2+c_2-d_2+e_2',
'\\end{gather}',
'',
'\\begin{align}',
'a_1&=b_1+c_1 \\\\',
'a_2&=b_2+c_2-d_2+e_2',
'\\end{align}',
'',
'\\begin{align}',
'a_{11} &= b_{11} &',
' a_{12} &= b_{12} \\\\',
'a_{21} &= b_{21} &',
' a_{22} &= b_{22}+c_{22}',
'\\end{align}',
'',
'Some \\text{text}',
'\\begin{equation}',
'a = \\text{something}',
'\\end{equation}',
'',
'\\begin{corollary}',
' Whatever!',
'\\end{corollary}',
'\\begin{corollary*}',
'And whatever.',
'\\end{corollary*}',
'',
'\\end{document}',
'',
'\\begin{flalign*}',
'a_{11} &= b_{11} &',
' a_{12} &= b_{12} \\\\',
'a_{21} &= b_{21} &',
' a_{22} &= b_{22}+c_{22}',
'\\end{flalign*}',
'',
'',
'\\subsection{A subsection}',
'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.',
'\\subsection{A subsubsection}',
'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.',
'',
'',
'',
'\\paragraph{A Paragraph}',
' Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.',
'',
'\\section{\\itshape Section with explicit font}',
'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure ...
'',
'\\end{document}'].join('\n');
examples['tbl'] = ['\\section{First Example}','\\begin{tabular}{|c|ccc|r|}',
' \\hline',
'$k$ & $x_1^k$ & $x_2^k$ & $x_3^k$ & remarks \\\\',
' \\hline',
'0 & -0.3 & 0.6 & 0.7 & \\\\',
'1 & 0.47102965 & 0.04883157 & -0.53345964 & *\\\\',
'2 & 0.49988691 & 0.00228830 & -0.52246185 & $s_3$ \\\\',
'3 & 0.49999976 & 0.00005380 & -0.52365600 & \\\\',
'4 & 0.5 & 0.00000307 & -0.52359743 & $\\epsilon < 10^{-5}$ \\\\',
'7 & 0.5 & 0 & -0.52359878 & $\\epsilon < \\xi $ \\\\',
' \\hline',
'\\end{tabular}',
'\\section{Second Example}',
'\\begin{tabular}{|c|r@{.}lr@{.}lr@{.}l||r|}',
' \\hline',
'\\multicolumn{8}{|c|}',
' {Iteration $k$ of $f(x_n)$} \\\\',
'\\textbf{\\em k}',
' & \\multicolumn{2}{c}{$x_1^k$}',
' & \\multicolumn{2}{c}{$x_2^k$}',
' & \\multicolumn{2}{c||}{$x_3^k$}',
' & remarks \\\\ \\hline \\hline',
'0 & -0&3 & 0&6 & 0&7 & - \\\\',
'1 & 0&47102965 & 0&04883157 & -0&53345964 & $\\delta<\\epsilon$ \\\\',
'2 & 0&49988691 & 0&00228830 & -0&52246185 & $\\delta < \\varepsilon$ \\\\',
'3 & 0&49999976 & 0&00005380 & -0&523656 & $N$ \\\\',
'4 & 0&5 & 0&00000307 & -0&52359743 & \\\\',
'$\\vdots$ & \\multicolumn{2}{c}{$\\vdots$}',
' & \\multicolumn{2}{c}{$\\ddots$}',
' & \\multicolumn{2}{c||}{$\\vdots$} & \\\\',
'7 & 0&5 & 0&0 & \\textbf{-0}&\\textbf{52359878}',
' & $\\delta<10^{-8}$ \\\\ \\hline',
'\\end{tabular}',
'','Source: \\url{http://amath.colorado.edu/documentation/LaTeX/reference/tables/}'].join('\n');
( run in 1.015 second using v1.01-cache-2.11-cpan-97f6503c9c8 )