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

# Multiple Columns in LaTeX - twocolumn and multicol

> Learn how to create columns in LaTeX with the twocolumn option and the multicol package. Control column breaks, spacing, rules, and balanced layouts.

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

If you want multiple columns in LaTeX, there are two main options:

* use the `twocolumn` document-class option when the whole document should stay in two columns
* use the `multicol` package when only part of the document should switch to columns

This guide shows when to use each approach, how to force a column break, and how to control spacing and separator rules.

<Info>
  **Quick answer**:

  <LatexSource filename="example.tex" source={"\\documentclass[twocolumn]{article}"} />

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

  for a full two-column document, or:

  <LatexSource filename="example.tex" source={"\\usepackage{multicol}\n\n\\begin{multicols}{2}\nYour text here\n\\end{multicols}"} />

  <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_formatting_multiple_columns">
    <LatexPreview src="/images/rendered/learn-latex-formatting-multiple-columns-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={595.276} height={841.89} />
  </RenderedOutput>

  for a section that should use two columns.

  **Related topics**: [Document classes](/learn/reference/document-classes) | [Headers & footers](/learn/latex/formatting/headers-footers) | [Figure positioning](/learn/latex/figures/positioning)
</Info>

## Which Column Method Should You Use?

| Need                            | Best choice              |
| ------------------------------- | ------------------------ |
| Whole paper in two columns      | `twocolumn` class option |
| Only one section in columns     | `multicol`               |
| Manual break to the next column | `\columnbreak`           |
| Adjust gap between columns      | `\columnsep`             |
| Add a line between columns      | `\columnseprule`         |

## Document Class Columns

### Built-in Two-Column Mode

<LatexSource filename="twocolumn-class.tex" source={"% Two-column mode in document class\n\\documentclass[twocolumn]{article}\n\\usepackage{lipsum}\n\n\\begin{document}\n\n\\title{Two-Column Article}\n\\author{Author Name}\n\\maketitle\n\n\\section{Introduction}\n\\lipsum[1-2]\n\n\\section{Methods}\n\\lipsum[3-4]\n\n\\section{Results}\n\\lipsum[5-6]\n\n\\end{document}"} />

<RenderedOutput title="Rendered output">
  <LatexPreview src="/images/rendered/learn-latex-formatting-multiple-columns-03/page-1.svg" alt="Compiled PDF page 1 from twocolumn-class.tex" caption="Page 1 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment." width={595.276} height={841.89} />

  <LatexPreview src="/images/rendered/learn-latex-formatting-multiple-columns-03/page-2.svg" alt="Compiled PDF page 2 from twocolumn-class.tex" caption="Page 2 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment." width={595.276} height={841.89} />
</RenderedOutput>

### Column Separation

