<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: curgin</title>
    <description>The latest articles on DEV Community by curgin (@curgin).</description>
    <link>https://dev.to/curgin</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4137168%2Fc2b25320-ace8-4bac-b603-7501643e3ee6.png</url>
      <title>DEV Community: curgin</title>
      <link>https://dev.to/curgin</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/curgin"/>
    <language>en</language>
    <item>
      <title>From LaTeX to Crisp SVG: A Browser-Local Equation Export Workflow</title>
      <dc:creator>curgin</dc:creator>
      <pubDate>Tue, 22 Sep 2026 08:17:51 +0000</pubDate>
      <link>https://dev.to/curgin/from-latex-to-crisp-svg-a-browser-local-equation-export-workflow-269g</link>
      <guid>https://dev.to/curgin/from-latex-to-crisp-svg-a-browser-local-equation-export-workflow-269g</guid>
      <description>&lt;p&gt;Mathematical notation travels through more places than a LaTeX runtime. A formula may start in a research note, then move to a slide deck, a GitHub README, an LMS upload, or a CMS that treats raw LaTeX as ordinary text. In those contexts, exporting a stable image is often the practical boundary between a readable equation and a broken one.&lt;/p&gt;

&lt;p&gt;This article walks through a browser-local workflow for converting a MathJax-compatible equation into an image that can be reused in documentation and product work. The example tool is &lt;a href="https://latextoimg.com/" rel="noopener noreferrer"&gt;LaTeX to Image&lt;/a&gt;, but the format and review decisions apply to any equation-export workflow.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why image exports still matter
&lt;/h2&gt;

&lt;p&gt;Raw LaTeX is excellent source material: it is compact, reviewable, and easy to keep beside code. The trouble begins when the target does not include a TeX renderer. A README viewer may render inline math differently from a course platform; a slide program may not render it at all.&lt;/p&gt;

&lt;p&gt;An exported image makes the output deterministic for a specific destination. It also creates a useful separation of concerns:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Keep LaTeX as the editable source of truth.&lt;/li&gt;
&lt;li&gt;Render the source with a MathJax-compatible renderer.&lt;/li&gt;
&lt;li&gt;Export the version that fits the destination.&lt;/li&gt;
&lt;li&gt;Store the source next to the asset so future edits do not start from a screenshot.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That separation is especially helpful when a formula appears in design handoff files, release notes, or support content maintained by people who do not have a local TeX environment.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Start with a portable equation
&lt;/h2&gt;

&lt;p&gt;Use a small, self-contained expression first. For example, the Gaussian integral:&lt;/p&gt;

&lt;p&gt;\int_0^\infty e^{-x^2}\,dx = \frac{\sqrt{\pi}}{2}&lt;/p&gt;

&lt;p&gt;When an equation fails to render, check structural issues before changing tools: unclosed braces, a mismatched begin/end environment, and commands outside the renderer's supported package set are common causes. A browser equation renderer is not the same thing as a full TeX compiler, so a document containing TikZ, arbitrary packages, or PDF-specific workflows needs a different pipeline.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Choose the export format deliberately
&lt;/h2&gt;

&lt;p&gt;The best format is determined by the consumer, not by the equation.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Destination&lt;/th&gt;
&lt;th&gt;Recommended format&lt;/th&gt;
&lt;th&gt;Reason&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;README, documentation site, or web UI&lt;/td&gt;
&lt;td&gt;SVG&lt;/td&gt;
&lt;td&gt;It stays sharp when the surrounding layout scales.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Slides, chat, or a learning platform&lt;/td&gt;
&lt;td&gt;PNG&lt;/td&gt;
&lt;td&gt;It is widely accepted and can preserve transparency.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A system that flattens uploads&lt;/td&gt;
&lt;td&gt;JPG or JPEG&lt;/td&gt;
&lt;td&gt;It is a straightforward raster fallback when transparency is not needed.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A good workflow is to keep an SVG master for durable documentation and generate a PNG only when a target cannot accept vector output. That avoids trying to recover clean edges from a raster image later.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Treat appearance as part of the interface
&lt;/h2&gt;

&lt;p&gt;An equation is not just content; its background, scale, and color affect whether it fits the page around it. Before exporting, review three settings:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Background.&lt;/strong&gt; Use transparent output for a formula that needs to sit on slides, a dark documentation theme, or a colored design canvas. Use a solid background when the destination will not preserve alpha.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scale.&lt;/strong&gt; Render large enough for the target's display size. Scaling a small PNG upward is where thin strokes become soft.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Formula color.&lt;/strong&gt; Match the contrast of the final surface instead of assuming black text will work everywhere.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;LaTeX to Image exposes these controls in the browser and supports PNG, SVG, JPG, and JPEG export. Its public documentation also states that rendering happens locally after MathJax loads, rather than uploading the equation for conversion. That is useful when the expression is part of an unreleased document or an internal technical note.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Keep the source with the exported file
&lt;/h2&gt;

&lt;p&gt;A durable handoff contains more than the image. Save the original LaTeX in the same pull request, note, or content repository. If the renderer offers copy actions, keep both the source and any SVG markup with the asset.&lt;/p&gt;

&lt;p&gt;For a Markdown workflow, the practical pattern is simple:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Keep the formula source in a nearby Markdown file or code comment.&lt;/li&gt;
&lt;li&gt;Export an SVG for web documentation, or a PNG for systems without vector support.&lt;/li&gt;
&lt;li&gt;Name the asset for its subject rather than its dimensions, for example gaussian-integral.svg.&lt;/li&gt;
&lt;li&gt;Re-render from the source whenever the formula or visual style changes.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The important part is that the image remains a build artifact, not the only editable version of the math.&lt;/p&gt;

&lt;h2&gt;
  
  
  A quick export checklist
&lt;/h2&gt;

&lt;p&gt;Before committing an equation image, verify the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The expression renders without errors.&lt;/li&gt;
&lt;li&gt;The selected format matches the target platform.&lt;/li&gt;
&lt;li&gt;Transparent output is used only where the destination supports it.&lt;/li&gt;
&lt;li&gt;The scale is crisp at the final display size.&lt;/li&gt;
&lt;li&gt;The original LaTeX is stored next to the exported asset.&lt;/li&gt;
&lt;li&gt;The image has useful alt text when published on the web.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try the workflow
&lt;/h2&gt;

&lt;p&gt;If you need a lightweight browser tool for this step, &lt;a href="https://latextoimg.com/" rel="noopener noreferrer"&gt;LaTeX to Image&lt;/a&gt; lets you paste a MathJax-compatible expression, adjust its presentation, and download or copy PNG, SVG, JPG, or JPEG output. It can also copy the image, SVG markup, LaTeX source, or a reusable URL with the selected settings.&lt;/p&gt;

&lt;p&gt;The value is not in replacing a full TeX build. It is in making the last mile predictable: a clean equation image for the places where raw LaTeX is not available.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
