> ## 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.

# Scientific Notation in LaTeX

> Master scientific and technical notation in LaTeX. Learn physics formulas, chemistry equations, units, and specialized scientific formatting.

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>;
};

Learn to typeset scientific and technical documents with LaTeX. This guide covers physics, chemistry, units, and specialized notation used in scientific fields.

<Info>
  **Prerequisites**: Familiarity with [basic mathematics](/learn/latex/mathematics/basics) in LaTeX. Knowledge of mathematical symbols is helpful.
</Info>

## Physics Notation

### Fundamental Constants and Variables

<LatexSource filename="physics-constants.tex" source={"\\documentclass{article}\n\\usepackage{amsmath,amssymb}\n\\usepackage{siunitx} % For units\n\\begin{document}\n\n% Common physics constants\n$c = \\SI{3.0e8}{\\meter\\per\\second}$ % Speed of light\n$h = \\SI{6.626e-34}{\\joule\\second}$ % Planck constant\n$\\hbar = \\frac{h}{2\\pi}$ % Reduced Planck constant\n$k_B = \\SI{1.381e-23}{\\joule\\per\\kelvin}$ % Boltzmann constant\n$e = \\SI{1.602e-19}{\\coulomb}$ % Elementary charge\n\n% Common variables\n$\\vec{F}$ % Force vector\n$\\vec{v}$ % Velocity vector\n$\\vec{E}$ % Electric field\n$\\vec{B}$ % Magnetic field\n$\\mathbf{r}$ % Position vector\n\n\\end{document}"} />

<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_mathematics_science">
  <LatexPreview src="/images/rendered/learn-latex-mathematics-science-01/page-1.svg" alt="Compiled PDF page 1 from physics-constants.tex" caption="Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment." width={612} height={792} />
</RenderedOutput>

### Quantum Mechanics

<LatexSource filename="quantum-mechanics.tex" source={"% Dirac notation\n$\\langle \\psi | \\phi \\rangle$ % Inner product\n$| \\psi \\rangle$ % Ket\n$\\langle \\phi |$ % Bra\n$\\langle \\psi | \\hat{H} | \\phi \\rangle$ % Expectation value\n\n% Schrödinger equation\n$i\\hbar \\frac{\\partial}{\\partial t} |\\psi\\rangle = \\hat{H}|\\psi\\rangle$\n\n% Wave function\n$\\Psi(x,t) = A e^{i(kx - \\omega t)}$\n\n% Commutation relations\n$[\\hat{x}, \\hat{p}] = i\\hbar$\n$[\\hat{L}_i, \\hat{L}_j] = i\\hbar\\epsilon_{ijk}\\hat{L}_k$\n\n% Uncertainty principle\n$\\Delta x \\Delta p \\geq \\frac{\\hbar}{2}$"} />

<RenderedOutput title="Rendered output">
  <LatexPreview src="/images/rendered/learn-latex-mathematics-science-02/page-1.svg" alt="Compiled PDF page 1 from quantum-mechanics.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>

### Electromagnetism

<LatexSource filename="electromagnetism.tex" source={"% Maxwell's equations\n\\begin{align}\n\\nabla \\cdot \\vec{E} &= \\frac{\\rho}{\\epsilon_0} \\\\\n\\nabla \\cdot \\vec{B} &= 0 \\\\\n\\nabla \\times \\vec{E} &= -\\frac{\\partial \\vec{B}}{\\partial t} \\\\\n\\nabla \\times \\vec{B} &= \\mu_0 \\vec{J} + \\mu_0\\epsilon_0\\frac{\\partial \\vec{E}}{\\partial t}\n\\end{align}\n\n% Lorentz force\n$\\vec{F} = q(\\vec{E} + \\vec{v} \\times \\vec{B})$\n\n% Electromagnetic wave\n$\\vec{E}(\\vec{r},t) = \\vec{E}_0 \\cos(\\vec{k} \\cdot \\vec{r} - \\omega t + \\phi)$\n\n% Poynting vector\n$\\vec{S} = \\frac{1}{\\mu_0} \\vec{E} \\times \\vec{B}$"} />

<RenderedOutput title="Rendered output">
  <LatexPreview src="/images/rendered/learn-latex-mathematics-science-03/page-1.svg" alt="Compiled PDF page 1 from electromagnetism.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>

### Thermodynamics and Statistical Mechanics

<LatexSource filename="thermodynamics.tex" source={"% First law of thermodynamics\n$dU = \\delta Q - \\delta W$\n\n% Entropy\n$S = k_B \\ln \\Omega$\n\n% Maxwell-Boltzmann distribution\n$f(v) = 4\\pi n \\left(\\frac{m}{2\\pi k_B T}\\right)^{3/2} v^2 e^{-\\frac{mv^2}{2k_B T}}$\n\n% Partition function\n$Z = \\sum_i e^{-\\beta E_i}$\n\n% Boltzmann factor\n$P_i \\propto e^{-\\beta E_i}$ where $\\beta = \\frac{1}{k_B T}$\n\n% Heat capacity\n$C_V = \\left(\\frac{\\partial U}{\\partial T}\\right)_V$"} />

