> ## Documentation Index
> Fetch the complete documentation index at: https://resources.latex-cloud-studio.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Chemistry Notation

> Master chemistry notation in LaTeX. Learn chemical formulas, reactions, molecular structures, and specialized chemistry symbols.

export const RenderedOutput = ({title = "Rendered output", ctaHref, ctaLabel = "Open LaTeX Cloud Studio", children}) => {
  const [isExpanded, setIsExpanded] = useState(false);
  const trackEditorCta = () => {
    const target = new URL(ctaHref, window.location.href);
    globalThis.posthog?.capture?.("docs_app_cta_clicked", {
      source_page: window.location.pathname,
      source_section: "rendered_output",
      cta_variant: "first_compiled_example",
      target_url: target.toString(),
      target_utm_source: target.searchParams.get("utm_source"),
      target_utm_medium: target.searchParams.get("utm_medium"),
      target_utm_campaign: target.searchParams.get("utm_campaign"),
      target_utm_content: target.searchParams.get("utm_content")
    }, {
      transport: "sendBeacon",
      send_instantly: true
    });
  };
  return <details className="rendered-output" onToggle={event => setIsExpanded(event.currentTarget.open)}>
      <summary className="rendered-output__summary">
        <span className="rendered-output__title">{title}</span>
        <span className="rendered-output__hint" aria-hidden="true">View compiled result</span>
      </summary>
      {isExpanded && <div className="rendered-output__content">
          {children}
          {ctaHref && <aside className="rendered-output__cta" aria-label="Continue in the LaTeX editor">
              <span>
                <strong>Ready to use this syntax?</strong>
                Continue in the browser editor when you want to adapt the example in a real project.
              </span>
              <a href={ctaHref} onClick={trackEditorCta}>{ctaLabel}<span aria-hidden="true"> →</span></a>
            </aside>}
        </div>}
    </details>;
};

export const LatexSource = ({filename, source}) => {
  const [copyStatus, setCopyStatus] = useState("Copy");
  const copySource = async () => {
    try {
      await navigator.clipboard.writeText(source);
      setCopyStatus("Copied");
    } catch {
      setCopyStatus("Select and copy");
    }
  };
  return <figure className="latex-source">
      <figcaption className="latex-source__header">
        <span className="latex-source__filename">{filename}</span>
        <button type="button" className="latex-source__copy" onClick={copySource} aria-live="polite">
          {copyStatus}
        </button>
      </figcaption>
      <pre className="latex-source__pre" aria-label={`LaTeX source: ${filename}`} tabIndex="0">
        <code className="language-latex">{source}</code>
      </pre>
    </figure>;
};

