外观
nice-uppi-in-LaTeX.md---
title: 如何用 LaTeX 打出好看的正体 π
createTime: 2026/1/25
categories:
- IT
tags:
- LaTeX
---
众所周知,`unicode-math` 和 `upgreek` 提供的正体 $\pi$ 的字体不大适合 $\LaTeX$ 默认的 `Latin Morden Math` 字体的风格。以下是使用 `Times New Roman` 字体的解决方案:
```latex
\usepackage{fontspec}
\usepackage{amsmath}
\providecommand{\tuppi}{\mathord{\text{\fontspec{FreeSerif}\symbol{"03C0}}}}
% 在不致冲突的情况下也可以设置成 \uppi
```
效果:
<p style="text-align: center;">
<span style="font-family: 'Times New Roman'; font-size: 20pt; padding: 0.25em 0.5em; border: 1px solid">
π
</span>
</p>
有其它好的字体,也可以替换代码中的 `Times New Roman`。