<RenderedOutput title="Rendered output">
  <LatexPreview src="/images/rendered/learn-latex-mathematics-science-04/page-1.svg" alt="Compiled PDF page 1 from thermodynamics.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>

## Chemistry Notation

### Chemical Formulas and Equations

<LatexSource filename="chemistry.tex" source={"\\documentclass{article}\n\\usepackage{chemfig} % For chemical structures\n\\usepackage{mhchem}  % For chemical equations\n\\begin{document}\n\n% Simple molecules\n\\ce{H2O} % Water\n\\ce{CO2} % Carbon dioxide\n\\ce{NH3} % Ammonia\n\\ce{C6H12O6} % Glucose\n\n% Chemical reactions\n\\ce{2H2 + O2 -> 2H2O}\n\\ce{CaCO3 <=> CaO + CO2}\n\\ce{A + B <<>> C + D}\n\n% Ions and charges\n\\ce{Na+} \\ce{Cl-} \\ce{SO4^2-} \\ce{NH4+}\n\n% Isotopes\n\\ce{^{14}C} \\ce{^{235}U} \\ce{^{1}H}\n\n% Reaction conditions\n\\ce{A + B ->[\\Delta][catalyst] C + D}\n\n\\end{document}"} />

<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>

### Chemical Structures

<LatexSource filename="chemical-structures.tex" source={"\\usepackage{chemfig}\n\n% Simple structures\n\\chemfig{H-C(-[2]H)(-[6]H)-H} % Methane\n\\chemfig{*6(=-=-=-)} % Benzene\n\\chemfig{H-N(-H)-H} % Ammonia\n\n% More complex molecules\n\\chemfig{[:30]*6((-=O)-N(-CH_3)-*5(-N=-N(-CH_3)-=)-=-=-=-)}\n\n% Reaction schemes\n\\schemestart\n\\chemfig{A}\n\\arrow{->}\n\\chemfig{B}\n\\arrow{<=>}\n\\chemfig{C}\n\\schemestop"} />

<RenderedOutput title="Rendered output">
  <LatexPreview src="/images/rendered/learn-latex-mathematics-science-06/page-1.svg" alt="Compiled PDF page 1 from chemical-structures.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>

### Spectroscopy

<LatexSource filename="spectroscopy.tex" source={"% NMR notation\n$^1$H NMR: $\\delta$ \\SI{7.26}{\\ppm}\n$^{13}$C NMR: $\\delta$ \\SI{77.16}{\\ppm}\n\n% IR frequencies\n$\\tilde{\\nu} = \\SI{3000}{\\per\\centi\\meter}$ % Wavenumber\n\n% UV-Vis\n$\\lambda_{\\max} = \\SI{280}{\\nano\\meter}$\n$\\epsilon = \\SI{1500}{\\liter\\per\\mole\\per\\centi\\meter}$ % Molar absorptivity\n\n% Mass spectrometry\n$m/z = 91$ % Mass-to-charge ratio\n$[\\text{M}]^+ = 120$ % Molecular ion"} />

<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>

## Units and Measurements

### SI Units with siunitx

<LatexSource filename="si-units.tex" source={"\\usepackage{siunitx}\n\n% Basic units\n\\SI{10}{\\meter}\n\\SI{5.2}{\\kilogram}\n\\SI{3.7}{\\second}\n\\SI{298}{\\kelvin}\n\\SI{2.5}{\\ampere}\n\n% Derived units\n\\SI{9.8}{\\meter\\per\\second\\squared} % Acceleration\n\\SI{101325}{\\pascal} % Pressure\n\\SI{4.18}{\\joule\\per\\gram\\per\\kelvin} % Specific heat\n\\SI{1.5}{\\tesla} % Magnetic field\n\n% Powers of 10\n\\SI{6.022e23}{\\per\\mole} % Avogadro's number\n\\SI{1.38e-23}{\\joule\\per\\kelvin} % Boltzmann constant\n\n% Ranges\n\\SIrange{10}{20}{\\celsius}\n\\SIrange{1e-3}{1e-6}{\\meter}\n\n% Complex units\n\\SI{2.5e-4}{\\meter\\squared\\per\\second}\n\\SI{1.6e-19}{\\joule\\per\\particle}"} />

<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>

### Unit Formatting Best Practices

