mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-06 11:48:41 +00:00
* copy-tex contrib module * Factor out replacement code * Fix lint * Support for more browsers, in particular Firefox * Use for loop instead of Array.forEach * Use replaceChild if replaceWith is unavailable * Browserify to remove let etc. * Fix HTML handling, in particular for Edge * Convert DocumentFragment to HTML directly (via children' outerHTML) * Set HTML content *before* text content; Edge takes the last only * Handle .katex-html and .katex-mathml separately * Implement option 2: CSS user-select: all Also fix auto-render.js build location * Revise documentation according to @kevinbarabash's comments * Split copy-tex.js into it + katex2tex.js This supports re-use of code in a custom copy handler. * Document custom copy handler * Add missing file
41 lines
1.1 KiB
HTML
41 lines
1.1 KiB
HTML
<!DOCTYPE html>
|
|
<!--To run this example from a clone of the repository, run `make serve`
|
|
in the root KaTeX directory and then visit with your web browser:
|
|
http://0.0.0.0:7936/contrib/copy-tex/index.html
|
|
-->
|
|
<html>
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>Copy-tex test</title>
|
|
<script src="/katex.js" type="text/javascript"></script>
|
|
<link href="/katex.css" rel="stylesheet" type="text/css">
|
|
<link href="./copy-tex.css" rel="stylesheet" type="text/css">
|
|
<script src="../auto-render/auto-render.js" type="text/javascript"></script>
|
|
<script src="./copy-tex.js" type="text/javascript"></script>
|
|
<style type="text/css">
|
|
body {
|
|
margin: 0px;
|
|
padding: 0px;
|
|
font-size: 36px;
|
|
}
|
|
|
|
#test > .blue {
|
|
color: blue;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<h1>Copy-tex test</h1>
|
|
<h2>Try copy/pasting some of the text below!</h2>
|
|
<p>
|
|
Here is some \(\KaTeX\) math: $$ x^2+y^2=z^2 $$
|
|
The variables are \(x\), \(y\), and \(z\),
|
|
which are all in \(\mathbb{R}^+\).
|
|
Q.E.D.
|
|
</p>
|
|
<script>
|
|
renderMathInElement(document.body);
|
|
</script>
|
|
</body>
|
|
</html>
|