export const LatexPreview = ({src, alt, caption, width, height}) => {
  const minZoom = 1;
  const maxZoom = 3;
  const zoomStep = 0.5;
  const measureSvgContent = async (assetSrc, pageWidth, pageHeight) => {
    const cacheKey = "__latexCloudSvgContentBoxCache";
    const contentBoxCache = globalThis[cacheKey] ?? new Map();
    globalThis[cacheKey] = contentBoxCache;
    if (contentBoxCache.has(assetSrc)) return contentBoxCache.get(assetSrc);
    const measurement = (async () => {
      const assetUrl = new URL(assetSrc, window.location.href);
      if (assetUrl.origin !== window.location.origin) {
        throw new Error("Rendered output must use a same-origin SVG asset.");
      }
      const response = await fetch(assetUrl, {
        credentials: "same-origin"
      });
      if (!response.ok) throw new Error(`Rendered output request failed with ${response.status}.`);
      const source = await response.text();
      const documentNode = new DOMParser().parseFromString(source, "image/svg+xml");
      if (documentNode.querySelector("parsererror")) throw new Error("Rendered output is not valid SVG.");
      const sourceSvg = documentNode.documentElement;
      sourceSvg.querySelectorAll("script, foreignObject").forEach(node => node.remove());
      [sourceSvg, ...sourceSvg.querySelectorAll("*")].forEach(node => {
        [...node.attributes].forEach(attribute => {
          if ((/^on/i).test(attribute.name)) node.removeAttribute(attribute.name);
          if ((attribute.name === "href" || attribute.name === "xlink:href") && !attribute.value.startsWith("#")) {
            node.removeAttribute(attribute.name);
          }
        });
      });
      const measurementHost = document.createElement("div");
      measurementHost.className = "latex-preview__measurement-host";
      const measuredSvg = document.importNode(sourceSvg, true);
      measuredSvg.setAttribute("aria-hidden", "true");
      measurementHost.appendChild(measuredSvg);
      document.body.appendChild(measurementHost);
      try {
        const measuredElements = [...measuredSvg.children].filter(node => !["defs", "desc", "metadata", "style", "title"].includes(node.tagName.toLowerCase()));
        const elementBounds = measuredElements.map(node => node.getBBox()).filter(box => [box.x, box.y, box.width, box.height].every(Number.isFinite) && box.width > 0 && box.height > 0);
        if (elementBounds.length === 0) {
          throw new Error("Rendered output has no measurable visible content.");
        }
        const sortedBounds = [...elementBounds].sort((left, right) => left.y - right.y);
        const clusterGap = pageHeight * 0.045;
        const clusters = [];
        sortedBounds.forEach(box => {
          const current = clusters[clusters.length - 1];
          if (!current || box.y - current.bottom > clusterGap) {
            clusters.push({
              boxes: [box],
              bottom: box.y + box.height
            });
            return;
          }
          current.boxes.push(box);
          current.bottom = Math.max(current.bottom, box.y + box.height);
        });
        const contentClusters = clusters.filter(cluster => {
          const clusterBox = cluster.boxes.reduce((combined, box) => {
            const right = Math.max(combined.x + combined.width, box.x + box.width);
            const bottom = Math.max(combined.y + combined.height, box.y + box.height);
            const x = Math.min(combined.x, box.x);
            const y = Math.min(combined.y, box.y);
            return {
              x,
              y,
              width: right - x,
              height: bottom - y
            };
          });
          const centerY = clusterBox.y + clusterBox.height / 2;
          const isMarginFurniture = cluster.boxes.length <= 2 && clusterBox.width < pageWidth * 0.2 && clusterBox.height < pageHeight * 0.04 && (centerY < pageHeight * 0.08 || centerY > pageHeight * 0.8);
          return !isMarginFurniture;
        });
        const visibleBounds = (contentClusters.length > 0 ? contentClusters : clusters).flatMap(cluster => cluster.boxes);
        const bounds = visibleBounds.reduce((combined, box) => {
          const right = Math.max(combined.x + combined.width, box.x + box.width);
          const bottom = Math.max(combined.y + combined.height, box.y + box.height);
          const x = Math.min(combined.x, box.x);
          const y = Math.min(combined.y, box.y);
          return {
            x,
            y,
            width: right - x,
            height: bottom - y
          };
        });
        const clampValue = (value, minimum, maximum) => Math.min(maximum, Math.max(minimum, value));
        const padding = Math.max(8, Math.min(pageWidth, pageHeight) * 0.025);
        const x = clampValue(bounds.x - padding, 0, pageWidth);
        const y = clampValue(bounds.y - padding, 0, pageHeight);
        const right = clampValue(bounds.x + bounds.width + padding, 0, pageWidth);
        const bottom = clampValue(bounds.y + bounds.height + padding, 0, pageHeight);
        return {
          x,
          y,
          width: right - x,
          height: bottom - y
        };
      } finally {
        measurementHost.remove();
      }
    })();
    contentBoxCache.set(assetSrc, measurement);
    measurement.catch(() => contentBoxCache.delete(assetSrc));
    return measurement;
  };
  const renderPreviewAsset = ({contentBox: assetContentBox, loading}) => {
    if (!assetContentBox) {
      return <img className="latex-preview__asset" src={src} alt={alt} width={width} height={height} loading={loading} draggable="false" />;
    }
    return <svg className="latex-preview__asset" viewBox={`${assetContentBox.x} ${assetContentBox.y} ${assetContentBox.width} ${assetContentBox.height}`} preserveAspectRatio="xMidYMid meet" role="img" aria-label={alt}>
        <image href={src} x="0" y="0" width={width} height={height} />
      </svg>;
  };
  const [isOpen, setIsOpen] = useState(false);
  const [frameMode, setFrameMode] = useState("content");
  const [viewMode, setViewMode] = useState("fit");
  const [zoom, setZoom] = useState(minZoom);
  const [contentBox, setContentBox] = useState(null);
  const [measurementStatus, setMeasurementStatus] = useState("loading");
  const dialogRef = useRef(null);
  const closeButtonRef = useRef(null);
  const viewportRef = useRef(null);
  const previousFocusRef = useRef(null);
  const dragRef = useRef(null);
  useEffect(() => {
    let isCurrent = true;
    setMeasurementStatus("loading");
    measureSvgContent(src, width, height).then(box => {
      if (!isCurrent) return;
      setContentBox(box);
      setMeasurementStatus("ready");
    }).catch(() => {
      if (!isCurrent) return;
      setContentBox(null);
      setFrameMode("page");
      setMeasurementStatus("error");
    });
    return () => {
      isCurrent = false;
    };
  }, [height, src, width]);
  const closeViewer = useCallback(() => {
    setIsOpen(false);
  }, []);
  const openViewer = () => {
    previousFocusRef.current = document.activeElement;
    setFrameMode(contentBox ? "content" : "page");
    setViewMode("fit");
    setZoom(minZoom);
    setIsOpen(true);
  };
  const applyZoom = useCallback(nextZoom => {
    const boundedZoom = Math.min(maxZoom, Math.max(minZoom, nextZoom));
    setViewMode("custom");
    setZoom(boundedZoom);
  }, []);
  const zoomIn = useCallback(() => {
    applyZoom(viewMode === "fit" ? minZoom + zoomStep : zoom + zoomStep);
  }, [applyZoom, viewMode, zoom]);
  const zoomOut = useCallback(() => {
    applyZoom(viewMode === "fit" ? minZoom : zoom - zoomStep);
  }, [applyZoom, viewMode, zoom]);
  useEffect(() => {
    if (!isOpen) return undefined;
    const previousOverflow = document.body.style.overflow;
    document.body.style.overflow = "hidden";
    closeButtonRef.current?.focus();
    return () => {
      document.body.style.overflow = previousOverflow;
      previousFocusRef.current?.focus?.();
    };
  }, [isOpen]);
  useEffect(() => {
    if (!isOpen) return undefined;
    const handleKeyDown = event => {
      if (event.key === "Escape") {
        event.preventDefault();
        closeViewer();
        return;
      }
      if ((event.key === "+" || event.key === "=") && !event.metaKey && !event.ctrlKey) {
        event.preventDefault();
        zoomIn();
        return;
      }
      if (event.key === "-" && !event.metaKey && !event.ctrlKey) {
        event.preventDefault();
        zoomOut();
        return;
      }
      if (event.key !== "Tab" || !dialogRef.current) return;
      const focusable = [...dialogRef.current.querySelectorAll('button:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])')];
      if (focusable.length === 0) return;
      const first = focusable[0];
      const last = focusable[focusable.length - 1];
      if (event.shiftKey && document.activeElement === first) {
        event.preventDefault();
        last.focus();
      } else if (!event.shiftKey && document.activeElement === last) {
        event.preventDefault();
        first.focus();
      }
    };
    window.addEventListener("keydown", handleKeyDown);
    return () => {
      window.removeEventListener("keydown", handleKeyDown);
    };
  }, [closeViewer, isOpen, zoomIn, zoomOut]);
  const startDrag = event => {
    if (event.button !== 0 || !viewportRef.current) return;
    const viewport = viewportRef.current;
    dragRef.current = {
      pointerId: event.pointerId,
      x: event.clientX,
      y: event.clientY,
      scrollLeft: viewport.scrollLeft,
      scrollTop: viewport.scrollTop
    };
    viewport.setPointerCapture(event.pointerId);
    viewport.dataset.dragging = "true";
  };
  const continueDrag = event => {
    const drag = dragRef.current;
    const viewport = viewportRef.current;
    if (!drag || !viewport || drag.pointerId !== event.pointerId) return;
    viewport.scrollLeft = drag.scrollLeft - (event.clientX - drag.x);
    viewport.scrollTop = drag.scrollTop - (event.clientY - drag.y);
  };
  const stopDrag = event => {
    const viewport = viewportRef.current;
    if (viewport?.hasPointerCapture(event.pointerId)) viewport.releasePointerCapture(event.pointerId);
    if (viewport) delete viewport.dataset.dragging;
    dragRef.current = null;
  };
  const activeContentBox = frameMode === "content" ? contentBox : null;
  const activeWidth = activeContentBox?.width ?? width;
  const activeHeight = activeContentBox?.height ?? height;
  const activeRatio = activeWidth / activeHeight;
  const inlineContentBox = measurementStatus === "ready" ? contentBox : null;
  const inlineWidth = inlineContentBox?.width ?? width;
  const inlineHeight = inlineContentBox?.height ?? height;
  const inlineGeometry = {
    aspectRatio: `${inlineWidth} / ${inlineHeight}`,
    maxWidth: `${30 * inlineWidth / inlineHeight}rem`
  };
  const imageStyle = viewMode === "fit" ? {
    aspectRatio: `${activeWidth} / ${activeHeight}`,
    width: "100%",
    maxWidth: `${Math.max(16, activeRatio * 78)}dvh`
  } : {
    aspectRatio: `${activeWidth} / ${activeHeight}`,
    width: `${zoom * 100}%`,
    maxWidth: "none"
  };
  const zoomLabel = viewMode === "fit" ? frameMode === "content" ? "Fit content" : "Full page" : `${Math.round(zoom * 100)}%`;
  return <figure className="latex-preview">
      <button type="button" className="latex-preview__trigger" onClick={openViewer} aria-haspopup="dialog" aria-label={`Open zoomable preview: ${alt}`}>
        <span className="latex-preview__page" style={inlineGeometry}>
          {measurementStatus === "loading" ? <span className="latex-preview__loading" role="status">Preparing compiled output…</span> : renderPreviewAsset({
    src,
    alt,
    width,
    height,
    contentBox: inlineContentBox,
    loading: "lazy"
  })}
        </span>
        <span className="latex-preview__trigger-label" aria-hidden="true">
          <span className="latex-preview__trigger-icon">⌕</span>
          Open viewer
        </span>
      </button>
      <figcaption className="latex-preview__caption">
        <span>
          {caption}
          {measurementStatus === "error" && <span className="latex-preview__status" role="status"> Content fit is unavailable; the complete vector page is shown.</span>}
        </span>
        <a href={src} target="_blank" rel="noreferrer" className="latex-preview__source-link">Open SVG</a>
      </figcaption>

      {isOpen && <div className="latex-preview__backdrop" onMouseDown={event => {
    if (event.target === event.currentTarget) closeViewer();
  }}>
          <section ref={dialogRef} className="latex-preview__dialog" role="dialog" aria-modal="true" aria-label={`Rendered LaTeX viewer: ${alt}`}>
            <header className="latex-preview__toolbar">
              <div className="latex-preview__identity">
                <span className="latex-preview__eyebrow">Compiled LaTeX</span>
                <span className="latex-preview__filename">{alt}</span>
              </div>
              <div className="latex-preview__controls" aria-label="Preview controls">
                <button type="button" className={frameMode === "content" && viewMode === "fit" ? "is-active" : undefined} disabled={!contentBox} onClick={() => {
    setFrameMode("content");
    setViewMode("fit");
    setZoom(minZoom);
  }}>
                  Fit content
                </button>
                <button type="button" className={frameMode === "page" && viewMode === "fit" ? "is-active" : undefined} onClick={() => {
    setFrameMode("page");
    setViewMode("fit");
    setZoom(minZoom);
  }}>
                  Full page
                </button>
                <span className="latex-preview__zoom-group">
                  <button type="button" onClick={zoomOut} disabled={viewMode === "fit" || zoom <= minZoom} aria-label="Zoom out">−</button>
                  <output aria-live="polite" aria-label="Current zoom">{zoomLabel}</output>
                  <button type="button" onClick={zoomIn} disabled={viewMode !== "fit" && zoom >= maxZoom} aria-label="Zoom in">+</button>
                </span>
                <a href={src} target="_blank" rel="noreferrer">Open SVG</a>
                <button ref={closeButtonRef} type="button" className="latex-preview__close" onClick={closeViewer} aria-label="Close rendered LaTeX viewer">
                  Close
                </button>
              </div>
            </header>
            <div ref={viewportRef} className="latex-preview__viewport" data-view-mode={viewMode} onPointerDown={startDrag} onPointerMove={continueDrag} onPointerUp={stopDrag} onPointerCancel={stopDrag}>
              <span className="latex-preview__dialog-page" style={imageStyle}>
                {renderPreviewAsset({
    src,
    alt,
    width,
    height,
    contentBox: activeContentBox
  })}
              </span>
            </div>
            <footer className="latex-preview__viewer-note">
              Compiler-generated vector output · Use +/− to zoom · Drag to pan · Esc to close
            </footer>
          </section>
        </div>}
    </figure>;
};

