您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
在知乎中直接复制公式即可得到对应的LaTeX代码
// ==UserScript== // @name 知乎公式复制LaTeX // @namespace https://jasongzy.com // @version 1.0 // @description 在知乎中直接复制公式即可得到对应的LaTeX代码 // @author jasongzy // @match https://www.zhihu.com/* // @match https://www.zhihu.com/question/* // @match https://zhuanlan.zhihu.com/p/* // @icon https://www.google.com/s2/favicons?domain=zhihu.com // @grant GM_addStyle // ==/UserScript== GM_addStyle('.MathJax_Preview ~ .math-holder {font-size:0 !important; display:inline !important;}'); GM_addStyle('span.MJX_Assistive_MathML {display: none !important;}'); function edit_latex() { let eqs = document.querySelectorAll(".MathJax_Preview ~ .math-holder"); // console.log(eqs); for (let i = 0; i < eqs.length; i++) { if (!eqs[i].textContent.startsWith('$') || !eqs[i].textContent.endsWith('$')) { let latex = '$' + eqs[i].textContent + '$'; eqs[i].textContent = latex; // console.log(latex); } } } document.addEventListener('scroll', edit_latex); (window.onload = function () { 'use strict'; setTimeout(function () { edit_latex(); }, 3000); })