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

# Multi-language Documents in LaTeX

> Create documents in multiple languages with LaTeX. Learn babel, polyglossia, font selection, and internationalization best practices for global documents.

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

Master the creation of multi-language documents in LaTeX. This guide covers language packages, font configuration, bidirectional text, special characters, and internationalization strategies for professional multilingual publications.

<Info>
  **Prerequisites**: Basic LaTeX knowledge\
  **Time to complete**: 30-35 minutes\
  **Difficulty**: Intermediate to Advanced\
  **What you'll learn**: Language packages, fonts, encoding, hyphenation, and localization
</Info>

## Multi-language Overview

### Why Multi-language Support Matters

<CardGroup cols={2}>
  <Card title="Global Reach" icon="globe">
    Create documents for international audiences
  </Card>

  <Card title="Academic Requirements" icon="graduation-cap">
    Citations and quotes in original languages
  </Card>

  <Card title="Business Documents" icon="briefcase">
    Multilingual reports and presentations
  </Card>

  <Card title="Cultural Accuracy" icon="language">
    Proper typography and formatting rules
  </Card>
</CardGroup>

### Language Support Methods

<Tabs>
  <Tab title="babel">
    **Traditional package**

    * Wide language support
    * Works with pdfLaTeX
    * Extensive documentation
    * Active development
  </Tab>

  <Tab title="polyglossia">
    **Modern alternative**

    * Designed for XeLaTeX/LuaLaTeX
    * Better Unicode support
    * Advanced font features
    * Modern languages
  </Tab>

  <Tab title="CJK">
    **Asian languages**

    * Chinese, Japanese, Korean
    * Special considerations
    * Font requirements
    * Input methods
  </Tab>
</Tabs>

## Babel Package

### Basic Setup