Create professional chemistry documents with LaTeX, including chemical formulas, reaction equations, and molecular structures.

## Essential Chemistry Packages

<LatexSource filename="example.tex" source={"\\usepackage{chemfig}         % Molecular structures\n\\usepackage{mhchem}          % Chemical formulas and equations\n\\usepackage{chemmacros}      % Chemistry macros\n\\usepackage{siunitx}         % SI units\n\\usepackage{chemformula}     % Alternative to mhchem\n\\usepackage{mol2chemfig}     % Convert SMILES to chemfig"} />

<RenderedOutput title="Expected effect">
  <Info>
    This is setup or structural LaTeX code. It changes available commands or document behavior, but it does not produce meaningful standalone page content by itself.
  </Info>
</RenderedOutput>

## Chemical Formulas with mhchem

### Basic Formulas

<LatexSource filename="example.tex" source={"% Simple molecules\n\\ce{H2O}        % Water\n\\ce{CO2}        % Carbon dioxide\n\\ce{H2SO4}      % Sulfuric acid\n\\ce{Ca(OH)2}    % Calcium hydroxide\n\n% Ions\n\\ce{Na+}        % Sodium ion\n\\ce{SO4^2-}     % Sulfate ion\n\\ce{NH4+}       % Ammonium ion\n\n% Isotopes\n\\ce{^{14}C}     % Carbon-14\n\\ce{^{235}U}    % Uranium-235"} />

