Jelajahi Sumber

added chemistry example

Martin Thoma 13 tahun lalu
induk
melakukan
fdbee981f3

+ 32 - 0
tikz/chemistry-example/Makefile

@@ -0,0 +1,32 @@
+SOURCE = chemistry-example
+DELAY = 80
+DENSITY = 300
+WIDTH = 500
+
+make:
+	pdflatex $(SOURCE).tex -output-format=pdf
+	make clean
+
+clean:
+	rm -rf  $(TARGET) *.class *.html *.log *.aux
+
+gif:
+	pdfcrop $(SOURCE).pdf
+	convert -verbose -delay $(DELAY) -loop 0 -density $(DENSITY) $(SOURCE)-crop.pdf $(SOURCE).gif
+	make clean
+
+png:
+	make
+	make svg
+	inkscape $(SOURCE).svg -w $(WIDTH) --export-png=$(SOURCE).png
+
+transparentGif:
+	convert $(SOURCE).pdf -transparent white result.gif
+	make clean
+
+svg:
+	make
+	#inkscape $(SOURCE).pdf --export-plain-svg=$(SOURCE).svg
+	pdf2svg $(SOURCE).pdf $(SOURCE).svg
+	# Necessary, as pdf2svg does not always create valid svgs:
+	inkscape $(SOURCE).svg --export-plain-svg=$(SOURCE).svg

+ 17 - 0
tikz/chemistry-example/chemistry-example.tex

@@ -0,0 +1,17 @@
+\documentclass[varwidth=true, border=2pt]{standalone}
+\usepackage{chemfig,chemmacros}
+% Source: http://www.latex-community.org/know-how/latex/51-latex-math-science/434-chemistry-molecules
+% See Source for explanations
+
+\begin{document}
+    \begin{center}
+        \small\setatomsep{1.5em}
+        \schemestart
+        \chemfig{*6(=-=(-(=[2]O)-[::-60]O-[0]O-[::30](=[2]O)-[::-60]*6(=-=-=-))-=-)}
+        \arrow{->[$\Delta$]}
+        2 \chemfig{*6(=-=(-(=[2]O)-[::-60]\lewis{0.,O})-=-)}
+        \arrow
+        2 \chemfig{*6(=-=(-[,.15,,,draw=none]\lewis{0.,})-=-)}\+\ch{2 CO2 ^}
+        \schemestop
+    \end{center}
+\end{document}