<LatexSource filename="unit-best-practices.tex" source={"% Correct formatting\nThe reaction proceeded at \\SI{298}{\\kelvin}.\nPressure was maintained at \\SI{1.5}{\\bar}.\nThe sample had a mass of \\SI{2.5 \\pm 0.1}{\\gram}.\n\n% Avoid these common mistakes\n% Wrong: 298 K, 1.5 bar, 2.5±0.1 g\n% Right: Use siunitx as shown above\n\n% Scientific notation\n\\num{6.022e23} particles per mole\n\\SI{1.602e-19}{\\coulomb} per electron\n\n% Percentages and ratios\n\\SI{15}{\\percent} yield\n\\num{1:2:1} stoichiometric ratio"} />

<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>

## Specialized Scientific Packages

### Physics Package

<LatexSource filename="physics-package.tex" source={"\\usepackage{physics}\n\n% Derivatives\n\\dv{f}{x} % df/dx\n\\dv[2]{f}{x} % d²f/dx²\n\\pdv{f}{x} % ∂f/∂x\n\\pdv{f}{x}{y} % ∂²f/∂x∂y\n\n% Integrals\n\\int \\dd{x} % Better spacing\n\\int f(x) \\dd{x}\n\\int \\dd[3]{r} % 3D integral\n\n% Operators\n\\grad % Gradient\n\\div % Divergence\n\\curl % Curl\n\\laplacian % Laplacian\n\n% Brackets\n\\abs{x} % |x|\n\\norm{v} % ||v||\n\\eval{f(x)}_a^b % Evaluated at limits\n\n% Commutators and anticommutators\n\\comm{A}{B} % [A,B]\n\\anticomm{A}{B} % {A,B}\n\n% Matrix elements\n\\matrixel{n}{A}{m} % ⟨n|A|m⟩\n\\ev{A}{\\psi} % ⟨ψ|A|ψ⟩"} />

<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>

### Chemistry Packages

<LatexSource filename="chemistry-packages.tex" source={"% mhchem for chemical equations\n\\usepackage[version=4]{mhchem}\n\\ce{H2SO4} % Sulfuric acid\n\\ce{^{235}U} % Uranium-235\n\\ce{A + B -> C + D} % Reaction\n\n% chemfig for structures\n\\usepackage{chemfig}\n\\chemfig{H-C(-[2]H)(-[6]H)-H}\n\n% chemmacros for chemical symbols\n\\usepackage{chemmacros}\n\\pH % pH symbol\n\\pOH % pOH symbol\n\\Enthalpy{298} % Enthalpy at 298K\n\\Entropy{298} % Entropy at 298K\n\n% chemformula alternative\n\\usepackage{chemformula}\n\\ch{H2O} % Water\n\\ch{\"\\ox{+1,Na}\" + \"\\ox{-1,Cl}\" -> NaCl} % Oxidation states"} />

<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>

## Mathematical Physics

### Vector Calculus

<LatexSource filename="vector-calculus.tex" source={"% Vector operators\n\\vec{\\nabla} \\cdot \\vec{F} % Divergence\n\\vec{\\nabla} \\times \\vec{F} % Curl\n\\nabla^2 \\phi % Laplacian\n\n% Green's theorem\n\\oint_C \\vec{F} \\cdot d\\vec{r} = \\iint_D (\\nabla \\times \\vec{F}) \\cdot \\hat{n} \\, dA\n\n% Gauss's theorem\n\\iiint_V (\\nabla \\cdot \\vec{F}) \\, dV = \\oiint_S \\vec{F} \\cdot \\hat{n} \\, dA\n\n% Stokes' theorem\n\\oint_C \\vec{F} \\cdot d\\vec{r} = \\iint_S (\\nabla \\times \\vec{F}) \\cdot \\hat{n} \\, dA"} />

<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>

### Tensor Notation

<LatexSource filename="tensor-notation.tex" source={"% Einstein notation\n$g_{\\mu\\nu} x^\\mu x^\\nu$ % Metric tensor\n$T^{\\mu\\nu}$ % Stress-energy tensor\n$R_{\\mu\\nu} - \\frac{1}{2}Rg_{\\mu\\nu} = 8\\pi G T_{\\mu\\nu}$ % Einstein field equation\n\n% Christoffel symbols\n$\\Gamma^\\lambda_{\\mu\\nu} = \\frac{1}{2}g^{\\lambda\\rho}(\\partial_\\mu g_{\\rho\\nu} + \\partial_\\nu g_{\\rho\\mu} - \\partial_\\rho g_{\\mu\\nu})$\n\n% Covariant derivative\n$\\nabla_\\mu V^\\nu = \\partial_\\mu V^\\nu + \\Gamma^\\nu_{\\mu\\lambda} V^\\lambda$"} />

<RenderedOutput title="Rendered output">
  <LatexPreview src="/images/rendered/learn-latex-mathematics-science-13/page-1.svg" alt="Compiled PDF page 1 from tensor-notation.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>