<RenderedOutput title="Rendered output" ctaHref="https://app.latex-cloud-studio.com/?utm_source=resources&utm_medium=rendered_output&utm_campaign=docs_open_app&utm_content=learn_latex_specialized_notation_chemistry">
  <LatexPreview src="/images/rendered/learn-latex-specialized-notation-chemistry-02/page-1.svg" alt="Compiled PDF page 1 from example.tex" caption="Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper." width={612} height={792} />
</RenderedOutput>

<Card title="Expected output" icon="eye">
  **Water:** $\ce{H2O}$

  **Carbon dioxide:** $\ce{CO2}$

  **Sulfuric acid:** $\ce{H2SO4}$

  **Sodium ion:** $\ce{Na+}$

  **Sulfate ion:** $\ce{SO4^{2-}}$
</Card>

### States and Phases

<LatexSource filename="example.tex" source={"% Physical states\n\\ce{H2O(l)}     % Liquid water\n\\ce{CO2(g)}     % Gaseous CO2\n\\ce{NaCl(s)}    % Solid salt\n\\ce{Na+(aq)}    % Aqueous sodium ion\n\n% Crystal structures\n\\ce{CaCO3.H2O}  % Hydrate\n\\ce{Fe^{II}Fe^{III}2O4}  % Mixed oxidation states"} />

