Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download
Views: 1256
%md(hide = False) ### Use [mhchem](http://www.ctan.org/pkg/mhchem) with LaTeX in SMC worsheet. No need to include special packages. Supported by MathJax. Here is a simplified version of the Urey reaction. This reaction summarizes the role of the geosphere in the carbon cycle. $$\ce{CaSiO3 + CO2 <=>[weathering][outgassing] CaCO3 + SiO2}$$

Use mhchem with LaTeX in SMC worsheet.

No need to include special packages. Supported by MathJax.

Here is a simplified version of the Urey reaction. This reaction summarizes the role of the geosphere in the carbon cycle.

ParseError: KaTeX parse error: Undefined control sequence: \ce at position 1: \̲c̲e̲{CaSiO3 + CO2 <…
latex.add_package_to_preamble_if_available('chemfig') #Can create chemfig figures [chemfig](https://www.ctan.org/pkg/chemfig) %latex \chemfig{(-[:0,1.5,,,draw=none]\scriptstyle\color{red}0) (-[1]1)(-[:45,1.5,,,draw=none]\scriptstyle\color{red}45) (-[2]2)(-[:90,1.5,,,draw=none]\scriptstyle\color{red}90) (-[3]3)(-[:135,1.5,,,draw=none]\scriptstyle\color{red}135) (-[4]4)(-[:180,1.5,,,draw=none]\scriptstyle\color{red}180) (-[5]5)(-[:225,1.5,,,draw=none]\scriptstyle\color{red}225) (-[6]6)(-[:270,1.5,,,draw=none]\scriptstyle\color{red}270) (-[7]7)(-[:315,1.5,,,draw=none]\scriptstyle\color{red}315) -0} \chemfig{C(-[:0]H)(-[:90]H)(-[:180]H)(-[:270]H)}
latex.add_package_to_preamble_if_available('tikz') #Can also generate tikz figures (see http://www.texample.net/tikz/examples/ for some great examples) %latex \begin{tikzpicture} \draw[step=1cm, color=gray,very thin](-1,-1) grid (5,4); \draw[very thick,->] (0,0) -- (0,4) node[anchor=west]{$\infty$}; \draw[very thick,->] (4,0) -- (4,4) node[anchor=west]{$\infty$}; \draw[very thick] (0,0)--(4,0) node[anchor=north]{x=L}; \node at (0,-.25) {x = 0}; \draw[->] (-1,0) -- (5,0)node[anchor=west]{$x$}; \end{tikzpicture}
# plot 8th (or other) roots of unity from matplotlib import ticker rootnum = 8 roots = [e^(i*2*k*pi/rootnum) for k in range(rootnum)] xypoints = [(z.real(),z.imag()) for z in roots] labels = [text("$"+latex(z)+"$",(z.real() + 0.1,z.imag() - 0.2)) for z in roots] t = "%sth roots of unity\n"%rootnum + r"$e^{i\frac{2k\pi}{%s}},k=0,1,\ldots,5$"%rootnum p = point(xypoints, aspect_ratio = 1, title = t, size = 25, marker = 'o') TT = ticker.FormatStrFormatter('%3.1fi') c = circle((0, 0), 1, alpha = 0.5) g = p + sum(labels) + c g.show(xmin = -1.5, xmax = 1.5, ymin = -1.5, ymax = 1.5, title = t, tick_formatter = [None, TT], frame = True)
%sage r.set_plot_options(width=11, height=6)
%r # 1-liner boxplot of life expectancy vs region from World Health Organization # data from Global Health Observatory http://apps.who.int/gho/data/node.main setwd(file.path(Sys.getenv("HOME"),"projects/Cool_Things_With_SMC")) WHO = read.csv('WHO.csv') boxplot(WHO$LifeExpectancy ~ WHO$Region,show.names = T, main = "Life Expectancy for Geographic Regions")