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

推荐订阅源

CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
S
Securelist
GbyAI
GbyAI
The Register - Security
The Register - Security
B
Blog
Recorded Future
Recorded Future
D
DataBreaches.Net
C
Cybersecurity and Infrastructure Security Agency CISA
A
About on SuperTechFans
C
CERT Recently Published Vulnerability Notes
T
The Blog of Author Tim Ferriss
Vercel News
Vercel News
Google DeepMind News
Google DeepMind News
S
Schneier on Security
S
SegmentFault 最新的问题
Martin Fowler
Martin Fowler
T
Tenable Blog
T
The Exploit Database - CXSecurity.com
阮一峰的网络日志
阮一峰的网络日志
宝玉的分享
宝玉的分享
AWS News Blog
AWS News Blog
L
Lohrmann on Cybersecurity
Spread Privacy
Spread Privacy
N
News | PayPal Newsroom
Engineering at Meta
Engineering at Meta
T
Tor Project blog
The Hacker News
The Hacker News
量子位
酷 壳 – CoolShell
酷 壳 – CoolShell
MongoDB | Blog
MongoDB | Blog
Cyberwarzone
Cyberwarzone
Security Archives - TechRepublic
Security Archives - TechRepublic
爱范儿
爱范儿
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
C
Cyber Attacks, Cyber Crime and Cyber Security
T
Threatpost
WordPress大学
WordPress大学
Google Online Security Blog
Google Online Security Blog
G
GRAHAM CLULEY
Google DeepMind News
Google DeepMind News
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Attack and Defense Labs
Attack and Defense Labs
N
Netflix TechBlog - Medium
SecWiki News
SecWiki News
Hacker News: Ask HN
Hacker News: Ask HN
M
MIT News - Artificial intelligence
Scott Helme
Scott Helme
Microsoft Security Blog
Microsoft Security Blog
H
Help Net Security
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org

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} $$