<RenderedOutput title="Rendered output">
  <LatexPreview src="/images/rendered/learn-latex-specialized-notation-chemistry-03/page-1.svg" alt="Compiled PDF page 1 from example.tex" caption="Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper." width={612} height={792} />
</RenderedOutput>

## Chemical Reactions

### Basic Reactions

<LatexSource filename="example.tex" source={"% Simple reaction\n\\ce{2H2 + O2 -> 2H2O}\n\n% With conditions\n\\ce{N2 + 3H2 ->[\\text{Fe cat.}][450°C, 200 atm] 2NH3}\n\n% Equilibrium\n\\ce{N2O4 <=> 2NO2}\n\n% With heat\n\\ce{CaCO3 ->[\\Delta] CaO + CO2}\n\n% Precipitation\n\\ce{AgNO3(aq) + NaCl(aq) -> AgCl v + NaNO3(aq)}"} />

<RenderedOutput title="Expected effect">
  <Info>
    This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.
  </Info>
</RenderedOutput>

<Card title="Expected output" icon="eye">
  **Simple reaction:** $\ce{2H2 + O2 -> 2H2O}$

  **Equilibrium:** $\ce{N2O4 <=> 2NO2}$

  **Precipitation:** $\ce{AgCl v}$ (silver chloride precipitate)
</Card>

### Complex Reactions

<LatexSource filename="example.tex" source={"% Multi-step reactions\n\\begin{align}\n\\ce{CH4 + Cl2 &->[\\text{UV}] CH3Cl + HCl}\\\\\n\\ce{CH3Cl + Cl2 &->[\\text{UV}] CH2Cl2 + HCl}\n\\end{align}\n\n% Organic reactions\n\\ce{R-OH + R'-COOH <=>[H+] R'-COO-R + H2O}\n\n% Redox reactions\n\\ce{MnO4- + 8H+ + 5e- -> Mn^2+ + 4H2O}"} />