<LatexSource filename="babel-basic.tex" source={"\\documentclass{article}\n\\usepackage[T1]{fontenc}\n\\usepackage[utf8]{inputenc}\n\n% Load languages (last one is default)\n\\usepackage[spanish, french, english]{babel}\n\n\\begin{document}\n\n% English (default)\n\\section{Introduction}\nThis document demonstrates multi-language support.\n\n% Switch to French\n\\selectlanguage{french}\n\\section{Introduction}\nCe document démontre le support multilingue.\n\n% Switch to Spanish\n\\selectlanguage{spanish}\n\\section{Introducción}\nEste documento demuestra el soporte multilingüe.\n\n% Back to English\n\\selectlanguage{english}\n\n% Inline language switching\nThis is English text with some \\foreignlanguage{french}{mots français}\nand \\foreignlanguage{spanish}{palabras españolas}.\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_how_to_multi_language_documents">
  <LatexPreview src="/images/rendered/learn-latex-how-to-multi-language-documents-01/page-1.svg" alt="Compiled PDF page 1 from babel-basic.tex" caption="Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment." width={595.276} height={841.89} />
</RenderedOutput>

<LatexSource filename="babel-advanced.tex" source={"\\documentclass{article}\n\\usepackage[T1]{fontenc}\n\\usepackage[utf8]{inputenc}\n\\usepackage[german, greek, english]{babel}\n\n% Language-specific commands\n\\addto\\captionsenglish{\n    \\renewcommand{\\contentsname}{Table of Contents}\n}\n\n\\addto\\captionsgerman{\n    \\renewcommand{\\contentsname}{Inhaltsverzeichnis}\n}\n\n\\begin{document}\n\n\\tableofcontents\n\n\\section{Multilingual Document}\n\n% Environment for language switching\n\\begin{otherlanguage}{german}\n\\subsection{Deutscher Abschnitt}\nDies ist ein deutscher Text mit korrekter Silbentrennung\nund Typografie. Beachten Sie die Anführungszeichen: \"`deutsche Anführungszeichen\"'.\n\\end{otherlanguage}\n\n% Greek text\n\\begin{otherlanguage}{greek}\n\\subsection{Ελληνική ενότητα}\nΑυτό είναι ελληνικό κείμενο με σωστή υφενοποίηση.\n\\end{otherlanguage}\n\n% Babel shorthands\n\\selectlanguage{german}\nDas ist ein \"Beispiel\" mit deutschen Anführungszeichen.\nDer Bindestrich\"=Trick funktioniert auch.\n\n\\end{document}"} />

<RenderedOutput title="Rendered output">
  <LatexPreview src="/images/rendered/learn-latex-how-to-multi-language-documents-02/page-1.svg" alt="Compiled PDF page 1 from babel-advanced.tex" caption="Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment." width={595.276} height={841.89} />
</RenderedOutput>

### Language-specific Features

<LatexSource filename="babel-features.tex" source={"\\documentclass{article}\n\\usepackage[T1]{fontenc}\n\\usepackage[utf8]{inputenc}\n\\usepackage[french, spanish, english]{babel}\n\n\\begin{document}\n\n% Date formatting\n\\selectlanguage{english}\nToday's date: \\today\n\n\\selectlanguage{french}\nDate d'aujourd'hui: \\today\n\n\\selectlanguage{spanish}\nFecha de hoy: \\today\n\n% Hyphenation patterns\n\\selectlanguage{english}\n\\hyphenation{hy-phen-a-tion ex-am-ple}\nThis is a hyphenation example with very long words.\n\n% Language-specific typography\n\\selectlanguage{french}\n\\frenchspacing % French spacing rules\nVoici un exemple : avec les espaces françaises !\n\n% Quotes\n\\selectlanguage{english}\nEnglish ``quotes'' are different from \\selectlanguage{french}\\og guillemets français\\fg{}\nand \\selectlanguage{spanish}<<comillas españolas>>.\n\n% Language attributes\n\\selectlanguage{english}\n\\languageattribute{english}{american} % American English\nColor, organize, analyze.\n\n\\languageattribute{english}{british} % British English\nColour, organise, analyse.\n\n\\end{document}"} />

<RenderedOutput title="Expected effect">
  <Info>
    This is document setup or preamble code. It changes the behavior of a containing document but does not produce an honest standalone page by itself.
  </Info>
</RenderedOutput>

<LatexSource filename="babel-environments.tex" source={"\\documentclass{article}\n\\usepackage[T1]{fontenc}\n\\usepackage[utf8]{inputenc}\n\\usepackage[russian, german, english]{babel}\n\n% Define language environments\n\\newenvironment{english}\n    {\\begin{otherlanguage}{english}}\n    {\\end{otherlanguage}}\n\n\\newenvironment{german}\n    {\\begin{otherlanguage}{german}}\n    {\\end{otherlanguage}}\n\n\\newenvironment{russian}\n    {\\begin{otherlanguage}{russian}}\n    {\\end{otherlanguage}}\n\n\\begin{document}\n\n\\section{Mixed Language Document}\n\n\\begin{english}\nThis is an English paragraph with proper hyphenation and formatting.\n\\end{english}\n\n\\begin{german}\nDies ist ein deutscher Absatz mit korrekter Silbentrennung und Formatierung.\n\\end{german}\n\n\\begin{russian}\nЭто русский абзац с правильным переносом и форматированием.\n\\end{russian}\n\n% Mixed paragraph\n\\begin{english}\nThe German word \\foreignlanguage{german}{Schadenfreude} has no direct\nEnglish translation, while the Russian \\foreignlanguage{russian}{тоска}\nexpresses a deep spiritual anguish.\n\\end{english}\n\n\\end{document}"} />

<RenderedOutput title="Rendered output">
  <LatexPreview src="/images/rendered/learn-latex-how-to-multi-language-documents-04/page-1.svg" alt="Compiled PDF page 1 from babel-environments.tex" caption="Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment." width={595.276} height={841.89} />
</RenderedOutput>

## Polyglossia Package

### XeLaTeX/LuaLaTeX Setup

<LatexSource filename="polyglossia-basic.tex" source={"\\documentclass{article}\n\\usepackage{polyglossia}\n\n% Set main language\n\\setdefaultlanguage{english}\n\n% Set other languages\n\\setotherlanguages{french, spanish, arabic, chinese}\n\n% Font configuration\n\\usepackage{fontspec}\n\\setmainfont{Linux Libertine O}\n\\setsansfont{Linux Biolinum O}\n\\setmonofont{Inconsolata}\n\n% Language-specific fonts\n\\newfontfamily\\arabicfont[Script=Arabic,Scale=1.2]{Amiri}\n\\newfontfamily\\chinesefont[Scale=0.9]{Noto Sans CJK SC}\n\n\\begin{document}\n\n\\section{Multilingual with Polyglossia}\n\nThis is English text.\n\n\\begin{french}\nCeci est un texte français avec les bonnes règles typographiques.\n\\end{french}\n\n\\begin{spanish}\nEste es un texto español con la tipografía correcta.\n\\end{spanish}\n\n\\begin{arabic}\nهذا نص عربي مع الاتجاه الصحيح من اليمين إلى اليسار.\n\\end{arabic}\n\n\\begin{chinese}\n这是中文文本，使用正确的字体。\n\\end{chinese}\n\n\\end{document}"} />

<RenderedOutput title="Expected effect">
  <Info>
    This example configures a system font. The visible result depends on fonts installed in the reader's compilation environment, so the code box describes the intended configuration instead of showing a misleading substitute font.
  </Info>
</RenderedOutput>

<LatexSource filename="polyglossia-advanced.tex" source={"\\documentclass{article}\n\\usepackage{polyglossia}\n\n% Language setup with options\n\\setdefaultlanguage[variant=american]{english}\n\\setotherlanguage[variant=medieval,spelling=new,babelshorthands=true]{german}\n\\setotherlanguage[numerals=arabic]{farsi}\n\\setotherlanguage{japanese}\n\n% Fonts\n\\usepackage{fontspec}\n\\setmainfont{TeX Gyre Termes}\n\n% Language-specific fonts\n\\newfontfamily\\germanfont{UnifrakturMaguntia}\n\\newfontfamily\\farsifont[Script=Arabic,Numbers=Farsi]{Vazir}\n\\newfontfamily\\japanesefont{Noto Sans CJK JP}\n\n\\begin{document}\n\n\\section{Advanced Polyglossia Features}\n\n% Date in different languages\nEnglish date: \\today\n\n\\begin{german}\nDeutsches Datum: \\today\n\n% Medieval German with special font\n{\\germanfont Hier ist mittelalterlicher deutscher Text in Fraktur.}\n\\end{german}\n\n\\begin{farsi}\nتاریخ فارسی: \\today\n\nاین متن فارسی با اعداد فارسی است: ۱۲۳۴۵۶۷۸۹۰\n\\end{farsi}\n\n\\begin{japanese}\n日本語のテキスト。今日の日付：\\today\n\\end{japanese}\n\n% Language-specific numbering\n\\begin{english}\n\\begin{enumerate}\n    \\item First item\n    \\item Second item\n\\end{enumerate}\n\\end{english}\n\n\\begin{farsi}\n\\begin{enumerate}\n    \\item مورد اول\n    \\item مورد دوم\n\\end{enumerate}\n\\end{farsi}\n\n\\end{document}"} />

<RenderedOutput title="Expected effect">
  <Info>
    This example configures a system font. The visible result depends on fonts installed in the reader's compilation environment, so the code box describes the intended configuration instead of showing a misleading substitute font.
  </Info>
</RenderedOutput>

### Bidirectional Text

<LatexSource filename="bidi-text.tex" source={"\\documentclass{article}\n\\usepackage{polyglossia}\n\\usepackage{bidi} % For older systems\n\n\\setdefaultlanguage{english}\n\\setotherlanguage{arabic}\n\\setotherlanguage{hebrew}\n\n\\usepackage{fontspec}\n\\newfontfamily\\arabicfont[Script=Arabic,Scale=1.2]{Scheherazade}\n\\newfontfamily\\hebrewfont[Script=Hebrew,Scale=1.1]{David CLM}\n\n\\begin{document}\n\n\\section{Bidirectional Text Support}\n\nThis is left-to-right English text.\n\n\\begin{arabic}\n\\subsection{النص العربي}\nهذا نص من اليمين إلى اليسار. يمكن مزج \\textLR{English words} في النص العربي.\n\n\\begin{itemize}\n    \\item البند الأول\n    \\item البند الثاني مع \\textLR{LTR text}\n    \\item البند الثالث\n\\end{itemize}\n\\end{arabic}\n\nMixed paragraph: The Arabic phrase \\textarabic{السلام عليكم} means\n\"peace be upon you\" and the Hebrew \\texthebrew{שלום} means \"peace/hello\".\n\n\\begin{hebrew}\n\\subsection{טקסט עברי}\nזהו טקסט מימין לשמאל בעברית. אפשר לשלב \\textLR{English} בתוך העברית.\n\\end{hebrew}\n\n% Tables with RTL text\n\\begin{table}[h]\n\\centering\n\\begin{tabular}{|c|c|c|}\n\\hline\nEnglish & \\textarabic{عربي} & \\texthebrew{עברית} \\\\\n\\hline\nHello & \\textarabic{مرحبا} & \\texthebrew{שלום} \\\\\nGoodbye & \\textarabic{وداعا} & \\texthebrew{להתראות} \\\\\nThank you & \\textarabic{شكرا} & \\texthebrew{תודה} \\\\\n\\hline\n\\end{tabular}\n\\caption{Multilingual greetings}\n\\end{table}\n\n\\end{document}"} />

<RenderedOutput title="Expected effect">
  <Info>
    This example configures a system font. The visible result depends on fonts installed in the reader's compilation environment, so the code box describes the intended configuration instead of showing a misleading substitute font.
  </Info>
</RenderedOutput>

<LatexSource filename="mixed-directions.tex" source={"\\documentclass{article}\n\\usepackage{polyglossia}\n\\setdefaultlanguage{english}\n\\setotherlanguage{arabic}\n\\setotherlanguage{french}\n\n\\usepackage{fontspec}\n\\newfontfamily\\arabicfont[Script=Arabic]{Amiri}\n\n% Environments for direction control\n\\newenvironment{RTL}\n    {\\begin{arabic}\\begin{flushright}}\n    {\\end{flushright}\\end{arabic}}\n\n\\newenvironment{LTR}\n    {\\begin{flushleft}}\n    {\\end{flushleft}}\n\n\\begin{document}\n\n\\section{Complex Directional Layouts}\n\n\\begin{RTL}\nهذه فقرة عربية مع اتجاه من اليمين إلى اليسار.\nيمكن إدراج \\textLR{English text} و\\textfrench{texte français} داخل النص العربي.\n\\end{RTL}\n\n\\begin{LTR}\nThis is an English paragraph with embedded Arabic: \\textarabic{مثال عربي}\nand continuing in English.\n\\end{LTR}\n\n% Two-column layout with different directions\n\\begin{minipage}[t]{0.45\\textwidth}\n\\begin{english}\n\\subsection{Left Column}\nThis is the English column with left-to-right text flow.\n\\end{english}\n\\end{minipage}\n\\hfill\n\\begin{minipage}[t]{0.45\\textwidth}\n\\begin{RTL}\n\\subsection{العمود الأيمن}\nهذا هو العمود العربي مع تدفق النص من اليمين إلى اليسار.\n\\end{RTL}\n\\end{minipage}\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>

## Font Configuration

### Selecting Appropriate Fonts

<LatexSource filename="font-selection.tex" source={"\\documentclass{article}\n\\usepackage{fontspec} % XeLaTeX/LuaLaTeX\n\\usepackage{polyglossia}\n\n\\setdefaultlanguage{english}\n\\setotherlanguages{russian, greek, japanese, arabic}\n\n% Main document fonts\n\\setmainfont[\n    Ligatures=TeX,\n    BoldFont={* Bold},\n    ItalicFont={* Italic},\n    BoldItalicFont={* Bold Italic}\n]{TeX Gyre Termes}\n\n\\setsansfont[\n    Ligatures=TeX,\n    Scale=0.9\n]{TeX Gyre Heros}\n\n\\setmonofont[\n    Scale=0.9\n]{Inconsolata}\n\n% Language-specific fonts\n\\newfontfamily\\russianfont[\n    Script=Cyrillic,\n    Ligatures=TeX\n]{PT Serif}\n\n\\newfontfamily\\greekfont[\n    Script=Greek,\n    Ligatures=TeX\n]{GFS Artemisia}\n\n\\newfontfamily\\japanesefont[\n    Script=CJK,\n    Scale=0.9\n]{Noto Sans CJK JP}\n\n\\newfontfamily\\arabicfont[\n    Script=Arabic,\n    Scale=1.2,\n    RightToLeft=true\n]{Scheherazade}\n\n\\begin{document}\n\n\\section{Font Configuration for Multiple Languages}\n\nDefault English text uses TeX Gyre Termes.\n\n\\begin{russian}\nРусский текст использует шрифт PT Serif, который хорошо поддерживает кириллицу.\n\\end{russian}\n\n\\begin{greek}\nΤο ελληνικό κείμενο χρησιμοποιεί τη γραμματοσειρά GFS Artemisia.\n\\end{greek}\n\n\\begin{japanese}\n日本語のテキストはNoto Sans CJK JPフォントを使用します。\n\\end{japanese}\n\n\\begin{arabic}\nالنص العربي يستخدم خط Scheherazade مع دعم كامل للغة العربية.\n\\end{arabic}\n\n\\end{document}"} />

<RenderedOutput title="Expected effect">
  <Info>
    This example configures a system font. The visible result depends on fonts installed in the reader's compilation environment, so the code box describes the intended configuration instead of showing a misleading substitute font.
  </Info>
</RenderedOutput>

<LatexSource filename="fallback-fonts.tex" source={"\\documentclass{article}\n\\usepackage{fontspec}\n\\usepackage[fallback]{polyglossia}\n\n% Define font with fallbacks\n\\setmainfont[\n    Ligatures=TeX,\n    FallbackFont={\n        {Noto Sans CJK SC}[Scale=0.9],\n        {Noto Sans Arabic}[Scale=1.1],\n        {Noto Sans Devanagari},\n        {Symbola}\n    }\n]{Linux Libertine O}\n\n\\begin{document}\n\n\\section{Font Fallback System}\n\nThis system allows mixing scripts seamlessly:\n- English text (default font)\n- 中文文字 (Chinese fallback)\n- العربية (Arabic fallback)\n- हिन्दी (Devanagari fallback)\n- Symbols: 🌍 ✓ ♠ (Symbola fallback)\n\nAll in one paragraph without manual font switching!\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>

### OpenType Features

<LatexSource filename="opentype-features.tex" source={"\\documentclass{article}\n\\usepackage{fontspec}\n\n% Font with various OpenType features\n\\setmainfont[\n    Numbers={OldStyle,Proportional},\n    Ligatures={Common,Contextual,Historic},\n    Letters=SmallCaps,\n    Style=Alternate\n]{EB Garamond}\n\n% Define font variations\n\\newfontfamily\\liningfont[Numbers={Lining,Monospaced}]{EB Garamond}\n\\newfontfamily\\swashfont[Style=Swash,Contextuals=Swash]{EB Garamond}\n\\newfontfamily\\historicfont[Style=Historic,Ligatures=Historic]{EB Garamond}\n\n\\begin{document}\n\n\\section{OpenType Features}\n\n% Number styles\nDefault oldstyle figures: 0123456789\n\n{\\liningfont Lining figures: 0123456789}\n\n% Ligatures\nStandard ligatures: ff fi fl ffi ffl\n\n{\\addfontfeature{Ligatures=NoCommon}No ligatures: ff fi fl ffi ffl}\n\n% Small caps\n\\textsc{Small Capitals for Emphasis}\n\n% Swash characters\n{\\swashfont Swash variants for Q and &}\n\n% Historic forms\n{\\historicfont Historic long s: distinction}\n\n% Fractions\n\\addfontfeature{Fractions=On}\nAutomatic fractions: 1/2 3/4 5/8\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>

## Special Characters and Symbols

### Input Methods

<LatexSource filename="special-chars.tex" source={"\\documentclass{article}\n\\usepackage[utf8]{inputenc} % For pdfLaTeX\n\\usepackage[T1]{fontenc}\n\\usepackage{textcomp}\n\\usepackage[english, french, german]{babel}\n\n\\begin{document}\n\n\\section{Special Characters}\n\n% Direct Unicode input (with utf8)\nCafé, naïve, Zürich, señor, Москва\n\n% LaTeX commands for special characters\nCaf\\'e, na\\\"{\\i}ve, Z\\\"urich, se\\~nor\n\n% French special characters\n\\selectlanguage{french}\n\\oe uvre, c\\oe ur, <<~guillemets~>>\n\n% German special characters\n\\selectlanguage{german}\n\"Anf\"uhrungszeichen\", \"=, \"~, \"`German quotes\"'\n\n% Text symbols\n\\texttrademark{} \\textregistered{} \\textcopyright{} \\texteuro{} \\textyen{}\n\n% Accented characters\n\\`{a} \\'{e} \\^{o} \\~{n} \\\"{u} \\={a} \\.{c} \\u{g} \\v{s} \\H{o}\n\n% Special ligatures\n\\AE{} \\ae{} \\OE{} \\oe{} \\AA{} \\aa{} \\O{} \\o{} \\L{} \\l{} \\SS{} \\ss{}\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>

<LatexSource filename="unicode-symbols.tex" source={"\\documentclass{article}\n\\usepackage{fontspec} % XeLaTeX/LuaLaTeX\n\\usepackage{unicode-math}\n\n\\setmainfont{TeX Gyre Termes}\n\\setmathfont{TeX Gyre Termes Math}\n\n\\begin{document}\n\n\\section{Unicode Symbols and Characters}\n\n% Direct Unicode input\nArrows: → ← ↑ ↓ ⇒ ⇐ ⇔ ↔\n\nMathematical: ∀ ∃ ∈ ∉ ⊂ ⊃ ∪ ∩ ∅\n\nGreek: α β γ δ ε ζ η θ Γ Δ Θ Λ Ξ Π Σ Φ Ψ Ω\n\nCyrillic: А Б В Г Д Е Ё Ж З И Й К Л М Н О П Р С Т У Ф\n\nCurrency: € £ ¥ ₹ ₽ ¢ ¤\n\nFractions: ½ ⅓ ¼ ⅕ ⅙ ⅐ ⅛ ⅑ ⅒\n\nMiscellaneous: © ® ™ ° § ¶ † ‡ • … ‰ ′ ″\n\nBox drawing: ┌─┬─┐ │ │ │ ├─┼─┤ └─┴─┘\n\n% Emoji (requires appropriate font)\nEmoji: 😀 🌍 ✓ ✗ ⚠ ℹ 🔍 📧\n\n\\end{document}"} />

<RenderedOutput title="Rendered output">
  <LatexPreview src="/images/rendered/learn-latex-how-to-multi-language-documents-13/page-1.svg" alt="Compiled PDF page 1 from unicode-symbols.tex" caption="Generated from the shown source with XeLaTeX in the pinned LaTeXCloud TeX Live 2026 environment." width={595.28} height={841.89} />
</RenderedOutput>

## Hyphenation and Line Breaking

### Language-specific Hyphenation

<LatexSource filename="hyphenation-rules.tex" source={"\\documentclass{article}\n\\usepackage[T1]{fontenc}\n\\usepackage[utf8]{inputenc}\n\\usepackage[english, german, french]{babel}\n\n\\begin{document}\n\n\\section{Hyphenation Examples}\n\n% English hyphenation\n\\selectlanguage{english}\n\\hyphenation{hy-phen-a-tion ex-am-ple spe-cial-word}\n\nThis is a demonstration of hyphenation in English with some\nextraordinarily long words that need proper hyphenation patterns\nto break correctly at line endings.\n\n% German hyphenation\n\\selectlanguage{german}\n\\hyphenation{Sil-ben-tren-nung Bei-spiel-wör-ter}\n\nDies ist eine Demonstration der Silbentrennung im Deutschen mit\naußergewöhnlich langen Wörtern, die ordnungsgemäße Trennmuster\nbenötigen.\n\n% French hyphenation\n\\selectlanguage{french}\n\\hyphenation{hy-phe-na-tion ex-em-ple}\n\nCeci est une démonstration de la césure en français avec des mots\nextraordinairement longs qui nécessitent des modèles de césure\nappropriés.\n\n% Prevent hyphenation\n\\selectlanguage{english}\n\\mbox{Unhyphenatable} word or \\hbox{compound expression}.\n\n\\end{document}"} />

<RenderedOutput title="Rendered output">
  <LatexPreview src="/images/rendered/learn-latex-how-to-multi-language-documents-14/page-1.svg" alt="Compiled PDF page 1 from hyphenation-rules.tex" caption="Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment." width={595.276} height={841.89} />
</RenderedOutput>

<LatexSource filename="custom-hyphenation.tex" source={"\\documentclass{article}\n\\usepackage[T1]{fontenc}\n\\usepackage[utf8]{inputenc}\n\\usepackage[english]{babel}\n\n% Global hyphenation exceptions\n\\hyphenation{\n    ana-lysis\n    analy-ses\n    bio-log-i-cal\n    com-put-er\n    data-base\n    para-digm\n}\n\n% Language-specific patterns\n\\makeatletter\n\\addto\\extrasenglish{\n    \\def\\englishhyphenmins{2 3} % min left/right\n}\n\\makeatother\n\n\\begin{document}\n\n\\section{Custom Hyphenation Patterns}\n\n% Inline hyphenation hints\nThe word analysis\\-is can be hyphenated manually.\n\n% Discretionary hyphens\nCom\\-pu\\-ter\\-ized data\\-base man\\-age\\-ment sys\\-tems.\n\n% Prevent hyphenation in specific text\n\\begin{sloppypar}\nThis paragraph will have looser spacing to avoid hyphenation\nof extraordinarily long technical terminology.\n\\end{sloppypar}\n\n% Hyphenation with penalties\n\\hyphenpenalty=10000 % Prevent hyphenation\n\\exhyphenpenalty=10000 % Prevent hyphenation after explicit hyphen\n\nNo hyphenation in this paragraph with very long words.\n\n\\hyphenpenalty=50 % Allow hyphenation\n\\exhyphenpenalty=50\n\nNormal hyphenation restored for this paragraph.\n\n\\end{document}"} />

<RenderedOutput title="Rendered output">
  <LatexPreview src="/images/rendered/learn-latex-how-to-multi-language-documents-15/page-1.svg" alt="Compiled PDF page 1 from custom-hyphenation.tex" caption="Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment." width={595.276} height={841.89} />
</RenderedOutput>

## Document Structure

### Multilingual Documents

<LatexSource filename="multilingual-report.tex" source={"\\documentclass{report}\n\\usepackage[T1]{fontenc}\n\\usepackage[utf8]{inputenc}\n\\usepackage[english, spanish, french, german]{babel}\n\\usepackage{csquotes} % Context-sensitive quotes\n\n% Chapter names in different languages\n\\addto\\captionsenglish{\\renewcommand{\\chaptername}{Chapter}}\n\\addto\\captionsspanish{\\renewcommand{\\chaptername}{Capítulo}}\n\\addto\\captionsfrench{\\renewcommand{\\chaptername}{Chapitre}}\n\\addto\\captionsgerman{\\renewcommand{\\chaptername}{Kapitel}}\n\n\\begin{document}\n\n% Title page in multiple languages\n\\begin{titlepage}\n    \\centering\n    \\vspace*{2cm}\n\n    {\\Huge\\bfseries Multilingual Report\\\\\n    Rapport Multilingue\\\\\n    Informe Multilingüe\\\\\n    Mehrsprachiger Bericht\\par}\n\n    \\vspace{2cm}\n\n    {\\Large\\itshape International Organization\\\\\n    Organisation Internationale\\\\\n    Organización Internacional\\\\\n    Internationale Organisation\\par}\n\n    \\vfill\n\n    {\\large\\today\\par}\n\\end{titlepage}\n\n\\tableofcontents\n\n\\selectlanguage{english}\n\\chapter{Introduction}\nThis report is written in multiple languages...\n\n\\selectlanguage{french}\n\\chapter{Introduction}\nCe rapport est rédigé en plusieurs langues...\n\n\\selectlanguage{spanish}\n\\chapter{Introducción}\nEste informe está escrito en varios idiomas...\n\n\\selectlanguage{german}\n\\chapter{Einleitung}\nDieser Bericht ist in mehreren Sprachen verfasst...\n\n\\end{document}"} />

<RenderedOutput title="Rendered output">
  <LatexPreview src="/images/rendered/learn-latex-how-to-multi-language-documents-16/page-1.svg" alt="Compiled PDF page 1 from multilingual-report.tex" caption="Page 1 of 6. 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-how-to-multi-language-documents-16/page-2.svg" alt="Compiled PDF page 2 from multilingual-report.tex" caption="Page 2 of 6. 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-how-to-multi-language-documents-16/page-3.svg" alt="Compiled PDF page 3 from multilingual-report.tex" caption="Page 3 of 6. 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-how-to-multi-language-documents-16/page-4.svg" alt="Compiled PDF page 4 from multilingual-report.tex" caption="Page 4 of 6. 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-how-to-multi-language-documents-16/page-5.svg" alt="Compiled PDF page 5 from multilingual-report.tex" caption="Page 5 of 6. 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-how-to-multi-language-documents-16/page-6.svg" alt="Compiled PDF page 6 from multilingual-report.tex" caption="Page 6 of 6. Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment." width={595.276} height={841.89} />
</RenderedOutput>

<LatexSource filename="parallel-text.tex" source={"\\documentclass{article}\n\\usepackage[T1]{fontenc}\n\\usepackage[utf8]{inputenc}\n\\usepackage[english, latin]{babel}\n\\usepackage{parallel}\n\\usepackage{lipsum}\n\n\\begin{document}\n\n\\section{Parallel Texts}\n\n% Two-column parallel text\n\\begin{Parallel}{0.48\\textwidth}{0.48\\textwidth}\n\\ParallelLText{\n    \\selectlanguage{english}\n    \\subsection{English Version}\n    This is the English version of the text. It appears on the left side\n    and maintains proper hyphenation and justification for English.\n}\n\\ParallelRText{\n    \\selectlanguage{latin}\n    \\subsection{Versio Latina}\n    Haec est versio Latina textus. In dextra parte apparet et propriam\n    hyphenationem iustificationemque Latinam servat.\n}\n\\end{Parallel}\n\n% Side-by-side with different fonts\n\\begin{minipage}[t]{0.48\\textwidth}\n    \\selectlanguage{english}\n    \\subsubsection{Modern English}\n    Contemporary text with modern spelling and grammar conventions.\n\\end{minipage}\n\\hfill\n\\begin{minipage}[t]{0.48\\textwidth}\n    \\selectlanguage{english}\n    \\subsubsection{Middle English}\n    \\fontfamily{uncl}\\selectfont\n    Whan that Aprille with his shoures soote...\n\\end{minipage}\n\n\\end{document}"} />

<RenderedOutput title="Rendered output">
  <LatexPreview src="/images/rendered/learn-latex-how-to-multi-language-documents-17/page-1.svg" alt="Compiled PDF page 1 from parallel-text.tex" caption="Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment." width={595.276} height={841.89} />
</RenderedOutput>

## Localization

### Dates and Numbers

<LatexSource filename="localization.tex" source={"\\documentclass{article}\n\\usepackage{polyglossia}\n\\usepackage{datetime2}\n\n\\setdefaultlanguage{english}\n\\setotherlanguages{french, german, spanish, russian}\n\n\\begin{document}\n\n\\section{Localized Dates and Numbers}\n\n% Dates in different languages\n\\begin{tabular}{ll}\nEnglish: & \\today \\\\\n\\French French: & \\today \\\\\n\\German German: & \\today \\\\\n\\Spanish Spanish: & \\today \\\\\n\\Russian Russian: & \\today \\\\\n\\end{tabular}\n\n% Number formatting\n\\begin{english}\nEnglish: 1,234,567.89\n\\end{english}\n\n\\begin{french}\nFrench: 1 234 567,89\n\\end{french}\n\n\\begin{german}\nGerman: 1.234.567,89\n\\end{german}\n\n% Ordinal numbers\n\\begin{english}\n1st, 2nd, 3rd, 4th, 21st\n\\end{english}\n\n\\begin{french}\n1\\textsuperscript{er}, 2\\textsuperscript{e},\n3\\textsuperscript{e}, 21\\textsuperscript{e}\n\\end{french}\n\n\\begin{spanish}\n1\\textsuperscript{o}, 2\\textsuperscript{o},\n3\\textsuperscript{o}, 21\\textsuperscript{o}\n\\end{spanish}\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>

<LatexSource filename="currency-units.tex" source={"\\documentclass{article}\n\\usepackage{siunitx}\n\\usepackage[english, german, french]{babel}\n\n% SI unit localization\n\\sisetup{\n    locale = US,\n    per-mode = symbol\n}\n\n\\begin{document}\n\n\\section{Units and Currency}\n\n% Currency in different locales\n\\selectlanguage{english}\nPrice: \\$1,234.56 or \\pounds 987.65\n\n\\selectlanguage{german}\nPreis: 1.234,56\\,€ oder 987,65\\,£\n\n\\selectlanguage{french}\nPrix: 1 234,56\\,€ ou 987,65\\,£\n\n% Units with localization\n\\selectlanguage{english}\n\\SI{123.456}{\\kilo\\meter\\per\\hour}\n\n\\selectlanguage{german}\n\\sisetup{locale = DE}\n\\SI{123.456}{\\kilo\\meter\\per\\hour}\n\n\\selectlanguage{french}\n\\sisetup{locale = FR}\n\\SI{123.456}{\\kilo\\meter\\per\\hour}\n\n\\end{document}"} />

<RenderedOutput title="Rendered output">
  <LatexPreview src="/images/rendered/learn-latex-how-to-multi-language-documents-19/page-1.svg" alt="Compiled PDF page 1 from currency-units.tex" caption="Generated from the shown source with pdfLaTeX in the pinned LaTeXCloud TeX Live 2026 environment." width={612} height={792} />
</RenderedOutput>

## Best Practices

### Multilingual Tips

<Tip>
  ✅ **Best practices checklist**:

  * [ ] Choose appropriate engine (pdfLaTeX vs XeLaTeX/LuaLaTeX)
  * [ ] Select suitable fonts for all languages
  * [ ] Test hyphenation patterns
  * [ ] Configure proper encoding
  * [ ] Set language-specific typography rules
  * [ ] Handle bidirectional text correctly
  * [ ] Use semantic markup for language switches
  * [ ] Maintain consistent style across languages
  * [ ] Test PDF searchability and copying
  * [ ] Consider accessibility requirements
</Tip>

### Common Issues

<Warning>
  **Avoid these multilingual pitfalls**:

  1. **Wrong encoding** - Use UTF-8 consistently
  2. **Missing fonts** - Verify font support for all scripts
  3. **Hardcoded strings** - Use babel/polyglossia captions
  4. **Mixed directions** - Test RTL/LTR thoroughly
  5. **Hyphenation errors** - Load patterns for all languages
  6. **Quote styles** - Use csquotes for consistency
  7. **Number formats** - Respect locale conventions
</Warning>

## Complete Example

<LatexSource filename="complete-multilingual.tex" source={"\\documentclass{book}\n\\usepackage{fontspec} % XeLaTeX\n\\usepackage{polyglossia}\n\\usepackage{csquotes}\n\\usepackage{datetime2}\n\\usepackage{siunitx}\n\\usepackage{lipsum}\n\n% Language setup\n\\setdefaultlanguage[variant=american]{english}\n\\setotherlanguages{french, german, spanish, russian, arabic, japanese}\n\n% Font configuration\n\\setmainfont{TeX Gyre Termes}\n\\setsansfont{TeX Gyre Heros}\n\\setmonofont{Inconsolata}\n\n% Language-specific fonts\n\\newfontfamily\\russianfont{PT Serif}\n\\newfontfamily\\arabicfont[Script=Arabic]{Amiri}\n\\newfontfamily\\japanesefont{Noto Sans CJK JP}\n\n% Metadata\n\\title{Multilingual Document Example\\\\\n\\large Exemple de Document Multilingue\\\\\nMehrsprachiges Dokumentbeispiel}\n\\author{International Author}\n\\date{\\today}\n\n\\begin{document}\n\n\\frontmatter\n\\maketitle\n\n\\begin{abstract}\nThis document demonstrates comprehensive multilingual support in LaTeX,\nincluding various scripts, bidirectional text, and localization features.\n\\end{abstract}\n\n\\tableofcontents\n\n\\mainmatter\n\n\\chapter{Introduction}\n\\section{English Section}\n\nThis document showcases LaTeX's capabilities for handling multiple languages\nand scripts within a single document. We'll explore various features including:\n\n\\begin{itemize}\n    \\item Font selection and configuration\n    \\item Bidirectional text support\n    \\item Proper hyphenation and line breaking\n    \\item Localized formatting\n    \\item Special characters and symbols\n\\end{itemize}\n\n\\section{Section Française}\n\\begin{french}\nCette section démontre le support du français avec :\n\\begin{itemize}\n    \\item Les guillemets français : \\enquote{exemple}\n    \\item Les espaces insécables : voici !\n    \\item La date : \\today\n    \\item Les nombres : \\num{1234567.89}\n\\end{itemize}\n\\end{french}\n\n\\section{Deutscher Abschnitt}\n\\begin{german}\nDieser Abschnitt zeigt die deutsche Unterstützung mit:\n\\begin{itemize}\n    \\item Deutsche Anführungszeichen: \\enquote{Beispiel}\n    \\item Datum: \\today\n    \\item Zahlen: \\num{1234567.89}\n    \\item Silbentrennung für lange Wörter\n\\end{itemize}\n\\end{german}\n\n\\chapter{Advanced Features}\n\n\\section{Bidirectional Text}\n\\begin{english}\nThis chapter includes Arabic text: \\textarabic{مرحبا بالعالم} (Hello World)\nembedded within English paragraphs.\n\\end{english}\n\n\\begin{arabic}\nهذا قسم كامل باللغة العربية. يُظهر الدعم الكامل للنص من اليمين إلى اليسار\nمع الخطوط والتنسيق المناسبين. يمكن تضمين \\textLR{English text} داخل العربية.\n\\end{arabic}\n\n\\section{Asian Languages}\n\\begin{japanese}\n日本語のサポートも含まれています。これは日本語のテキストの例です。\nLaTeXは複雑な文字体系も処理できます。\n\\end{japanese}\n\n\\chapter{Reference Section}\n\n\\section{Common Phrases}\n\\begin{tabular}{llll}\n\\textbf{English} & \\textbf{Français} & \\textbf{Deutsch} & \\textbf{Español} \\\\\nHello & Bonjour & Hallo & Hola \\\\\nThank you & Merci & Danke & Gracias \\\\\nGoodbye & Au revoir & Auf Wiedersehen & Adiós \\\\\n\\end{tabular}\n\n\\backmatter\n\\appendix\n\n\\chapter{Technical Notes}\nThis document was compiled with XeLaTeX to support Unicode and\nadvanced font features. All languages are properly configured with\nappropriate hyphenation patterns and typography rules.\n\n\\end{document}"} />

<RenderedOutput title="Expected effect">
  <Info>
    This example configures a system font. The visible result depends on fonts installed in the reader's compilation environment, so the code box describes the intended configuration instead of showing a misleading substitute font.
  </Info>
</RenderedOutput>

## Next Steps

Explore more advanced topics:

<CardGroup cols={2}>
  <Card title="Book Publishing" icon="book" href="/learn/latex/how-to/book-publishing">
    Create multilingual books
  </Card>

  <Card title="Collaboration" icon="users" href="/learn/latex/how-to/collaboration-workflow">
    International team workflows
  </Card>

  <Card title="Templates" icon="copy" href="/learn/latex/how-to/using-templates">
    Multilingual templates
  </Card>

  <Card title="Typography" icon="font" href="/learn/latex/fonts">
    Advanced typography
  </Card>
</CardGroup>

***

<Info>
  **Pro tip**: Always test your multilingual documents thoroughly. Check that text is searchable and copyable in the PDF, verify that hyphenation works correctly, and ensure that all special characters display properly. Consider creating language-specific style files for frequently used configurations.
</Info>
