Mercurial
comparison mrjunejune/src/tools/latex_editor/index.html @ 244:b8aa08503378
[tools] Add sandboxed online LaTeX editor
Co-authored-by: Copilot <[email protected]>
| author | MrJuneJune <me@mrjunejune.com> |
|---|---|
| date | Mon, 03 Aug 2026 16:56:25 -0700 |
| parents | |
| children | 4f2b50bc78e7 |
comparison
equal
deleted
inserted
replaced
| 243:823f2a8b16c8 | 244:b8aa08503378 |
|---|---|
| 1 <!doctype html> | |
| 2 <html lang="en"> | |
| 3 <head> | |
| 4 {{/parts/base_head.html}} | |
| 5 <title>LaTeX Editor - MrJuneJune</title> | |
| 6 <link rel="stylesheet" href="/tools/latex_editor/index.css" /> | |
| 7 <script src="/tools/latex_editor/index.js" defer></script> | |
| 8 </head> | |
| 9 <body> | |
| 10 {{/parts/header.html}} | |
| 11 <main class="latex-page"> | |
| 12 <div class="latex-heading"> | |
| 13 <div> | |
| 14 <h1>Online LaTeX Editor</h1> | |
| 15 <p>Write LaTeX here. My server compiles it inside a locked-down sandbox and sends the PDF back to this preview.</p> | |
| 16 </div> | |
| 17 <div class="latex-actions"> | |
| 18 <label class="auto-compile"> | |
| 19 <input id="autoCompile" type="checkbox" checked /> | |
| 20 Auto compile | |
| 21 </label> | |
| 22 <button id="resetButton" type="button" class="secondary">Reset</button> | |
| 23 <button id="compileButton" type="button">Compile PDF</button> | |
| 24 <a id="downloadButton" class="button-link disabled" aria-disabled="true">Download</a> | |
| 25 </div> | |
| 26 </div> | |
| 27 | |
| 28 <p id="latexStatus" class="latex-status" role="status" aria-live="polite"> | |
| 29 Preparing your first PDF... | |
| 30 </p> | |
| 31 | |
| 32 <div class="latex-workspace"> | |
| 33 <section class="latex-panel editor-panel" aria-labelledby="sourceHeading"> | |
| 34 <div class="panel-heading"> | |
| 35 <h2 id="sourceHeading">document.tex</h2> | |
| 36 <span id="sourceSize">0 / 65,536 bytes</span> | |
| 37 </div> | |
| 38 <textarea id="latexSource" spellcheck="false" autocomplete="off" aria-label="LaTeX source">\documentclass[11pt]{article} | |
| 39 \usepackage[margin=1in]{geometry} | |
| 40 \usepackage{amsmath} | |
| 41 \usepackage{xcolor} | |
| 42 | |
| 43 \title{Hello from my server} | |
| 44 \author{MrJuneJune} | |
| 45 \date{\today} | |
| 46 | |
| 47 \begin{document} | |
| 48 \maketitle | |
| 49 | |
| 50 This PDF was compiled by the custom C server behind this website. | |
| 51 | |
| 52 \[ | |
| 53 e^{i\pi} + 1 = 0 | |
| 54 \] | |
| 55 | |
| 56 \textcolor{blue}{Edit this document and watch the preview update.} | |
| 57 | |
| 58 \end{document} | |
| 59 </textarea> | |
| 60 </section> | |
| 61 | |
| 62 <section class="latex-panel preview-panel" aria-labelledby="previewHeading"> | |
| 63 <div class="panel-heading"> | |
| 64 <h2 id="previewHeading">PDF preview</h2> | |
| 65 <span>Server rendered</span> | |
| 66 </div> | |
| 67 <iframe | |
| 68 id="pdfPreview" | |
| 69 title="Compiled LaTeX PDF preview" | |
| 70 src="about:blank" | |
| 71 ></iframe> | |
| 72 <pre id="latexDiagnostics" class="latex-diagnostics" hidden></pre> | |
| 73 </section> | |
| 74 </div> | |
| 75 | |
| 76 <section class="latex-notes"> | |
| 77 <h2>Limits</h2> | |
| 78 <p>Source is capped at 64 KiB and compilation at 8 seconds. Shell commands, network access, and reads outside the isolated TeX workspace are blocked.</p> | |
| 79 </section> | |
| 80 </main> | |
| 81 {{/parts/footer.html}} | |
| 82 </body> | |
| 83 </html> |