clone

a browser-first diagram editor with live svg previews, local drafts and encrypted, accountless sharing

main
diagramzip / examples / diagrams / tikz.tex
tikz.tex 14.6K
1% From: https://tikz.net/periodic-table/23% Adapted from https://texample.net/tikz/examples/periodic-table-of-chemical-elements.4% All Credit to Ivan Griffin.56\documentclass[tikz]{standalone}7\usetikzlibrary{shapes,calc}89\begin{document}1011\newcommand{\ElemLabel}[4]{12 \begin{minipage}{2.2cm}13 \centering14 {\textbf{#1} \hfill #2}%15 \linebreak \linebreak16 {\textbf{#3}}%17 \linebreak \linebreak18 {{#4}}19 \end{minipage}20}2122\newcommand{\NaturalElem}[4]{\ElemLabel{#1}{#2}{\huge {#3}}{#4}}2324\newcommand{\SyntheticElem}[4]{\ElemLabel{#1}{#2}{\color{gray}{\huge #3}}{#4}}2526\begin{tikzpicture}[font=\sffamily]2728 % Fill Color Styles29 \tikzstyle{ElementFill} = [fill=yellow!15]30 \tikzstyle{AlkaliMetalFill} = [fill=blue!55]31 \tikzstyle{AlkalineEarthMetalFill} = [fill=blue!40]32 \tikzstyle{MetalFill} = [fill=blue!25]33 \tikzstyle{MetalloidFill} = [fill=orange!40]34 \tikzstyle{NonmetalFill} = [fill=teal!40]35 \tikzstyle{HalogenFill} = [fill=yellow!40]36 \tikzstyle{NobleGasFill} = [fill=green!55]37 \tikzstyle{LanthanideActinideFill} = [fill=red!40]3839 % Element Styles40 \tikzstyle{Element} = [ElementFill,41 minimum width=2.5cm, minimum height=2.5cm, node distance=2.75cm]42 \tikzstyle{AlkaliMetal} = [Element, AlkaliMetalFill]43 \tikzstyle{AlkalineEarthMetal} = [Element, AlkalineEarthMetalFill]44 \tikzstyle{Metal} = [Element, MetalFill]45 \tikzstyle{Metalloid} = [Element, MetalloidFill]46 \tikzstyle{Nonmetal} = [Element, NonmetalFill]47 \tikzstyle{Halogen} = [Element, HalogenFill]48 \tikzstyle{NobleGas} = [Element, NobleGasFill]49 \tikzstyle{LanthanideActinide} = [Element, LanthanideActinideFill]50 \tikzstyle{PeriodLabel} = [font={\sffamily\LARGE}, node distance=2.0cm]51 \tikzstyle{GroupLabel} = [font={\sffamily\LARGE}, minimum width=2.75cm, node distance=2.0cm]5253 % Group 1 - IA54 \node[Element] (H) {\NaturalElem{1} {1.0079}{H}{Hydrogen}};55 \node[below of=H, AlkaliMetal] (Li) {\NaturalElem{3}{6.941}{Li}{Lithium}};56 \node[below of=Li, AlkaliMetal] (Na) {\NaturalElem{11}{22.990}{Na}{Sodium}};57 \node[below of=Na, AlkaliMetal] (K) {\NaturalElem{19}{39.098}{K}{Potassium}};58 \node[below of=K, AlkaliMetal] (Rb) {\NaturalElem{37}{85.468}{Rb}{Rubidium}};59 \node[below of=Rb, AlkaliMetal] (Cs) {\NaturalElem{55}{132.91}{Cs}{Caesium}};60 \node[below of=Cs, AlkaliMetal] (Fr) {\NaturalElem{87}{223}{Fr}{Francium}};6162 % Group 2 - IIA63 \node[right of=Li, AlkalineEarthMetal] (Be) {\NaturalElem{4}{9.0122}{Be}{Beryllium}};64 \node[below of=Be, AlkalineEarthMetal] (Mg) {\NaturalElem{12}{24.305}{Mg}{Magnesium}};65 \node[below of=Mg, AlkalineEarthMetal] (Ca) {\NaturalElem{20}{40.078}{Ca}{Calcium}};66 \node[below of=Ca, AlkalineEarthMetal] (Sr) {\NaturalElem{38}{87.62}{Sr}{Strontium}};67 \node[below of=Sr, AlkalineEarthMetal] (Ba) {\NaturalElem{56}{137.33}{Ba}{Barium}};68 \node[below of=Ba, AlkalineEarthMetal] (Ra) {\NaturalElem{88}{226}{Ra}{Radium}};6970 % Group 3 - IIIB71 \node[right of=Ca, Metal] (Sc) {\NaturalElem{21}{44.956}{Sc}{Scandium}};72 \node[below of=Sc, Metal] (Y) {\NaturalElem{39}{88.906}{Y}{Yttrium}};73 \node[below of=Y, LanthanideActinide] (LaLu) {\NaturalElem{57-71}{}{La-Lu}{Lanthanide}};74 \node[below of=LaLu, LanthanideActinide] (AcLr) {\NaturalElem{89-103}{}{Ac-Lr}{Actinide}};7576 % Group 4 - IVB77 \node[right of=Sc, Metal] (Ti) {\NaturalElem{22}{47.867}{Ti}{Titanium}};78 \node[below of=Ti, Metal] (Zr) {\NaturalElem{40}{91.224}{Zr}{Zirconium}};79 \node[below of=Zr, Metal] (Hf) {\NaturalElem{72}{178.49}{Hf}{Hafnium}};80 \node[below of=Hf, Metal] (Rf) {\SyntheticElem{104}{261}{Rf}{Rutherfordium}};8182 % Group 5 - VB83 \node[right of=Ti, Metal] (V) {\NaturalElem{23}{50.942}{V}{Vanadium}};84 \node[below of=V, Metal] (Nb) {\NaturalElem{41}{92.906}{Nb}{Niobium}};85 \node[below of=Nb, Metal] (Ta) {\NaturalElem{73}{180.95}{Ta}{Tantalum}};86 \node[below of=Ta, Metal] (Db) {\SyntheticElem{105}{262}{Db}{Dubnium}};8788 % Group 6 - VIB89 \node[right of=V, Metal] (Cr) {\NaturalElem{24}{51.996}{Cr}{Chromium}};90 \node[below of=Cr, Metal] (Mo) {\NaturalElem{42}{95.94}{Mo}{Molybdenum}};91 \node[below of=Mo, Metal] (W) {\NaturalElem{74}{183.84}{W}{Tungsten}};92 \node[below of=W, Metal] (Sg) {\SyntheticElem{106}{266}{Sg}{Seaborgium}};9394 % Group 7 - VIIB95 \node[right of=Cr, Metal] (Mn) {\NaturalElem{25}{54.938}{Mn}{Manganese}};96 \node[below of=Mn, Metal] (Tc) {\NaturalElem{43}{96}{Tc}{Technetium}};97 \node[below of=Tc, Metal] (Re) {\NaturalElem{75}{186.21}{Re}{Rhenium}};98 \node[below of=Re, Metal] (Bh) {\SyntheticElem{107}{264}{Bh}{Bohrium}};99100 % Group 8 - VIIIB101 \node[right of=Mn, Metal] (Fe) {\NaturalElem{26}{55.845}{Fe}{Iron}};102 \node[below of=Fe, Metal] (Ru) {\NaturalElem{44}{101.07}{Ru}{Ruthenium}};103 \node[below of=Ru, Metal] (Os) {\NaturalElem{76}{190.23}{Os}{Osmium}};104 \node[below of=Os, Metal] (Hs) {\SyntheticElem{108}{277}{Hs}{Hassium}};105106 % Group 9 - VIIIB107 \node[right of=Fe, Metal] (Co) {\NaturalElem{27}{58.933}{Co}{Cobalt}};108 \node[below of=Co, Metal] (Rh) {\NaturalElem{45}{102.91}{Rh}{Rhodium}};109 \node[below of=Rh, Metal] (Ir) {\NaturalElem{77}{192.22}{Ir}{Iridium}};110 \node[below of=Ir, Metal] (Mt) {\SyntheticElem{109}{268}{Mt}{Meitnerium}};111112 % Group 10 - VIIIB113 \node[right of=Co, Metal] (Ni) {\NaturalElem{28}{58.693}{Ni}{Nickel}};114 \node[below of=Ni, Metal] (Pd) {\NaturalElem{46}{106.42}{Pd}{Palladium}};115 \node[below of=Pd, Metal] (Pt) {\NaturalElem{78}{195.08}{Pt}{Platinum}};116 \node[below of=Pt, Metal] (Ds) {\SyntheticElem{110}{281}{Ds}{Darmstadtium}};117118 % Group 11 - IB119 \node[right of=Ni, Metal] (Cu) {\NaturalElem{29}{63.546}{Cu}{Copper}};120 \node[below of=Cu, Metal] (Ag) {\NaturalElem{47}{107.87}{Ag}{Silver}};121 \node[below of=Ag, Metal] (Au) {\NaturalElem{79}{196.97}{Au}{Gold}};122 \node[below of=Au, Metal] (Rg) {\SyntheticElem{111}{280}{Rg}{Roentgenium}};123124 % Group 12 - IIB125 \node[right of=Cu, Metal] (Zn) {\NaturalElem{30}{65.39}{Zn}{Zinc}};126 \node[below of=Zn, Metal] (Cd) {\NaturalElem{48}{112.41}{Cd}{Cadmium}};127 \node[below of=Cd, Metal] (Hg) {\NaturalElem{80}{200.59}{Hg}{Mercury}};128 \node[below of=Hg, Metal] (Uub) {\SyntheticElem{112}{285}{Uub}{Ununbium}};129130 % Group 13 - IIIA131 \node[right of=Zn, Metal] (Ga) {\NaturalElem{31}{69.723}{Ga}{Gallium}};132 \node[above of=Ga, Metal] (Al) {\NaturalElem{13}{26.982}{Al}{Aluminium}};133 \node[above of=Al, Metalloid] (B) {\NaturalElem{5}{10.811}{B}{Boron}};134 \node[below of=Ga, Metal] (In) {\NaturalElem{49}{114.82}{In}{Indium}};135 \node[below of=In, Metal] (Tl) {\NaturalElem{81}{204.38}{Tl}{Thallium}};136 \node[below of=Tl, Metal] (Uut) {\SyntheticElem{113}{284}{Uut}{Ununtrium}};137138 % Group 14 - IVA139 \node[right of=B, Nonmetal] (C) {\NaturalElem{6}{12.011}{C}{Carbon}};140 \node[below of=C, Metalloid] (Si) {\NaturalElem{14}{28.086}{Si}{Silicon}};141 \node[below of=Si, Metalloid] (Ge) {\NaturalElem{32}{72.64}{Ge}{Germanium}};142 \node[below of=Ge, Metal] (Sn) {\NaturalElem{50}{118.71}{Sn}{Tin}};143 \node[below of=Sn, Metal] (Pb) {\NaturalElem{82}{207.2}{Pb}{Lead}};144 \node[below of=Pb, Metal] (Uuq) {\SyntheticElem{114}{289}{Uuq}{Ununquadium}};145146 % Group 15 - VA147 \node[right of=C, Nonmetal] (N) {\NaturalElem{7}{14.007}{N}{Nitrogen}};148 \node[below of=N, Nonmetal] (P) {\NaturalElem{15}{30.974}{P}{Phosphorus}};149 \node[below of=P, Metalloid] (As) {\NaturalElem{33}{74.922}{As}{Arsenic}};150 \node[below of=As, Metalloid] (Sb) {\NaturalElem{51}{121.76}{Sb}{Antimony}};151 \node[below of=Sb, Metal] (Bi) {\NaturalElem{83}{208.98}{Bi}{Bismuth}};152 \node[below of=Bi, Metal] (Uup) {\SyntheticElem{115}{288}{Uup}{Ununpentium}};153154 % Group 16 - VIA155 \node[right of=N, Nonmetal] (O) {\NaturalElem{8}{15.999}{O}{Oxygen}};156 \node[below of=O, Nonmetal] (S) {\NaturalElem{16}{32.065}{S}{Sulphur}};157 \node[below of=S, Nonmetal] (Se) {\NaturalElem{34}{78.96}{Se}{Selenium}};158 \node[below of=Se, Metalloid] (Te) {\NaturalElem{52}{127.6}{Te}{Tellurium}};159 \node[below of=Te, Metalloid] (Po) {\NaturalElem{84}{209}{Po}{Polonium}};160 \node[below of=Po, Metal] (Uuh) {\SyntheticElem{116}{293}{Uuh}{Ununhexium}};161162 % Group 17 - VIIA163 \node[right of=O, Halogen] (F) {\NaturalElem{9}{18.998}{F}{Fluorine}};164 \node[below of=F, Halogen] (Cl) {\NaturalElem{17}{35.453}{Cl}{Chlorine}};165 \node[below of=Cl, Halogen] (Br) {\NaturalElem{35}{79.904}{Br}{Bromine}};166 \node[below of=Br, Halogen] (I) {\NaturalElem{53}{126.9}{I}{Iodine}};167 \node[below of=I, Halogen] (At) {\NaturalElem{85}{210}{At}{Astatine}};168 \node[below of=At, Element] (Uus) {\SyntheticElem{117}{292}{Uus}{Ununseptium}};169170 % Group 18 - VIIIA171 \node[right of=F, NobleGas] (Ne) {\NaturalElem{10}{20.180}{Ne}{Neon}};172 \node[above of=Ne, NobleGas] (He) {\NaturalElem{2}{4.0025}{He}{Helium}};173 \node[below of=Ne, NobleGas] (Ar) {\NaturalElem{18}{39.948}{Ar}{Argon}};174 \node[below of=Ar, NobleGas] (Kr) {\NaturalElem{36}{83.8}{Kr}{Krypton}};175 \node[below of=Kr, NobleGas] (Xe) {\NaturalElem{54}{131.29}{Xe}{Xenon}};176 \node[below of=Xe, NobleGas] (Rn) {\NaturalElem{86}{222}{Rn}{Radon}};177 \node[below of=Rn, Nonmetal] (Uuo) {\SyntheticElem{118}{294}{Uuo}{Ununoctium}};178179 % Period180 \node[left of=H, PeriodLabel] (Period1) {1};181 \node[left of=Li, PeriodLabel] (Period2) {2};182 \node[left of=Na, PeriodLabel] (Period3) {3};183 \node[left of=K, PeriodLabel] (Period4) {4};184 \node[left of=Rb, PeriodLabel] (Period5) {5};185 \node[left of=Cs, PeriodLabel] (Period6) {6};186 \node[left of=Fr, PeriodLabel] (Period7) {7};187188 % Group189 \node[above of=H, GroupLabel] (Group1) {1 \hfill IA};190 \node[above of=Be, GroupLabel] (Group2) {2 \hfill IIA};191 \node[above of=Sc, GroupLabel] (Group3) {3 \hfill IIIA};192 \node[above of=Ti, GroupLabel] (Group4) {4 \hfill IVB};193 \node[above of=V, GroupLabel] (Group5) {5 \hfill VB};194 \node[above of=Cr, GroupLabel] (Group6) {6 \hfill VIB};195 \node[above of=Mn, GroupLabel] (Group7) {7 \hfill VIIB};196 \node[above of=Fe, GroupLabel] (Group8) {8 \hfill VIIIB};197 \node[above of=Co, GroupLabel] (Group9) {9 \hfill VIIIB};198 \node[above of=Ni, GroupLabel] (Group10) {10 \hfill VIIIB};199 \node[above of=Cu, GroupLabel] (Group11) {11 \hfill IB};200 \node[above of=Zn, GroupLabel] (Group12) {12 \hfill IIB};201 \node[above of=B, GroupLabel] (Group13) {13 \hfill IIIA};202 \node[above of=C, GroupLabel] (Group14) {14 \hfill IVA};203 \node[above of=N, GroupLabel] (Group15) {15 \hfill VA};204 \node[above of=O, GroupLabel] (Group16) {16 \hfill VIA};205 \node[above of=F, GroupLabel] (Group17) {17 \hfill VIIA};206 \node[above of=He, GroupLabel] (Group18) {18 \hfill VIIIA};207208 % Lanthanide209 \node[below of=Rf, LanthanideActinide, yshift=-1cm] (La) {\NaturalElem{57}{138.91}{La}{Lanthanum}};210 \node[right of=La, LanthanideActinide] (Ce) {\NaturalElem{58}{140.12}{Ce}{Cerium}};211 \node[right of=Ce, LanthanideActinide] (Pr) {\NaturalElem{59}{140.91}{Pr}{Praseodymium}};212 \node[right of=Pr, LanthanideActinide] (Nd) {\NaturalElem{60}{144.24}{Nd}{Neodymium}};213 \node[right of=Nd, LanthanideActinide] (Pm) {\NaturalElem{61}{145}{Pm}{Promethium}};214 \node[right of=Pm, LanthanideActinide] (Sm) {\NaturalElem{62}{150.36}{Sm}{Samarium}};215 \node[right of=Sm, LanthanideActinide] (Eu) {\NaturalElem{63}{151.96}{Eu}{Europium}};216 \node[right of=Eu, LanthanideActinide] (Gd) {\NaturalElem{64}{157.25}{Gd}{Gadolinium}};217 \node[right of=Gd, LanthanideActinide] (Tb) {\NaturalElem{65}{158.93}{Tb}{Terbium}};218 \node[right of=Tb, LanthanideActinide] (Dy) {\NaturalElem{66}{162.50}{Dy}{Dysprosium}};219 \node[right of=Dy, LanthanideActinide] (Ho) {\NaturalElem{67}{164.93}{Ho}{Holmium}};220 \node[right of=Ho, LanthanideActinide] (Er) {\NaturalElem{68}{167.26}{Er}{Erbium}};221 \node[right of=Er, LanthanideActinide] (Tm) {\NaturalElem{69}{168.93}{Tm}{Thulium}};222 \node[right of=Tm, LanthanideActinide] (Yb) {\NaturalElem{70}{173.04}{Yb}{Ytterbium}};223 \node[right of=Yb, LanthanideActinide] (Lu) {\NaturalElem{71}{174.97}{Lu}{Lutetium}};224225 % Actinide226 \node[below of=La, LanthanideActinide, yshift=-1cm] (Ac) {\NaturalElem{89}{227}{Ac}{Actinium}};227 \node[right of=Ac, LanthanideActinide] (Th) {\NaturalElem{90}{232.04}{Th}{Thorium}};228 \node[right of=Th, LanthanideActinide] (Pa) {\NaturalElem{91}{231.04}{Pa}{Protactinium}};229 \node[right of=Pa, LanthanideActinide] (U) {\NaturalElem{92}{238.03}{U}{Uranium}};230 \node[right of=U, LanthanideActinide] (Np) {\SyntheticElem{93}{237}{Np}{Neptunium}};231 \node[right of=Np, LanthanideActinide] (Pu) {\SyntheticElem{94}{244}{Pu}{Plutonium}};232 \node[right of=Pu, LanthanideActinide] (Am) {\SyntheticElem{95}{243}{Am}{Americium}};233 \node[right of=Am, LanthanideActinide] (Cm) {\SyntheticElem{96}{247}{Cm}{Curium}};234 \node[right of=Cm, LanthanideActinide] (Bk) {\SyntheticElem{97}{247}{Bk}{Berkelium}};235 \node[right of=Bk, LanthanideActinide] (Cf) {\SyntheticElem{98}{251}{Cf}{Californium}};236 \node[right of=Cf, LanthanideActinide] (Es) {\SyntheticElem{99}{252}{Es}{Einsteinium}};237 \node[right of=Es, LanthanideActinide] (Fm) {\SyntheticElem{100}{257}{Fm}{Fermium}};238 \node[right of=Fm, LanthanideActinide] (Md) {\SyntheticElem{101}{258}{Md}{Mendelevium}};239 \node[right of=Md, LanthanideActinide] (No) {\SyntheticElem{102}{259}{No}{Nobelium}};240 \node[right of=No, LanthanideActinide] (Lr) {\SyntheticElem{103}{262}{Lr}{Lawrencium}};241242 % Draw dotted lines connecting Lanthanide breakout to main table243 \draw[thick,dotted] (LaLu.north west) -- (La.north west)244 (LaLu.south west) -- (La.south west);245 % Draw dotted lines connecting Actinide breakout to main table246 \draw[thick,dotted] (AcLr.north west) -- (Ac.north west)247 (AcLr.south west) -- (Ac.south west);248249 % Legend250 \fill[AlkaliMetalFill] ($(La.north -| Fr.west) + (0,1em)$)251 rectangle +(1em, 1em) node[right, yshift=-1.2ex] (AlkaliMetal) {Alkali Metal};252 \fill[AlkalineEarthMetalFill] ($(AlkaliMetal.west) - (1em,2em)$)253 rectangle +(1em, 1em) node[right, yshift=-1.2ex] (AlkalineEarthMetal) {Alkaline Earth Metal};254 \fill[MetalFill] ($(AlkalineEarthMetal.west) - (1em,2em)$)255 rectangle +(1em, 1em) node[right, yshift=-1.2ex] (Metal) {Metal};256 \fill[MetalloidFill] ($(Metal.west) - (1em,2em)$)257 rectangle +(1em, 1em) node[right, yshift=-1.2ex] (Metalloid) {Metalloid};258 \fill[NonmetalFill] ($(Metalloid.west) - (1em,2em)$)259 rectangle +(1em, 1em) node[right, yshift=-1.2ex] (Non-metal) {Non-metal};260 \fill[HalogenFill] ($(Non-metal.west) - (1em,2em)$)261 rectangle +(1em, 1em) node[right, yshift=-1.2ex] (Halogen) {Halogen};262 \fill[NobleGasFill] ($(Halogen.west) - (1em,2em)$)263 rectangle +(1em, 1em) node[right, yshift=-1.2ex] (NobleGas) {Noble Gas};264 \fill[LanthanideActinideFill] ($(NobleGas.west) - (1em,2em)$)265 rectangle +(1em, 1em) node[right, yshift=-1.2ex] (Lanthanide/Actinide) {Lanthanide/Actinide};266267 \node at (Ac -| Fr) [draw, Element, fill=white] (legend) {\NaturalElem{Z}{mass}{\LARGE Symbol}{Name}};268 \node[align=left] at (Ac -| Ra) {black: natural\\\color{gray}gray: man-made};269270 % Diagram Title271 \node at (H.west -| Fe.north) [scale=2, font={\sffamily\Huge\bfseries}]272 {Periodic Table of Elements};273274\end{tikzpicture}275276\end{document}