我经常需要在数学模式下使用它d
来表示物理中向量空间或流形的维度。但是,我不希望这个符号与用于导数或微分算子的符号相同。所以我在寻找一个新的符号来表示维度。 D
太大,\delta
太“神秘”(而且我无论如何都会用它来表示其他东西)。
下面是一个小代码示例,供大家参考:
\documentclass[11pt,letterpaper,twoside]{book}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[total={6in,10in},left=1.5in,top=0.5in,includehead,includefoot]{geometry}
\usepackage{microtype}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{mathtools}
\begin{document}
The symbol $d$ is the spacetime dimension. Usually : $d = 1, 2, 3, \dots, \infty$. We have $\mathcal{M}^d$, or $\mathbb{R}^d$. $dx$ is a differential. Some prefer to write $\mathrm{d}x$ instead, which I don't like. Spacetime signature is
\begin{equation}
\sigma_d = -\, 2, \qquad \text{when $d = 4$.}
\end{equation}
\end{document}
那么我可以用什么符号代替d
和D
?还有其他弯曲的 d 符号吗?
答案1
我有时会使用 Euler 或 Computer Modern Upright Italic 来表示与运算符不同的直立数学符号。不过,通常情况下,这些符号都是 ISO 样式的常量。
其他可用的数学字母包括\mathsf
、\mathtt
和\mathcal
。\mathfrak
例子
下面是定义新符号的示例,作为Computer Modern Upright Italic 中的\dimension
字母:d
\documentclass[11pt,letterpaper,twoside]{book}
\usepackage{iftex} % For \iftutex
\usepackage[paperwidth=10cm]{geometry} % Format the MWE for TeX.SX
\pagestyle{empty}
\iftutex
% LuaTeX or XeTeX
\usepackage{mathtools}
\usepackage{unicode-math}
\defaultfontfeatures{Scale=MatchLowercase}
\setmathfontface{\mathui}{CMU Serif Upright Italic} % Includes Greek.
\else
% PDFTeX or other legacy 8-bit TeX
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{mathtools}
\usepackage{amsfonts}
\DeclareMathAlphabet{\mathui}{T1}{cmr}{m}{ui}
\fi
\usepackage{microtype}
\newcommand\dimension{\mathui{d}}
\begin{document}
The symbol \(\dimension\) is the spacetime dimension. Usually :
\(\dimension = 1, 2, 3, \dots, \infty\). We have
\(\mathcal{M}^{\dimension}\), or \(\mathbb{R}^{\dimension}\). \(dx\) is
a differential. Some prefer to write \(\mathrm{d}x\) instead, which I don't
like. Spacetime signature is
\begin{equation}
\sigma_{\dimension} = -\, 2, \qquad \text{when\ } \dimension = 4.
\end{equation}
\end{document}
我常用的与运算符字体不同的直立数学符号的例子是:欧拉恒等式,其常数设置在 Hermann Zapf 的 AMS Euler 中,文本设置在他 Palatino(的克隆版)中。
\documentclass{article}
\usepackage{iftex} % For \iftutex
\usepackage[paperwidth=10cm]{geometry} % Format this MWE for TeX.SX
\pagestyle{empty}
\iftutex
% LuaTeX or XeTeX
\usepackage{unicode-math}
\defaultfontfeatures{Scale=MatchLowercase}
\setmainfont{TeX Gyre Pagella}[Scale = 1.0]
\setmathfont{Asana Math}
\setmathfont{Neo Euler}[range={up/{Latin,latin,Greek,greek},
bfup/{Latin,latin,Greek,greek},
cal,bfcal,frak,bffrak}]
\else
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{tgpagella}
\usepackage{newpxmath}
\DeclareMathAlphabet{\symup}{U}{zeur}{m}{n}
\DeclareSymbolFont{euler}{U}{zeur}{m}{n}
\DeclareMathSymbol{\uppi}{\mathalpha}{euler}{"19}
\fi
\newcommand\upe{\symup{e}}
\newcommand\upi{\symup{i}}
\begin{document}
\begin{align*}
\upe^{\upi x} &= \cos x + \upi \sin x \\
\upe^{\upi \uppi} + 1 &= 0
\end{align*}
\end{document}