相关文章:https://blog.youkuaiyun.com/stalendp/article/details/44904639
Anki是一个非常不错的记忆卡片工具,但是编辑界面比较简陋。
1. 这里将使用TinyMCE的粘贴功能,来获取word等工具编辑的文本,然后再转化成html,贴到anki中。
<!DOCTYPE html>
<html>
<head>
<script src='https://cdn.tiny.cloud/1/no-api-key/tinymce/4.9.10-80/tinymce.min.js'></script>
<script>
tinymce.init({
selector: '#mytextarea', // change this value according to your HTML
plugins: "code",
toolbar: "code",
menubar: "tools",
width: "800",
height : "600",
});
</script>
</head>
<body><h1>TinyMCE Quick Start Guide</h1>
<form method="post"><textarea id="mytextarea"></textarea></form>
</body>
</html>
2. Latex工具;
Anki是支持Latex的,下面是用来编辑Latex的工具。还可以导出成word使用的格式。
参考:Type math formulas in Microsoft Word the LaTeX way?
先用LaTeX生成MathML,然后以无格式的方式粘贴到word中(win: Ctrl+Alt+V, mac: control + command + V); 或者粘贴到文本编辑器中,再粘贴回来(这样保证没有格式,是个纯文本)。
<!DOCTYPE html>
<html>
<head>
<title>tex texample</title>
<script src="http://apps.bdimg.com/libs/jquery/1.6.4/jquery.min.js"></script>
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
MathJax.Hub.Config({
extensions: ["tex2jax.js"],
jax: ["input/TeX", "output/HTML-CSS"],
tex2jax: {
inlineMath: [ ['$','$'], ["\\(","\\)"] ],
displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
},
"HTML-CSS": { availableFonts: ["TeX"] }
});
</script>
<script>
function SelectText(element) {
var doc = document
, text = doc.getElementById(element)
, range, selection
;
if (doc.body.createTextRange) {
range = document.body.createTextRange();
range.moveToElementText(text);
range.select();
} else if (window.getSelection) {
selection = window.getSelection();
range = document.createRange();
range.selectNodeContents(text);
selection.removeAllRanges();
selection.addRange(range);
}
}
$(document).ready(function(){
$("#latexContent").val("\\[ \\]");
$('#latexContent').bind('input propertychange', function() {
$("#myoutput").text($("#latexContent").val());
// MathJax.Hub.Queue(["TypeseTextt",MathJax.Hub,"myoutput"]);
MathJax.Hub.Typeset("myoutput")
$("#myMathml").text("");
});
$("#btnShowMathML").click(function(){
var con = $(".MJX_Assistive_MathML").html();
$("#myMathml").text(con);
SelectText("myMathml");
});
$("#btnClear").click(function(){
$("#latexContent").val("$$ $$");
$("#myoutput").html("<p style='color: grey; font-style: italic;'> The LaTeX will display here ! </p>");
});
});
</script>
</head>
<body>
<center>
<p> Enter LaTeX here! </p>
<textarea id="latexContent" rows="5" cols="100"> </textarea>
<button id="btnClear" type="button">clear</button>
<button id="btnShowMathML" type="button">Show The MathML</button> </br></br>
<span id="myoutput">
<p style="color: grey; font-style: italic;"> The LaTeX will display here ! </p>
</span> </br>
<span id="myMathml"> </span>
</center>
</body>
</html>