## Laboratory and Experimental

### Error Analysis

<LatexSource filename="error-analysis.tex" source={"% Measurements with uncertainty\n$m = \\SI{2.45 \\pm 0.05}{\\gram}$\n$T = \\SI{298.2 \\pm 0.3}{\\kelvin}$\n\n% Relative error\n$\\frac{\\Delta x}{x} = \\SI{2.3}{\\percent}$\n\n% Error propagation\n$\\Delta f = \\sqrt{\\left(\\frac{\\partial f}{\\partial x}\\Delta x\\right)^2 + \\left(\\frac{\\partial f}{\\partial y}\\Delta y\\right)^2}$\n\n% Statistical measures\n$\\bar{x} = \\frac{1}{n}\\sum_{i=1}^n x_i$ % Mean\n$s = \\sqrt{\\frac{\\sum_{i=1}^n (x_i - \\bar{x})^2}{n-1}}$ % Standard deviation\n$\\sigma_{\\bar{x}} = \\frac{s}{\\sqrt{n}}$ % Standard error of mean"} />

<RenderedOutput title="Rendered output">
  <LatexPreview src="/images/rendered/learn-latex-mathematics-science-14/page-1.svg" alt="Compiled PDF page 1 from error-analysis.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>

### Data Presentation

<LatexSource filename="data-presentation.tex" source={"% Significant figures\n\\num{1.23e-4} % Scientific notation\n\\num{1.234567} % Regular number\n\n% Tables with uncertainties\n\\begin{tabular}{cS[table-format=3.2(2)]}\n\\toprule\nTrial & {Mass (\\si{\\gram})} \\\\\n\\midrule\n1 & 2.45(5) \\\\\n2 & 2.52(3) \\\\\n3 & 2.48(4) \\\\\n\\bottomrule\n\\end{tabular}\n\n% Concentration notation\n$[\\text{HCl}] = \\SI{0.1}{\\Molar}$\n$c(\\text{NaOH}) = \\SI{0.05}{\\mol\\per\\liter}$"} />

<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>

## Best Practices for Scientific Writing

<Tip>
  **Scientific LaTeX guidelines:**

  1. **Consistency**: Use the same notation throughout your document
  2. **Units**: Always use the `siunitx` package for proper unit formatting
  3. **Variables**: Use consistent fonts for variables (italic for scalars, bold for vectors)
  4. **Spacing**: Proper spacing around operators and in equations
  5. **Packages**: Load appropriate packages for your field (physics, mhchem, etc.)
  6. **Standards**: Follow field-specific conventions and style guides
</Tip>

## Common Scientific Symbols

<LatexSource filename="scientific-symbols.tex" source={"% Physics\n$\\hbar$ % Reduced Planck constant\n$\\alpha$ % Fine structure constant\n$\\mu_0$ % Permeability of free space\n$\\epsilon_0$ % Permittivity of free space\n$\\sigma$ % Stefan-Boltzmann constant\n\n% Chemistry\n$\\Delta H$ % Enthalpy change\n$\\Delta S$ % Entropy change\n$\\Delta G$ % Gibbs free energy change\n$K_{\\text{eq}}$ % Equilibrium constant\n$K_{\\text{sp}}$ % Solubility product\n\n% Mathematics/Statistics\n$\\sigma$ % Standard deviation\n$\\mu$ % Population mean\n$\\chi^2$ % Chi-squared\n$R^2$ % Coefficient of determination\n$p$ % p-value"} />

<RenderedOutput title="Rendered output">
  <LatexPreview src="/images/rendered/learn-latex-mathematics-science-16/page-1.svg" alt="Compiled PDF page 1 from scientific-symbols.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>

## Quick Reference

### Essential Packages

<LatexSource filename="example.tex" source={"\\usepackage{amsmath,amssymb} % Mathematics\n\\usepackage{siunitx}         % Units and numbers\n\\usepackage{physics}         % Physics notation\n\\usepackage{mhchem}          % Chemistry\n\\usepackage{chemfig}         % Chemical structures\n\\usepackage{booktabs}        % Professional tables"} />

<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>

### Common Templates

| Field                 | Template Start                                                 |
| --------------------- | -------------------------------------------------------------- |
| **Physics Paper**     | `\documentclass{article}` + `amsmath` + `siunitx` + `physics`  |
| **Chemistry Paper**   | `\documentclass{article}` + `amsmath` + `mhchem` + `chemfig`   |
| **Laboratory Report** | `\documentclass{report}` + `siunitx` + `booktabs` + `graphicx` |
| **Thesis**            | `\documentclass{book}` + all packages + `biblatex`             |

***

<Info>
  **Next**: Learn about [Bibliography and citations](/learn/latex/bibliography-citations) for managing references in scientific documents.
</Info>