<RenderedOutput title="Expected effect">
  <Info>
    This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.
  </Info>
</RenderedOutput>

## Molecular Structures with chemfig

### Simple Molecules

<LatexSource filename="example.tex" source={"% Methane\n\\chemfig{C(-[2]H)(-[4]H)(-[6]H)-H}\n\n% Ethanol\n\\chemfig{H-C(-[2]H)(-[6]H)-C(-[2]H)(-[6]H)-OH}\n\n% Benzene\n\\chemfig{*6(=-=-=-)}\n\n% Cyclohexane (chair conformation)\n\\chemfig{*6(---(-[,,,,line width=2pt])---)}"} />

<RenderedOutput title="Rendered output">
  <LatexPreview src="/images/rendered/learn-latex-specialized-notation-chemistry-06/page-1.svg" alt="Compiled PDF page 1 from example.tex" caption="Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper." width={612} height={792} />
</RenderedOutput>

<Card title="Expected output" icon="eye">
  **Methane:** $\mathrm{CH_4}$ - tetrahedral structure with central carbon bonded to four hydrogens

  **Benzene:** $\mathrm{C_6H_6}$ - hexagonal aromatic ring with alternating double bonds
</Card>

### Complex Structures

<LatexSource filename="example.tex" source={"% Glucose\n\\chemfig{\n  HO-[2,0.5,2]?<[7,0.7](-[2,0.5]OH)-[,,,,line width=2pt]\n  (-[6,0.5]OH)>[1,0.7](-[6,0.5]OH)-[3,0.7]\n  (-[4,0.5]OH)-[1,0.7]O-[7,0.7]?\n}\n\n% Aspirin\n\\chemfig{\n  *6(=-*6(-(=O)-O-(-=[:30]O)-CH_3)=-=-)\n}\n\n% DNA base pairing\n\\chemfig{\n  N**6(--N--C(=[::60]O)--*5(-N=-N(-H)-))\n  @{a1}.|[,3.0]|@{a2}.\n  N**6(-C(-H_3)-C(=[::60]O)-N(-H)--*5(=N--N=))\n}\n\\chemmove{\\draw[dashed] (a1) -- (a2);}"} />

<RenderedOutput title="Rendered output">
  <LatexPreview src="/images/rendered/learn-latex-specialized-notation-chemistry-07/page-1.svg" alt="Compiled PDF page 1 from example.tex" caption="Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper." width={612} height={792} />
</RenderedOutput>

<Card title="Expected output" icon="eye">
  **Glucose:** $\mathrm{C_6H_{12}O_6}$ - six-membered ring structure with hydroxyl groups

  **Aspirin:** $\mathrm{C_9H_8O_4}$ - acetylsalicylic acid with benzene ring and ester group
</Card>

## Reaction Mechanisms

### Arrow Pushing

<LatexSource filename="example.tex" source={"% Nucleophilic substitution\n\\schemestart\n\\chemfig{R-X} + \\chemfig{\\charge{90=\\|}{Nu}}\n\\arrow{->[$S_N2$]}\n\\chemfig{R-Nu} + \\chemfig{X^-}\n\\schemestop\n\n% Elimination reaction\n\\schemestart\n\\chemfig{H-C(-[2]H)(-[6]H)-C(-[2]H)(-[6]X)-H}\n\\arrow{->[$E2$][-HX]}\n\\chemfig{H-C(-[2]H)=C(-[6]H)-H}\n\\schemestop"} />

<RenderedOutput title="Expected effect">
  <Info>
    This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.
  </Info>
</RenderedOutput>

<Card title="Expected output" icon="eye">
  **Nucleophilic substitution:** $\mathrm{R\text{-}X + Nu^- \xrightarrow{S_N2} R\text{-}Nu + X^-}$

  **Elimination reaction:** $\mathrm{R\text{-}CH_2\text{-}CHX\text{-}R' \xrightarrow{E2} R\text{-}CH=CH\text{-}R' + HX}$
</Card>

### Curved Arrows

