惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Stack Overflow Blog
Stack Overflow Blog
Vercel News
Vercel News
N
Netflix TechBlog - Medium
M
MIT News - Artificial intelligence
F
Full Disclosure
GbyAI
GbyAI
H
Hackread – Cybersecurity News, Data Breaches, AI and More
D
Docker
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
D
DataBreaches.Net
Hugging Face - Blog
Hugging Face - Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
人人都是产品经理
人人都是产品经理
大猫的无限游戏
大猫的无限游戏
Hacker News: Ask HN
Hacker News: Ask HN
V
Visual Studio Blog
IT之家
IT之家
N
News and Events Feed by Topic
T
The Exploit Database - CXSecurity.com
S
Schneier on Security
月光博客
月光博客
H
Heimdal Security Blog
T
The Blog of Author Tim Ferriss
腾讯CDC
C
Cyber Attacks, Cyber Crime and Cyber Security
T
Troy Hunt's Blog
小众软件
小众软件
Jina AI
Jina AI
博客园 - Franky
Scott Helme
Scott Helme
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
C
CERT Recently Published Vulnerability Notes
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
阮一峰的网络日志
阮一峰的网络日志
N
News and Events Feed by Topic
Apple Machine Learning Research
Apple Machine Learning Research
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
TaoSecurity Blog
TaoSecurity Blog
F
Fortinet All Blogs
Y
Y Combinator Blog
P
Privacy & Cybersecurity Law Blog
B
Blog RSS Feed
Microsoft Security Blog
Microsoft Security Blog
量子位
H
Help Net Security
MongoDB | Blog
MongoDB | Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
The Last Watchdog
The Last Watchdog
博客园 - 三生石上(FineUI控件)
L
LINUX DO - 最新话题

Ridic

一个关于映射度的问题 买原版书遇到的坑 区域不变性及相关应用 Klein瓶的高维推广 待解决的问题 一些待整理的资料 记录一些想看的书和课程 在服务器中部署Overleaf 高等代数习题课-记录 关于学习过程的“参数权重”设置 从今天开始写一些东西 不定积分练习 国内Docker镜像代理 《上海高考指南》数学部分阅读与分析 函数关于两点对称问题 数学笔记-第八周 数学笔记-第七周 二模前复习总结 6 数学笔记-第六周 将 word 中的 Mathtype 公式转为 Latex 原创一题 为什么高中数学题越来越难 有趣的开源项目整理 5 4 3 上海高考数学压轴题 2023年普通高中学业水平模拟测试 2 1 典型难题整理 Linux 相关操作 参加 TACA 考试 一些导数题 新买的乒乓球拍 数学综合卷 使用 Git Hook 将网站部署到服务器 利用BurpSuite和Charles进行抓包 关于window.opener 2023上海英语春考 解决Mac开机界面壁纸不同的问题 迁移到了新域名 期中考复习试卷 关于 友链 Helloworld 随时随地写代码--基于Code-server部署自己的云开发环境 GAN CFOP 学校的电脑 嘀咕
博客加入数学公式支持
Tom · 2023-04-02 · via Ridic

记录一下 PaperMod 主题加入 Katex 公式支持的方法,以便之后博文的公式书写。当然,大部分数学的内容还是会写在 Astroid 中。

创建 layouts/partials/math.html 文件,写入以下内容:

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.2/dist/katex.min.css" integrity="sha384-bYdxxUwYipFNohQlHt0bjN/LCpueqWz13HufFEV1SUatKs1cm4L6fFgCi1jT643X" crossorigin="anonymous">
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.2/dist/katex.min.js" integrity="sha384-Qsn9KnoKISj6dI8g7p1HBlNpVx0I8p1SvlwOldgi3IorMle61nQy4zEahWYtljaz" crossorigin="anonymous"></script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.2/dist/contrib/auto-render.min.js" integrity="sha384-+VBxd3r6XgURycqtZ117nYw44OOcIax56Z4dCRWbxyPt0Koah1uHoK0o4+/RRE05" crossorigin="anonymous"></script>
<script>
    document.addEventListener("DOMContentLoaded", function() {
        renderMathInElement(document.body, {
          // customised options
          // • auto-render specific keys, e.g.:
          delimiters: [
              {left: '$$', right: '$$', display: true},
              {left: '$', right: '$', display: false},
              {left: '\\(', right: '\\)', display: false},
              {left: '\\[', right: '\\]', display: true}
          ],
          // • rendering keys, e.g.:
          throwOnError : false
        });
    });
</script>

然后创建 layouts/partials/extend_head.html 文件,写入以下内容:

{{ if or .Params.math .Site.Params.math }}
{{ partial "math.html" . }}
{{ end }}

当我们确认某一篇博客需要加入数学公式支持时,我们需要在markdown文件键入以下内容:

---
title: 
date: 
tags: 
math: true
---

数学公式测试:

$$x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}$$

$$ q(x,t)= \begin{cases}(t-k+1)x^2,\quad \ \ & t\in\big(k-1,k-\dfrac{1}{2}\big],\\ (k-t)x^2, \quad \ \ & t\in\big(k-\dfrac{1}{2},k\big], \end{cases} $$

$$ \left|\begin{array}{cccc} 1 &6 & 9 \\ 7 &90 & f(x) \\ 9 & \psi(x) &g(x) \\ \end{array}\right| $$

$$ \begin{cases} \ u_{tt}(x,t)= b(t)\triangle u(x,t-4)&\\ \ \hspace{42pt}- q(x,t)f[u(x,t-3)]+te^{-t}\sin^2 x, & t \neq t_k; \\ \ u(x,t_k^+) - u(x,t_k^-) = c_k u(x,t_k), & k=1,2,3\ldots ;\\ \ u_{t}(x,t_k^+) - u_{t}(x,t_k^-) =c_k u_{t}(x,t_k), & k=1,2,3\ldots\ . \end{cases} $$