rdesign/frontend/node_modules/katex/contrib/copy-tex
Jeff Emmett 80f1e96e6b Fix frontend build: type errors, SDK handling, docker context
- Use jq to cleanly remove encryptid SDK from package.json in Docker
- Fix TypeScript strict mode errors in dashboard and assistant
- Add .dockerignore to exclude node_modules from build context
- Use project root as Docker build context for frontend
- Fix Traefik routing: separate frontend/api/studio paths

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 02:21:52 +00:00
..
README.md Fix frontend build: type errors, SDK handling, docker context 2026-03-24 02:21:52 +00:00
copy-tex.ts Fix frontend build: type errors, SDK handling, docker context 2026-03-24 02:21:52 +00:00
index.html Fix frontend build: type errors, SDK handling, docker context 2026-03-24 02:21:52 +00:00
katex2tex.ts Fix frontend build: type errors, SDK handling, docker context 2026-03-24 02:21:52 +00:00

README.md

Copy-tex extension

This extension modifies the copy/paste behavior in any browser supporting the Clipboard API so that, when selecting and copying KaTeX-rendered elements, the text content of the resulting clipboard renders KaTeX elements as their LaTeX source surrounded by specified delimiters. (The HTML content of the resulting clipboard remains the selected HTML content, as it normally would.) The default delimiters are $...$ for inline math and $$...$$ for display math, but you can easy switch them to e.g. \(...\) and \[...\] by modifying copyDelimiters in the source code. Note that a selection containing part of a KaTeX formula gets extended to include the entire KaTeX formula.

Usage

This extension isn't part of KaTeX proper, so the script should be separately included in the page.

<script src="https://cdn.jsdelivr.net/npm/katex@0.16.40/dist/contrib/copy-tex.min.js" integrity="sha384-Pe2JWbaShhSRT0SESJ9XLPeAsi4yrNi7r/CiH0Coq7giBjK5a6Ae7XcybE8rNlQP" crossorigin="anonymous"></script>

(Note that, as of KaTeX 0.16.0, there is no longer a corresponding CSS file.)

See index.html for an example. (To run this example from a clone of the repository, run yarn start in the root KaTeX directory, and then visit http://localhost:7936/contrib/copy-tex/index.html with your web browser.)

If you want to build your own custom copy handler based on this one, copy the copy-tex.js into your codebase and replace the require statement with require('katex/contrib/copy-tex/katex2tex.js').

ECMAScript module is also available:

<script type="module" src="https://cdn.jsdelivr.net/npm/katex@0.16.40/dist/contrib/copy-tex.mjs" integrity="sha384-PTy3nbMSATx5Ifo/k1ErbnbMVEp3koLGaqTD+zBo5H0fPFue/mKr1M3//74Fu6Tf" crossorigin="anonymous"></script>