<LatexSource filename="example.tex" source={"\\chemfig{\n  @{a1}\\charge{45=\\|}{O}-H@{a2}\n  \\+ R-@{b1}\\charge{180=\\|}{Br}@{b2}\n}\n\\chemmove{\n  \\draw[->] (a1) .. controls +(45:5mm) and +(135:5mm) .. (b1);\n  \\draw[->] (b1) .. controls +(0:5mm) and +(0:5mm) .. (b2);\n}"} />

<RenderedOutput title="Expected effect">
  <Info>
    This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.
  </Info>
</RenderedOutput>

<Card title="Expected output" icon="eye">
  **Curved arrow mechanism:** Shows electron flow from nucleophile ($\mathrm{O^-}$) attacking the electrophilic carbon, with leaving group ($\mathrm{Br^-}$) departure indicated by curved arrows.
</Card>

## Laboratory Equipment

### Common Glassware

<LatexSource filename="example.tex" source={"% Using TikZ for simple diagrams\n\\begin{tikzpicture}\n  % Round bottom flask\n  \\draw (0,0) circle (1cm);\n  \\draw (-0.3,1) -- (-0.3,2);\n  \\draw (0.3,1) -- (0.3,2);\n\n  % Beaker\n  \\draw (3,0) -- (3,2) -- (4,2) -- (4,0);\n  \\draw (3,0) arc (180:360:0.5cm);\n\\end{tikzpicture}"} />

<RenderedOutput title="Rendered output">
  <LatexPreview src="/images/rendered/learn-latex-specialized-notation-chemistry-10/page-1.svg" alt="Compiled PDF page 1 from example.tex" caption="Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper." width={612} height={792} />
</RenderedOutput>

## Chemical Tables

### Periodic Table Elements

<LatexSource filename="example.tex" source={"\\begin{table}[h]\n\\centering\n\\begin{tabular}{|c|c|c|c|}\n\\hline\n\\textbf{Symbol} & \\textbf{Name} & \\textbf{Number} & \\textbf{Mass} \\\\\n\\hline\nH & Hydrogen & 1 & 1.008 \\\\\nHe & Helium & 2 & 4.003 \\\\\nLi & Lithium & 3 & 6.941 \\\\\nBe & Beryllium & 4 & 9.012 \\\\\n\\hline\n\\end{tabular}\n\\caption{First four elements}\n\\end{table}"} />

<RenderedOutput title="Rendered output">
  <LatexPreview src="/images/rendered/learn-latex-specialized-notation-chemistry-11/page-1.svg" alt="Compiled PDF page 1 from example.tex" caption="Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper." width={595.276} height={841.89} />
</RenderedOutput>

### Thermodynamic Data

<LatexSource filename="example.tex" source={"% Using siunitx for proper formatting\n\\begin{table}[h]\n\\centering\n\\begin{tabular}{l S[table-format=3.1] S[table-format=3.1]}\n\\toprule\nCompound & {$\\Delta H_f°$ (\\si{kJ/mol})} & {$S°$ (\\si{J/(mol.K)})} \\\\\n\\midrule\n\\ce{H2O(l)} & -285.8 & 69.9 \\\\\n\\ce{CO2(g)} & -393.5 & 213.8 \\\\\n\\ce{O2(g)} & 0.0 & 205.0 \\\\\n\\bottomrule\n\\end{tabular}\n\\end{table}"} />

<RenderedOutput title="Rendered output">
  <LatexPreview src="/images/rendered/learn-latex-specialized-notation-chemistry-12/page-1.svg" alt="Compiled PDF page 1 from example.tex" caption="Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper." width={612} height={792} />
</RenderedOutput>

## Units and Measurements

### Using siunitx

<LatexSource filename="example.tex" source={"% Basic units\n\\SI{25.0}{°C}                    % Temperature\n\\SI{101.325}{kPa}                % Pressure\n\\SI{2.5e-3}{mol/L}               % Concentration\n\\SI{98.5}{\\percent}              % Percentage\n\n% Complex units\n\\SI{8.314}{J/(mol.K)}            % Gas constant\n\\SI{6.022e23}{mol^{-1}}          % Avogadro's number\n\n% Ranges\n\\SIrange{20}{25}{°C}\n\\SIrange{1}{5}{mL}"} />

<RenderedOutput title="Rendered output">
  <LatexPreview src="/images/rendered/learn-latex-specialized-notation-chemistry-13/page-1.svg" alt="Compiled PDF page 1 from example.tex" caption="Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper." width={612} height={792} />
</RenderedOutput>

## Chemical Equations with chemformula

### Alternative Syntax