<LatexSource filename="column-separation.tex" source={"\\documentclass[twocolumn]{article}\n\\usepackage{lipsum}\n\n% Customize column parameters\n\\setlength{\\columnsep}{30pt}        % Space between columns\n\\setlength{\\columnseprule}{0.5pt}   % Rule between columns\n\\setlength{\\columnwidth}{0.45\\textwidth}  % Column width\n\n% Color the rule\n\\usepackage{xcolor}\n\\renewcommand{\\columnseprulecolor}{\\color{gray}}\n\n\\begin{document}\n\n\\section{Sample Content}\n\\lipsum[1-4]\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>

## The multicol Package

### Basic Multi-Column Setup

<LatexSource filename="multicol-basic.tex" source={"\\documentclass{article}\n\\usepackage{multicol}\n\\usepackage{lipsum}\n\n\\begin{document}\n\n\\section{Introduction}\nThis text appears in single column.\n\n% Start multi-column environment\n\\begin{multicols}{3}\n\\lipsum[1-6]\nThis text flows across three columns with automatic balancing.\n\\end{multicols}\n\nBack to single column text.\n\n\\section{Two-Column Section}\n\\begin{multicols}{2}\n\\lipsum[7-10]\n\\end{multicols}\n\n\\end{document}"} />

<RenderedOutput title="Rendered output">
  <LatexPreview src="/images/rendered/learn-latex-formatting-multiple-columns-05/page-1.svg" alt="Compiled PDF page 1 from multicol-basic.tex" caption="Page 1 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment." width={595.276} height={841.89} />

  <LatexPreview src="/images/rendered/learn-latex-formatting-multiple-columns-05/page-2.svg" alt="Compiled PDF page 2 from multicol-basic.tex" caption="Page 2 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment." width={595.276} height={841.89} />

  <LatexPreview src="/images/rendered/learn-latex-formatting-multiple-columns-05/page-3.svg" alt="Compiled PDF page 3 from multicol-basic.tex" caption="Page 3 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment." width={595.276} height={841.89} />
</RenderedOutput>

### Column Rules and Spacing

<LatexSource filename="multicol-styling.tex" source={"\\documentclass{article}\n\\usepackage{multicol}\n\\usepackage{xcolor}\n\\usepackage{lipsum}\n\n% Global column settings\n\\setlength{\\columnseprule}{1pt}\n\\renewcommand{\\columnseprulecolor}{\\color{blue}}\n\\setlength{\\columnsep}{25pt}\n\n\\begin{document}\n\n\\begin{multicols}{3}\n[\\section{Three Columns with Rules}\nThis section demonstrates styled column rules.]\n\n\\lipsum[1-4]\n\n\\end{multicols}\n\n% Local column settings\n\\begin{multicols}{2}\n[\\subsection{Custom Spacing}]\n\\setlength{\\columnseprule}{0.5pt}\n\\renewcommand{\\columnseprulecolor}{\\color{red}}\n\n\\lipsum[5-8]\n\n\\end{multicols}\n\n\\end{document}"} />

<RenderedOutput title="Rendered output">
  <LatexPreview src="/images/rendered/learn-latex-formatting-multiple-columns-06/page-1.svg" alt="Compiled PDF page 1 from multicol-styling.tex" caption="Page 1 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment." width={612} height={792} />

  <LatexPreview src="/images/rendered/learn-latex-formatting-multiple-columns-06/page-2.svg" alt="Compiled PDF page 2 from multicol-styling.tex" caption="Page 2 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment." width={612} height={792} />
</RenderedOutput>

## Advanced Column Control

### Unbalanced Columns

<LatexSource filename="unbalanced-columns.tex" source={"\\documentclass{article}\n\\usepackage{multicol}\n\\usepackage{lipsum}\n\n\\begin{document}\n\n% Balanced columns (default)\n\\begin{multicols}{2}\n[\\section{Balanced Columns}]\n\\lipsum[1-3]\n\\end{multicols}\n\n% Unbalanced columns\n\\begin{multicols*}{2}\n[\\section{Unbalanced Columns}]\n\\lipsum[4-6]\nShort content here.\n\n\\columnbreak\nMuch longer content in the second column that continues for many lines and demonstrates unbalanced column layout.\n\\lipsum[7-8]\n\\end{multicols*}\n\n\\end{document}"} />

<RenderedOutput title="Rendered output">
  <LatexPreview src="/images/rendered/learn-latex-formatting-multiple-columns-07/page-1.svg" alt="Compiled PDF page 1 from unbalanced-columns.tex" caption="Page 1 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment." width={595.276} height={841.89} />

  <LatexPreview src="/images/rendered/learn-latex-formatting-multiple-columns-07/page-2.svg" alt="Compiled PDF page 2 from unbalanced-columns.tex" caption="Page 2 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment." width={595.276} height={841.89} />
</RenderedOutput>

### Manual Column Breaks

<LatexSource filename="column-breaks.tex" source={"\\documentclass{article}\n\\usepackage{multicol}\n\\usepackage{lipsum}\n\n\\begin{document}\n\n\\begin{multicols}{3}\n[\\section{Manual Column Control}]\n\nFirst column content.\n\\lipsum[1]\n\n\\columnbreak\nSecond column starts here.\n\\lipsum[2]\n\n\\columnbreak\nThird column content.\n\\lipsum[3]\n\n\\end{multicols}\n\n% Preventing column breaks\n\\begin{multicols}{2}\n[\\section{Preventing Breaks}]\n\n\\lipsum[4]\n\n\\begin{samepage}\nThis paragraph should not be broken across columns.\nIt will stay together as one unit.\n\\end{samepage}\n\n\\lipsum[5]\n\n\\end{multicols}\n\n\\end{document}"} />

<RenderedOutput title="Rendered output">
  <LatexPreview src="/images/rendered/learn-latex-formatting-multiple-columns-08/page-1.svg" alt="Compiled PDF page 1 from column-breaks.tex" caption="Page 1 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment." width={595.276} height={841.89} />

  <LatexPreview src="/images/rendered/learn-latex-formatting-multiple-columns-08/page-2.svg" alt="Compiled PDF page 2 from column-breaks.tex" caption="Page 2 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment." width={595.276} height={841.89} />
</RenderedOutput>

## Column Spanning Elements

### Spanning Headers and Figures

<LatexSource filename="spanning-elements.tex" source={"\\documentclass{article}\n\\usepackage{multicol}\n\\usepackage{graphicx}\n\\usepackage{lipsum}\n\n\\begin{document}\n\n\\begin{multicols}{2}\n[\\section{Document with Spanning Elements}\nThis section header spans both columns and provides context for the content below.]\n\n\\lipsum[1-2]\n\n\\end{multicols}\n\n% Figure spanning columns\n\\begin{figure*}[t]\n\\centering\n\\includegraphics[width=0.8\\textwidth]{example-image}\n\\caption{This figure spans the full page width across multiple columns}\n\\label{fig:spanning}\n\\end{figure*}\n\n\\begin{multicols}{2}\n\n\\lipsum[3-4]\n\n% Table spanning columns\n\\end{multicols}\n\n\\begin{table*}[t]\n\\centering\n\\begin{tabular}{|c|c|c|c|c|}\n\\hline\nColumn 1 & Column 2 & Column 3 & Column 4 & Column 5 \\\\\n\\hline\nData & Data & Data & Data & Data \\\\\n\\hline\n\\end{tabular}\n\\caption{Wide table spanning multiple columns}\n\\end{table*}\n\n\\begin{multicols}{2}\n\n\\lipsum[5-6]\n\n\\end{multicols}\n\n\\end{document}"} />

<RenderedOutput title="Rendered output">
  <LatexPreview src="/images/rendered/learn-latex-formatting-multiple-columns-09/page-1.svg" alt="Compiled PDF page 1 from spanning-elements.tex" caption="Page 1 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment." width={612} height={792} />

  <LatexPreview src="/images/rendered/learn-latex-formatting-multiple-columns-09/page-2.svg" alt="Compiled PDF page 2 from spanning-elements.tex" caption="Page 2 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment." width={612} height={792} />
</RenderedOutput>

### Inline Spanning Text

<LatexSource filename="inline-spanning.tex" source={"\\documentclass{article}\n\\usepackage{multicol}\n\\usepackage{lipsum}\n\n\\begin{document}\n\n\\begin{multicols}{3}\n[\\section{Mixed Column Content}]\n\n\\lipsum[1]\n\n\\end{multicols}\n\n% Temporary single column for important note\n\\begin{center}\n\\fbox{\\parbox{0.8\\textwidth}{\n\\textbf{Important Note:} This highlighted text spans across the full width to draw attention to critical information.\n}}\n\\end{center}\n\n\\begin{multicols}{3}\n\n\\lipsum[2-4]\n\n\\end{multicols}\n\n\\end{document}"} />

<RenderedOutput title="Rendered output">
  <LatexPreview src="/images/rendered/learn-latex-formatting-multiple-columns-10/page-1.svg" alt="Compiled PDF page 1 from inline-spanning.tex" caption="Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment." width={595.276} height={841.89} />
</RenderedOutput>

## Customizing Column Behavior

### Column Width and Balance

<LatexSource filename="custom-column-behavior.tex" source={"\\documentclass{article}\n\\usepackage{multicol}\n\\usepackage{lipsum}\n\n\\begin{document}\n\n% Custom column tolerance\n\\setlength{\\multicolsep}{12pt plus 4pt minus 3pt}\n\\setlength{\\premulticols}{12pt plus 4pt minus 3pt}\n\\setlength{\\postmulticols}{12pt plus 4pt minus 3pt}\n\n\\begin{multicols}{2}\n[\\section{Customized Column Spacing}]\n\n% Custom balance\n\\raggedcolumns\n\\lipsum[1-3]\n\n\\end{multicols}\n\n% Force balanced columns\n\\begin{multicols}{3}\n[\\subsection{Forced Balance}]\n\n\\flushcolumns\nThis content will be balanced across three columns regardless of natural break points.\n\\lipsum[4-5]\n\n\\end{multicols}\n\n\\end{document}"} />

<RenderedOutput title="Rendered output">
  <LatexPreview src="/images/rendered/learn-latex-formatting-multiple-columns-11/page-1.svg" alt="Compiled PDF page 1 from custom-column-behavior.tex" caption="Page 1 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment." width={595.276} height={841.89} />

  <LatexPreview src="/images/rendered/learn-latex-formatting-multiple-columns-11/page-2.svg" alt="Compiled PDF page 2 from custom-column-behavior.tex" caption="Page 2 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment." width={595.276} height={841.89} />
</RenderedOutput>

### Column Penalties

<LatexSource filename="column-penalties.tex" source={"\\documentclass{article}\n\\usepackage{multicol}\n\\usepackage{lipsum}\n\n% Adjust penalties for better column breaks\n\\clubpenalty=10000\n\\widowpenalty=10000\n\\displaywidowpenalty=10000\n\n\\begin{document}\n\n\\begin{multicols}{2}\n[\\section{Optimized Column Breaks}]\n\n% Prevent bad breaks\n\\interlinepenalty=10000\n\n\\lipsum[1]\n\n% Allow breaks here\n\\penalty-100\n\n\\lipsum[2]\n\n% Discourage breaks\n\\nopagebreak\n\\lipsum[3]\n\n\\end{multicols}\n\n\\end{document}"} />

<RenderedOutput title="Rendered output">
  <LatexPreview src="/images/rendered/learn-latex-formatting-multiple-columns-12/page-1.svg" alt="Compiled PDF page 1 from column-penalties.tex" caption="Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment." width={595.276} height={841.89} />
</RenderedOutput>

## Specialized Column Layouts

### Mixed Column Layouts

<LatexSource filename="mixed-layouts.tex" source={"\\documentclass{article}\n\\usepackage{multicol}\n\\usepackage{lipsum}\n\n\\begin{document}\n\n% Single column introduction\n\\section{Introduction}\n\\lipsum[1]\n\n% Two-column main content\n\\begin{multicols}{2}\n[\\subsection{Main Content}]\n\\lipsum[2-4]\n\\end{multicols}\n\n% Three-column details\n\\begin{multicols}{3}\n[\\subsection{Detailed Analysis}]\n\\lipsum[5-7]\n\\end{multicols}\n\n% Back to single column\n\\section{Conclusion}\n\\lipsum[8]\n\n\\end{document}"} />

<RenderedOutput title="Rendered output">
  <LatexPreview src="/images/rendered/learn-latex-formatting-multiple-columns-13/page-1.svg" alt="Compiled PDF page 1 from mixed-layouts.tex" caption="Page 1 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment." width={595.276} height={841.89} />

  <LatexPreview src="/images/rendered/learn-latex-formatting-multiple-columns-13/page-2.svg" alt="Compiled PDF page 2 from mixed-layouts.tex" caption="Page 2 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment." width={595.276} height={841.89} />
</RenderedOutput>

### Asymmetric Columns

<LatexSource filename="asymmetric-columns.tex" source={"\\documentclass{article}\n\\usepackage{paracol}\n\\usepackage{lipsum}\n\n\\begin{document}\n\n\\section{Asymmetric Layout}\n\n% Different width columns\n\\setlength{\\columnseprule}{0.4pt}\n\\columnratio{0.6}\n\n\\begin{paracol}{2}\n\n% Main content (60% width)\n\\lipsum[1-3]\n\n\\switchcolumn\n\n% Sidebar content (40% width)\n\\textbf{Sidebar Notes:}\n\nKey points from the main text:\n\\begin{itemize}\n\\item Important observation\n\\item Critical detail\n\\item Summary point\n\\end{itemize}\n\nAdditional references and supplementary information.\n\n\\end{paracol}\n\n\\end{document}"} />

<RenderedOutput title="Rendered output">
  <LatexPreview src="/images/rendered/learn-latex-formatting-multiple-columns-14/page-1.svg" alt="Compiled PDF page 1 from asymmetric-columns.tex" caption="Page 1 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment." width={595.276} height={841.89} />

  <LatexPreview src="/images/rendered/learn-latex-formatting-multiple-columns-14/page-2.svg" alt="Compiled PDF page 2 from asymmetric-columns.tex" caption="Page 2 of 2. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment." width={595.276} height={841.89} />
</RenderedOutput>

## Newsletter and Journal Layouts

### Newsletter Style

<LatexSource filename="newsletter-layout.tex" source={"\\documentclass[twocolumn]{article}\n\\usepackage{multicol}\n\\usepackage{graphicx}\n\\usepackage{fancyhdr}\n\\usepackage{xcolor}\n\n% Newsletter header\n\\pagestyle{fancy}\n\\fancyhf{}\n\\fancyhead[L]{\\textbf{\\Large COMPANY NEWSLETTER}}\n\\fancyhead[R]{\\textbf{Issue 42 | March 2024}}\n\\renewcommand{\\headrulewidth}{2pt}\n\n% Column customization\n\\setlength{\\columnsep}{20pt}\n\\setlength{\\columnseprule}{0.5pt}\n\n\\begin{document}\n\n% Full-width header article\n\\twocolumn[\n\\begin{@twocolumnfalse}\n\\begin{center}\n\\textbf{\\Huge MAJOR ANNOUNCEMENT}\\\\[10pt]\n\\textit{\\large Company achieves significant milestone in Q1 2024}\n\\end{center}\n\\vspace{20pt}\n\\end{@twocolumnfalse}\n]\n\n\\section{Lead Story}\nThis is the main story content that flows in two-column format.\n\n\\includegraphics[width=\\columnwidth]{example-image}\n\n\\section{Secondary News}\nAdditional news items continue in column format.\n\n\\section{Quick Updates}\n\\begin{itemize}\n\\item Update 1\n\\item Update 2\n\\item Update 3\n\\end{itemize}\n\n\\end{document}"} />

<RenderedOutput title="Expected effect">
  <Info>
    This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.
  </Info>
</RenderedOutput>

### Academic Journal Style

<LatexSource filename="journal-layout.tex" source={"\\documentclass[twocolumn,10pt]{article}\n\\usepackage{multicol}\n\\usepackage{abstract}\n\\usepackage{lipsum}\n\n% Journal formatting\n\\setlength{\\columnsep}{15pt}\n\\setlength{\\columnseprule}{0.3pt}\n\n% Custom abstract\n\\renewcommand{\\abstractnamefont}{\\normalfont\\bfseries}\n\\renewcommand{\\abstracttextfont}{\\normalfont\\small\\itshape}\n\n\\begin{document}\n\n% Single column for title and abstract\n\\twocolumn[\n\\begin{@twocolumnfalse}\n\\title{Research Paper Title: A Comprehensive Study}\n\\author{Author Name$^1$, Co-Author Name$^2$}\n\\date{}\n\\maketitle\n\n\\begin{abstract}\nThis is the abstract of the research paper that spans the full width before the two-column layout begins. It provides a concise summary of the research methodology, findings, and conclusions.\n\\end{abstract}\n\n\\vspace{10pt}\n\\textbf{Keywords:} LaTeX, typography, academic writing, columns\n\\vspace{20pt}\n\\end{@twocolumnfalse}\n]\n\n\\section{Introduction}\n\\lipsum[1-2]\n\n\\section{Literature Review}\n\\lipsum[3-4]\n\n\\section{Methodology}\n\\lipsum[5-6]\n\n\\section{Results}\n\\lipsum[7-8]\n\n\\begin{table}[h]\n\\centering\n\\begin{tabular}{lcc}\n\\hline\nMethod & Accuracy & Time \\\\\n\\hline\nA & 95\\% & 10s \\\\\nB & 92\\% & 5s \\\\\n\\hline\n\\end{tabular}\n\\caption{Results comparison}\n\\end{table}\n\n\\section{Discussion}\n\\lipsum[9-10]\n\n\\section{Conclusion}\n\\lipsum[11]\n\n\\end{document}"} />

<RenderedOutput title="Rendered output">
  <LatexPreview src="/images/rendered/learn-latex-formatting-multiple-columns-16/page-1.svg" alt="Compiled PDF page 1 from journal-layout.tex" caption="Page 1 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment." width={595.276} height={841.89} />

  <LatexPreview src="/images/rendered/learn-latex-formatting-multiple-columns-16/page-2.svg" alt="Compiled PDF page 2 from journal-layout.tex" caption="Page 2 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment." width={595.276} height={841.89} />

  <LatexPreview src="/images/rendered/learn-latex-formatting-multiple-columns-16/page-3.svg" alt="Compiled PDF page 3 from journal-layout.tex" caption="Page 3 of 3. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment." width={595.276} height={841.89} />
</RenderedOutput>

## Troubleshooting Column Issues

### Common Problems and Solutions

<LatexSource filename="troubleshooting-columns.tex" source={"\\documentclass{article}\n\\usepackage{multicol}\n\\usepackage{lipsum}\n\n\\begin{document}\n\n% Problem: Uneven column heights\n% Solution: Use balanced multicols\n\\begin{multicols}{2}\n[\\section{Balanced Columns}]\n\\lipsum[1-3]\n\\end{multicols}\n\n% Problem: Figures breaking columns badly\n% Solution: Use [H] placement or adjust penalties\n\\begin{multicols}{2}\n[\\section{Figure Placement}]\n\n\\lipsum[4]\n\n% Better figure placement\n\\begin{figure}[H]\n\\centering\n\\includegraphics[width=0.8\\columnwidth]{example-image}\n\\caption{Properly placed figure}\n\\end{figure}\n\n\\lipsum[5]\n\n\\end{multicols}\n\n% Problem: Tables too wide for columns\n% Solution: Use adjustbox or scale\n\\begin{multicols}{2}\n[\\section{Table Fitting}]\n\n\\lipsum[6]\n\n\\begin{table}[H]\n\\centering\n\\resizebox{\\columnwidth}{!}{%\n\\begin{tabular}{cccc}\n\\hline\nA & B & C & D \\\\\n\\hline\nData & Data & Data & Data \\\\\n\\hline\n\\end{tabular}\n}\n\\caption{Resized table}\n\\end{table}\n\n\\lipsum[7]\n\n\\end{multicols}\n\n\\end{document}"} />

<RenderedOutput title="Expected effect">
  <Info>
    This excerpt depends on project files such as images, bibliography data, or included TeX sources that are not part of this standalone code box. Its exact output is project-specific, so no fabricated preview is shown.
  </Info>
</RenderedOutput>

### Fine-tuning Column Balance

<LatexSource filename="fine-tuning.tex" source={"\\documentclass{article}\n\\usepackage{multicol}\n\\usepackage{lipsum}\n\n\\begin{document}\n\n% Adjust column parameters\n\\setlength{\\multicolsep}{6pt plus 2pt minus 1pt}\n\\setlength{\\premulticols}{6pt plus 2pt minus 1pt}\n\\setlength{\\postmulticols}{6pt plus 2pt minus 1pt}\n\n% Fine-tune balance tolerance\n\\setcounter{collectmore}{-1}  % More aggressive balancing\n\n\\begin{multicols}{3}\n[\\section{Fine-tuned Columns}]\n\n% Use penalties to control breaks\n\\lipsum[1]\n\n\\penalty-100  % Encourage break here\n\n\\lipsum[2]\n\n\\penalty10000  % Discourage break here\nShort paragraph that should stay together.\n\n\\lipsum[3]\n\n\\end{multicols}\n\n\\end{document}"} />

<RenderedOutput title="Rendered output">
  <LatexPreview src="/images/rendered/learn-latex-formatting-multiple-columns-18/page-1.svg" alt="Compiled PDF page 1 from fine-tuning.tex" caption="Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment." width={595.276} height={841.89} />
</RenderedOutput>

## Best Practices

<Tip>
  **Column layout guidelines:**

  1. **Choose appropriate column count** - 2-3 columns work best for most content
  2. **Consider line length** - Aim for 45-75 characters per line
  3. **Balance content** - Use multicol for automatic balancing
  4. **Mind the gaps** - Adjust `\columnsep` for readability
  5. **Test thoroughly** - Check appearance at different zoom levels
  6. **Use spanning elements wisely** - Don't break flow unnecessarily
</Tip>

### Professional Column Setup

<LatexSource filename="professional-setup.tex" source={"\\documentclass{article}\n\\usepackage{multicol}\n\\usepackage{microtype}  % Better typography\n\\usepackage{lipsum}\n\n% Professional column settings\n\\setlength{\\columnsep}{18pt}\n\\setlength{\\columnseprule}{0.3pt}\n\\renewcommand{\\columnseprulecolor}{\\color{gray!50}}\n\n% Improve text flow\n\\tolerance=1000\n\\hyphenpenalty=1000\n\\exhyphenpenalty=1000\n\n\\begin{document}\n\n\\begin{multicols}{2}\n[\\section{Professional Layout}\nOptimized for readability and professional appearance.]\n\n\\lipsum[1-4]\n\nThis layout uses professional typography settings to ensure optimal readability across multiple columns.\n\n\\end{multicols}\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>

## Quick Reference

### Essential Commands

| Command                             | Purpose               | Example                             |
| ----------------------------------- | --------------------- | ----------------------------------- |
| `\begin{multicols}{n}`              | Start n-column layout | `\begin{multicols}{3}`              |
| `\columnbreak`                      | Force column break    | Insert between paragraphs           |
| `\setlength{\columnsep}{length}`    | Set column separation | `\setlength{\columnsep}{20pt}`      |
| `\setlength{\columnseprule}{width}` | Set rule width        | `\setlength{\columnseprule}{0.5pt}` |

### Column Parameters

| Parameter        | Description                  | Typical Value           |
| ---------------- | ---------------------------- | ----------------------- |
| `\columnsep`     | Space between columns        | 18pt-25pt               |
| `\columnseprule` | Rule width                   | 0pt-1pt                 |
| `\multicolsep`   | Space before/after multicols | 12pt plus 4pt minus 3pt |
| `\premulticols`  | Space before multicols       | 12pt plus 4pt minus 3pt |
| `\postmulticols` | Space after multicols        | 12pt plus 4pt minus 3pt |

### Document Class Options

| Option      | Effect                  |
| ----------- | ----------------------- |
| `twocolumn` | Enable two-column mode  |
| `onecolumn` | Single column (default) |
| `landscape` | Landscape orientation   |

***

<Info>
  **Next**: Learn about [LaTeX counters and numbering](/learn/latex/formatting/counters-numbering) for advanced numbering schemes, or explore [Headers and footers](/learn/latex/formatting/headers-footers) for page design.
</Info>