<LatexSource filename="example.tex" source={"% Using chemformula package\n\\ch{H2O}                         % Water\n\\ch{H+ + OH- <=> H2O}            % Equilibrium\n\\ch{CO2 + H2O -> H2CO3}          % Reaction\n\n% With stoichiometry\n\\ch{!( 2 H2 + O2 -> 2 H2O )}\n\n% Oxidation states\n\\ch{Fe^{III}Cl3}"} />

<RenderedOutput title="Expected effect">
  <Info>
    This code is a contextual or intentionally partial LaTeX excerpt, not a self-contained compilable document. Its visible result depends on the surrounding document, so the documentation shows the expected role without inventing a standalone preview.
  </Info>
</RenderedOutput>

## Common Chemistry Symbols

<Card title="Symbol Reference" icon="flask">
  |        Symbol        | LaTeX            | Meaning        |
  | :------------------: | :--------------- | :------------- |
  | $\rightleftharpoons$ | `\ce{<=>}`       | Equilibrium    |
  |     $\rightarrow$    | `\ce{->}`        | Reaction arrow |
  |     $\downarrow$     | `\ce{v}`         | Precipitate    |
  |      $\uparrow$      | `\ce{^}`         | Gas evolution  |
  |       $\Delta$       | `\Delta`         | Heat           |
  |          $°$         | `°` or `\degree` | Degree         |
  |         $\pm$        | `\pm`            | Plus/minus     |
  |        $\cdot$       | `\cdot`          | Hydrate dot    |
</Card>

## Spectroscopy Notation

### NMR Spectroscopy

<LatexSource filename="example.tex" source={"% Chemical shifts\n$\\delta$ \\SI{7.25}{ppm} (s, 5H, Ph)\n$\\delta$ \\SI{3.65}{ppm} (q, $J = \\SI{7.1}{Hz}$, 2H, \\ce{CH2})\n\n% Coupling constants\n$^3J_\\text{HH} = \\SI{7.5}{Hz}$\n$^1J_\\text{CH} = \\SI{125}{Hz}$"} />

<RenderedOutput title="Rendered output">
  <LatexPreview src="/images/rendered/learn-latex-specialized-notation-chemistry-15/page-1.svg" alt="Compiled PDF page 1 from example.tex" caption="Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper." width={612} height={792} />
</RenderedOutput>

### IR Spectroscopy

<LatexSource filename="example.tex" source={"% Wavenumbers\n\\SI{3500}{cm^{-1}} (O--H stretch)\n\\SI{1715}{cm^{-1}} (C=O stretch)\n\\SI{2950}{cm^{-1}} (C--H stretch)\n\n% Peak descriptions\n$\\tilde{\\nu}$ = \\SI{1650}{cm^{-1}} (s, br)"} />

<RenderedOutput title="Rendered output">
  <LatexPreview src="/images/rendered/learn-latex-specialized-notation-chemistry-16/page-1.svg" alt="Compiled PDF page 1 from example.tex" caption="Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment. The visible fragment is compiled inside the documented minimal article wrapper." width={612} height={792} />
</RenderedOutput>

## Best Practices

<CardGroup cols={2}>
  <Card title="Consistent Notation" icon="check">
    Use the same package throughout your document
  </Card>

  <Card title="Define Abbreviations" icon="book">
    Define all chemical abbreviations when first used
  </Card>

  <Card title="Use SI Units" icon="ruler">
    Always use siunitx for measurements
  </Card>

  <Card title="Clear Structures" icon="eye">
    Keep molecular structures simple and readable
  </Card>
</CardGroup>

## Troubleshooting

<Warning>
  **Common issues**:

  * Package conflicts: Don't load both mhchem and chemformula
  * Font issues: Some chemistry fonts require special setup
  * Compilation: chemfig structures may need multiple passes
</Warning>

## Further Reading

<CardGroup cols={2}>
  <Card title="Physics Notation" icon="atom" href="/learn/latex/specialized-notation/physics">
    Physics symbols and equations
  </Card>

  <Card title="Symbol Reference" icon="book" href="/learn/reference/symbols">
    General symbol reference
  </Card>

  <Card title="Tables Guide" icon="table" href="/learn/latex/tables/creating-tables">
    Creating data tables
  </Card>

  <Card title="Mathematics" icon="square-root-variable" href="/learn/latex/mathematics/mathematical-expressions">
    Mathematical expressions
  </Card>
</CardGroup>
